Skip to content
Extraits de code Groupes Projets
Valider 0323024f rédigé par danielvincent's avatar danielvincent
Parcourir les fichiers

Merge branch 'master' of github.com:diaspora/diaspora

parents df5b7d6d d60dc03d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
---
default:
socket_host: 0.0.0.0
socket_debug: false
pod_url: tom.joindiaspora.com
mongo_post: 27017
socket_collection_name: websocket
socket_port: 8080
pubsub_server: https://pubsubhubbub.appspot.com/
mongo_host: localhost
debug: false
production:
development:
pod_url: tom.joindiaspora.com
test:
pod_url: http://example.org/
socket_port: 8081
...@@ -2,10 +2,20 @@ ...@@ -2,10 +2,20 @@
# licensed under the Affero General Public License version 3. See # licensed under the Affero General Public License version 3. See
# the COPYRIGHT file. # the COPYRIGHT file.
raw_config = File.read("#{Rails.root}/config/app_config.yml") def load_config_yaml filename
all_envs = YAML.load(raw_config) YAML.load(File.read(filename))
if all_envs[Rails.env] end
APP_CONFIG = all_envs['default'].merge(all_envs[Rails.env]).symbolize_keys
if File.exist? "#{Rails.root}/config/app_config.yml"
all_envs = load_config_yaml "#{Rails.root}/config/app_config.yml"
all_envs = load_config_yaml "#{Rails.root}/config/app_config_example.yml" unless all_envs
else
puts "WARNING: No config/app_config.yml found! Look at config/app_config_example.yml for help."
all_envs = load_config_yaml "#{Rails.root}/config/app_config_example.yml"
end
if all_envs[Rails.env.to_s]
APP_CONFIG = all_envs['default'].merge(all_envs[Rails.env.to_s]).symbolize_keys
else else
APP_CONFIG = all_envs['default'].symbolize_keys APP_CONFIG = all_envs['default'].symbolize_keys
end end
......
...@@ -46,7 +46,7 @@ def set_app_config username ...@@ -46,7 +46,7 @@ def set_app_config username
current_config[Rails.env.to_s] ||= {} current_config[Rails.env.to_s] ||= {}
current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com"
current_config['default']['pod_url'] = "#{username}.joindiaspora.com" current_config['default']['pod_url'] = "#{username}.joindiaspora.com"
file = File.new(Rails.root.join('..','shared','app_config.yml'),'w') file = File.new(Rails.root.join('..','..','shared','app_config.yml'),'w')
file.write(current_config.to_yaml) file.write(current_config.to_yaml)
file.close file.close
end end
...@@ -11,7 +11,7 @@ def set_app_config username ...@@ -11,7 +11,7 @@ def set_app_config username
current_config[Rails.env.to_s] ||= {} current_config[Rails.env.to_s] ||= {}
current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com"
current_config['default']['pod_url'] = "#{username}.joindiaspora.com" current_config['default']['pod_url'] = "#{username}.joindiaspora.com"
file = File.new(Rails.root.join('..','shared','app_config.yml'),'w') file = File.new(Rails.root.join('..','..','shared','app_config.yml'),'w')
file.write(current_config.to_yaml) file.write(current_config.to_yaml)
file.close file.close
end end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter