Skip to content

Commit

Permalink
feat(matterbridge): init
Browse files Browse the repository at this point in the history
Co-Authored-By: Vinicius Santos <[email protected]>
  • Loading branch information
Misterio77 and ViniciusDMSantos committed Sep 14, 2024
1 parent 244cbf3 commit d4349b8
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 3 deletions.
9 changes: 6 additions & 3 deletions hosts/galapagos/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ plausible-admin-password: ENC[AES256_GCM,data:H27VpzOx4+ubaISDY4HfslRfUpxbc6Yf8Q
plausible-smtp-password: ENC[AES256_GCM,data:5znKSLwDb2yI0c+hcpUvj80Bjx6Es2EZXA==,iv:db99T4M9GNItBoU+WmlTcjB7BokG3fiO3vaJ1EwfwJs=,tag:lj1kNyM0njwUDnJHvDElwQ==,type:str]
plausible-secret-key: ENC[AES256_GCM,data:6ky6w3Cj33Jt5w+rbGYwFufYo2vW5L/zwSJpmbTCSfLPIxZB0ro95b4HbNADGQRLMDvkCjbK7OMnK/HDXWZeZ67E7A+TqIQU+Vnsam0Q4dv8RE6qaSWaLK9ndv8E05dVQgkCvX8uKxWZqtit7BaPdl3RBMolmXFZ4ZecAtweuUo=,iv:Lt9rxAXgwRpe4Qx98iZEpmO1q2tUy1Wk7WQ2r/PpuMo=,tag:XxPy1LIloeXXoR6LI9Lihg==,type:str]
kavita-secret: ENC[AES256_GCM,data:RzyRM9+NI30SeLBJ2iqg0K4ckcoZJK2/Wm3svIkjFJZSv/NmbWgdOzz+vGI=,iv:3h0ngt0IQKESVyWGlaBsco2mt/DIBGKoomIunMIhAJo=,tag:d3GcTF+5tISHcQZ1MKgLfg==,type:str]
matterbridge-matrix: ENC[AES256_GCM,data:WpiXatjx1uaE5LT4iM3D,iv:uroG2Axc7UdF2/96GoIT1ujDlHbIzPb+OT9X8DrluoQ=,tag:m0ngVUhIy5DkRUWA/NXzFg==,type:str]
matterbridge-telegram: ENC[AES256_GCM,data:ySy/anNOhswBxSr5ta3FU5lE4EcxSH9AfETdZGI4V84wCBVXRDKgz+WbEZi2Kw==,iv:myPgtbqRdiMGhcvuRfx7WJ7nVVBVanuEovdGcZ9uhqA=,tag:eb0bhQXBMXme4TWL9w6/fw==,type:str]
matterbridge-discord: ENC[AES256_GCM,data:5WAREmw8cQUVF8SRKNjcFA7kWfwYW06XQ/KIK4XvhyHnw6E3rYYTr9WzDnaS73FLT4CG1m1KCmisFOa6vHwDkJ2rFXngit18,iv:y+PatyMJIMW/Au9jFhH1G0MU/Rs80Oukw76LH68sRn4=,tag:eySYD/227VHgpd6VNwvJzQ==,type:str]
sops:
kms: []
gcp_kms: []
Expand All @@ -19,8 +22,8 @@ sops:
SzFPZFBPZDR3S2VlZ3RQd3RXR29YajAK7zR5agnyLV+jifKg94PSeoRVfXn1yYmj
0oqDQXJX6SvjFlRMBCJKHnpfWSZwWkCpZTwqsZSuupIZxhSjai2tkw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2023-04-24T19:33:17Z"
mac: ENC[AES256_GCM,data:IVMLPCm+oiXpWRrtiy7obsuV09h8Pvdjzvha/LzBagPbruPCczLzBTXZQgs/SAfdI6oCn/eEB0/S6B9yEvry16M1wPox6InMopm0CXt0RU1do6jbWGh6vvGrwB1makmo6imf1l03tQUn0ZFeqAftj4TzGfJqWYG+Jr3OEuoAhHg=,iv:mOHyiQJj6IMlB29K/fYw4pDzRLugIQpt7QgYlYEFJlE=,tag:tK2wBHu8l+Ixvf0mEX+EPA==,type:str]
lastmodified: "2024-09-14T19:45:17Z"
mac: ENC[AES256_GCM,data:sj/KkZTcT0eKhfZdwD4M0k7F1QJtlnmVjC33riKUuVoshL5gY7IgkO84K5S2S50WTTf4XNIVxp90yF4VihyO9Ot4XulWkjui7FxOuABJYdzNFeMznULMEiQZBkKCi4+pNFKsJCCcq5pDIB14UGaNX79gKWmd34+xh5GYmW6XuTw=,iv:OjnYlL6MeivnS+XrXa2RPUUlqA5HD442YBKSMn5RHcM=,tag:H0497V+qnud+AHflfjMVsA==,type:str]
pgp:
- created_at: "2022-07-26T17:44:23Z"
enc: |-
Expand All @@ -41,4 +44,4 @@ sops:
-----END PGP MESSAGE-----
fp: 7088C7421873E0DB97FF17C2245CAB70B4C225E9
unencrypted_suffix: _unencrypted
version: 3.7.3
version: 3.9.0
1 change: 1 addition & 0 deletions hosts/galapagos/services/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
./website.nix
./mtproxy.nix
./staging-webserver.nix
./matterbridge.nix
];
}
126 changes: 126 additions & 0 deletions hosts/galapagos/services/matterbridge.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{ config, ... }:
{
nixpkgs.overlays = [(final: prev: {
# TODO: move to services.matterbridge.package when https://github.com/NixOS/nixpkgs/pull/340180 is available
matterbridge = prev.matterbridge.overrideAttrs (_: {
version = "unstable-2024-08-27";
src = final.fetchFromGitHub {
owner = "42wim";
repo = "matterbridge";
rev = "c4157a4d5b49fce79c80a30730dc7c404bacd663";
hash = "sha256-ZnNVDlrkZd/I0NWmQMZzJ3RIruH0ARoVKJ4EyYVdMiw=";
};
});
})];

services.matterbridge = {
enable = true;
configPath = config.sops.templates."matterbridge".path;
};

sops.secrets = {
matterbridge-telegram.sopsFile = ../secrets.yml;
matterbridge-matrix.sopsFile = ../secrets.yml;
matterbridge-discord.sopsFile = ../secrets.yml;
};
sops.templates."matterbridge" = {
owner = config.services.matterbridge.user;
group = config.services.matterbridge.group;
content = /* toml */ ''
[telegram.gelos]
Token="${config.sops.placeholder.matterbridge-telegram}"
RemoteNickFormat="*{NICK}*@{PROTOCOL}: "
UseFirstName=true
MessageFormat="MarkdownV2"
PreserveThreading=true
QuoteFormat="{MESSAGE}"
[matrix.gelos]
Server="https://matrix.org"
Login="bot-teste-matrix"
Password="${config.sops.placeholder.matterbridge-matrix}"
PreserveThreading=true
QuoteFormat="{MESSAGE}"
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
NoHomeServerSuffix=false
[discord.gelos]
Token="${config.sops.placeholder.matterbridge-discord}"
Server="1284533922578960404"
AutoWebhooks=true
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
PreserveThreading=true
[[gateway]]
name="geral"
enable=true
[[gateway.inout]]
account="telegram.gelos"
channel="-1001671420611"
[[gateway.inout]]
account="matrix.gelos"
channel="#gelos-geral:matrix.org"
[[gateway]]
name="offtopic"
enable=true
[[gateway.inout]]
account="telegram.gelos"
channel="-1001671420611/34225"
[[gateway.inout]]
account="matrix.gelos"
channel="#gelos-offtopic:matrix.org"
[[gateway.inout]]
account="discord.gelos"
channel="off-topic"
[[gateway]]
name="suporte"
enable=true
[[gateway.inout]]
account="telegram.gelos"
channel="-1001671420611/35728"
[[gateway.inout]]
account="matrix.gelos"
channel="#gelos-suporte:matrix.org"
[[gateway]]
name="installfest"
enable=true
[[gateway.inout]]
account="telegram.gelos"
channel="-1001671420611/34212"
[[gateway.inout]]
account="matrix.gelos"
channel="#gelos-installfest:matrix.org"
[[gateway]]
name="nix"
enable=true
[[gateway.inout]]
account="telegram.gelos"
channel="-1001671420611/69543"
[[gateway.inout]]
account="matrix.gelos"
channel="#gelos-nix:matrix.org"
[[gateway]]
name="linuxgaming"
enable=true
[[gateway.inout]]
account="telegram.gelos"
channel="-1001671420611/103504"
[[gateway.inout]]
account="matrix.gelos"
channel="#gelos-linuxgaming:matrix.org"
[[gateway]]
name="reunioes"
enable=true
[[gateway.inout]]
account="telegram.gelos"
channel="-1001671420611/47679"
[[gateway.inout]]
account="matrix.gelos"
channel="#gelos-reunioes:matrix.org"
'';
};
}

0 comments on commit d4349b8

Please sign in to comment.