Skip to content

Commit

Permalink
Merge pull request #11 from petercort/update-2
Browse files Browse the repository at this point in the history
updating another thing
  • Loading branch information
petercort authored Nov 12, 2024
2 parents 0e9f166 + a21b084 commit 1ffcfa3
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# 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
Expand Down
30 changes: 30 additions & 0 deletions argocd/pod.yaml
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 5 additions & 1 deletion config/event-buddy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ 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
- command:
- tail
- "-f"
- /dev/null
volumeMounts:
- name: azure-secrets-store
mountPath: "/mnt/secrets-store"
Expand Down
4 changes: 3 additions & 1 deletion src/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
@@ -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)',
},
Expand Down

0 comments on commit 1ffcfa3

Please sign in to comment.