infrastructure/machines/compute01/zammad.nix
Tom Hubrecht ad39c91168
All checks were successful
lint / check (push) Successful in 23s
build configuration / build_web02 (push) Successful in 1m3s
build configuration / build_vault01 (push) Successful in 1m5s
build configuration / build_storage01 (push) Successful in 1m9s
build configuration / build_web01 (push) Successful in 1m39s
npins update / npins_update (push) Successful in 53s
build configuration / build_compute01 (push) Successful in 42m1s
chore(infra): Switch to age-secrets.autoMatch
2024-02-19 14:47:27 +01:00

55 lines
1.1 KiB
Nix

{ config, ... }:
let
host = "support.dgnum.eu";
port = 3005;
websocketPort = 6902;
in
{
services.zammad = {
enable = true;
inherit port websocketPort;
host = "127.0.0.1";
secretKeyBaseFile = config.age.secrets."zammad-secret_key_base_file".path;
};
services.nginx = {
enable = true;
virtualHosts.${host} = {
enableACME = true;
forceSSL = true;
root = "/var/lib/zammad/public";
locations = {
"/".proxyPass = "http://127.0.0.1:${builtins.toString port}";
"/ws" = {
proxyPass = "http://127.0.0.1:${builtins.toString websocketPort}";
proxyWebsockets = true;
};
"/cable" = {
proxyPass = "http://127.0.0.1:${builtins.toString port}";
proxyWebsockets = true;
};
"~ ^/(assets/|robots.txt|humans.txt|favicon.ico|apple-touch-icon.png)".extraConfig = ''
expires max;
'';
};
extraConfig = ''
server_tokens off;
client_max_body_size 50M;
'';
};
};
age-secrets.autoMatch = [ "zammad" ];
}