Fix the mastodon user variable

This commit is contained in:
Greg 2019-04-10 16:38:57 +02:00
parent 4a6c1541ad
commit 67a2c1ea55
1 changed files with 17 additions and 17 deletions

View File

@ -29,11 +29,13 @@ end
mastodon_path = node["kosmos-mastodon"]["directory"]
group "mastodon" do
mastodon_user = "mastodon"
group mastodon_user do
gid 62786
end
user "mastodon" do
user mastodon_user do
comment "mastodon user"
uid 62786
gid 62786
@ -59,7 +61,7 @@ end
#
template "/lib/systemd/system/mastodon-web.service" do
source "mastodon-web.systemd.service.erb"
variables user: user,
variables user: mastodon_user,
app_dir: mastodon_path,
port: node["kosmos-mastodon"]["puma_port"],
bundle_path: "/opt/ruby_build/builds/#{ruby_version}/bin/bundle"
@ -71,7 +73,7 @@ end
#
template "/lib/systemd/system/mastodon-sidekiq.service" do
source "mastodon-sidekiq.systemd.service.erb"
variables user: user,
variables user: mastodon_user,
app_dir: mastodon_path,
bundle_path: "/opt/ruby_build/builds/#{ruby_version}/bin/bundle",
sidekiq_threads: node["kosmos-mastodon"]["sidekiq_threads"]
@ -83,15 +85,13 @@ end
#
template "/lib/systemd/system/mastodon-streaming.service" do
source "mastodon-streaming.systemd.service.erb"
variables user: user,
variables user: mastodon_user,
app_dir: mastodon_path,
port: node["kosmos-mastodon"]["streaming_port"]
notifies :run, "execute[systemctl daemon-reload]", :immediately
notifies :restart, "service[mastodon-streaming]", :delayed
end
user = "mastodon"
application mastodon_path do
owner "mastodon"
group "mastodon"
@ -104,8 +104,8 @@ application mastodon_path do
end
git do
user user
group user
user mastodon_user
group mastodon_user
repository "https://gitea.kosmos.org/kosmos/mastodon.git"
revision "production"
end
@ -115,8 +115,8 @@ application mastodon_path do
template ".env.production" do
source "env.production.erb"
mode "0640"
owner user
group user
owner mastodon_user
group mastodon_user
variables redis_url: node["kosmos-mastodon"]["redis_url"],
domain: node["kosmos-mastodon"]["server_name"],
paperclip_secret: mastodon_credentials['paperclip_secret'],
@ -136,14 +136,14 @@ application mastodon_path do
execute do
environment "HOME" => mastodon_path
user user
user mastodon_user
cwd mastodon_path
command "/opt/ruby_build/builds/#{ruby_version}/bin/bundle install --without development,test --deployment"
end
execute do
environment "HOME" => mastodon_path
user user
user mastodon_user
cwd mastodon_path
command "yarn install --pure-lockfile"
end
@ -156,8 +156,8 @@ application mastodon_path do
execute 'rake db:migrate' do
environment "RAILS_ENV" => "production", "HOME" => mastodon_path
user user
group user
user mastodon_user
group mastodon_user
cwd mastodon_path
command "PATH=\"/opt/ruby_build/builds/#{ruby_version}/bin:$PATH\" bundle exec rake db:migrate"
end
@ -167,8 +167,8 @@ application mastodon_path do
# it cannot find the bundled gems
execute 'rake assets:precompile' do
environment "RAILS_ENV" => "production", "HOME" => mastodon_path
user user
group user
user mastodon_user
group mastodon_user
cwd mastodon_path
command "PATH=\"/opt/ruby_build/builds/#{ruby_version}/bin:$PATH\" bundle exec rake assets:precompile"
end