From da5c95950901d05176cf9a2223004b5a2dd4d70b Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sun, 13 Oct 2024 04:45:06 +0200 Subject: [PATCH] bicep/matrix/hookshot: add nginx --- .../services/matrix/hookshot/default.nix | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hosts/bicep/services/matrix/hookshot/default.nix b/hosts/bicep/services/matrix/hookshot/default.nix index d7f7041..4c64494 100644 --- a/hosts/bicep/services/matrix/hookshot/default.nix +++ b/hosts/bicep/services/matrix/hookshot/default.nix @@ -1,5 +1,10 @@ { config, lib, unstablePkgs, inputs, ... }: +let + cfg = config.services.matrix-hookshot; + webhookListenAddress = "127.0.0.1"; + webhookListenPort = 9000; +in { imports = [ ./module.nix @@ -30,18 +35,19 @@ }; listeners = [ { - bindAddress = "127.0.0.1"; - port = 9000; + bindAddress = webhookListenAddress; + port = webhookListenPort; resources = [ "webhooks" - "metrics" - "provisioning" + # "metrics" + # "provisioning" "widgets" ]; } ]; generic = { enabled = true; + outbound = true; }; feeds = { enabled = true; @@ -54,4 +60,11 @@ services.matrix-synapse-next.settings = { app_service_config_files = [ config.sops.secrets."matrix/registrations/matrix-hookshot".path ]; }; + + services.nginx.virtualHosts."hookshot.pvv.ntnu.no" = { + enableACME = true; + locations."/" = { + proxyPass = "http://${webhookListenAddress}:${toString webhookListenPort}"; + }; + }; }