From 7e709768c33785a8cddee7f5ff515357a8971f96 Mon Sep 17 00:00:00 2001 From: Norm Date: Wed, 15 May 2024 16:58:58 -0400 Subject: [PATCH] Use /var/tmp for media cache path in apache/nginx configs The /var/tmp directory is not mounted as tmpfs unlike /tmp which is mounted as such on some distros like Fedora or Arch. Since there isn't really a benefit to having the cache on tmpfs, this change should allow for a larger cache if needed without worrying about running out of RAM. --- installation/apache/akkoma-apache.conf | 2 +- installation/apache/apache-cache-purge.sh.example | 2 +- installation/nginx/akkoma.nginx | 2 +- installation/nginx/nginx-cache-purge.sh.example | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/installation/apache/akkoma-apache.conf b/installation/apache/akkoma-apache.conf index 65bbf15e1..76357789e 100644 --- a/installation/apache/akkoma-apache.conf +++ b/installation/apache/akkoma-apache.conf @@ -60,7 +60,7 @@ ServerTokens Prod Include /etc/letsencrypt/options-ssl-apache.conf # Uncomment the following to enable MediaProxy caching on disk - #CacheRoot /tmp/akkoma-media-cache/ + #CacheRoot /var/tmp/akkoma-media-cache/ #CacheDirLevels 1 #CacheDirLength 2 #CacheEnable disk /proxy diff --git a/installation/apache/apache-cache-purge.sh.example b/installation/apache/apache-cache-purge.sh.example index 65df9cc11..59c2a5ed0 100755 --- a/installation/apache/apache-cache-purge.sh.example +++ b/installation/apache/apache-cache-purge.sh.example @@ -16,7 +16,7 @@ SCRIPTNAME=${0##*/} # mod_disk_cache directory -CACHE_DIRECTORY="/tmp/akkoma-media-cache" +CACHE_DIRECTORY="/var/tmp/akkoma-media-cache" ## Removes an item via the htcacheclean utility ## $1 - the filename, can be a pattern . diff --git a/installation/nginx/akkoma.nginx b/installation/nginx/akkoma.nginx index bfb1fffb3..bdd5d0f8b 100644 --- a/installation/nginx/akkoma.nginx +++ b/installation/nginx/akkoma.nginx @@ -3,7 +3,7 @@ # See the documentation at docs.akkoma.dev for your particular distro/OS for # installation instructions. -proxy_cache_path /tmp/akkoma-media-cache levels=1:2 keys_zone=akkoma_media_cache:10m max_size=1g +proxy_cache_path /var/tmp/akkoma-media-cache levels=1:2 keys_zone=akkoma_media_cache:10m max_size=1g inactive=720m use_temp_path=off; # this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only diff --git a/installation/nginx/nginx-cache-purge.sh.example b/installation/nginx/nginx-cache-purge.sh.example index 6cd01d1e7..be5f186e4 100755 --- a/installation/nginx/nginx-cache-purge.sh.example +++ b/installation/nginx/nginx-cache-purge.sh.example @@ -5,7 +5,7 @@ SCRIPTNAME=${0##*/} # NGINX cache directory -CACHE_DIRECTORY="/tmp/akkoma-media-cache" +CACHE_DIRECTORY="/var/tmp/akkoma-media-cache" ## Return the files where the items are cached. ## $1 - the filename, can be a pattern .