niksos/hosts/chmura/seafile.nix
2023-07-16 10:47:11 +02:00

45 lines
1.2 KiB
Nix

{
config,
inputs,
pkgs,
...
}: {
services.seafile = {
enable = true;
adminEmail = "jacekpoz@cock.li";
initialAdminPassword = "";
ccnetSettings.General.SERVICE_URL = "https://f.jacekpoz.pl";
seafileSettings = {
fileserver = {
host = "0.0.0.0";
port = 8082;
max_download_dir_size = 10000;
};
general.enable_syslog = true;
};
};
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
'';
};
services.caddy = {
enable = true;
virtualHosts."f.jacekpoz.pl".extraConfig = ''
reverse_proxy * localhost:8082
'';
};
}