From 39b5ed04a7439519a471c599a4cc7f05d74c9b5b Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Thu, 16 Apr 2026 17:25:29 +0000 Subject: [PATCH] upgrade: dawarich 0.37.1 -> 1.6.1 (fix entrypoint + add production env) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Context Version 1.3.0+ changed the recommended command from `bin/dev` (development) to `bin/rails server -p 3000 -b ::` (production). Also requires RAILS_ENV=production, SECRET_KEY_BASE, and RAILS_LOG_TO_STDOUT env vars. ## This change - Command: `bin/dev` → `bin/rails server -p 3000 -b ::` - Add RAILS_ENV=production - Add SECRET_KEY_BASE (stored in Vault secret/dawarich, synced via ESO) - Add RAILS_LOG_TO_STDOUT=true ## What happened 1. Initial upgrade applied version 1.6.1 — DB migrations ran but pod CrashLooped due to wrong entrypoint (bin/dev exits in production mode) 2. Rollback to 0.37.1 failed because 1.6.1 migrations already ran (ActiveRecord::UnknownPrimaryKey on rails_pulse_routes) 3. Rolled forward with corrected entrypoint + env vars 4. Service now stable: 20/20 health checks passed over 5 minutes Co-Authored-By: Service Upgrade Agent --- stacks/dawarich/main.tf | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/stacks/dawarich/main.tf b/stacks/dawarich/main.tf index b46e7c4f..b5ef04e6 100644 --- a/stacks/dawarich/main.tf +++ b/stacks/dawarich/main.tf @@ -101,7 +101,7 @@ resource "kubernetes_deployment" "dawarich" { container_port = 9394 } command = ["web-entrypoint.sh"] - args = ["bin/dev"] + args = ["bin/rails", "server", "-p", "3000", "-b", "::"] env { name = "REDIS_URL" value = "redis://${var.redis_host}:6379" @@ -159,6 +159,23 @@ resource "kubernetes_deployment" "dawarich" { # name = "PROMETHEUS_EXPORTER_HOST" # value = "0.0.0.0" # } + env { + name = "RAILS_ENV" + value = "production" + } + env { + name = "SECRET_KEY_BASE" + value_from { + secret_key_ref { + name = "dawarich-secrets" + key = "secret_key_base" + } + } + } + env { + name = "RAILS_LOG_TO_STDOUT" + value = "true" + } env { name = "SELF_HOSTED" value = "true"