Commit fe851aa8 authored by Felix Bartels's avatar Felix Bartels

try to generate a random password

statping however does not seem to use it
Signed-off-by: Felix Bartels's avatarFelix Bartels <felix@host-consultants.de>
parent 6acc3ed8
#!/bin/sh
set -x
export DB_CONN=postgres
export DB_HOST=$CLOUDRON_POSTGRESQL_HOST
export DB_PORT=$CLOUDRON_POSTGRESQL_PORT
......@@ -10,9 +12,11 @@ export SAMPLE_DATA=false # do not install statping demo data
export DOMAIN=https://$CLOUDRON_APP_DOMAIN
export IS_DOCKER=true
# TODO generate admin pwd and api secret?
# ADMIN_PASSWORD
# API_SECRET
random_string() {
LC_CTYPE=C tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c32
}
# TODO check why ADMIN_PASSWORD and API_SECRET do not work
if [ ! -e .env ]; then
cat <<-EOF > "./.env"
......@@ -20,6 +24,8 @@ if [ ! -e .env ]; then
#USE_CDN=false
DISABLE_LOGS=false
ALLOW_REPORTS=false
ADMIN_PASSWORD=$(random_string)
API_SECRET=$(random_string)
EOF
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment