diff --git a/site-cookbooks/sockethub/recipes/default.rb b/site-cookbooks/sockethub/recipes/default.rb index daa6b63..4c7d4c6 100644 --- a/site-cookbooks/sockethub/recipes/default.rb +++ b/site-cookbooks/sockethub/recipes/default.rb @@ -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' => '*',