diaspora-prosody-config 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/diaspora-prosody-config.gemspec +8 -8
- data/etc/prosody.cfg.lua.tpl +14 -5
- data/lib/diaspora-prosody-config.rb +20 -28
- metadata +23 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51d3827fb7cb49b8541a26121c7815643aa0e89e
|
4
|
+
data.tar.gz: a0ceb0f04f825c91eeab6d0c47c4e130bcf2b285
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf3edcf393680f1d7a95730ce453ce711f3d7b9021951e7504e968382402aea6546e47615da393959d81905d919c134f7cfdfac0ac77055fc046b9fe8e5215c7
|
7
|
+
data.tar.gz: da2540715ad90b2124d04efc42cf7883e3d624d32102e96c429e52740bc39eb55dac6bd830d8236ef9317ff8d013808235ef847c99eade8669d06f0bc2b2c506
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
diaspora-prosody-config (0.0.
|
4
|
+
diaspora-prosody-config (0.0.5)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -56,11 +56,11 @@ PLATFORMS
|
|
56
56
|
|
57
57
|
DEPENDENCIES
|
58
58
|
diaspora-prosody-config!
|
59
|
-
minitest
|
60
|
-
pronto
|
61
|
-
pronto-rubocop
|
62
|
-
rake
|
63
|
-
sqlite3
|
59
|
+
minitest (~> 5.8)
|
60
|
+
pronto (~> 0.6.0)
|
61
|
+
pronto-rubocop (~> 0.6.1)
|
62
|
+
rake (~> 10.5)
|
63
|
+
sqlite3 (~> 1.3)
|
64
64
|
|
65
65
|
BUNDLED WITH
|
66
66
|
1.10.6
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'diaspora-prosody-config'
|
3
|
-
s.version = '0.0.
|
4
|
-
s.summary = '
|
5
|
-
s.description = '
|
3
|
+
s.version = '0.0.5'
|
4
|
+
s.summary = 'Diaspora Configuration Wrapper For Prosodoy'
|
5
|
+
s.description = 'This gem maps configuration options from Diaspora to Prosody.'
|
6
6
|
s.license = 'GPL-3.0'
|
7
7
|
|
8
8
|
s.authors = ['Lukas Matt']
|
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
s.require_paths = ['lib']
|
14
14
|
|
15
|
-
s.add_development_dependency 'pronto'
|
16
|
-
s.add_development_dependency 'pronto-rubocop'
|
17
|
-
s.add_development_dependency 'sqlite3'
|
18
|
-
s.add_development_dependency 'minitest'
|
19
|
-
s.add_development_dependency 'rake'
|
15
|
+
s.add_development_dependency 'pronto', '~> 0.6.0'
|
16
|
+
s.add_development_dependency 'pronto-rubocop', '~> 0.6.1'
|
17
|
+
s.add_development_dependency 'sqlite3', '~> 1.3'
|
18
|
+
s.add_development_dependency 'minitest', '~> 5.8'
|
19
|
+
s.add_development_dependency 'rake', '~> 10.5'
|
20
20
|
end
|
data/etc/prosody.cfg.lua.tpl
CHANGED
@@ -59,7 +59,7 @@ modules_enabled = {
|
|
59
59
|
--"admin_telnet"; -- Opens telnet console interface on localhost port 5582
|
60
60
|
|
61
61
|
-- HTTP modules
|
62
|
-
|
62
|
+
"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
|
63
63
|
--"http_files"; -- Serve static files from a directory over HTTP
|
64
64
|
|
65
65
|
-- Other specific functionality
|
@@ -80,6 +80,15 @@ modules_disabled = {
|
|
80
80
|
-- "s2s"; -- Handle server-to-server connections
|
81
81
|
};
|
82
82
|
|
83
|
+
-- BOSH ports configuration
|
84
|
+
bosh_ports = {
|
85
|
+
{
|
86
|
+
port = #{bosh_port};
|
87
|
+
path = "#{bosh_path}";
|
88
|
+
interface = "#{bosh_interface}";
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
83
92
|
-- NOTE if you append new plugin_paths do not remove the variable #{plugin_path}
|
84
93
|
-- or copy all modules from the gem directory gem_diaspora-prosody-config
|
85
94
|
plugin_paths = { "#{plugin_path}" }
|
@@ -144,8 +153,8 @@ authentication = "internal_plain"
|
|
144
153
|
-- Logging configuration
|
145
154
|
-- For advanced logging see http://prosody.im/doc/logging
|
146
155
|
log = {
|
147
|
-
|
148
|
-
error = "
|
156
|
+
#{log_debug} = "#{log_info}"; -- Change 'info' to 'debug' for verbose logging
|
157
|
+
error = "#{log_error}";
|
149
158
|
-- "*syslog"; -- Uncomment this for logging to syslog
|
150
159
|
-- "*console"; -- Log to the console, useful for debugging with daemonize=false
|
151
160
|
}
|
@@ -165,8 +174,8 @@ VirtualHost "#{virtualhost_hostname}"
|
|
165
174
|
}
|
166
175
|
|
167
176
|
ssl = {
|
168
|
-
key = "
|
169
|
-
certificate = "
|
177
|
+
key = "#{virtualhost_ssl_key}";
|
178
|
+
certificate = "#{virtualhost_ssl_crt}";
|
170
179
|
}
|
171
180
|
|
172
181
|
modules_enabled = {
|
@@ -27,10 +27,10 @@ module Prosody
|
|
27
27
|
DIASPORACFG = "#{FileUtils.pwd}/config/prosody.cfg.lua".freeze
|
28
28
|
|
29
29
|
def self.start
|
30
|
-
check_sanity && system("#{find_binary} --config #{WRAPPERCFG}")
|
30
|
+
check_sanity.nil? && system("#{find_binary} --config #{WRAPPERCFG}")
|
31
31
|
end
|
32
32
|
|
33
|
-
def self.update_configuration
|
33
|
+
def self.update_configuration(opts = {})
|
34
34
|
# update prosody cfg in diaspora config dir
|
35
35
|
gemcfg = "#{WRAPPERCFG}.tpl"
|
36
36
|
unless File.exist?(DIASPORACFG)
|
@@ -38,21 +38,12 @@ module Prosody
|
|
38
38
|
end
|
39
39
|
|
40
40
|
config = File.read(DIASPORACFG)
|
41
|
-
config_params.each do |k, v|
|
42
|
-
begin
|
43
|
-
v = 'MySQL' if v.include?('mysql2')
|
44
|
-
v = 'PostgreSQL' if v.include?('postgresql')
|
45
|
-
v = 'SQLite3' if v.include?('sqlite3')
|
46
|
-
rescue
|
47
|
-
warn("Warning! #{k} is empty")
|
48
|
-
end
|
41
|
+
config_params(opts).each do |k, v|
|
49
42
|
config.gsub!(/\#\{#{k}\}/, "#{v}")
|
50
43
|
end
|
51
44
|
File.open(WRAPPERCFG, 'w') {|f| f.write(config) }
|
52
45
|
end
|
53
46
|
|
54
|
-
private
|
55
|
-
|
56
47
|
def self.find_binary
|
57
48
|
ENV['PATH'].split(':').each do |p|
|
58
49
|
prosodybin = "#{p}/prosody"
|
@@ -76,28 +67,29 @@ module Prosody
|
|
76
67
|
if version < Gem::Version.new('0.9.0')
|
77
68
|
abort('your\'re prosody version should be >= 0.9.0')
|
78
69
|
end
|
79
|
-
abort('wasn\'t able to detect the Diaspora environment') unless defined?(AppConfig)
|
80
|
-
abort('wasn\'t able to detect the Rails environment') unless defined?(Rails)
|
81
|
-
|
82
|
-
update_configuration
|
83
70
|
end
|
84
71
|
|
85
|
-
def self.config_params
|
72
|
+
def self.config_params(opts)
|
86
73
|
db = Rails.application.config.database_configuration[Rails.env]
|
87
74
|
hostname = AppConfig.environment.url
|
88
75
|
.gsub(/^http(s){0,1}:\/\/|\/$/, '')
|
89
76
|
.to_s rescue 'localhost'
|
90
77
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
78
|
+
opts[:virtualhost_ssl_key] = "#{opts[:certs]}/#{hostname}.key"
|
79
|
+
opts[:virtualhost_ssl_crt] = "#{opts[:certs]}/#{hostname}.crt"
|
80
|
+
|
81
|
+
opts[:plugin_path] = "#{GEMDIR}/modules"
|
82
|
+
opts[:virtualhost_hostname] =
|
83
|
+
hostname.gsub(/^http(s){0,1}:\/\/|\/$/, '').to_s rescue 'localhost'
|
84
|
+
|
85
|
+
opts[:virtualhost_driver] =
|
86
|
+
case opts[:virtualhost_driver]
|
87
|
+
when 'mysql2' then 'MySQL'
|
88
|
+
when 'postgresql' then 'PostgreSQL'
|
89
|
+
else 'SQLite3'
|
90
|
+
end
|
91
|
+
opts
|
102
92
|
end
|
93
|
+
|
94
|
+
private_class_method :find_binary, :check_sanity, :config_params
|
103
95
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diaspora-prosody-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Matt
|
@@ -14,73 +14,73 @@ dependencies:
|
|
14
14
|
name: pronto
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.6.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pronto-rubocop
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.6.1
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.6.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '1.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '5.8'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '5.8'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '10.5'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
83
|
-
description:
|
82
|
+
version: '10.5'
|
83
|
+
description: This gem maps configuration options from Diaspora to Prosody.
|
84
84
|
email: lukas@zauberstuhl.de
|
85
85
|
executables: []
|
86
86
|
extensions: []
|
@@ -125,5 +125,5 @@ rubyforge_project:
|
|
125
125
|
rubygems_version: 2.4.3
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
|
-
summary:
|
128
|
+
summary: Diaspora Configuration Wrapper For Prosodoy
|
129
129
|
test_files: []
|