From 797b9a8a37c6fa09359a3f129d0362a19200616e Mon Sep 17 00:00:00 2001 From: c6ristian Date: Mon, 19 Feb 2024 00:28:51 +0100 Subject: [PATCH] WIP: serve old easterhegg pages from public-web-static host --- .../virtualHosts/default.nix | 1 + .../historic-easterhegg/default.nix | 11 ++++ .../eh03.easterhegg.eu.nix | 56 +++++++++++++++++++ .../eh05.easterhegg.eu.nix | 56 +++++++++++++++++++ .../eh07.easterhegg.eu.nix | 56 +++++++++++++++++++ .../eh09.easterhegg.eu.nix | 56 +++++++++++++++++++ .../eh11.easterhegg.eu.nix | 56 +++++++++++++++++++ 7 files changed, 292 insertions(+) create mode 100644 config/hosts/public-web-static/virtualHosts/historic-easterhegg/default.nix create mode 100644 config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh03.easterhegg.eu.nix create mode 100644 config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh05.easterhegg.eu.nix create mode 100644 config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh07.easterhegg.eu.nix create mode 100644 config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh09.easterhegg.eu.nix create mode 100644 config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh11.easterhegg.eu.nix diff --git a/config/hosts/public-web-static/virtualHosts/default.nix b/config/hosts/public-web-static/virtualHosts/default.nix index e22165f..3678a96 100644 --- a/config/hosts/public-web-static/virtualHosts/default.nix +++ b/config/hosts/public-web-static/virtualHosts/default.nix @@ -9,5 +9,6 @@ ./spaceapi.hamburg.ccc.de.nix ./staging.hamburg.ccc.de.nix ./www.hamburg.ccc.de.nix + ./historic-easterhegg ]; } diff --git a/config/hosts/public-web-static/virtualHosts/historic-easterhegg/default.nix b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/default.nix new file mode 100644 index 0000000..1ecb71b --- /dev/null +++ b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/default.nix @@ -0,0 +1,11 @@ +{...}: + +{ + imports = [ + ./eh03.easterhegg.eu.nix + ./eh05.easterhegg.eu.nix + ./eh07.easterhegg.eu.nix + ./eh09.easterhegg.eu.nix + ./eh11.easterhegg.eu.nix + ]; +} \ No newline at end of file diff --git a/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh03.easterhegg.eu.nix b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh03.easterhegg.eu.nix new file mode 100644 index 0000000..242b952 --- /dev/null +++ b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh03.easterhegg.eu.nix @@ -0,0 +1,56 @@ +{ pkgs, ... }: + +let + eh03 = builtins.fetchGit { + url = "forgejo@git.hamburg.ccc.de:CCCHH/easterhegg-2003-website.git"; + ref = "main"; + rev = "7c5249671be88e9bfa6ca51ea1a906b75a2bcece"; + }; +in +{ + services.nginx.virtualHosts = { + "acme-eh03.easterhegg.eu" = { + enableACME = true; + serverName = "eh03.easterhegg.eu"; + + listen = [ + { + addr = "0.0.0.0"; + port = 31820; + } + ]; + }; + + "eh03.easterhegg.eu" = { + forceSSL = true; + useACMEHost = "eh03.easterhegg.eu"; + + listen = [ + { + addr = "0.0.0.0"; + port = 8443; + ssl = true; + proxyProtocol = true; + } + ]; + + root = pkgs.buildEnv { + name = "eh03"; + paths = [ + eh03 + ]; + }; + + 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; + ''; + }; + }; +} diff --git a/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh05.easterhegg.eu.nix b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh05.easterhegg.eu.nix new file mode 100644 index 0000000..05f0aa3 --- /dev/null +++ b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh05.easterhegg.eu.nix @@ -0,0 +1,56 @@ +{ pkgs, ... }: + +let + eh05 = builtins.fetchGit { + url = "forgejo@git.hamburg.ccc.de:CCCHH/easterhegg-2005-website.git"; + ref = "main"; + rev = "ef633b2cf45d72205c840935e036c16b57517e8b"; + }; +in +{ + services.nginx.virtualHosts = { + "acme-eh05.easterhegg.eu" = { + enableACME = true; + serverName = "eh05.easterhegg.eu"; + + listen = [ + { + addr = "0.0.0.0"; + port = 31820; + } + ]; + }; + + "eh05.easterhegg.eu" = { + forceSSL = true; + useACMEHost = "eh05.easterhegg.eu"; + + listen = [ + { + addr = "0.0.0.0"; + port = 8443; + ssl = true; + proxyProtocol = true; + } + ]; + + root = pkgs.buildEnv { + name = "eh05"; + paths = [ + eh05 + ]; + }; + + 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; + ''; + }; + }; +} diff --git a/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh07.easterhegg.eu.nix b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh07.easterhegg.eu.nix new file mode 100644 index 0000000..50d3937 --- /dev/null +++ b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh07.easterhegg.eu.nix @@ -0,0 +1,56 @@ +{ pkgs, ... }: + +let + eh07 = builtins.fetchGit { + url = "forgejo@git.hamburg.ccc.de:CCCHH/easterhegg-2007-website.git"; + ref = "main"; + rev = "50cd064c6329a38ad2e9c1a4a8d4b37abd171b53"; + }; +in +{ + services.nginx.virtualHosts = { + "acme-eh07.easterhegg.eu" = { + enableACME = true; + serverName = "eh07.easterhegg.eu"; + + listen = [ + { + addr = "0.0.0.0"; + port = 31820; + } + ]; + }; + + "eh07.easterhegg.eu" = { + forceSSL = true; + useACMEHost = "eh07.easterhegg.eu"; + + listen = [ + { + addr = "0.0.0.0"; + port = 8443; + ssl = true; + proxyProtocol = true; + } + ]; + + root = pkgs.buildEnv { + name = "eh07"; + paths = [ + eh07 + ]; + }; + + 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; + ''; + }; + }; +} diff --git a/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh09.easterhegg.eu.nix b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh09.easterhegg.eu.nix new file mode 100644 index 0000000..191dbef --- /dev/null +++ b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh09.easterhegg.eu.nix @@ -0,0 +1,56 @@ +{ pkgs, ... }: + +let + eh09 = builtins.fetchGit { + url = "forgejo@git.hamburg.ccc.de:CCCHH/easterhegg-2009-website.git"; + ref = "main"; + rev = "30498f6b2cba4f2c37db810f1bc2b98638ac9f05"; + }; +in +{ + services.nginx.virtualHosts = { + "acme-eh09.easterhegg.eu" = { + enableACME = true; + serverName = "eh09.easterhegg.eu"; + + listen = [ + { + addr = "0.0.0.0"; + port = 31820; + } + ]; + }; + + "eh09.easterhegg.eu" = { + forceSSL = true; + useACMEHost = "eh09.easterhegg.eu"; + + listen = [ + { + addr = "0.0.0.0"; + port = 8443; + ssl = true; + proxyProtocol = true; + } + ]; + + root = pkgs.buildEnv { + name = "eh09"; + paths = [ + eh09 + ]; + }; + + 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; + ''; + }; + }; +} diff --git a/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh11.easterhegg.eu.nix b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh11.easterhegg.eu.nix new file mode 100644 index 0000000..9982b1c --- /dev/null +++ b/config/hosts/public-web-static/virtualHosts/historic-easterhegg/eh11.easterhegg.eu.nix @@ -0,0 +1,56 @@ +{ pkgs, ... }: + +let + eh11 = builtins.fetchGit { + url = "forgejo@git.hamburg.ccc.de:CCCHH/easterhegg-2011-website.git"; + ref = "main"; + rev = "3df97af36394f93514913f2be7e84c9b6bff1b1c"; + }; +in +{ + services.nginx.virtualHosts = { + "acme-eh11.easterhegg.eu" = { + enableACME = true; + serverName = "eh11.easterhegg.eu"; + + listen = [ + { + addr = "0.0.0.0"; + port = 31820; + } + ]; + }; + + "eh11.easterhegg.eu" = { + forceSSL = true; + useACMEHost = "eh11.easterhegg.eu"; + + listen = [ + { + addr = "0.0.0.0"; + port = 8443; + ssl = true; + proxyProtocol = true; + } + ]; + + root = pkgs.buildEnv { + name = "eh11"; + paths = [ + eh11 + ]; + }; + + 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; + ''; + }; + }; +}