From 13d55d7293adaf38230f623ed1a894abc55d1f52 Mon Sep 17 00:00:00 2001 From: chaos Date: Mon, 4 Sep 2023 18:09:16 +0100 Subject: [PATCH] prune media before gotosocial backup, fix try_files on piped frontend in container --- hosts/hetzner-vm/containers/piped/piped.nix | 3 +++ hosts/hetzner-vm/containers/social/profiles/backups.nix | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/hosts/hetzner-vm/containers/piped/piped.nix b/hosts/hetzner-vm/containers/piped/piped.nix index 88b4ada..a8c2ed4 100644 --- a/hosts/hetzner-vm/containers/piped/piped.nix +++ b/hosts/hetzner-vm/containers/piped/piped.nix @@ -105,6 +105,9 @@ in { locations."/" = { proxyPass = "http://unix:${pipedSocketForComponent "frontend"}"; }; + extraConfig = '' + try_files $uri $uri/ /index.html; + ''; }; services.nginx.virtualHosts."backend.piped.owo.monster" = { diff --git a/hosts/hetzner-vm/containers/social/profiles/backups.nix b/hosts/hetzner-vm/containers/social/profiles/backups.nix index 2f03f40..4d5346b 100644 --- a/hosts/hetzner-vm/containers/social/profiles/backups.nix +++ b/hosts/hetzner-vm/containers/social/profiles/backups.nix @@ -27,7 +27,13 @@ (db: "postgresqlBackup-${db}")) } --wait + systemctl stop gotosocial + ${goToSocialAdmin} export --path /var/lib/gotosocial/gts-export.json + + ${goToSocialAdmin} media prune all + + systemctl start gotosocial '') }/bin/backupPrepareCommand";