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