Add cpu.ccc.de to static web host (under cpuccc.hamburg.ccc.de for now)

This commit is contained in:
June 2026-01-25 20:44:07 +01:00
commit 709afd0a1d
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
2 changed files with 88 additions and 0 deletions

View file

@ -0,0 +1,87 @@
{ ... }:
let
# For now under cpuccc.hamburg.ccc.de.
domain = "cpuccc.hamburg.ccc.de";
# dataDir = "/var/www/${domain}";
dataDir = "/var/www/cpu.ccc.de";
deployUser = "cpuccc-website-deploy";
in
{
services.nginx.virtualHosts = {
"acme-${domain}" = {
enableACME = true;
serverName = "${domain}";
listen = [
{
addr = "0.0.0.0";
port = 31820;
}
];
};
# https://git.hamburg.ccc.de/CCCHH/cpu.ccc.de/src/branch/main/nginx.conf
"${domain}" = {
forceSSL = true;
useACMEHost = "${domain}";
listen = [
{
addr = "0.0.0.0";
port = 8443;
ssl = true;
proxyProtocol = true;
}
];
root = "${dataDir}";
extraConfig = ''
index index.html;
default_type text/plain;
# 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;
port_in_redirect off;
'';
locations."/" = {
tryFiles = "$uri $uri/ =404";
extraConfig = ''
location /feed/ {
default_type application/rss+xml;
types {
text/xml application/rss+xml;
}
}
location /rss {
default_type application/rss+xml;
}
'';
};
};
};
systemd.tmpfiles.rules = [
"d ${dataDir} 0755 ${deployUser} ${deployUser}"
];
users.users."${deployUser}" = {
isNormalUser = true;
group = "${deployUser}";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOnO7g/7mVVKnvkszto8m3nPljO/6qQc/34aEbrhKOvn deploy key for cpu.ccc.de"
];
};
users.groups."${deployUser}" = { };
}

View file

@ -4,6 +4,7 @@
imports = [
./branding-resources.hamburg.ccc.de.nix
./c3cat.de.nix
./cpu.ccc.de.nix
./cryptoparty-hamburg.de.nix
./element-admin.hamburg.ccc.de.nix
./element.hamburg.ccc.de.nix