aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-11-15 17:53:59 +0100
committerAlex Auvolat <alex@adnab.me>2021-11-15 17:53:59 +0100
commite20b903bc0caa2a971b6b3bdd4143ddd7624245a (patch)
treef92f4c3f644f91068af02ed2236f0e837c8d1553 /app
parent489cc492d50f446e933716e9e0812bd33bc71060 (diff)
downloadinfrastructure-e20b903bc0caa2a971b6b3bdd4143ddd7624245a.tar.gz
infrastructure-e20b903bc0caa2a971b6b3bdd4143ddd7624245a.zip
Add matterbridge to bridge RFID channel
Diffstat (limited to 'app')
-rw-r--r--app/matterbridge/config/matterbridge.toml30
-rw-r--r--app/matterbridge/deploy/matterbridge.hcl40
2 files changed, 70 insertions, 0 deletions
diff --git a/app/matterbridge/config/matterbridge.toml b/app/matterbridge/config/matterbridge.toml
new file mode 100644
index 0000000..c3faa5a
--- /dev/null
+++ b/app/matterbridge/config/matterbridge.toml
@@ -0,0 +1,30 @@
+[rocketchat]
+[rocketchat.dravedev]
+Server = "https://rocketchat.drave.quebec:443"
+Login = "{{ key "secrets/matterbridge/rocketchat.drave.quebec_user" | trimSpace }}"
+Password = "{{ key "secrets/matterbridge/rocketchat.drave.quebec_pass" | trimSpace }}"
+PrefixMessagesWithNick=false
+RemoteNickFormat="{NICK}"
+
+
+
+[matrix]
+[matrix.deuxfleurs]
+Server = "https://im.deuxfleurs.fr"
+Login = "{{ key "secrets/matterbridge/im.deuxfleurs.fr_user" | trimSpace }}"
+Password = "{{ key "secrets/matterbridge/im.deuxfleurs.fr_pass" | trimSpace }}"
+PrefixMessagesWithNick=true
+RemoteNickFormat="<{NICK}> "
+
+[[gateway]]
+name = "rfid"
+enable = true
+
+ [[gateway.inout]]
+ account = "rocketchat.dravedev"
+ channel = "rfid"
+
+ [[gateway.inout]]
+ account = "matrix.deuxfleurs"
+ channel = "#rfid:deuxfleurs.fr"
+
diff --git a/app/matterbridge/deploy/matterbridge.hcl b/app/matterbridge/deploy/matterbridge.hcl
new file mode 100644
index 0000000..6fb6dd0
--- /dev/null
+++ b/app/matterbridge/deploy/matterbridge.hcl
@@ -0,0 +1,40 @@
+job "matterbridge" {
+ datacenters = ["dc1"]
+ type = "service"
+ priority = 90
+
+ constraint {
+ attribute = "${attr.cpu.arch}"
+ value = "amd64"
+ }
+
+ group "main" {
+ count = 1
+
+ task "bridge" {
+ driver = "docker"
+ config {
+ image = "42wim/matterbridge:1.23"
+ readonly_rootfs = true
+ volumes = [
+ "secrets/matterbridge.toml:/etc/matterbridge/matterbridge.toml"
+ ]
+ }
+
+ resources {
+ memory = 200
+ }
+
+ template {
+ data = file("../config/matterbridge.toml")
+ destination = "secrets/matterbridge.toml"
+ }
+
+ restart {
+ attempts = 10
+ delay = "30s"
+ }
+ }
+ }
+}
+