feat(dragonwell): allow for nonstandard modules from past forges in caddy

Signed-off-by: jolheiser <john.olheiser@gmail.com>
teamcity
jolheiser 2024-07-01 15:00:37 -05:00
parent dd2761b1d6
commit 4c9de84663
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
2 changed files with 25 additions and 1 deletions

View File

@ -1,4 +1,6 @@
{pkgs, ...}: { {pkgs, ...}: let
modules = import ./go.nix;
in {
services.caddy = { services.caddy = {
enable = true; enable = true;
virtualHosts = { virtualHosts = {
@ -35,6 +37,7 @@
"go.jolheiser.com" = { "go.jolheiser.com" = {
extraConfig = '' extraConfig = ''
header Content-Type text/html header Content-Type text/html
${modules}
respond /* `<html><head> respond /* `<html><head>
<meta name="go-import" content="go.jolheiser.com{path} git https://git.jojodev.com/jolheiser{path}.git"> <meta name="go-import" content="go.jolheiser.com{path} git https://git.jojodev.com/jolheiser{path}.git">
<meta http-equiv="refresh" content="3; url=https://pkg.go.dev/go.jolheiser.com{path}" /> <meta http-equiv="refresh" content="3; url=https://pkg.go.dev/go.jolheiser.com{path}" />

View File

@ -0,0 +1,21 @@
let
modules = [
{
name = "hcaptcha";
repo = "gitea.com/jolheiser/hcaptcha";
}
{
name = "pwn";
repo = "gitea.com/jolheiser/pwn";
}
];
in
builtins.concatStringsSep "\n" (builtins.map (module: ''
respond /${module.name}* `<html><head>
<meta name="go-import" content="go.jolheiser.com/${module.name} git https://${module.repo}.git">
<meta http-equiv="refresh" content="3; url=https://pkg.go.dev/go.jolheiser.com/${module.name}" />
</head><body>
Redirecting to <a href="https://pkg.go.dev/go.jolheiser.com/${module.name}">https://pkg.go.dev/go.jolheiser.com/${module.name}</a>
</body></html>`
'')
modules)