From cbaed036da14f492a02a463a6c99c0341c5f41b9 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Wed, 21 May 2025 13:41:33 +0200 Subject: [PATCH] Make paths written to at runtime and secrets configurable via ENV variables --- config/application.rb | 2 +- config/database.yml | 2 +- config/storage.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/application.rb b/config/application.rb index 932ba42..8187854 100644 --- a/config/application.rb +++ b/config/application.rb @@ -35,6 +35,6 @@ module EntranceExam # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - config.entrance_exam_token = "password" + config.entrance_exam_token = ENV.fetch("RAILS_ENTRANCE_PASSWORD", "password") end end diff --git a/config/database.yml b/config/database.yml index 9844d64..3d62897 100644 --- a/config/database.yml +++ b/config/database.yml @@ -11,7 +11,7 @@ default: &default development: <<: *default - database: storage/development.sqlite3 + database: <%= ENV.fetch("RAILS_DATABASE_PATH", "storage/development.sqlite3") # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". diff --git a/config/storage.yml b/config/storage.yml index 4942ab6..4ee4ca1 100644 --- a/config/storage.yml +++ b/config/storage.yml @@ -4,7 +4,7 @@ test: local: service: Disk - root: <%= Rails.root.join("storage") %> + root: <%= ENV.fetch("RAILS_STORAGE_PATH", Rails.root.join("storage")) %> # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) # amazon: