| local matrix = import "lib/matrix.libsonnet"; |
| local irc = import "lib/appservice-irc.libsonnet"; |
| local telegram = import "lib/appservice-telegram.libsonnet"; |
| |
| matrix { |
| local app = self, |
| local cfg = app.cfg, |
| cfg+:: { |
| namespace: "matrix-0x3c", |
| webDomain: "matrix.0x3c.pl", |
| serverName: "0x3c.pl", |
| }, |
| |
| synapseConfig+:: { |
| password_config: { |
| enabled: true, |
| }, |
| }, |
| |
| riotConfig+:: { |
| "brand": "Element - %s" % [cfg.serverName], |
| "branding": { |
| "welcomeBackgroundUrl": "https://media.0x3c.pl/file/0x3c-mastodon/0x3c-pixelsort.png" |
| }, |
| }, |
| |
| appservices: { |
| "telegram-prod": telegram.AppServiceTelegram("prod") { |
| cfg+: { |
| image: cfg.images.appserviceTelegram, |
| storageClassName: cfg.storageClassName, |
| metadata: app.metadata("appservice-telegram-prod"), |
| |
| config+: { |
| homeserver+: { |
| address: "https://%s" % [cfg.webDomain], |
| domain: cfg.serverName, |
| }, |
| appservice+: { |
| id: "telegram", |
| bot_avatar: "https://media.0x3c.pl/file/0x3c-mastodon/posejbot2.png", |
| }, |
| telegram+: { |
| # not7cd: it may be convinient to use same bot credentials for both appservices |
| api_id: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-id", "\n"))[0], |
| api_hash: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-hash", "\n"))[0], |
| bot_token: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-token", "\n"))[0], |
| }, |
| bridge+: { |
| permissions+: { |
| "0x3c.pl": "puppeting", |
| "@not7cd:0x3c.pl": "admin", // propabbly |
| "@q3k:0x3c.pl": "admin", |
| }, |
| }, |
| }, |
| }, |
| }, |
| }, |
| } |