From f2c4e0b11c847e8d3b42ab42eae9f8bb0e0a6768 Mon Sep 17 00:00:00 2001 From: Laura Mosher <2660801+lauramosher@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:14:33 -0400 Subject: [PATCH] chore(offline): prep and make adjustments for a smoother offline experience (#970) Co-authored-by: Laura Mosher --- rails/Dockerfile | 4 +--- rails/config/environments/offline.rb | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/rails/Dockerfile b/rails/Dockerfile index 4aebb9b0d..bc2d9a8b2 100644 --- a/rails/Dockerfile +++ b/rails/Dockerfile @@ -57,9 +57,7 @@ EXPOSE 3000 ENV RAILS_ENV="production" \ AUTO_RUN_MIGRATIONS=on \ - DATABASE_URL="" \ - OFFLINE_MODE="no" \ - SECRET_KEY_BASE="" + DATABASE_URL="" RUN apk --no-cache add \ tzdata \ diff --git a/rails/config/environments/offline.rb b/rails/config/environments/offline.rb index 1fc940627..69bf38d21 100644 --- a/rails/config/environments/offline.rb +++ b/rails/config/environments/offline.rb @@ -31,7 +31,9 @@ # including the ones that sign and encrypt cookies. config.secret_key_base = lambda { # Always use configured SECRET_KEY_BASE env var if one is configured - if ENV.fetch("SECRET_KEY_BASE", false) + # Presence check is to ensure that we don't attempt to set an empty string + # as the secret_key_base. + if ENV.fetch("SECRET_KEY_BASE", false).present? secrets.secret_key_base ||= ENV["SECRET_KEY_BASE"] else key_file = Rails.root.join("tmp/offline_secret.txt") @@ -96,8 +98,6 @@ # Compress CSS using a preproccessor # config.assets.css_compressor = :sass - config.assets.prefix = "/offline-assets" - # Fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false