2024-12-12 14:41:43 +01:00
|
|
|
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
2023-10-02 12:50:40 +02:00
|
|
|
{ config, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
host = "support.dgnum.eu";
|
|
|
|
|
|
|
|
port = 3005;
|
|
|
|
websocketPort = 6902;
|
2024-02-02 10:51:31 +01:00
|
|
|
in
|
|
|
|
{
|
2023-10-02 12:50:40 +02:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2024-02-02 10:51:31 +01:00
|
|
|
"~ ^/(assets/|robots.txt|humans.txt|favicon.ico|apple-touch-icon.png)".extraConfig = ''
|
|
|
|
expires max;
|
|
|
|
'';
|
2023-10-02 12:50:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
server_tokens off;
|
|
|
|
client_max_body_size 50M;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-19 14:47:27 +01:00
|
|
|
age-secrets.autoMatch = [ "zammad" ];
|
2023-10-02 12:50:40 +02:00
|
|
|
}
|