From 7fa8cb1b0191a48f7f0c0a4af2d544e3d14f76fc Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Wed, 24 Apr 2024 13:58:04 +0200 Subject: [PATCH] heimdall: Split caddy config into separate file and add dendrite config --- machines/heimdall/caddy/default.nix | 38 +++++++++++++++++++++++++++++ machines/heimdall/configuration.nix | 24 ++---------------- 2 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 machines/heimdall/caddy/default.nix diff --git a/machines/heimdall/caddy/default.nix b/machines/heimdall/caddy/default.nix new file mode 100644 index 0000000..83aa010 --- /dev/null +++ b/machines/heimdall/caddy/default.nix @@ -0,0 +1,38 @@ +{ + services.caddy = { + virtualHosts = { + "datarift.nl" = { + extraConfig = '' + @webfinger-erwin { + path /.well-known/webfinger + query resource=acct:erwin@datarift.nl + } + respond @webfinger-erwin 200 { + body `{"subject":"acct:erwin@datarift.nl","links":[{"rel":"http://openid.net/specs/connect/1.0/issuer","href":"https://id.datarift.nl/realms/datarift"}]}` + close + } + ''; + }; + "git.datarift.nl" = { + extraConfig = '' + reverse_proxy gitea.barn-beaver.ts.net:3000 + ''; + }; + + "boskma.frl" = { + extraConfig = '' + header /.well-known/matrix/* Content-Type application/json + header /.well-known/matrix/* Access-Control-Allow-Origin * + respond /.well-known/matrix/server `{"m.server": "matrix.boskma.frl:443"}` + respond /.well-known/matrix/client `{"m.homeserver": {"base_url": "https://matrix.boskma.frl"}}` + ''; + }; + + "matrix.boskma.frl" = { + extraConfig = '' + reverse_proxy /_matrix/* neo.barn-beaver.ts.net:8008 + ''; + }; + }; + }; +} diff --git a/machines/heimdall/configuration.nix b/machines/heimdall/configuration.nix index 6a41253..252acd2 100644 --- a/machines/heimdall/configuration.nix +++ b/machines/heimdall/configuration.nix @@ -9,6 +9,8 @@ ../../users/root ../../users/erwin + + ./caddy ]; eboskma = { @@ -122,28 +124,6 @@ enable = true; permitCertUid = "caddy"; }; - - caddy = { - virtualHosts = { - "datarift.nl" = { - extraConfig = '' - @webfinger-erwin { - path /.well-known/webfinger - query resource=acct:erwin@datarift.nl - } - respond @webfinger-erwin 200 { - body `{"subject":"acct:erwin@datarift.nl","links":[{"rel":"http://openid.net/specs/connect/1.0/issuer","href":"https://id.datarift.nl/realms/datarift"}]}` - close - } - ''; - }; - "git.datarift.nl" = { - extraConfig = '' - reverse_proxy gitea.barn-beaver.ts.net:3000 - ''; - }; - }; - }; }; security = {