From 0593edaabf080ebe1c0942a408ee1daabe5afe2b Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 30 Apr 2021 00:06:36 -0500 Subject: [PATCH] config: allow specifying location of Danbooru config file. Allow specifying the location of the `config/danbooru_local_config.rb` file with the DANBOORU_CONFIG_FILE environment variable. For example: DANBOORU_CONFIG_FILE=/etc/danbooru/danbooru_local_config.rb bin/rails server This is useful in Kubernetes because it lets us mount a directory containing the config file without it clobbering everything else in the config/ directory. --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 85ebe5db0..ae6375365 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,7 +16,7 @@ Bundler.require(*Rails.groups) begin require_relative "danbooru_default_config" - require_relative "danbooru_local_config" + require_relative ENV.fetch("DANBOORU_CONFIG_FILE", "danbooru_local_config") rescue LoadError end