infra/k8s/matrix/bridge.yaml

22 lines
563 B
YAML
Raw Normal View History

2024-03-20 02:32:34 +00:00
apiVersion: v1
kind: ConfigMap
metadata:
name: bridge-init
namespace: matrix
data:
2024-07-07 04:27:20 +00:00
initialize-bridge.py: | # TODO: migrate this and it's users to secrets-init/secrets-init.py which is similar but more generic
2024-06-05 02:48:26 +00:00
#!/usr/bin/python
import os
with open("/config/config.yaml") as r:
c = r.read()
for i in ["AS_TOKEN", "HS_TOKEN", "TG_API_ID", "TG_API_HASH"]:
value = os.getenv(i)
if value is not None:
c = c.replace(i, value)
print("replaced", i)
with open("/data/config.yaml", 'w') as w:
w.write(c)