Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
c4a86e031d
8 changed files with 69 additions and 31 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -13,3 +13,4 @@ gpg/diaspora-production/*.gpg
|
|||
gpg/*/random_seed
|
||||
public/uploads/*
|
||||
.rvmrc
|
||||
config/app_config.yml
|
||||
|
|
|
|||
|
|
@ -239,6 +239,9 @@ class User
|
|||
|
||||
###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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
23
config/app_config_example.yml
Normal file
23
config/app_config_example.yml
Normal file
|
|
@ -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:
|
||||
|
|
@ -53,6 +53,11 @@ namespace :deploy do
|
|||
run "ln -s -f #{shared_path}/bundle #{current_path}/vendor/bundle"
|
||||
end
|
||||
|
||||
task :symlink_config do
|
||||
run "touch #{shared_path}/app_config.yml"
|
||||
run "ln -s -f #{shared_path}/app_config.yml #{current_path}/config/app_config.yml"
|
||||
end
|
||||
|
||||
task :start do
|
||||
start_mongo
|
||||
start_thin
|
||||
|
|
@ -150,4 +155,4 @@ namespace :db do
|
|||
|
||||
end
|
||||
|
||||
after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle"
|
||||
after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config'
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ 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"
|
||||
file = File.new(Rails.root.join('config','app_config.yml'),'w')
|
||||
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('..','shared','app_config.yml'),'w')
|
||||
file.write(current_config.to_yaml)
|
||||
file.close
|
||||
end
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
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"
|
||||
file = File.new(Rails.root.join('config','app_config.yml'),'w')
|
||||
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('..','shared','app_config.yml'),'w')
|
||||
file.write(current_config.to_yaml)
|
||||
file.close
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue