blob: 76d318e6064c9ede7b466f92149bcabfacd54fe5 [file] [log] [blame]
Sergiusz Bazanski6f773e02019-10-02 20:46:48 +02001local mirko = import "../../kube/mirko.libsonnet";
2local kube = import "../../kube/kube.libsonnet";
3
Sergiusz Bazanskid0ec2c62019-11-21 00:08:52 +01004local smsgw = import "smsgw.libsonnet";
Sergiusz Bazanskic315aac2020-01-02 16:43:39 +01005local teleimg = import "teleimg.libsonnet";
Sergiusz Bazanski64946962020-02-02 17:15:55 +01006local frab = import "frab.libsonnet";
Sergiusz Bazanski74818e12020-02-18 22:56:21 +01007local pretalx = import "pretalx.libsonnet";
Serge Bazanski95ba05d2021-05-12 21:28:10 +00008local cebulacamp = import "cebulacamp.libsonnet";
Serge Bazanski0aa29102023-04-01 23:18:05 +00009local capacifier = import "capacifier.libsonnet";
Sergiusz Bazanskid0ec2c62019-11-21 00:08:52 +010010
Sergiusz Bazanski6f773e02019-10-02 20:46:48 +020011{
12 hswaw(name):: mirko.Environment(name) {
13 local env = self,
14 local cfg = self.cfg,
15
16 cfg+: {
Sergiusz Bazanskid0ec2c62019-11-21 00:08:52 +010017 smsgw: smsgw.cfg,
Sergiusz Bazanskic315aac2020-01-02 16:43:39 +010018 teleimg: teleimg.cfg,
Sergiusz Bazanski64946962020-02-02 17:15:55 +010019 frab: frab.cfg,
Sergiusz Bazanski74818e12020-02-18 22:56:21 +010020 pretalx: pretalx.cfg,
Serge Bazanski95ba05d2021-05-12 21:28:10 +000021 cebulacamp: cebulacamp.cfg,
Serge Bazanski0aa29102023-04-01 23:18:05 +000022 capacifier: capacifier.cfg,
Sergiusz Bazanski6f773e02019-10-02 20:46:48 +020023 },
24
25 components: {
Sergiusz Bazanskid0ec2c62019-11-21 00:08:52 +010026 smsgw: smsgw.component(cfg.smsgw, env),
Sergiusz Bazanskia8854882020-01-05 00:34:38 +010027 teleimg: teleimg.teleimg(cfg.teleimg, env),
28 lelegram: teleimg.lelegram(cfg.teleimg, env),
Sergiusz Bazanski64946962020-02-02 17:15:55 +010029 frab: frab.component(cfg.frab, env),
Piotr Dobrowolski8e22f6c2023-05-10 22:20:13 +020030 pretalx: pretalx.component(cfg.pretalx, env) {
31 cronjob: null,
32 },
Serge Bazanski95ba05d2021-05-12 21:28:10 +000033 cebulacamp: cebulacamp.component(cfg.cebulacamp, env),
Serge Bazanski0aa29102023-04-01 23:18:05 +000034 capacifier: capacifier.component(cfg.capacifier, env),
Sergiusz Bazanski6f773e02019-10-02 20:46:48 +020035 },
36 },
37
38 prod: self.hswaw("hswaw-prod") {
39 cfg+: {
40 smsgw+: {
41 secret+: {
42 twilio_token: std.base64(std.split(importstr "secrets/plain/prod-twilio-token", "\n")[0]),
43 },
44 webhookFQDN: "smsgw-webhook-prod.hswaw.net",
Sergiusz Bazanski5b866622019-10-18 14:54:36 +020045 },
Sergiusz Bazanskic315aac2020-01-02 16:43:39 +010046 teleimg+: {
47 webFQDN: "teleimg.hswaw.net",
48 secret+: {
49 telegram_token: std.base64(std.split(importstr "secrets/plain/prod-telegram-token", "\n")[0]),
50 },
51 },
Sergiusz Bazanski64946962020-02-02 17:15:55 +010052 frab+: {
53 storageClassName: "waw-hdd-redundant-3",
54 webFQDN: "frab.hackerspace.pl",
55 secret+: {
56 secretKeyBase: std.base64(std.split(importstr "secrets/plain/prod-frab-smtp-password", "\n")[0]),
57 smtpPassword: std.base64(std.split(importstr "secrets/plain/prod-frab-secret-key-base", "\n")[0]),
58 },
59 },
Sergiusz Bazanski74818e12020-02-18 22:56:21 +010060 pretalx+: {
61 storageClassName: "waw-hdd-redundant-3",
62 webFQDN: "cfp.cebula.camp",
63 smtpPassword: std.base64(std.split(importstr "secrets/plain/prod-pretalx-smtp-password", "\n")[0]),
64 s3+: {
65 credsSecret: import "secrets/plain/prod-pretalx-s3.json",
66 },
67 },
Serge Bazanski95ba05d2021-05-12 21:28:10 +000068 cebulacamp+: {
69 webFQDN: "cebula.camp",
70 },
Serge Bazanski0aa29102023-04-01 23:18:05 +000071 capacifier+: {
Serge Bazanski88bec7a2023-09-22 22:09:24 +000072 ldapBindPassword: std.split(importstr "secrets/plain/prod-capacifier-password", "\n")[0],
Serge Bazanski0aa29102023-04-01 23:18:05 +000073 },
Sergiusz Bazanski6f773e02019-10-02 20:46:48 +020074 },
75 },
Serge Bazanski7459bbc2023-07-28 17:14:29 +000076
77 admins: kube.RoleBinding("admins") {
78 metadata+: {
79 namespace: "hswaw-prod",
80 },
81 roleRef: {
82 apiGroup: "rbac.authorization.k8s.io",
83 kind: "ClusterRole",
84 name: "system:admin-namespace",
85 },
86 subjects: [
87 kube.User("ar@hackerspace.pl"),
Serge Bazanski603b4f72023-09-22 20:34:22 +000088 kube.User("radex@hackerspace.pl"),
Serge Bazanski7459bbc2023-07-28 17:14:29 +000089 ],
90 },
Sergiusz Bazanski6f773e02019-10-02 20:46:48 +020091}