disable registration in sso mode

This commit is contained in:
Girish Ramakrishnan 2019-07-18 11:34:51 -07:00
parent 9fb7c54624
commit c5e7b2e6ad

View file

@ -50,6 +50,12 @@ if grep -q "^SECRET_KEY_BASE=$" /app/data/env.production; then
echo "==> Init database" echo "==> Init database"
HOME=/app/data SAFETY_ASSURED=1 bundle exec rails db:schema:load db:seed HOME=/app/data SAFETY_ASSURED=1 bundle exec rails db:schema:load db:seed
if [[ -n "${CLOUDRON_LDAP_SERVER:-}" ]]; then
echo "Disabling registration by default"
PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} \
-c "INSERT INTO settings (var, value) VALUES ('registrations_mode', 'none')"
fi
fi fi
chown -R cloudron:cloudron /app/data /tmp/mastodon /run/mastodon chown -R cloudron:cloudron /app/data /tmp/mastodon /run/mastodon