blob: 2a9fb9a47afcff3e4994e90f5792c47b338738be [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 Szulc25080092020-11-11 18:06:41 +010012
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 Szulcc67abc22020-11-08 16:46:56 +010018 cas: {
19 enable: true,
20 oauth2: {
21 clientID: "YCWg1Qor9YstKn_yAHB_NT3GFAGqbnDFzIwyI_fCUWI",
Serge Bazanskiab1f7dc2021-05-12 21:06:20 +000022 clientSecret: (std.split(importstr "secrets/plain/cas-proxy-0x3c-0auth2-secret", "\n"))[0],
Norbert Szulcc67abc22020-11-08 16:46:56 +010023 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 Bazanski52e79662020-11-03 23:35:21 +010028 },
29 },
Norbert Szulccaabcab2020-11-08 16:16:32 +010030
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 Szulc9dcf5f82020-11-08 16:19:01 +010037
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 Szulc5d784c52021-02-12 19:35:26 +010066 displayname_template: "{displayname}[T]",
67 displayname_preference: [
68 "username",
69 "full name",
70 "phone number",
71 ],
Norbert Szulc9dcf5f82020-11-08 16:19:01 +010072 },
73 },
74 },
75 },
76 },
Serge Bazanski52e79662020-11-03 23:35:21 +010077}