Deploy Sockethub from the npm package #146
@@ -2,3 +2,4 @@ node.default['sockethub']['port'] = '10551'
|
|||||||
node.default['sockethub']['external_port'] = '10550'
|
node.default['sockethub']['external_port'] = '10550'
|
||||||
node.default['sockethub']['version'] = '3.1.4'
|
node.default['sockethub']['version'] = '3.1.4'
|
||||||
node.default['sockethub']['nginx']['server_name'] = 'sockethub.kosmos.org'
|
node.default['sockethub']['nginx']['server_name'] = 'sockethub.kosmos.org'
|
||||||
|
node.default['sockethub']['debug_logs'] = 'sockethub*'
|
||||||
|
|||||||
@@ -48,6 +48,15 @@ execute "systemctl daemon-reload" do
|
|||||||
action :nothing
|
action :nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
environment_variables = {
|
||||||
|
'PORT' => node['sockethub']['port'],
|
||||||
|
# Use the second database (index starts at 0)
|
||||||
|
'REDIS_URL' => "redis://localhost:6379/1"
|
||||||
|
}
|
||||||
|
unless node['sockethub']['debug_logs'].nil?
|
||||||
|
environment_variables['DEBUG'] = node['sockethub']['debug_logs']
|
||||||
|
end
|
||||||
|
|
||||||
template "/lib/systemd/system/sockethub_nodejs.service" do
|
template "/lib/systemd/system/sockethub_nodejs.service" do
|
||||||
|
|
|||||||
source 'nodejs.systemd.service.erb'
|
source 'nodejs.systemd.service.erb'
|
||||||
owner 'root'
|
owner 'root'
|
||||||
@@ -57,10 +66,7 @@ template "/lib/systemd/system/sockethub_nodejs.service" do
|
|||||||
user: "sockethub",
|
user: "sockethub",
|
||||||
group: "sockethub",
|
group: "sockethub",
|
||||||
entry: "/usr/bin/sockethub",
|
entry: "/usr/bin/sockethub",
|
||||||
environment: { 'DEBUG' => '*',
|
environment: environment_variables
|
||||||
'PORT' => node['sockethub']['port'],
|
|
||||||
# Use the second database (index starts at 0)
|
|
||||||
'REDIS_URL' => "redis://localhost:6379/1" }
|
|
||||||
)
|
)
|
||||||
notifies :run, "execute[systemctl daemon-reload]", :delayed
|
notifies :run, "execute[systemctl daemon-reload]", :delayed
|
||||||
notifies :restart, "service[sockethub_nodejs]", :delayed
|
notifies :restart, "service[sockethub_nodejs]", :delayed
|
||||||
|
|||||||
Reference in New Issue
Block a user
Aside from this being useful to be configurable as an attribute per node/role/environment, I think this should not use full debug logs in production.
I'm pairing with @slvrbckt in 2 hours, so I'll find out about the best config value here.
@slvrbckt Could you add a comment here perhaps about which log setting you think would make sense in production?
I would suggest
DEBUG=sockethub*as a reasonable log level, as it will report on the core sockethub components (sockethub, platforms and schemas) but not the auxilary libraries which would increase verbosity a lot.