-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
bootstrap
executable file
·49 lines (44 loc) · 1.19 KB
/
bootstrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
echo "Weblate domain:"
read -r domain
cloud_domain="${domain%.weblate.cloud}"
if [ "$cloud_domain" = "$domain" ] ; then
echo "Cloud domain (without .weblate.cloud):"
read -r cloud_domain
fi
echo "Weblate title:"
read -r title
if [ -f ~/.config/weblate-bootstrap/sentry_dsn ] ; then
sentry=$(cat ~/.config/weblate-bootstrap/sentry_dsn)
else
echo "Sentry DSN:"
read -r sentry
fi
if [ -f ~/.config/weblate-bootstrap/sentry_token ] ; then
sentry_token=$(cat ~/.config/weblate-bootstrap/sentry_token)
else
echo "Sentry Token:"
read -r sentry_token
fi
if [ -f ~/.config/weblate-bootstrap/graylog_token ] ; then
graylog_token=$(cat ~/.config/weblate-bootstrap/graylog_token)
else
echo "Graylog Token:"
read -r graylog_token
fi
smtp_pass=$(openssl rand -hex 32)
cat > "${1:-/etc/weblate-bootstrap}" <<EOT
WEBLATE_DOMAIN="$domain"
WEBLATE_CLOUD_DOMAIN="$cloud_domain"
WEBLATE_TITLE="$title"
WEBLATE_SECRET=$(openssl rand -hex 32)
WEBLATE_SENTRY="$sentry"
WEBLATE_SENTRY_TOKEN="$sentry_token"
WEBLATE_GRAYLOG_TOKEN="$graylog_token"
WEBLATE_VERSION="$2"
# Exim
EXIM_PASS=$smtp_pass
# $(openssl passwd -6 "$smtp_pass")
# Postgresql
POSTGRES_PASS=$(openssl rand -hex 32)
EOT