Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
common
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libre.sh
kubernetes
common
Commits
87440d6e
Commit
87440d6e
authored
3 years ago
by
Pierre Ozoux
Browse files
Options
Downloads
Patches
Plain Diff
Adds function for email creation.
parent
459b540b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/functions.sh
+33
-0
33 additions, 0 deletions
scripts/functions.sh
with
33 additions
and
0 deletions
scripts/functions.sh
+
33
−
0
View file @
87440d6e
...
...
@@ -100,3 +100,36 @@ function pg_set_archive_mode_and_wait() {
pg_ensure_rolling_update_is_done
fi
}
function
create_emails
()
{
noreply_email_password
=
$(
cat
/dev/urandom |
tr
-dc
'a-zA-Z0-9'
|
fold
-w
18 |
head
-n
1
)
noreply_email
=
"
${
NS
}
@liiib.re"
forum_email_password
=
$(
cat
/dev/urandom |
tr
-dc
'a-zA-Z0-9'
|
fold
-w
18 |
head
-n
1
)
forum_email
=
"forum-
${
NS
}
@liiib.re"
chat_email_password
=
$(
cat
/dev/urandom |
tr
-dc
'a-zA-Z0-9'
|
fold
-w
18 |
head
-n
1
)
chat_email
=
"
${
CHAT_SUBDOMAIN
}
-
${
NS
}
@liiib.re"
source
/etc/env
mail_username
=
contact@indie.host
mail_hostname
=
mail.indie.host
noreply_local_part
=
`
echo
$noreply_email
|
cut
-d
@
-f1
`
forum_local_part
=
`
echo
$forum_email
|
cut
-d
@
-f1
`
chat_local_part
=
`
echo
$chat_email
|
cut
-d
@
-f1
`
email_domain
=
`
echo
$noreply_email
|
cut
-d
@
-f2
`
curl
--data
"username=
${
mail_username
}
&password=
${
mail_password
}
&login=Log+In&rememberme=0"
-c
/tmp/cookie.txt https://
${
mail_hostname
}
/auth/login
domain_id
=
`
curl
-b
/tmp/cookie.txt https://
${
mail_hostname
}
/domain |
grep
$email_domain
|
grep
purge-domain |
grep
-o
'purge-domain-[0-9]*'
|
grep
-o
'[0-9]*'
`
curl
--data
"local_part=
${
noreply_local_part
}
&domain=
${
domain_id
}
&password=
${
noreply_email_password
}
"
-b
/tmp/cookie.txt https://
${
mail_hostname
}
/mailbox/add
curl
--data
"local_part=
${
forum_local_part
}
&domain=
${
domain_id
}
&password=
${
forum_email_password
}
"
-b
/tmp/cookie.txt https://
${
mail_hostname
}
/mailbox/add
curl
--data
"local_part=
${
chat_local_part
}
&domain=
${
domain_id
}
&password=
${
chat_email_password
}
"
-b
/tmp/cookie.txt https://
${
mail_hostname
}
/mailbox/add
rm
/tmp/cookie.txt
kubectl
-n
${
NS
}
create secret generic
${
NS
}
-smtp
--from-literal
=
host
=
mail.indie.host
--from-literal
=
port
=
587
--from-literal
=
from_email
=
${
noreply_email
}
--from-literal
=
username
=
${
noreply_email
}
--from-literal
=
password
=
${
noreply_email_password
}
--from-literal
=
mail_from_address
=
${
noreply_local_part
}
kubectl
-n
${
NS
}
create secret generic forum-
${
NS
}
-smtp
--from-literal
=
host
=
mail.indie.host
--from-literal
=
port
=
587
--from-literal
=
from_email
=
${
forum_email
}
--from-literal
=
username
=
${
forum_email
}
--from-literal
=
password
=
${
forum_email_password
}
--from-literal
=
mail_from_address
=
${
forum_local_part
}
kubectl
-n
${
NS
}
create secret generic
${
CHAT_SUBDOMAIN
}
-
${
NS
}
-smtp
--from-literal
=
host
=
mail.indie.host
--from-literal
=
port
=
587
--from-literal
=
from_email
=
${
chat_email
}
--from-literal
=
username
=
${
chat_email
}
--from-literal
=
password
=
${
chat_email_password
}
--from-literal
=
mail_from_address
=
${
chat_local_part
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment