Commit a7699c2a authored by Jonne Haß's avatar Jonne Haß Committed by Dennis Schubert
Browse files

Update configurate and enable missing key exceptions

closes #5934
parent 166a152d
......@@ -21,6 +21,7 @@
* 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)
......
......@@ -45,7 +45,7 @@ gem "uglifier", "2.7.1"
# Configuration
gem "configurate", "0.2.0"
gem "configurate", "0.3.1"
# Cross-origin resource sharing
......
......@@ -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)
......
......@@ -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:
......
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment