dotnix @main -
refs -
log -
-
https://git.jolheiser.com/dotnix.git
feat(dragonwell): allow for nonstandard modules from past forges in caddy
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmaDCuUACgkQuFOtpdp7
v3psVg//V4dVjVF0IjNXE778RKB/XJIg0ZCiK/5MjoHfbrEIzni4NayZWT/zFvy6
CPY9INkEFEjFQGj5gcAR8VrGLkv/GVTv2ICF3uZXlCazvKpbh5LIMGqaEs9y/4tN
WELQjEQVBDySHyF4LDlwPfQRt0Lr9AcWhhHTIyaOULeXILGB2erMwikPW+3E5azi
Z55loo4GmF0CUmX3zIZSmp7WnwJuL/ZYof4n0KK7RRdW6N+ad30ELrky+nhtzMV+
SWZs52Rl1JWPVH8hSMg20ZeoXvU/EFScsP7X7N5/jsPuYdUYdLPq6oawfUJLE5aC
Dl5vycELMrLlwLsqAc4aOgwJEBPWKDetfIyOg8xrOwHTPp2FLERbueJoGCTn8KrT
iXN8OOGPZfPt+MFWzkPcFKyoTsIEFhJMw9qotBvKLbps52MVFu8qDwCPm480ugmV
RVdVpmjFcrZctM0VCtVXttXpjvl0PiFPsQqpm3vggK8/Er4Y3Xurot4dv6fQ7Fd1
K0ffOLjGWuBMdehVXUEAQd8ND0+dE0iU822zMzKFZ7aXz3BK/hhjkyRM0NsC50QR
MlDir3KTrazl8oKCEFoRYMmJxDmxhwqXQp7tzgd+i4630I0FbTJr+fcyqfVxadwN
pLxbinSDSOS7/mWzxRl0Qqc9JK/n1AJpaunhqyUqsaN1Fb7XCYU=
=l9Ce
-----END PGP SIGNATURE-----
diff --git a/machines/dragonwell/caddy.nix b/machines/dragonwell/caddy.nix
index c6f1dd894bee87ecc66e7ee7f7d263527ef3c6ee..768c75de496fecad7af7fcca4b585c954e1ca049 100644
--- a/machines/dragonwell/caddy.nix
+++ b/machines/dragonwell/caddy.nix
@@ -1,4 +1,6 @@
-{pkgs, ...}: {
+{pkgs, ...}: let
+ modules = import ./go.nix;
+in {
services.caddy = {
enable = true;
virtualHosts = {
@@ -35,6 +37,7 @@ };
"go.jolheiser.com" = {
extraConfig = ''
header Content-Type text/html
+ ${modules}
respond /* `<html><head>
<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}" />
diff --git a/machines/dragonwell/go.nix b/machines/dragonwell/go.nix
new file mode 100644
index 0000000000000000000000000000000000000000..6976212002f4fab8012968f67bca4ebe43f4eb8b
--- /dev/null
+++ b/machines/dragonwell/go.nix
@@ -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)