deploy diday.org site

This commit is contained in:
lilly 2026-02-27 21:04:40 +01:00
commit bbfe9eba6f
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g
3 changed files with 30 additions and 22 deletions

View file

@ -18,8 +18,8 @@
./staging.hackertours.hamburg.ccc.de.nix
./staging.hamburg.ccc.de.nix
./www.hamburg.ccc.de.nix
./staging.did.hamburg.ccc.de.nix
./diday.org.nix
./staging.diday.org.nix
./historic-easterhegg
];
}

View file

@ -36,6 +36,10 @@ in
}
];
basicAuth = {
"preview" = "liebe";
};
extraConfig = ''
return 301 https://diday.org;
'';
@ -54,6 +58,10 @@ in
}
];
basicAuth = {
"preview" = "liebe";
};
root = "${dataDir}";
extraConfig = ''

View file

@ -0,0 +1,57 @@
{ config, ... }:
let
domain = "staging.diday.org";
dataDir = "/var/www/${domain}";
deployUser = "diday-website-deploy";
in
{
security.acme.certs."${domain}" = {
domain = "*.diday.org";
group = "nginx";
server = "https://acme-staging-v02.api.letsencrypt.org/directory";
dnsProvider = "desec";
environmentFile = config.sops.secrets."staging.diday.org/lego.env".path;
};
services.nginx.virtualHosts = {
"${domain}" = {
useACMEHost = "${domain}";
forceSSL = true;
listen = [
{
addr = "0.0.0.0";
port = 8443;
ssl = true;
proxyProtocol = true;
}
];
basicAuth = {
"preview" = "liebe";
};
extraConfig = ''
# Make use of the ngx_http_realip_module to set the $remote_addr and
# $remote_port to the client address and client port, when using proxy
# protocol.
# First set our proxy protocol proxy as trusted.
set_real_ip_from 172.31.17.140;
# Then tell the realip_module to get the addreses from the proxy protocol
# header.
real_ip_header proxy_protocol;
error_page 404 /404.html;
port_in_redirect off;
'';
};
};
systemd.tmpfiles.rules = [
"d ${dataDir} 0755 ${deployUser} ${deployUser}"
];
sops.secrets."staging.diday.org/lego.env" = {};
}