mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-28 04:45:06 +02:00
Dawarich: run db:migrate before assets:precompile (#14051)
* fix(dawarich): run db:migrate before assets:precompile In Rails production, eager loading during assets:precompile can execute DB queries. Dawarich 1.7.0 adds new tables (monthly digest email preferences, S3 storage settings). Running precompile before migrate causes 'Operation not permitted' / exit code 1 when those tables do not exist yet. Reordered to: db:migrate -> assets:precompile -> data:migrate, which is the correct Rails deployment sequence. Fixes #14048 * add otp key
This commit is contained in:
committed by
GitHub
parent
93a53fe16e
commit
6044637f12
@@ -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"
|
||||
|
||||
|
||||
@@ -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 <<EOF >/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}
|
||||
|
||||
Reference in New Issue
Block a user