comms: stop seeding atlas bots in synapse job
This commit is contained in:
parent
1186722bb5
commit
976b5994dd
@ -27,12 +27,6 @@ spec:
|
|||||||
vault.hashicorp.com/agent-inject-secret-bot-pass: "kv/data/atlas/comms/atlasbot-credentials-runtime"
|
vault.hashicorp.com/agent-inject-secret-bot-pass: "kv/data/atlas/comms/atlasbot-credentials-runtime"
|
||||||
vault.hashicorp.com/agent-inject-template-bot-pass: |
|
vault.hashicorp.com/agent-inject-template-bot-pass: |
|
||||||
{{- with secret "kv/data/atlas/comms/atlasbot-credentials-runtime" -}}{{ index .Data.data "bot-password" }}{{- end -}}
|
{{- with secret "kv/data/atlas/comms/atlasbot-credentials-runtime" -}}{{ index .Data.data "bot-password" }}{{- end -}}
|
||||||
vault.hashicorp.com/agent-inject-secret-bot-quick-pass: "kv/data/atlas/comms/atlasbot-credentials-runtime"
|
|
||||||
vault.hashicorp.com/agent-inject-template-bot-quick-pass: |
|
|
||||||
{{- with secret "kv/data/atlas/comms/atlasbot-credentials-runtime" -}}{{ index .Data.data "bot-quick-password" }}{{- end -}}
|
|
||||||
vault.hashicorp.com/agent-inject-secret-bot-smart-pass: "kv/data/atlas/comms/atlasbot-credentials-runtime"
|
|
||||||
vault.hashicorp.com/agent-inject-template-bot-smart-pass: |
|
|
||||||
{{- with secret "kv/data/atlas/comms/atlasbot-credentials-runtime" -}}{{ index .Data.data "bot-smart-password" }}{{- end -}}
|
|
||||||
vault.hashicorp.com/agent-inject-secret-seeder-pass: "kv/data/atlas/comms/atlasbot-credentials-runtime"
|
vault.hashicorp.com/agent-inject-secret-seeder-pass: "kv/data/atlas/comms/atlasbot-credentials-runtime"
|
||||||
vault.hashicorp.com/agent-inject-template-seeder-pass: |
|
vault.hashicorp.com/agent-inject-template-seeder-pass: |
|
||||||
{{- with secret "kv/data/atlas/comms/atlasbot-credentials-runtime" -}}{{ index .Data.data "seeder-password" }}{{- end -}}
|
{{- with secret "kv/data/atlas/comms/atlasbot-credentials-runtime" -}}{{ index .Data.data "seeder-password" }}{{- end -}}
|
||||||
@ -88,12 +82,6 @@ spec:
|
|||||||
value: synapse
|
value: synapse
|
||||||
- name: SEEDER_USER
|
- name: SEEDER_USER
|
||||||
value: othrys-seeder
|
value: othrys-seeder
|
||||||
- name: BOT_USER
|
|
||||||
value: atlas-smart
|
|
||||||
- name: BOT_USER_QUICK
|
|
||||||
value: atlas-quick
|
|
||||||
- name: BOT_USER_SMART
|
|
||||||
value: atlas-smart
|
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
@ -151,12 +139,8 @@ spec:
|
|||||||
cur.execute(query, [values[c] for c in columns])
|
cur.execute(query, [values[c] for c in columns])
|
||||||
|
|
||||||
seeder_user = os.environ["SEEDER_USER"]
|
seeder_user = os.environ["SEEDER_USER"]
|
||||||
bot_user = os.environ["BOT_USER"]
|
|
||||||
bot_quick = os.environ.get("BOT_USER_QUICK", "").strip()
|
|
||||||
bot_smart = os.environ.get("BOT_USER_SMART", "").strip()
|
|
||||||
server = "live.bstein.dev"
|
server = "live.bstein.dev"
|
||||||
seeder_id = f"@{seeder_user}:{server}"
|
seeder_id = f"@{seeder_user}:{server}"
|
||||||
bot_id = f"@{bot_user}:{server}"
|
|
||||||
|
|
||||||
conn = psycopg2.connect(
|
conn = psycopg2.connect(
|
||||||
host=os.environ["PGHOST"],
|
host=os.environ["PGHOST"],
|
||||||
@ -170,13 +154,6 @@ spec:
|
|||||||
with conn.cursor() as cur:
|
with conn.cursor() as cur:
|
||||||
cols = get_cols(cur)
|
cols = get_cols(cur)
|
||||||
upsert_user(cur, cols, seeder_id, os.environ["SEEDER_PASS"], True)
|
upsert_user(cur, cols, seeder_id, os.environ["SEEDER_PASS"], True)
|
||||||
upsert_user(cur, cols, bot_id, os.environ["BOT_PASS"], False)
|
|
||||||
if bot_quick and os.environ.get("BOT_PASS_QUICK"):
|
|
||||||
quick_id = f"@{bot_quick}:{server}"
|
|
||||||
upsert_user(cur, cols, quick_id, os.environ["BOT_PASS_QUICK"], False)
|
|
||||||
if bot_smart and os.environ.get("BOT_PASS_SMART"):
|
|
||||||
smart_id = f"@{bot_smart}:{server}"
|
|
||||||
upsert_user(cur, cols, smart_id, os.environ["BOT_PASS_SMART"], False)
|
|
||||||
finally:
|
finally:
|
||||||
conn.close()
|
conn.close()
|
||||||
PY
|
PY
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user