Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

terse_url in user, db seeds are fixed, config/app_config.yml is now i…

…n gitignore, copy over config/app_config_example.yml.
  • Loading branch information...
commit 020ff603bdbbea476483a70c0aad764de646893a 1 parent c8e5252
ilya authored
View
1  .gitignore
@@ -13,3 +13,4 @@ gpg/diaspora-production/*.gpg
gpg/*/random_seed
public/uploads/*
.rvmrc
+config/app_config.yml
View
3  app/models/user.rb
@@ -221,6 +221,9 @@ def update_profile(params)
###Helpers############
def self.instantiate!( opts = {} )
+ terse_url = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '')
+ terse_url.chop! if terse_url[-1, 1] == '/'
+
opts[:person][:diaspora_handle] = "#{opts[:username]}@#{terse_url}"
opts[:person][:url] = APP_CONFIG[:pod_url]
opts[:person][:serialized_key] = generate_key
View
34 config/app_config.yml
@@ -1,23 +1,17 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3. See
-# the COPYRIGHT file.
-
-
-default:
- pod_url: "http://example.org/"
- debug: false
- socket_debug : false
+---
+default:
socket_host: 0.0.0.0
- socket_port: 8080
- socket_collection_name: 'websocket'
- pubsub_server: 'https://pubsubhubbub.appspot.com/'
- mongo_host: 'localhost'
+ socket_debug: false
+ pod_url: tom.joindiaspora.com
mongo_post: 27017
-
-development:
-
-test:
- pod_url: "http://example.org/"
+ 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
-
-production:
View
23 config/app_config_example.yml
@@ -0,0 +1,23 @@
+# Copyright (c) 2010, Diaspora Inc. This file is
+# licensed under the Affero General Public License version 3. See
+# the COPYRIGHT file.
+
+
+default:
+ pod_url: "http://example.org/"
+ debug: false
+ socket_debug : false
+ socket_host: 0.0.0.0
+ socket_port: 8080
+ socket_collection_name: 'websocket'
+ pubsub_server: 'https://pubsubhubbub.appspot.com/'
+ mongo_host: 'localhost'
+ mongo_post: 27017
+
+development:
+
+test:
+ pod_url: "http://example.org/"
+ socket_port: 8081
+
+production:
View
8 db/seeds/backer.rb
@@ -42,10 +42,10 @@ def create
end
def set_app_config username
- current_config = YAML.load(Rails.root.join('config', 'app_config.yml')).symbolize_keys
- current_config[Rails.env] ||= {}
- current_config[Rails.env][:pod_url] = "#{username}.joindiaspora.com"
- current_config[:default][:pod_url] = "#{username}.joindiaspora.com"
+ current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml')))
+ current_config[Rails.env.to_s] ||= {}
+ current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com"
+ current_config['default']['pod_url'] = "#{username}.joindiaspora.com"
file = File.new(Rails.root.join('config','app_config.yml'),'w')
file.write(current_config.to_yaml)
file.close
View
12 db/seeds/dev.rb
@@ -6,7 +6,19 @@
require 'config/environment'
+def set_app_config username
+ current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml')))
+ current_config[Rails.env.to_s] ||= {}
+ current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com"
+ current_config['default']['pod_url'] = "#{username}.joindiaspora.com"
+ file = File.new(Rails.root.join('config','app_config.yml'),'w')
+ file.write(current_config.to_yaml)
+ file.close
+end
+
username = "tom"
+set_app_config username
+
# Create seed user
user = User.instantiate!( :email => "tom@tom.joindiaspora.com",
:username => "tom",
View
8 db/seeds/tom.rb
@@ -7,10 +7,10 @@
require 'config/environment'
def set_app_config username
- current_config = YAML.load(Rails.root.join('config', 'app_config.yml')).symbolize_keys
- current_config[Rails.env] ||= {}
- current_config[Rails.env][:pod_url] = "#{username}.joindiaspora.com"
- current_config[:default][:pod_url] = "#{username}.joindiaspora.com"
+ current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml')))
+ current_config[Rails.env.to_s] ||= {}
+ current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com"
+ current_config['default']['pod_url'] = "#{username}.joindiaspora.com"
file = File.new(Rails.root.join('config','app_config.yml'),'w')
file.write(current_config.to_yaml)
file.close
Please sign in to comment.
Something went wrong with that request. Please try again.