From 078105260a834484260ce2bb897a3b9ca7665b25 Mon Sep 17 00:00:00 2001 From: Peber Date: Mon, 11 Nov 2024 22:29:32 -0500 Subject: [PATCH 1/3] updating another thing --- argocd/pod.yaml | 30 ++++++++++++++++++++++++++++++ config/event-buddy-deployment.yaml | 4 ++++ src/commands.js | 4 +++- src/utils.js | 4 +++- 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 argocd/pod.yaml diff --git a/argocd/pod.yaml b/argocd/pod.yaml new file mode 100644 index 0000000..e64655e --- /dev/null +++ b/argocd/pod.yaml @@ -0,0 +1,30 @@ +kind: Pod +apiVersion: v1 +metadata: + name: cool-test-pod + namespace: default +spec: + containers: + - name: busybox + image: registry.k8s.io/e2e-test-images/busybox:1.29-4 + command: + - "/bin/sleep" + - "10000" + volumeMounts: + - name: secrets-store01-inline + mountPath: "/mnt/secrets-store" + readOnly: true + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 250m + memory: 256Mi + volumes: + - name: secrets-store01-inline + csi: + driver: secrets-store.csi.k8s.io + readOnly: true + volumeAttributes: + secretProviderClass: "sc-demo-keyvault-csi" \ No newline at end of file diff --git a/config/event-buddy-deployment.yaml b/config/event-buddy-deployment.yaml index 824a50a..7de2e4e 100644 --- a/config/event-buddy-deployment.yaml +++ b/config/event-buddy-deployment.yaml @@ -18,6 +18,10 @@ spec: name: event-buddy ports: - containerPort: 80 + - command: + - tail + - "-f" + - /dev/null volumeMounts: - name: azure-secrets-store mountPath: "/mnt/secrets-store" diff --git a/src/commands.js b/src/commands.js index 257c18f..fbf5256 100644 --- a/src/commands.js +++ b/src/commands.js @@ -2,7 +2,9 @@ const { REST, Routes } = require('discord.js'); require('dotenv').config() const fs = require('node:fs'); const path = require('node:path'); -const { appId, guildId, discordToken } = process.env; +const discordToken = fs.readFileSync("/mnt/secrets-store/discordToken", 'utf8'); +const guildId = fs.readFileSync("/mnt/secrets-store/guildId", 'utf8'); +const appId = fs.readFileSync("/mnt/secrets-store/APPID", 'utf8'); const commands = []; // Grab all the command folders from the commands directory you created earlier diff --git a/src/utils.js b/src/utils.js index 2b46c84..6856d87 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,14 +1,16 @@ import 'dotenv/config'; export async function DiscordRequest(endpoint, options) { + const discordToken = fs.readFileSync("/mnt/secrets-store/discordToken", 'utf8'); // append endpoint to root API URL const url = 'https://discord.com/api/v10/' + endpoint; // Stringify payloads if (options.body) options.body = JSON.stringify(options.body); + // Use fetch to make requests const res = await fetch(url, { headers: { - Authorization: `Bot ${process.env.discordToken}`, + Authorization: `Bot ${discordToken}`, 'Content-Type': 'application/json; charset=UTF-8', 'User-Agent': 'DiscordBot (https://github.com/petercort/fbf-event-buddy, 1.0.0)', }, From 810ac022fab400600411b64be19a7469929e62bc Mon Sep 17 00:00:00 2001 From: "GitHub-Actions[bot]" Date: Tue, 12 Nov 2024 03:30:54 +0000 Subject: [PATCH 2/3] Bot: Updating CHANGELOG and README for release based on #11 --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89aa6ab..0c5285a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,35 @@ # Changelog -### Version 0.0.1 +### Version 0.0.4 + +#### bugfix +* PR [#11](https://github.com/petercort/FBF-Event-Buddy/pull/11) - updating another thing + + + +### Version 0.0.3 #### enhancement -* PR [#6](https://github.com/petercort/FBF-Event-Buddy/pull/6) - Update TERMS.md +* PR [#10](https://github.com/petercort/FBF-Event-Buddy/pull/10) - updating things! + + +### Version 0.0.2 + +#### chore +* PR [#9](https://github.com/petercort/FBF-Event-Buddy/pull/9) - Create CONTRIBUTING.md + + + +### Version 0.0.1 + +#### chore +* PR [#8](https://github.com/petercort/FBF-Event-Buddy/pull/8) - Update TERMS.md + + + +### Version 0.0.1 + +#### enhancement +* PR [#6](https://github.com/petercort/FBF-Event-Buddy/pull/6) - Update TERMS.md \ No newline at end of file From a21b084b2814d65ef425504d327f3a79ef48595f Mon Sep 17 00:00:00 2001 From: "GitHub-Actions[bot]" Date: Tue, 12 Nov 2024 03:35:50 +0000 Subject: [PATCH 3/3] Bot: Updating CHANGELOG and README for release based on #11 --- CHANGELOG.md | 12 ++++++------ config/event-buddy-deployment.yaml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0b0de1..0c5285a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,33 +1,33 @@ -# Changelog - +# Changelog + ### Version 0.0.4 #### bugfix * PR [#11](https://github.com/petercort/FBF-Event-Buddy/pull/11) - updating another thing - + ### Version 0.0.3 #### enhancement * PR [#10](https://github.com/petercort/FBF-Event-Buddy/pull/10) - updating things! - + ### Version 0.0.2 #### chore * PR [#9](https://github.com/petercort/FBF-Event-Buddy/pull/9) - Create CONTRIBUTING.md - + ### Version 0.0.1 #### chore * PR [#8](https://github.com/petercort/FBF-Event-Buddy/pull/8) - Update TERMS.md - + ### Version 0.0.1 diff --git a/config/event-buddy-deployment.yaml b/config/event-buddy-deployment.yaml index e65519f..930c11d 100644 --- a/config/event-buddy-deployment.yaml +++ b/config/event-buddy-deployment.yaml @@ -14,7 +14,7 @@ spec: app: event-buddy spec: containers: - - image: ghcr.io/petercort/event-buddy:0.0.3 + - image: ghcr.io/petercort/event-buddy:0.0.4 name: event-buddy ports: - containerPort: 80