Deploy Sockethub from the npm package #146

Merged
raucao merged 10 commits from feature/145-sockethub_from_npm into master 2021-08-31 09:00:07 +00:00
2 changed files with 11 additions and 4 deletions
Showing only changes of commit 43736cd8e9 - Show all commits

View File

@ -2,3 +2,4 @@ node.default['sockethub']['port'] = '10551'
node.default['sockethub']['external_port'] = '10550'
node.default['sockethub']['version'] = '3.1.4'
node.default['sockethub']['nginx']['server_name'] = 'sockethub.kosmos.org'
node.default['sockethub']['debug_logs'] = 'sockethub*'

View File

@ -48,6 +48,15 @@ execute "systemctl daemon-reload" do
action :nothing
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

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.

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?

@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.

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.
source 'nodejs.systemd.service.erb'
owner 'root'
@ -57,10 +66,7 @@ template "/lib/systemd/system/sockethub_nodejs.service" do
user: "sockethub",
group: "sockethub",
entry: "/usr/bin/sockethub",
environment: { 'DEBUG' => '*',
'PORT' => node['sockethub']['port'],
# Use the second database (index starts at 0)
'REDIS_URL' => "redis://localhost:6379/1" }
environment: environment_variables
)
notifies :run, "execute[systemctl daemon-reload]", :delayed
notifies :restart, "service[sockethub_nodejs]", :delayed