From 736d7908b4f31095e7a7b92fc632b0f6fad05e83 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 19 May 2020 01:20:45 +0200 Subject: RUBY_VERSION factorisation --- conf/cron | 2 +- conf/mastodon-sidekiq.service | 2 +- conf/mastodon-web.service | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'conf') diff --git a/conf/cron b/conf/cron index 9a984a3..8bf7bdb 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,2 @@ RAILS_ENV=production -@daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.5/bin/bundle exec rake __USER__:media:remove_remote +@daily cd __FINAL__PATH__/live && __RBENVROOT__/shims/bundle exec rake __USER__:media:remove_remote diff --git a/conf/mastodon-sidekiq.service b/conf/mastodon-sidekiq.service index d5fc7e1..73f29e5 100644 --- a/conf/mastodon-sidekiq.service +++ b/conf/mastodon-sidekiq.service @@ -9,7 +9,7 @@ Environment="RAILS_ENV=production" Environment="DB_POOL=25" Environment="MALLOC_ARENA_MAX=2" - ExecStart=/opt/rbenv/versions/2.6.5/bin/bundle exec sidekiq -c 25 + ExecStart=__RBENVROOT__/shims/bundle exec sidekiq -c 25 TimeoutSec=15 Restart=always StandardError=syslog diff --git a/conf/mastodon-web.service b/conf/mastodon-web.service index bb65afe..14d1260 100644 --- a/conf/mastodon-web.service +++ b/conf/mastodon-web.service @@ -8,7 +8,7 @@ WorkingDirectory=__FINALPATH__/live Environment="RAILS_ENV=production" Environment="PORT=__PORT_WEB__" - ExecStart=/opt/rbenv/versions/2.6.5/bin/bundle exec puma -C config/puma.rb + ExecStart=__RBENVROOT__/shims/bundle exec puma -C config/puma.rb ExecReload=/bin/kill -SIGUSR1 $MAINPID TimeoutSec=15 Restart=always -- cgit v1.2.3-70-g09d2 From 5f421f48d7fb69b8c8adafad48b93bbb621c6dce Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 19 May 2020 19:20:06 +0200 Subject: Fix CRON --- conf/cron | 2 +- scripts/install | 2 -- scripts/upgrade | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) (limited to 'conf') diff --git a/conf/cron b/conf/cron index 8bf7bdb..af98c3c 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,2 @@ RAILS_ENV=production -@daily cd __FINAL__PATH__/live && __RBENVROOT__/shims/bundle exec rake __USER__:media:remove_remote +@daily cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl media remove diff --git a/scripts/install b/scripts/install index 1f1a11f..32cb94e 100644 --- a/scripts/install +++ b/scripts/install @@ -230,8 +230,6 @@ ynh_secure_remove --file="$final_path/live/key.txt" ynh_script_progression --message="Setuping a cron job for removing cache..." --weight=1 ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="../conf/cron" -ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/cron" -ynh_replace_string --match_string="__RBENVROOT__" --replace_string="$RBENV_ROOT" --target_file="../conf/cron" cp -f ../conf/cron /etc/cron.d/$app #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index da0e7bb..0a19125 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -308,8 +308,6 @@ ynh_store_file_checksum --file="$config" ynh_script_progression --message="Setuping a cron job for removing cache..." --weight=1 ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="../conf/cron" -ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/cron" -ynh_replace_string --match_string="__RBENVROOT__" --replace_string="$RBENV_ROOT" --target_file="../conf/cron" cp -f ../conf/cron /etc/cron.d/$app #================================================= -- cgit v1.2.3-70-g09d2 From 1977f0fff725ff589618fffc18e861b264f46891 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 19 May 2020 23:57:16 +0200 Subject: Imrpove cron --- conf/cron | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'conf') diff --git a/conf/cron b/conf/cron index af98c3c..1296c1b 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,4 @@ -RAILS_ENV=production @daily cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl media remove +@monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl media remove-orphans +@monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl accounts cull +@monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl status remove -- cgit v1.2.3-70-g09d2 From b4dc3908d08cb1767dbe729ea2cc8956369359c3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 May 2020 03:12:41 +0200 Subject: add tootctl preview_cards remove --- conf/cron | 1 + 1 file changed, 1 insertion(+) (limited to 'conf') diff --git a/conf/cron b/conf/cron index 1296c1b..f3cae63 100644 --- a/conf/cron +++ b/conf/cron @@ -2,3 +2,4 @@ @monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl media remove-orphans @monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl accounts cull @monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl status remove +@monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl preview_cards remove -- cgit v1.2.3-70-g09d2 From 29c9a33cdb9f11f14083bebaa519bf7a6f762cfc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 May 2020 03:16:41 +0200 Subject: fix tootctl statuses remove --- conf/cron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'conf') diff --git a/conf/cron b/conf/cron index f3cae63..776808b 100644 --- a/conf/cron +++ b/conf/cron @@ -1,5 +1,5 @@ @daily cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl media remove @monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl media remove-orphans @monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl accounts cull -@monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl status remove +@monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl statuses remove @monthly cd __FINAL_PATH__/live && RAILS_ENV=production bin/tootctl preview_cards remove -- cgit v1.2.3-70-g09d2 From 1f9dc463f214a8692e99ca1f3273461dda55e8fd Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 26 May 2020 14:39:04 +0200 Subject: switching from add_header to more_set_headers --- conf/nginx.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'conf') diff --git a/conf/nginx.conf b/conf/nginx.conf index d348613..866fcc7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -19,14 +19,14 @@ location / { } location ~ ^/(emoji|packs|system/accounts/avatars|system/media_attachments/files) { - add_header Cache-Control "public, max-age=31536000, immutable"; - add_header Strict-Transport-Security "max-age=31536000"; + more_set_headers "Cache-Control: public, max-age=31536000, immutable"; + more_set_headers "Strict-Transport-Security: max-age=31536000"; try_files $uri @proxy; } location /sw.js { - add_header Cache-Control "public, max-age=0"; - add_header Strict-Transport-Security "max-age=31536000"; + more_set_headers "Cache-Control: public, max-age=0"; + more_set_headers "Strict-Transport-Security: max-age=31536000"; try_files $uri @proxy; } @@ -49,8 +49,8 @@ location @proxy { proxy_cache_valid 200 7d; proxy_cache_valid 410 24h; proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; - add_header X-Cached $upstream_cache_status; - add_header Strict-Transport-Security "max-age=31536000"; + more_set_headers "X-Cached: $upstream_cache_status"; + more_set_headers "Strict-Transport-Security: max-age=31536000"; tcp_nodelay on; } -- cgit v1.2.3-70-g09d2