Set postgresql password

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2019-09-22 20:40:56 +02:00
parent 3a020c6e46
commit 94bd39ec11
3 changed files with 5 additions and 0 deletions

View file

@ -24,6 +24,9 @@ WEBLATE_SENTRY="$sentry"
EXIM_PASS=$smtp_pass
# $(openssl passwd -6 -salt $(openssl rand -hex 6) "$smtp_pass")

# Postgresql
POSTGRES_PASS=$(openssl rand -hex 32)

# Munin
MUNIN_ALLOW="$munin"
EOT

View file

@ -13,3 +13,4 @@ pg_ctlcluster 11 main start
# Create Weblate user and database
sudo -u postgres createuser -D weblate
sudo -u postgres createdb -O weblate weblate
sudo -u postgres psql -c "alter user weblate with encrypted password '$POSTGRES_PASS';"

View file

@ -71,6 +71,7 @@ sed -i \
-e "s#^SITE_TITLE.*#SITE_TITLE = '$WEBLATE_TITLE'#" \
-e "s#^ALLOWED_HOSTS.*#ALLOWED_HOSTS = ['$WEBLATE_DOMAIN']#" \
-e "s#^SENTRY_DSN.*#SENTRY_DSN = '$WEBLATE_SENTRY'#" \
-e "s#'PASSWORD':.*#'PASSWORD': '$POSTGRES_PASS'#" \
/home/weblate/weblate-env/lib/python3.7/site-packages/weblate/settings.py

sudo -u weblate /home/weblate/weblate-env/bin/weblate changesite --set-name $WEBLATE_DOMAIN