mirror of
https://git.cloudron.io/cloudron/mastodon-app.git
synced 2024-11-22 15:51:00 +00:00
Ensure we have the new required active record secrets
This commit is contained in:
parent
fdda17dc83
commit
8a34a7093e
1 changed files with 11 additions and 0 deletions
11
start.sh
11
start.sh
|
@ -47,6 +47,17 @@ fi
|
||||||
|
|
||||||
rm -f /run/mastodon/Gemfile.lock && cp /app/code/Gemfile.lock.original /run/mastodon/Gemfile.lock
|
rm -f /run/mastodon/Gemfile.lock && cp /app/code/Gemfile.lock.original /run/mastodon/Gemfile.lock
|
||||||
|
|
||||||
|
# generate new secrets
|
||||||
|
if ! grep "ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY" /app/data/env.production; then
|
||||||
|
echo "ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=$(openssl rand -hex 16)" >> /app/data/env.production
|
||||||
|
fi
|
||||||
|
if ! grep "ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT" /app/data/env.production; then
|
||||||
|
echo "ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=$(openssl rand -hex 16)" >> /app/data/env.production
|
||||||
|
fi
|
||||||
|
if ! grep "ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY" /app/data/env.production; then
|
||||||
|
echo "ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=$(openssl rand -hex 16)" >> /app/data/env.production
|
||||||
|
fi
|
||||||
|
|
||||||
if grep -q "^SECRET_KEY_BASE=$" /app/data/env.production; then
|
if grep -q "^SECRET_KEY_BASE=$" /app/data/env.production; then
|
||||||
echo "==> Generating secrets"
|
echo "==> Generating secrets"
|
||||||
export RANDFILE=/tmp/.rnd
|
export RANDFILE=/tmp/.rnd
|
||||||
|
|
Loading…
Reference in a new issue