I have no idea what I'm doing

This commit is contained in:
jacekpoz 2023-07-16 10:34:12 +02:00
parent ff7e612077
commit d7df136cb0
2 changed files with 54 additions and 0 deletions

View file

@ -4,5 +4,6 @@ _: {
./configuration.nix
./grafana.nix
./hardware-configuration.nix
./seafile.nix
];
}

53
hosts/chmura/seafile.nix Normal file
View file

@ -0,0 +1,53 @@
{
config,
inputs,
pkgs,
...
}: {
services.seafile = {
enable = true;
adminEmail = "jacekpoz@cock.li";
initialAdminPassword = "";
ccnetSettings.General.SERVICE_URL = "https://jacekpoz.pl/f";
seafileSettings = {
fileserver = {
host = "0.0.0.0";
port = 8082;
max_download_dir_size = 10000;
};
general.enable_syslog = true;
};
seahubExtraConf = ''
FILE_SERVER_ROOT = "https://f.jacekpoz.pl"
ALLOWED_HOSTS = [ "f.jacekpoz.pl" ]
'';
};
systemd.services.seafileGC = {
startAt = "*-*-* 04:00:00";
script = ''
echo Stopping seafile server
systemctl stop seahub.service
systemctl stop seaf-server.service
echo Server stopped, starting GC
${pkgs.seafile-server}/bin/seafserv-gc -F /etc/seafile/ -d /var/lib/seafile/data/ -c /var/lib/seafile/data/
echo GC completed, starting server
systemctl start seaf-server.service
systemctl start seahub.service
echo Server started
'';
};
systemd.tmpfiles.rules = [
"d /run/seahub/ 700 wwwrun wwwrun -"
];
services.caddy = {
enable = true;
virtualHosts."jacekpoz.pl".extraConfig = ''
reverse_proxy /f/* localhost:8082
'';
};
}