2022-01-17 15:59:51 +00:00
|
|
|
{
|
2022-06-12 15:39:15 +00:00
|
|
|
nix-packages,
|
|
|
|
system,
|
2022-12-30 14:44:49 +00:00
|
|
|
pkgs,
|
2022-06-12 15:39:15 +00:00
|
|
|
...
|
|
|
|
}: let
|
2022-09-30 15:46:21 +00:00
|
|
|
inherit (nix-packages.packages.${system}) old-homepage;
|
2022-06-12 15:39:15 +00:00
|
|
|
in {
|
2022-01-17 16:01:38 +00:00
|
|
|
systemd.services.homepage-old = {
|
2022-01-17 15:59:51 +00:00
|
|
|
enable = true;
|
|
|
|
description = "darkkirb.de";
|
2022-09-30 15:46:21 +00:00
|
|
|
script = "${old-homepage}/homepage";
|
2022-01-17 15:59:51 +00:00
|
|
|
serviceConfig = {
|
2022-09-30 15:46:21 +00:00
|
|
|
WorkingDirectory = old-homepage;
|
2022-01-17 16:09:51 +00:00
|
|
|
EnvironmentFile = "/run/secrets/services/old-homepage";
|
2022-01-17 15:59:51 +00:00
|
|
|
};
|
2022-06-12 15:39:15 +00:00
|
|
|
wantedBy = ["multi-user.target"];
|
2022-01-17 15:59:51 +00:00
|
|
|
};
|
2022-08-26 15:28:14 +00:00
|
|
|
services.caddy.virtualHosts."darkkirb.de" = {
|
|
|
|
useACMEHost = "darkkirb.de";
|
2022-12-30 13:03:57 +00:00
|
|
|
logFormat = pkgs.lib.mkForce "";
|
2022-08-26 15:28:14 +00:00
|
|
|
extraConfig = ''
|
|
|
|
import baseConfig
|
|
|
|
|
|
|
|
reverse_proxy {
|
|
|
|
to http://localhost:3002
|
|
|
|
trusted_proxies private_ranges
|
|
|
|
}
|
|
|
|
'';
|
2022-01-17 15:59:51 +00:00
|
|
|
};
|
2022-08-26 15:28:14 +00:00
|
|
|
services.caddy.virtualHosts."static.darkkirb.de" = {
|
|
|
|
useACMEHost = "darkkirb.de";
|
2022-12-30 13:03:57 +00:00
|
|
|
logFormat = pkgs.lib.mkForce "";
|
2022-08-26 15:28:14 +00:00
|
|
|
extraConfig = ''
|
|
|
|
import baseConfig
|
|
|
|
|
2022-08-28 15:20:46 +00:00
|
|
|
rewrite * /file/darkkirb-de{path}
|
2022-08-26 16:00:06 +00:00
|
|
|
|
2022-08-26 15:28:14 +00:00
|
|
|
reverse_proxy {
|
|
|
|
to https://f000.backblazeb2.com
|
|
|
|
header_up Host {upstream_hostport}
|
|
|
|
|
|
|
|
transport http {
|
|
|
|
versions 1.1 2 3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
'';
|
2022-01-17 14:54:37 +00:00
|
|
|
};
|
2022-06-12 15:39:15 +00:00
|
|
|
sops.secrets."services/old-homepage" = {};
|
2022-01-17 14:54:37 +00:00
|
|
|
}
|