Serge Bazanski | 60076c7 | 2020-11-03 19:17:25 +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", |
| 10 | webDomain: "matrix.hackerspace.pl", |
| 11 | serverName: "hackerspace.pl", |
| 12 | }, |
| 13 | |
| 14 | appservices: { |
| 15 | "irc-freenode": irc.AppServiceIrc("freenode") { |
| 16 | cfg+: { |
| 17 | image: cfg.appserviceIRCImage, |
| 18 | // TODO(q3k): move this appservice to waw-hdd-redundant-3 |
| 19 | storageClassName: "waw-hdd-paranoid-2", |
| 20 | metadata: app.metadata("appservice-irc-freenode"), |
| 21 | // TODO(q3k): add labels to blessed nodes |
| 22 | nodeSelector: { |
| 23 | "kubernetes.io/hostname": "bc01n03.hswaw.net", |
| 24 | }, |
| 25 | config+: { |
| 26 | homeserver+: { |
| 27 | url: "https://%s" % [cfg.webDomain], |
| 28 | domain: "%s" % [cfg.serverName], |
| 29 | }, |
| 30 | ircService+: { |
| 31 | servers+: { |
| 32 | "irc.freenode.net"+: { |
| 33 | ircClients+: { |
| 34 | maxClients: 150, |
| 35 | }, |
| 36 | }, |
| 37 | }, |
| 38 | }, |
| 39 | }, |
| 40 | }, |
| 41 | }, |
| 42 | "telegram-prod": telegram.AppServiceTelegram("prod") { |
| 43 | cfg+: { |
| 44 | image: cfg.appserviceTelegramImage, |
| 45 | storageClassName: cfg.storageClassName, |
| 46 | metadata: app.metadata("appservice-telegram-prod"), |
| 47 | |
| 48 | config+: { |
| 49 | homeserver+: { |
| 50 | address: "https://%s" % [cfg.webDomain], |
| 51 | domain: cfg.serverName, |
| 52 | }, |
| 53 | appservice+: { |
| 54 | id: "telegram", |
| 55 | }, |
| 56 | telegram+: { |
| 57 | api_id: (std.split(importstr "secrets/plain/appservice-telegram-prod-api-id", "\n"))[0], |
| 58 | api_hash: (std.split(importstr "secrets/plain/appservice-telegram-prod-api-hash", "\n"))[0], |
| 59 | bot_token: (std.split(importstr "secrets/plain/appservice-telegram-prod-token", "\n"))[0], |
| 60 | }, |
| 61 | bridge+: { |
| 62 | permissions+: { |
| 63 | "hackerspace.pl": "puppeting", |
| 64 | "@q3k:hackerspace.pl": "admin", |
| 65 | }, |
| 66 | }, |
| 67 | }, |
| 68 | }, |
| 69 | }, |
| 70 | }, |
| 71 | } |