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.
This commit is contained in:
evazion
2021-04-30 00:06:36 -05:00
parent f78d10a591
commit 0593edaabf

View File

@@ -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