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
|
gpg/*/random_seed
|
||||||
public/uploads/*
|
public/uploads/*
|
||||||
.rvmrc
|
.rvmrc
|
||||||
|
config/app_config.yml
|
||||||
|
|
|
||||||
|
|
@ -239,6 +239,9 @@ class User
|
||||||
|
|
||||||
###Helpers############
|
###Helpers############
|
||||||
def self.instantiate!( opts = {} )
|
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][:diaspora_handle] = "#{opts[:username]}@#{terse_url}"
|
||||||
opts[:person][:url] = APP_CONFIG[:pod_url]
|
opts[:person][:url] = APP_CONFIG[:pod_url]
|
||||||
opts[:person][:serialized_key] = generate_key
|
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
|
default:
|
||||||
# the COPYRIGHT file.
|
|
||||||
|
|
||||||
|
|
||||||
default:
|
|
||||||
pod_url: "http://example.org/"
|
|
||||||
debug: false
|
|
||||||
socket_debug : false
|
|
||||||
socket_host: 0.0.0.0
|
socket_host: 0.0.0.0
|
||||||
socket_port: 8080
|
socket_debug: false
|
||||||
socket_collection_name: 'websocket'
|
pod_url: tom.joindiaspora.com
|
||||||
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
|
||||||
mongo_host: 'localhost'
|
|
||||||
mongo_post: 27017
|
mongo_post: 27017
|
||||||
|
socket_collection_name: websocket
|
||||||
development:
|
socket_port: 8080
|
||||||
|
pubsub_server: https://pubsubhubbub.appspot.com/
|
||||||
test:
|
mongo_host: localhost
|
||||||
pod_url: "http://example.org/"
|
debug: false
|
||||||
|
production:
|
||||||
|
development:
|
||||||
|
pod_url: tom.joindiaspora.com
|
||||||
|
test:
|
||||||
|
pod_url: http://example.org/
|
||||||
socket_port: 8081
|
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"
|
run "ln -s -f #{shared_path}/bundle #{current_path}/vendor/bundle"
|
||||||
end
|
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
|
task :start do
|
||||||
start_mongo
|
start_mongo
|
||||||
start_thin
|
start_thin
|
||||||
|
|
@ -150,4 +155,4 @@ namespace :db do
|
||||||
|
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
def set_app_config username
|
def set_app_config username
|
||||||
current_config = YAML.load(Rails.root.join('config', 'app_config.yml')).symbolize_keys
|
current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml')))
|
||||||
current_config[Rails.env] ||= {}
|
current_config[Rails.env.to_s] ||= {}
|
||||||
current_config[Rails.env][: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('config','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
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,19 @@
|
||||||
|
|
||||||
require 'config/environment'
|
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"
|
username = "tom"
|
||||||
|
set_app_config username
|
||||||
|
|
||||||
# Create seed user
|
# Create seed user
|
||||||
user = User.instantiate!( :email => "tom@tom.joindiaspora.com",
|
user = User.instantiate!( :email => "tom@tom.joindiaspora.com",
|
||||||
:username => "tom",
|
:username => "tom",
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
require 'config/environment'
|
require 'config/environment'
|
||||||
|
|
||||||
def set_app_config username
|
def set_app_config username
|
||||||
current_config = YAML.load(Rails.root.join('config', 'app_config.yml')).symbolize_keys
|
current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml')))
|
||||||
current_config[Rails.env] ||= {}
|
current_config[Rails.env.to_s] ||= {}
|
||||||
current_config[Rails.env][: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('config','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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue