Skip to content

Commit

Permalink
chore(offline): prep and make adjustments for a smoother offline expe…
Browse files Browse the repository at this point in the history
…rience (#970)

Co-authored-by: Laura Mosher <lauramosher@users.noreply.github.com>
  • Loading branch information
lauramosher and lauramosher committed Oct 5, 2023
1 parent f5a94e7 commit f2c4e0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions rails/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 3 additions & 3 deletions rails/config/environments/offline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit f2c4e0b

Please sign in to comment.