forked from DGNum/infrastructure
Tom Hubrecht
88d9b8c3e3
Signed-off-by: Tom Hubrecht <tom.hubrecht@dgnum.eu> Acked-by: Ryan Lahfa <ryan.lahfa@dgnum.eu> Acked-by: Maurice Debray <maurice.debray@dgnum.eu> Acked-by: Lubin Bailly <lubin.bailly@dgnum.eu> Acked-by: Jean-Marc Gailis <jean-marc.gailis@dgnum.eu> as the legal authority, at the time of writing, in DGNum. Acked-by: Elias Coppens <elias.coppens@dgnum.eu> as a member, at the time of writing, of the DGNum executive counsel.
59 lines
1.2 KiB
Nix
59 lines
1.2 KiB
Nix
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
|
|
#
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
{ 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" ];
|
|
}
|