This commit is contained in:
parent
204b321268
commit
4167d15a6d
2 changed files with 7 additions and 31 deletions
|
@ -37,7 +37,12 @@ in {
|
||||||
webPort = 55001;
|
webPort = 55001;
|
||||||
enableUnixSocket = false;
|
enableUnixSocket = false;
|
||||||
localDomain = "xirion.net";
|
localDomain = "xirion.net";
|
||||||
trustedProxy = "192.168.0.123";
|
trustedProxy = "192.168.0.122";
|
||||||
|
mediaAutoRemove = {
|
||||||
|
enable = true;
|
||||||
|
olderThanDays = 30;
|
||||||
|
startAt = "weekly";
|
||||||
|
};
|
||||||
|
|
||||||
configureNginx = false;
|
configureNginx = false;
|
||||||
|
|
||||||
|
@ -78,8 +83,7 @@ in {
|
||||||
SMTP_AUTH_METHOD = "plain";
|
SMTP_AUTH_METHOD = "plain";
|
||||||
SMTP_OPENSSL_VERIFY_MODE = "none";
|
SMTP_OPENSSL_VERIFY_MODE = "none";
|
||||||
|
|
||||||
# TODO: Don't?
|
RAILS_SERVE_STATIC_FILES = "false";
|
||||||
RAILS_SERVE_STATIC_FILES = "true";
|
|
||||||
|
|
||||||
AUTHORIZED_FETCH = "true";
|
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;
|
networking.firewall = let cfg = config.services.mastodon;
|
||||||
in { allowedTCPPorts = [ cfg.streamingPort cfg.webPort ]; };
|
in { allowedTCPPorts = [ cfg.streamingPort cfg.webPort ]; };
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,6 @@ in {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/".extraConfig = ''
|
locations."/".extraConfig = ''
|
||||||
|
|
||||||
add_header Content-Type 'text/html; charset=UTF-8';
|
add_header Content-Type 'text/html; charset=UTF-8';
|
||||||
return 200 '<h1>meow</h1>';
|
return 200 '<h1>meow</h1>';
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue