diff --git a/ct/dawarich.sh b/ct/dawarich.sh index d2d260998..3d1ca7e02 100644 --- a/ct/dawarich.sh +++ b/ct/dawarich.sh @@ -53,6 +53,10 @@ function update_script() { export PATH="/root/.rbenv/shims:/root/.rbenv/bin:$PATH" eval "$(/root/.rbenv/bin/rbenv init - bash)" + if ! grep -q "OTP_ENCRYPTION_PRIMARY_KEY" /opt/dawarich/.env; then + echo "OTP_ENCRYPTION_PRIMARY_KEY=$(openssl rand -hex 32)" >>/opt/dawarich/.env + fi + set -a && source /opt/dawarich/.env && set +a $STD bundle config set --local deployment 'true' @@ -67,8 +71,8 @@ function update_script() { $STD npm install fi - $STD bundle exec rake assets:precompile $STD bundle exec rails db:migrate + $STD bundle exec rake assets:precompile $STD bundle exec rake data:migrate msg_ok "Ran Migrations" diff --git a/install/dawarich-install.sh b/install/dawarich-install.sh index 9edf3a296..34e58ded7 100644 --- a/install/dawarich-install.sh +++ b/install/dawarich-install.sh @@ -46,10 +46,12 @@ msg_ok "Set up Directories" msg_info "Configuring Environment" SECRET_KEY_BASE=$(openssl rand -hex 64) +OTP_ENCRYPTION_PRIMARY_KEY=$(openssl rand -hex 32) RELEASE=$(get_latest_github_release "Freika/dawarich") cat </opt/dawarich/.env RAILS_ENV=production SECRET_KEY_BASE=${SECRET_KEY_BASE} +OTP_ENCRYPTION_PRIMARY_KEY=${OTP_ENCRYPTION_PRIMARY_KEY} DATABASE_HOST=localhost DATABASE_USERNAME=${PG_DB_USER} DATABASE_PASSWORD=${PG_DB_PASS}