blob: 5a580adf062fd20cf20557314227ee000dda1efb [file] [log] [blame]
Serge Bazanski52e79662020-11-03 23:35:21 +01001local matrix = import "lib/matrix.libsonnet";
2local irc = import "lib/appservice-irc.libsonnet";
3local telegram = import "lib/appservice-telegram.libsonnet";
4
5matrix {
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 Szulcc67abc22020-11-08 16:46:56 +010012 cas: {
13 enable: true,
14 oauth2: {
15 clientID: "YCWg1Qor9YstKn_yAHB_NT3GFAGqbnDFzIwyI_fCUWI",
Norbert Szulc6ab920a2020-11-11 00:18:35 +010016 clientSecret: (std.split(importstr "secrets/plain/cas-proxy-0x3c-0auth2-secret", "\n"))[0],
Norbert Szulcc67abc22020-11-08 16:46:56 +010017 scope: "read:accounts",
18 authorizeURL: "https://0x3c.pl/oauth/authorize",
19 tokenURL: "https://0x3c.pl/oauth/token",
20 userinfoURL: "https://0x3c.pl/api/v1/accounts/verify_credentials",
21 },
Serge Bazanski52e79662020-11-03 23:35:21 +010022 },
23 },
Norbert Szulccaabcab2020-11-08 16:16:32 +010024
25 riotConfig+:: {
26 "brand": "Element - %s" % [cfg.serverName],
27 "branding": {
28 "welcomeBackgroundUrl": "https://media.0x3c.pl/file/0x3c-mastodon/0x3c-pixelsort.png"
29 },
30 },
Norbert Szulc9dcf5f82020-11-08 16:19:01 +010031
32 appservices: {
33 "telegram-prod": telegram.AppServiceTelegram("prod") {
34 cfg+: {
35 image: cfg.images.appserviceTelegram,
36 storageClassName: cfg.storageClassName,
37 metadata: app.metadata("appservice-telegram-prod"),
38
39 config+: {
40 homeserver+: {
41 address: "https://%s" % [cfg.webDomain],
42 domain: cfg.serverName,
43 },
44 appservice+: {
45 id: "telegram",
46 bot_avatar: "https://media.0x3c.pl/file/0x3c-mastodon/posejbot2.png",
47 },
48 telegram+: {
49 # not7cd: it may be convinient to use same bot credentials for both appservices
50 api_id: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-id", "\n"))[0],
51 api_hash: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-hash", "\n"))[0],
52 bot_token: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-token", "\n"))[0],
53 },
54 bridge+: {
55 permissions+: {
56 "0x3c.pl": "puppeting",
57 "@not7cd:0x3c.pl": "admin", // propabbly
58 "@q3k:0x3c.pl": "admin",
59 },
60 },
61 },
62 },
63 },
64 },
Serge Bazanski52e79662020-11-03 23:35:21 +010065}