Run sockethub as its own user

This commit is contained in:
Greg Karékinian 2017-04-28 12:01:07 +02:00
parent 8ba12e1ba2
commit c9879a60e2

View File

@ -2,26 +2,41 @@
# Cookbook Name:: sockethub
# Recipe:: default
#
# Copyright 2015, Kosmos
# Copyright 2015-2017, Kosmos
#
# All rights reserved - Do Not Redistribute
#
include_recipe 'kosmos-nodejs'
include_recipe 'kosmos-redis'
package "git"
group "sockethub" do
gid 7625
end
user "sockethub" do
comment "sockethub user"
uid 7625
gid 7625
manage_home true
shell "/bin/bash"
end
path_to_deploy = "/opt/sockethub"
application path_to_deploy do
owner "www-data"
group "www-data"
owner "sockethub"
group "sockethub"
git do
user "sockethub"
group "sockethub"
repository 'https://github.com/sockethub/sockethub.git'
revision 'v1.0.5'
end
npm_install
npm_install do
user "sockethub"
end
execute "systemctl daemon-reload" do
command "systemctl daemon-reload"
@ -34,8 +49,8 @@ application path_to_deploy do
group 'root'
mode '0644'
variables(
:user => owner,
:group => group,
:user => "sockethub",
:group => "sockethub",
:app_dir => path_to_deploy,
:entry => "/usr/local/bin/node /usr/local/bin/npm start",
:environment => { 'DEBUG' => '*',