masive rewriting and setup of server files

This commit is contained in:
2024-09-28 23:10:03 -06:00
parent f9399c51fa
commit 9151ca5971
39 changed files with 756 additions and 556 deletions

View File

@@ -10,14 +10,15 @@ let
in
{
options.my.servers.audiobookshelf = setup.mkOptions "audiobookshelf" "audiobooks" 5687;
config = lib.mkIf config.my.servers.audiobookshelf.enable {
config = {
networking.firewall.allowedTCPPorts = lib.mkIf (!cfg.isLocal) [ cfg.port ];
services = {
audiobookshelf = {
audiobookshelf = lib.mkIf cfg.enable {
inherit (cfg) port;
enable = true;
group = "piracy";
port = cfg.port;
};
nginx.virtualHosts."${cfg.host}" = proxy {
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (proxy {
"/" = {
proxyPass = cfg.local;
extraConfig = ''
@@ -26,11 +27,11 @@ in
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_redirect http:// https://;
proxy_http_version 1.1;
proxy_redirect http:// https://;
'';
};
};
});
};
};
}