From d472e63fb96eca72b4349262c443a067ab716d4d Mon Sep 17 00:00:00 2001 From: accassid Date: Thu, 22 Aug 2024 15:05:32 -0600 Subject: [PATCH] adding admin ids and backend curl --- backend/.kubernetes/kubernetes.yaml | 16 ++++++++++++++-- bot/discord/spellbook_discord.py | 6 +++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/backend/.kubernetes/kubernetes.yaml b/backend/.kubernetes/kubernetes.yaml index ecc8a29e..c94b39f2 100644 --- a/backend/.kubernetes/kubernetes.yaml +++ b/backend/.kubernetes/kubernetes.yaml @@ -291,7 +291,9 @@ spec: livenessProbe: exec: command: - - ls + - curl + - -f + - https://backend.commanderspellbook.com initialDelaySeconds: 40 periodSeconds: 20 timeoutSeconds: 5 @@ -300,4 +302,14 @@ spec: valueFrom: secretKeyRef: name: discord-bot-secrets - key: discord-token \ No newline at end of file + key: discord-token + - name: KUBE_ADMIN_USER__0 + valueFrom: + secretKeyRef: + name: discord-bot-secrets + key: deloo-discord-id + - name: KUBE_ADMIN_USER__1 + valueFrom: + secretKeyRef: + name: discord-bot-secrets + key: andy-discord-id \ No newline at end of file diff --git a/bot/discord/spellbook_discord.py b/bot/discord/spellbook_discord.py index e7897008..4b8e4a67 100644 --- a/bot/discord/spellbook_discord.py +++ b/bot/discord/spellbook_discord.py @@ -35,8 +35,8 @@ add_reactions=True, use_external_emojis=True, ) -administration_guilds = [int(guild) for guild in (os.getenv(f'ADMIN_GUILD__{i}') for i in range(10)) if guild is not None] -administration_users = [int(user) for user in (os.getenv(f'ADMIN_USER__{i}') for i in range(10)) if user is not None] +administration_guilds = [int(guild) for guild in (os.getenv(f'KUBE_ADMIN_GUILD__{i}', os.getenv(f'ADMIN_GUILD__{i}')) for i in range(10)) if guild is not None] +administration_users = [int(user) for user in (os.getenv(f'KUBE_ADMIN_USER__{i}', os.getenv(f'ADMIN_USER__{i}')) for i in range(10)) if user is not None] MAX_SEARCH_RESULTS = 7 @@ -346,4 +346,4 @@ async def find_my_combos(interaction: discord.Interaction, decklist: str | None await interaction.response.send_modal(FindMyCombosModal()) -bot.run(os.getenv('DISCORD_TOKEN', '')) +bot.run(os.getenv('KUBE_DISCORD_TOKEN', os.getenv('DISCORD_TOKEN', '')))