nixos-config/hosts/nuc/modules/seafile/default.nix

31 lines
853 B
Nix
Raw Normal View History

2023-10-15 16:30:40 +02:00
{ config, pkgs, ... }:
let
domain = "seafile.${config.networking.domain}";
in
{
services.seafile = {
enable = true;
adminEmail = "rouven@rfive.de";
initialAdminPassword = "unused garbage";
ccnetSettings.General.SERVICE_URL = "https://${domain}";
ccnetSettings.General.FILE_SERVER_ROOT = "https://${domain}/seafhttp";
2024-02-29 15:37:22 +01:00
seafileSettings.fileserver.port = 8083;
2023-10-15 16:30:40 +02:00
};
services.nginx.virtualHosts."${domain}" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://unix:/run/seahub/gunicorn.sock";
};
locations."/seafhttp" = {
proxyPass = "http://127.0.0.1:${toString config.services.seafile.seafileSettings.fileserver.port}";
extraConfig = ''
rewrite ^/seafhttp(.*)$ $1 break;
'';
};
locations."/media" = {
root = pkgs.seahub;
};
};
}