media auto remove
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Vivian 2023-04-29 23:51:59 +02:00
parent 204b321268
commit 4167d15a6d
2 changed files with 7 additions and 31 deletions

View file

@ -37,7 +37,12 @@ in {
webPort = 55001;
enableUnixSocket = false;
localDomain = "xirion.net";
trustedProxy = "192.168.0.123";
trustedProxy = "192.168.0.122";
mediaAutoRemove = {
enable = true;
olderThanDays = 30;
startAt = "weekly";
};
configureNginx = false;
@ -78,8 +83,7 @@ in {
SMTP_AUTH_METHOD = "plain";
SMTP_OPENSSL_VERIFY_MODE = "none";
# TODO: Don't?
RAILS_SERVE_STATIC_FILES = "true";
RAILS_SERVE_STATIC_FILES = "false";
AUTHORIZED_FETCH = "true";
@ -95,33 +99,6 @@ in {
};
};
# https://github.com/NixOS/nixpkgs/issues/116418#issuecomment-799517120
systemd.services.mastodon-media-prune = let cfg = config.services.mastodon;
in {
description = "Mastodon media prune";
environment = lib.filterAttrs (n: _: n != "PATH")
config.systemd.services.mastodon-web.environment;
serviceConfig = {
Type = "oneshot";
# Remove remote media attachments older than one month.
ExecStart = "${cfg.package}/bin/tootctl media remove --days=30";
User = cfg.user;
Group = cfg.group;
EnvironmentFile = "/var/lib/mastodon/.secrets_env";
PrivateTmp = true;
};
};
systemd.timers.mastodon-media-prune = {
description = "Mastodon media prune";
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "*-*-* 00:00:00"; # every day
Unit = "mastodon-media-prune.service";
AccuracySec = "60s";
};
};
networking.firewall = let cfg = config.services.mastodon;
in { allowedTCPPorts = [ cfg.streamingPort cfg.webPort ]; };
}

View file

@ -80,7 +80,6 @@ in {
enableACME = true;
forceSSL = true;
locations."/".extraConfig = ''
add_header Content-Type 'text/html; charset=UTF-8';
return 200 '<h1>meow</h1>';
'';