21 lines
460 B
YAML
21 lines
460 B
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: bridge-init
|
|
namespace: matrix
|
|
data:
|
|
initialize-bridge.py: |
|
|
#!/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)
|