2019-09-22 14:25:22 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
echo "Weblate domain:"
|
2021-02-12 20:22:37 +01:00
|
|
|
read -r domain
|
2024-02-02 18:07:39 +01:00
|
|
|
cloud_domain="${domain%.weblate.cloud}"
|
2025-04-08 11:35:17 +02:00
|
|
|
if [ "$cloud_domain" = "$domain" ]; then
|
2025-07-16 15:11:55 +02:00
|
|
|
echo "Cloud domain (without .weblate.cloud):"
|
|
|
|
read -r cloud_domain
|
2024-02-02 18:07:39 +01:00
|
|
|
fi
|
2019-09-22 14:25:22 +02:00
|
|
|
echo "Weblate title:"
|
2021-02-12 20:22:37 +01:00
|
|
|
read -r title
|
2025-04-08 11:35:17 +02:00
|
|
|
if [ -f ~/.config/weblate-bootstrap/sentry_dsn ]; then
|
2025-07-16 15:11:55 +02:00
|
|
|
sentry=$(cat ~/.config/weblate-bootstrap/sentry_dsn)
|
2020-04-14 16:34:28 +02:00
|
|
|
else
|
2025-07-16 15:11:55 +02:00
|
|
|
echo "Sentry DSN:"
|
|
|
|
read -r sentry
|
2020-04-14 16:34:28 +02:00
|
|
|
fi
|
2025-04-08 11:35:17 +02:00
|
|
|
if [ -f ~/.config/weblate-bootstrap/sentry_token ]; then
|
2025-07-16 15:11:55 +02:00
|
|
|
sentry_token=$(cat ~/.config/weblate-bootstrap/sentry_token)
|
2020-04-14 16:34:28 +02:00
|
|
|
else
|
2025-07-16 15:11:55 +02:00
|
|
|
echo "Sentry Token:"
|
|
|
|
read -r sentry_token
|
2020-04-14 16:34:28 +02:00
|
|
|
fi
|
2025-04-08 11:35:17 +02:00
|
|
|
if [ -f ~/.config/weblate-bootstrap/graylog_token ]; then
|
2025-07-16 15:11:55 +02:00
|
|
|
graylog_token=$(cat ~/.config/weblate-bootstrap/graylog_token)
|
2024-12-07 12:44:24 +01:00
|
|
|
else
|
2025-07-16 15:11:55 +02:00
|
|
|
echo "Graylog Token:"
|
|
|
|
read -r graylog_token
|
2024-12-07 12:44:24 +01:00
|
|
|
fi
|
2019-09-22 14:25:22 +02:00
|
|
|
|
|
|
|
smtp_pass=$(openssl rand -hex 32)
|
|
|
|
|
2025-07-16 15:11:55 +02:00
|
|
|
cat > "${1:-/etc/weblate-bootstrap}" << EOT
|
2019-09-22 14:25:22 +02:00
|
|
|
WEBLATE_DOMAIN="$domain"
|
2024-02-02 18:07:39 +01:00
|
|
|
WEBLATE_CLOUD_DOMAIN="$cloud_domain"
|
2019-09-22 14:25:22 +02:00
|
|
|
WEBLATE_TITLE="$title"
|
|
|
|
WEBLATE_SECRET=$(openssl rand -hex 32)
|
|
|
|
WEBLATE_SENTRY="$sentry"
|
2020-04-14 15:23:07 +02:00
|
|
|
WEBLATE_SENTRY_TOKEN="$sentry_token"
|
2024-12-07 12:44:24 +01:00
|
|
|
WEBLATE_GRAYLOG_TOKEN="$graylog_token"
|
2021-10-27 12:29:21 +02:00
|
|
|
WEBLATE_VERSION="$2"
|
2019-09-22 14:25:22 +02:00
|
|
|
|
|
|
|
# Exim
|
|
|
|
EXIM_PASS=$smtp_pass
|
2019-10-24 12:52:06 +02:00
|
|
|
# $(openssl passwd -6 "$smtp_pass")
|
2019-09-22 14:25:22 +02:00
|
|
|
|
2019-09-22 20:40:56 +02:00
|
|
|
# Postgresql
|
|
|
|
POSTGRES_PASS=$(openssl rand -hex 32)
|
2019-09-22 20:17:42 +02:00
|
|
|
EOT
|