diff --git a/Changelog.md b/Changelog.md index 3c35d41a0..9a604c1e6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -36,6 +36,7 @@ Ruby 2.0 is no longer officially supported. * Fix closing account from mobile view [#5913](https://github.com/diaspora/diaspora/pull/5913) * Allow using common custom template for desktop & mobile landing page [#5915](https://github.com/diaspora/diaspora/pull/5915) * Use correct branding in Atom feed [#5929](https://github.com/diaspora/diaspora/pull/5929) +* Update the configurate gem to avoid issues by missed missing settings keys [#5934](https://github.com/diaspora/diaspora/pull/5934) ## Features * Hide post title of limited post in comment notification email [#5843](https://github.com/diaspora/diaspora/pull/5843) diff --git a/Gemfile b/Gemfile index e89330d34..61593969e 100644 --- a/Gemfile +++ b/Gemfile @@ -45,7 +45,7 @@ gem "uglifier", "2.7.1" # Configuration -gem "configurate", "0.2.0" +gem "configurate", "0.3.1" # Cross-origin resource sharing diff --git a/Gemfile.lock b/Gemfile.lock index a948ec359..08f196a2d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -124,7 +124,7 @@ GEM compass (~> 1.0.0) sass-rails (<= 5.0.1) sprockets (< 2.13) - configurate (0.2.0) + configurate (0.3.1) connection_pool (2.2.0) crack (0.4.2) safe_yaml (~> 1.0.0) @@ -717,7 +717,7 @@ DEPENDENCIES capybara (= 2.4.4) carrierwave (= 0.10.0) compass-rails (= 2.0.4) - configurate (= 0.2.0) + configurate (= 0.3.1) cucumber-rails (= 1.4.2) database_cleaner (= 1.4.1) devise (= 3.4.1) diff --git a/config/defaults.yml b/config/defaults.yml index 4b5721864..04a9b7ec5 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -101,6 +101,7 @@ defaults: paypal_hosted_button_id: paypal_unhosted_button_encrypted: bitcoin_address: + bitcoin_wallet_id: # DEPRECATED: Remove with 0.6 community_spotlight: enable: false suggest_email: @@ -176,6 +177,8 @@ defaults: admins: account: podmin_email: + # List valid environment variables + redistogo_url: development: environment: diff --git a/config/load_config.rb b/config/load_config.rb index fd4742259..5e9985200 100644 --- a/config/load_config.rb +++ b/config/load_config.rb @@ -1,50 +1,50 @@ -require 'pathname' -require 'bundler/setup' -require 'configurate' +require "pathname" +require "bundler/setup" +require "configurate" -rails_env = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development' +rails_env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" module Rails def self.root - @__root ||= Pathname.new File.expand_path('../../', __FILE__) + @__root ||= Pathname.new File.expand_path("../../", __FILE__) end end -require Rails.root.join 'lib', 'configuration_methods' - -config_dir = Rails.root.join('config').to_s +require Rails.root.join "lib", "configuration_methods" +config_dir = Rails.root.join("config").to_s AppConfig ||= Configurate::Settings.create do add_provider Configurate::Provider::Dynamic add_provider Configurate::Provider::Env - - unless heroku? || rails_env == "test" || File.exists?(File.join(config_dir, 'diaspora.yml')) - $stderr.puts "FATAL: Configuration not found. Copy over diaspora.yml.example" - $stderr.puts " to diaspora.yml and edit it to your needs." + + unless heroku? || rails_env == "test" || File.exist?(File.join(config_dir, "diaspora.yml")) + warn "FATAL: Configuration not found. Copy over diaspora.yml.example" + warn " to diaspora.yml and edit it to your needs." exit! end - + add_provider Configurate::Provider::YAML, - File.join(config_dir, 'diaspora.yml'), - namespace: rails_env, required: false unless rails_env == 'test' + File.join(config_dir, "diaspora.yml"), + namespace: rails_env, required: false unless rails_env == "test" add_provider Configurate::Provider::YAML, - File.join(config_dir, 'diaspora.yml'), + File.join(config_dir, "diaspora.yml"), namespace: "configuration", required: false add_provider Configurate::Provider::YAML, - File.join(config_dir, 'defaults.yml'), + File.join(config_dir, "defaults.yml"), namespace: rails_env add_provider Configurate::Provider::YAML, - File.join(config_dir, 'defaults.yml'), - namespace: "defaults" + File.join(config_dir, "defaults.yml"), + namespace: "defaults", raise_on_missing: true extend Configuration::Methods - + if rails_env == "production" && - (environment.certificate_authorities.nil? || + (environment.certificate_authorities.nil? || environment.certificate_authorities.empty? || !File.file?(environment.certificate_authorities.get)) - $stderr.puts "FATAL: Diaspora doesn't know where your certificate authorities are. Please ensure they are set to a valid path in diaspora.yml" + warn "FATAL: Diaspora doesn't know where your certificate authorities are." \ + " Please ensure they are set to a valid path in diaspora.yml" exit! end end