forked from e621ng/e621ng
dotenv: enable overriding danbooru_local_config.rb with env vars.
This commit is contained in:
parent
a72df4133e
commit
f33108416e
@ -502,4 +502,16 @@ module Danbooru
|
||||
def aws_sqs_archives_url
|
||||
end
|
||||
end
|
||||
|
||||
class EnvironmentConfiguration
|
||||
def method_missing(method, *args)
|
||||
var = ENV["DANBOORU_#{method.to_s.upcase}"]
|
||||
|
||||
if var.present?
|
||||
var
|
||||
else
|
||||
CustomConfiguration.new.send(method, *args)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ require "#{Rails.root}/config/danbooru_local_config"
|
||||
|
||||
module Danbooru
|
||||
def config
|
||||
@configuration ||= CustomConfiguration.new
|
||||
@configuration ||= EnvironmentConfiguration.new
|
||||
end
|
||||
|
||||
module_function :config
|
||||
|
Loading…
Reference in New Issue
Block a user