From 07b6e478ccda8d43f701847d409c361e8db2217b Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Thu, 3 Apr 2025 22:32:32 +0100 Subject: [PATCH] feat: slight reworks and added the 2006 site --- applications/skynet.ie/old_site.nix | 26 ++++- applications/skynet.ie/skynet.ie.nix | 19 +++- applications/skynet.ie/wiki.nix | 5 - flake.lock | 139 ++++++++++++++++++++------- flake.nix | 3 + 5 files changed, 144 insertions(+), 48 deletions(-) diff --git a/applications/skynet.ie/old_site.nix b/applications/skynet.ie/old_site.nix index 1e43255..18f80df 100644 --- a/applications/skynet.ie/old_site.nix +++ b/applications/skynet.ie/old_site.nix @@ -9,10 +9,6 @@ with lib; { imports = []; config = { - services.skynet.acme.domains = [ - "${year}.skynet.ie" - ]; - services.skynet.dns.records = [ { record = year; @@ -27,6 +23,28 @@ with lib; { forceSSL = true; useACMEHost = "skynet"; root = "${inputs."skynet_website_${year}".defaultPackage."x86_64-linux"}"; + # Handle any of the old php sites + # https://stackoverflow.com/a/21911610 + locations = { + "/" = { + index = "index.html index.htm index.php"; + tryFiles = "$uri $uri.html $uri/ @extensionless-php"; + }; + + "~ \\.php$" = { + extraConfig = '' + fastcgi_pass unix:${config.services.phpfpm.pools.old_sites.socket}; + fastcgi_index index.php; + ''; + tryFiles = "$uri =404"; + }; + + "@extensionless-php" = { + extraConfig = '' + rewrite ^(.*)$ $1.php last; + ''; + }; + }; }; }; }; diff --git a/applications/skynet.ie/skynet.ie.nix b/applications/skynet.ie/skynet.ie.nix index 5082080..147174d 100644 --- a/applications/skynet.ie/skynet.ie.nix +++ b/applications/skynet.ie/skynet.ie.nix @@ -15,6 +15,7 @@ in { (import ./old_site.nix {year = "2023";}) (import ./old_site.nix {year = "2017";}) (import ./old_site.nix {year = "2009";}) + (import ./old_site.nix {year = "2006";}) ]; options.services.skynet."${name}" = { @@ -23,10 +24,8 @@ in { config = mkIf cfg.enable { services.skynet.acme.domains = [ - "www.skynet.ie" - "discord.skynet.ie" + "*.skynet.ie" "*.discord.skynet.ie" - "public.skynet.ie" ]; services.skynet.dns.records = [ @@ -103,5 +102,19 @@ in { }; }; }; + + # Some old sites need a php pool running + services.phpfpm.pools.old_sites = { + user = "nobody"; + settings = { + "pm" = "dynamic"; + "listen.owner" = config.services.nginx.user; + "pm.max_children" = 5; + "pm.start_servers" = 2; + "pm.min_spare_servers" = 1; + "pm.max_spare_servers" = 3; + "pm.max_requests" = 500; + }; + }; }; } diff --git a/applications/skynet.ie/wiki.nix b/applications/skynet.ie/wiki.nix index 6d1aa57..19250b3 100644 --- a/applications/skynet.ie/wiki.nix +++ b/applications/skynet.ie/wiki.nix @@ -17,11 +17,6 @@ in { }; config = mkIf cfg.enable { - services.skynet.acme.domains = [ - "renew.skynet.ie" - "wiki.skynet.ie" - ]; - services.skynet.dns.records = [ { record = "renew"; diff --git a/flake.lock b/flake.lock index ce99479..4a4262b 100644 --- a/flake.lock +++ b/flake.lock @@ -47,7 +47,7 @@ "inputs": { "fenix": "fenix_2", "flakeCompat": "flakeCompat_2", - "nixpkgs": "nixpkgs_18" + "nixpkgs": "nixpkgs_19" }, "locked": { "lastModified": 1719514321, @@ -632,11 +632,11 @@ }, "nixpkgs_14": { "locked": { - "lastModified": 1690026219, - "narHash": "sha256-oOduRk/kzQxOBknZXTLSEYd7tk+GoKvr8wV6Ab+t4AU=", + "lastModified": 1741037377, + "narHash": "sha256-SvtvVKHaUX4Owb+PasySwZsoc5VUeTf1px34BByiOxw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f465da166263bc0d4b39dfd4ca28b777c92d4b73", + "rev": "02032da4af073d0f6110540c8677f16d4be0117f", "type": "github" }, "original": { @@ -646,11 +646,11 @@ }, "nixpkgs_15": { "locked": { - "lastModified": 1689935543, - "narHash": "sha256-6GQ9ib4dA/r1leC5VUpsBo0BmDvNxLjKrX1iyL+h8mc=", + "lastModified": 1690026219, + "narHash": "sha256-oOduRk/kzQxOBknZXTLSEYd7tk+GoKvr8wV6Ab+t4AU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e43e2448161c0a2c4928abec4e16eae1516571bc", + "rev": "f465da166263bc0d4b39dfd4ca28b777c92d4b73", "type": "github" }, "original": { @@ -673,6 +673,20 @@ } }, "nixpkgs_17": { + "locked": { + "lastModified": 1689935543, + "narHash": "sha256-6GQ9ib4dA/r1leC5VUpsBo0BmDvNxLjKrX1iyL+h8mc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e43e2448161c0a2c4928abec4e16eae1516571bc", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_18": { "locked": { "lastModified": 1695978539, "narHash": "sha256-lta5HToBZMWZ2hl5CautNSUgIZViR41QxN7JKbMAjgQ=", @@ -686,7 +700,7 @@ "type": "indirect" } }, - "nixpkgs_18": { + "nixpkgs_19": { "locked": { "lastModified": 1668226844, "narHash": "sha256-G/S4FBWDAqHeBS/hfXwUCJbnaKnrQFoeeKwzvZEOgxM=", @@ -702,20 +716,6 @@ "type": "github" } }, - "nixpkgs_19": { - "locked": { - "lastModified": 1724395761, - "narHash": "sha256-zRkDV/nbrnp3Y8oCADf5ETl1sDrdmAW6/bBVJ8EbIdQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ae815cee91b417be55d43781eb4b73ae1ecc396c", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1733212471, @@ -732,6 +732,20 @@ "type": "github" } }, + "nixpkgs_20": { + "locked": { + "lastModified": 1724395761, + "narHash": "sha256-zRkDV/nbrnp3Y8oCADf5ETl1sDrdmAW6/bBVJ8EbIdQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ae815cee91b417be55d43781eb4b73ae1ecc396c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, "nixpkgs_3": { "locked": { "lastModified": 1734119587, @@ -849,6 +863,7 @@ "skynet_ldap_backend": "skynet_ldap_backend", "skynet_ldap_frontend": "skynet_ldap_frontend", "skynet_website": "skynet_website", + "skynet_website_2006": "skynet_website_2006", "skynet_website_2009": "skynet_website_2009", "skynet_website_2017": "skynet_website_2017", "skynet_website_2023": "skynet_website_2023", @@ -992,11 +1007,30 @@ "url": "https://forgejo.skynet.ie/Skynet/website_2017" } }, - "skynet_website_2009": { + "skynet_website_2006": { "inputs": { "nixpkgs": "nixpkgs_14", "utils": "utils_7" }, + "locked": { + "lastModified": 1743715699, + "narHash": "sha256-BgXlk7bT9q+cOE9u74ZfmqxxW0zIHZ/ebLyldO682Zg=", + "ref": "refs/heads/main", + "rev": "616040e0e7636c1e33a06262cc20fb1bf1fb61b6", + "revCount": 15, + "type": "git", + "url": "https://forgejo.skynet.ie/Skynet/website_2006" + }, + "original": { + "type": "git", + "url": "https://forgejo.skynet.ie/Skynet/website_2006" + } + }, + "skynet_website_2009": { + "inputs": { + "nixpkgs": "nixpkgs_15", + "utils": "utils_8" + }, "locked": { "lastModified": 1732375097, "narHash": "sha256-LthEi+y3a+i/VNLBlQZ1v9nkffgJMykMjonFtTt8Yxg=", @@ -1013,8 +1047,8 @@ }, "skynet_website_2017": { "inputs": { - "nixpkgs": "nixpkgs_15", - "utils": "utils_8" + "nixpkgs": "nixpkgs_16", + "utils": "utils_9" }, "locked": { "lastModified": 1689960297, @@ -1032,8 +1066,8 @@ }, "skynet_website_2023": { "inputs": { - "nixpkgs": "nixpkgs_16", - "utils": "utils_9" + "nixpkgs": "nixpkgs_17", + "utils": "utils_10" }, "locked": { "lastModified": 1696876711, @@ -1051,8 +1085,8 @@ }, "skynet_website_games": { "inputs": { - "nixpkgs": "nixpkgs_17", - "utils": "utils_10" + "nixpkgs": "nixpkgs_18", + "utils": "utils_11" }, "locked": { "lastModified": 1727122069, @@ -1071,8 +1105,8 @@ "skynet_website_wiki": { "inputs": { "alejandra": "alejandra_2", - "nixpkgs": "nixpkgs_19", - "utils": "utils_11" + "nixpkgs": "nixpkgs_20", + "utils": "utils_12" }, "locked": { "lastModified": 1739580335, @@ -1194,6 +1228,21 @@ "type": "github" } }, + "systems_15": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_2": { "locked": { "lastModified": 1681028828, @@ -1336,6 +1385,24 @@ "inputs": { "systems": "systems_13" }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_11": { + "inputs": { + "systems": "systems_14" + }, "locked": { "lastModified": 1694529238, "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", @@ -1350,9 +1417,9 @@ "type": "github" } }, - "utils_11": { + "utils_12": { "inputs": { - "systems": "systems_14" + "systems": "systems_15" }, "locked": { "lastModified": 1710146030, @@ -1463,11 +1530,11 @@ "systems": "systems_10" }, "locked": { - "lastModified": 1689068808, - "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 2d96432..2554929 100644 --- a/flake.nix +++ b/flake.nix @@ -58,6 +58,9 @@ # this is more of 2012 than 2009 but started in 2009 skynet_website_2009.url = "git+https://forgejo.skynet.ie/Skynet/website_2009"; + + # these are from a snapshot archive + skynet_website_2006.url = "git+https://forgejo.skynet.ie/Skynet/website_2006"; }; nixConfig = {