From f56fd8dccc84ac5d53ecdb811a553610b4ddd723 Mon Sep 17 00:00:00 2001 From: Akshay Mankar Date: Sun, 29 Oct 2023 13:45:51 +0100 Subject: [PATCH] WIP: Add matrix-hookshot --- .../apps/matrix/matrix-hookshot.nix | 112 ++++++++++++++++++ secrets/matrix-hookshot-registration.yaml.age | Bin 0 -> 1824 bytes secrets/secrets.nix | 1 + 3 files changed, 113 insertions(+) create mode 100644 hosts/nachtigall/apps/matrix/matrix-hookshot.nix create mode 100644 secrets/matrix-hookshot-registration.yaml.age diff --git a/hosts/nachtigall/apps/matrix/matrix-hookshot.nix b/hosts/nachtigall/apps/matrix/matrix-hookshot.nix new file mode 100644 index 00000000..d2b44c7c --- /dev/null +++ b/hosts/nachtigall/apps/matrix/matrix-hookshot.nix @@ -0,0 +1,112 @@ +{ flake, pkgs, ...}:{ + + age.secrets."matrix-hookshot-registration.yaml" = { + file = "${flake.self}/secrets/matrix-hookshot-registration.yaml.age"; + mode = "400"; + owner = "matrix-synapse"; + }; + + configFile = '' + bot: + avatar: mxc://half-shot.uk/2876e89ccade4cb615e210c458e2a7a6883fe17d + displayname: Hookshot Bot + bridge: + bindAddress: 0.0.0.0 + domain: test.pub.solar + mediaUrl: http://matrix-nginx-proxy:12080 + port: 9993 + url: http://matrix-nginx-proxy:12080 + feeds: + enabled: true + pollIntervalSeconds: 600 + pollTimeoutSeconds: 30 + generic: + allowJsTransformationFunctions: true + enableHttpGet: false + enabled: true + urlPrefix: https://matrix.test.pub.solar/hookshot/webhooks + userIdPrefix: _webhooks_ + waitForComplete: false + gitlab: + instances: + gitlab.com: + url: https://gitlab.com + webhook: + secret: "" + listeners: + - bindAddress: 0.0.0.0 + port: 9000 + resources: + - webhooks + - bindAddress: 0.0.0.0 + port: 9002 + resources: + - provisioning + - bindAddress: 0.0.0.0 + port: 9003 + resources: + - widgets + logging: + level: warn + metrics: + enabled: false + passFile: /data/passkey.pem + permissions: + - actor: pub.solar + services: + - level: commands + service: '*' + - actor: '@axeman:pub.solar' + services: + - level: admin + service: '*' + - actor: '@b12f:pub.solar' + services: + - level: admin + service: '*' + - actor: '@hensoko:pub.solar' + services: + - level: admin + service: '*' + - actor: '@teutat3s:pub.solar' + services: + - level: admin + service: '*' + provisioning: + secret: 1acb44197a5a6d52c6cff38ea07433bfbfe9a83313a6bade + widgets: + addToAdminRooms: false + branding: + widgetTitle: Hookshot Configuration + publicUrl: https://matrix.pub.solar/hookshot/widgetapi/v1/static + roomSetupWidget: + addOnInvite: false + ''; + + systemd.services.matrix-hookshot = { + description = "Matrix-Hookshot, a bridge between Matrix and multiple project management services, such as GitHub, GitLab and JIRA. "; + + wantedBy = [ "multi-user.target" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; + + serviceConfig = { + Type = "simple"; + Restart = "always"; + + ProtectSystem = "strict"; + ProtectHome = true; + ProtectKernelTunables = true; + ProtectKernelModules = true; + ProtectControlGroups = true; + + DynamicUser = true; + PrivateTmp = true; + UMask = "0027"; + + ExecStart = '' + ${pkgs.matrix-hookshot}/bin/matrix-hookshot + ''; + }; + }; +} diff --git a/secrets/matrix-hookshot-registration.yaml.age b/secrets/matrix-hookshot-registration.yaml.age new file mode 100644 index 0000000000000000000000000000000000000000..11189a2c3944f0f388fe50a15e49db68fb8aab1c GIT binary patch literal 1824 zcmZA0{qNia0mpF=G_2$6z=3liBh;crkk*NX4=0ZZ48XS9!U*`N_zw9q~ zC7*oWy46m$UBjPwV`u2zHS{egN&(3Yi6F3(Z8M$8r1A-;Sm{oz1g6Mr#6lrWP?H{M zXl1C<4eVf&mo-Dmk&e(7{gH_)RT~3_h|KrgZa*iE=x(S%)t2ALhGDP7$=PwY?iOVW z?Wv=>pj%gJp=K2MNrG@=N*Xt?F{{?7enB2my{y@H7_&qB>Qo1(rFN?b=Cfd(1E#$e z8qGSoXyoH|r>O}+rI)I}QGVpM2UBgBaqz)7Zg4t_U)KCUPxQ#54C4R~`(#ry;IivQ z)ocT_h`LHa_BIHz>1m13zf(Vh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rets.nix @@ -44,6 +44,7 @@ in { "matrix-mautrix-telegram-env-file.age".publicKeys = nachtigallKeys ++ baseKeys; "matrix-synapse-signing-key.age".publicKeys = nachtigallKeys ++ baseKeys; "matrix-synapse-secret-config.yaml.age".publicKeys = nachtigallKeys ++ baseKeys; + "matrix-hookshot-registration.yaml.age".publicKeys = nachtigallKeys ++ baseKeys; "nextcloud-secrets.age".publicKeys = nachtigallKeys ++ baseKeys; "nextcloud-admin-pass.age".publicKeys = nachtigallKeys ++ baseKeys;