Serge Bazanski | 52e7966 | 2020-11-03 23:35:21 +0100 | [diff] [blame] | 1 | local matrix = import "lib/matrix.libsonnet"; |
| 2 | local irc = import "lib/appservice-irc.libsonnet"; |
| 3 | local telegram = import "lib/appservice-telegram.libsonnet"; |
| 4 | |
| 5 | matrix { |
| 6 | local app = self, |
| 7 | local cfg = app.cfg, |
| 8 | cfg+:: { |
| 9 | namespace: "matrix-0x3c", |
| 10 | webDomain: "matrix.0x3c.pl", |
| 11 | serverName: "0x3c.pl", |
| 12 | }, |
| 13 | |
| 14 | synapseConfig+:: { |
| 15 | password_config: { |
| 16 | enabled: true, |
| 17 | }, |
| 18 | }, |
Norbert Szulc | caabcab | 2020-11-08 16:16:32 +0100 | [diff] [blame] | 19 | |
| 20 | riotConfig+:: { |
| 21 | "brand": "Element - %s" % [cfg.serverName], |
| 22 | "branding": { |
| 23 | "welcomeBackgroundUrl": "https://media.0x3c.pl/file/0x3c-mastodon/0x3c-pixelsort.png" |
| 24 | }, |
| 25 | }, |
Norbert Szulc | 9dcf5f8 | 2020-11-08 16:19:01 +0100 | [diff] [blame] | 26 | |
| 27 | appservices: { |
| 28 | "telegram-prod": telegram.AppServiceTelegram("prod") { |
| 29 | cfg+: { |
| 30 | image: cfg.images.appserviceTelegram, |
| 31 | storageClassName: cfg.storageClassName, |
| 32 | metadata: app.metadata("appservice-telegram-prod"), |
| 33 | |
| 34 | config+: { |
| 35 | homeserver+: { |
| 36 | address: "https://%s" % [cfg.webDomain], |
| 37 | domain: cfg.serverName, |
| 38 | }, |
| 39 | appservice+: { |
| 40 | id: "telegram", |
| 41 | bot_avatar: "https://media.0x3c.pl/file/0x3c-mastodon/posejbot2.png", |
| 42 | }, |
| 43 | telegram+: { |
| 44 | # not7cd: it may be convinient to use same bot credentials for both appservices |
| 45 | api_id: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-id", "\n"))[0], |
| 46 | api_hash: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-hash", "\n"))[0], |
| 47 | bot_token: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-token", "\n"))[0], |
| 48 | }, |
| 49 | bridge+: { |
| 50 | permissions+: { |
| 51 | "0x3c.pl": "puppeting", |
| 52 | "@not7cd:0x3c.pl": "admin", // propabbly |
| 53 | "@q3k:0x3c.pl": "admin", |
| 54 | }, |
| 55 | }, |
| 56 | }, |
| 57 | }, |
| 58 | }, |
| 59 | }, |
Serge Bazanski | 52e7966 | 2020-11-03 23:35:21 +0100 | [diff] [blame] | 60 | } |