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", |
Norbert Szulc | 2508009 | 2020-11-11 18:06:41 +0100 | [diff] [blame] | 12 | |
| 13 | images+: { |
| 14 | # We are using patched version for 0x3c now, to not break other configs |
| 15 | casProxy: "registry.k0.hswaw.net/informatic/oauth2-cas-proxy:0.1.5", |
| 16 | }, |
| 17 | |
Norbert Szulc | c67abc2 | 2020-11-08 16:46:56 +0100 | [diff] [blame] | 18 | cas: { |
| 19 | enable: true, |
| 20 | oauth2: { |
| 21 | clientID: "YCWg1Qor9YstKn_yAHB_NT3GFAGqbnDFzIwyI_fCUWI", |
Serge Bazanski | ab1f7dc | 2021-05-12 21:06:20 +0000 | [diff] [blame] | 22 | clientSecret: (std.split(importstr "secrets/plain/cas-proxy-0x3c-0auth2-secret", "\n"))[0], |
Norbert Szulc | c67abc2 | 2020-11-08 16:46:56 +0100 | [diff] [blame] | 23 | scope: "read:accounts", |
| 24 | authorizeURL: "https://0x3c.pl/oauth/authorize", |
| 25 | tokenURL: "https://0x3c.pl/oauth/token", |
| 26 | userinfoURL: "https://0x3c.pl/api/v1/accounts/verify_credentials", |
| 27 | }, |
Serge Bazanski | 52e7966 | 2020-11-03 23:35:21 +0100 | [diff] [blame] | 28 | }, |
| 29 | }, |
Norbert Szulc | caabcab | 2020-11-08 16:16:32 +0100 | [diff] [blame] | 30 | |
| 31 | riotConfig+:: { |
| 32 | "brand": "Element - %s" % [cfg.serverName], |
| 33 | "branding": { |
| 34 | "welcomeBackgroundUrl": "https://media.0x3c.pl/file/0x3c-mastodon/0x3c-pixelsort.png" |
| 35 | }, |
| 36 | }, |
Norbert Szulc | 9dcf5f8 | 2020-11-08 16:19:01 +0100 | [diff] [blame] | 37 | |
| 38 | appservices: { |
| 39 | "telegram-prod": telegram.AppServiceTelegram("prod") { |
| 40 | cfg+: { |
| 41 | image: cfg.images.appserviceTelegram, |
| 42 | storageClassName: cfg.storageClassName, |
| 43 | metadata: app.metadata("appservice-telegram-prod"), |
| 44 | |
| 45 | config+: { |
| 46 | homeserver+: { |
| 47 | address: "https://%s" % [cfg.webDomain], |
| 48 | domain: cfg.serverName, |
| 49 | }, |
| 50 | appservice+: { |
| 51 | id: "telegram", |
| 52 | bot_avatar: "https://media.0x3c.pl/file/0x3c-mastodon/posejbot2.png", |
| 53 | }, |
| 54 | telegram+: { |
| 55 | # not7cd: it may be convinient to use same bot credentials for both appservices |
| 56 | api_id: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-id", "\n"))[0], |
| 57 | api_hash: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-hash", "\n"))[0], |
| 58 | bot_token: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-token", "\n"))[0], |
| 59 | }, |
| 60 | bridge+: { |
| 61 | permissions+: { |
| 62 | "0x3c.pl": "puppeting", |
| 63 | "@not7cd:0x3c.pl": "admin", // propabbly |
| 64 | "@q3k:0x3c.pl": "admin", |
| 65 | }, |
Norbert Szulc | 5d784c5 | 2021-02-12 19:35:26 +0100 | [diff] [blame] | 66 | displayname_template: "{displayname}[T]", |
| 67 | displayname_preference: [ |
| 68 | "username", |
| 69 | "full name", |
| 70 | "phone number", |
| 71 | ], |
Norbert Szulc | 9dcf5f8 | 2020-11-08 16:19:01 +0100 | [diff] [blame] | 72 | }, |
| 73 | }, |
| 74 | }, |
| 75 | }, |
| 76 | }, |
Serge Bazanski | 52e7966 | 2020-11-03 23:35:21 +0100 | [diff] [blame] | 77 | } |