- Freundliche Wartungsseite (AZ-Branding, eingebettetes Logo, Auto-Reload, Dienst-Erkennung per Hostname) unter services/maintenance/www/ - nginx auf 127.0.0.1:3090 liefert die Seite mit 503 + Retry-After + no-store fuer alle Pfade - Traefik: File-Provider auf ueberwachtes Verzeichnis /var/lib/traefik/dynamic umgestellt (staticConfigFile-Override); Basis-Konfig wird per preStart als 00-base.toml hineingelinkt - maintenance-CLI (on/off/status/list): schaltet pro Dienst Router mit Prioritaet 1000 auf den Wartungs-Service, wirksam in ~1-2 s ohne Rebuild - Auto-Aus per transientem systemd-Timer (Default 4 h) + stuendlicher Expiry-Sweep als Reboot-Nachversicherung - ntfy-Push bei on/off (opt-in via Token-Datei) - errors-Middleware error-pages (502-504) an allen HTTP-Routern: Auch bei ungeplanten Ausfaellen erscheint die Wartungsseite statt Traefik-Standardfehler
71 lines
2.2 KiB
Nix
71 lines
2.2 KiB
Nix
{config, ...}: let
|
|
serviceName = "baserow";
|
|
servicePort = config.m3ta.ports.get serviceName;
|
|
in {
|
|
virtualisation.oci-containers.containers.${serviceName} = {
|
|
image = "docker.io/baserow/baserow:2.3.3";
|
|
environment = {
|
|
# BASEROW_AMOUNT_OF_GUNICORN_WORKERS = "4";
|
|
# BASEROW_AMOUNT_OF_WORKERS = "2";
|
|
DATABASE_CONN_MAX_AGE = "0";
|
|
# Proxy: tell Django the connection is HTTPS so cookies get Secure flag
|
|
BASEROW_ENABLE_SECURE_PROXY_SSL_HEADER = "yes";
|
|
# Published apps run on different origins — allow cross-origin cookie delivery
|
|
BASEROW_FRONTEND_SAME_SITE_COOKIE = "none";
|
|
# Valid base domain for published app subdomains
|
|
BASEROW_BUILDER_DOMAINS = "az-gruppe.com";
|
|
# Disable Caddy's on_demand TLS — Traefik handles TLS termination
|
|
BASEROW_CADDY_GLOBAL_CONF = "auto_https off";
|
|
};
|
|
environmentFiles = [config.age.secrets.baserow-env.path];
|
|
ports = ["127.0.0.1:${toString servicePort}:80"];
|
|
volumes = ["baserow_data:/baserow/data"];
|
|
extraOptions = ["--add-host=postgres:10.89.0.1" "--ip=10.89.0.10" "--network=web"];
|
|
};
|
|
|
|
# Traefik configuration
|
|
services.traefik.dynamicConfigOptions.http = {
|
|
services.${serviceName}.loadBalancer.servers = [
|
|
{
|
|
url = "http://localhost:${toString servicePort}/";
|
|
}
|
|
];
|
|
|
|
middlewares."${serviceName}-headers".headers = {
|
|
customRequestHeaders = {
|
|
X-Forwarded-Proto = "https";
|
|
X-Forwarded-Port = "443";
|
|
};
|
|
};
|
|
|
|
routers.${serviceName} = {
|
|
rule = "Host(`br.az-gruppe.com`)";
|
|
tls = {
|
|
certResolver = "ionos";
|
|
};
|
|
service = serviceName;
|
|
entrypoints = "websecure";
|
|
middlewares = ["error-pages" "${serviceName}-headers"];
|
|
};
|
|
|
|
routers.azubi = {
|
|
rule = "Host(`azubi.az-gruppe.com`)";
|
|
tls = {
|
|
certResolver = "ionos";
|
|
};
|
|
service = serviceName;
|
|
entrypoints = "websecure";
|
|
middlewares = ["error-pages" "${serviceName}-headers"];
|
|
};
|
|
routers.ausbilder = {
|
|
rule = "Host(`ausbilder.az-gruppe.com`)";
|
|
tls = {
|
|
certResolver = "ionos";
|
|
};
|
|
service = serviceName;
|
|
entrypoints = "websecure";
|
|
middlewares = ["error-pages" "${serviceName}-headers"];
|
|
};
|
|
};
|
|
}
|