From 449efbe288033e8b72ffc5ea31f251dc2f544dd5 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 13 Oct 2024 18:17:05 +0200 Subject: [PATCH 1/3] Updated docker ignore --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index f1de6b4..a00c4a4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,6 +9,7 @@ scripts .dockerignore .env .env.example +.envrc .gitignore .gitlab-ci.yml .node-version From 520928d4aa1093803c94f353d1f4a6a45a169b77 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 13 Oct 2024 20:13:48 +0200 Subject: [PATCH 2/3] Added script to update bot --- .env.example | 3 +++ scripts/updatebot.ts | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 scripts/updatebot.ts diff --git a/.env.example b/.env.example index c31f731..e5e186f 100644 --- a/.env.example +++ b/.env.example @@ -8,3 +8,6 @@ DEVTOKEN= CLIENTID= DEVID= GUILDID= +# watchtower +WATCHTOWERTOKEN= +WATCHTOWERURL= diff --git a/scripts/updatebot.ts b/scripts/updatebot.ts new file mode 100644 index 0000000..d5b51d0 --- /dev/null +++ b/scripts/updatebot.ts @@ -0,0 +1,18 @@ +import axios from "axios" + +const url = process.env.WATCHTOWERURL +const token = process.env.WATCHTOWERTOKEN + +if (!url || !token) { + throw new Error("Missing WATCHTOWERURL or WATCHTOWERTOKEN") +} + +await axios.get(url, { + headers: { + Authorization: `Bearer ${token}` + } +}).then(() => { + console.log("Illegitimate bot updated") +}).catch(err => { + console.error("Error updating bot", err) +}) From e993b133a090628bb08e6404e071c2e42d84e2e1 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 13 Oct 2024 20:17:59 +0200 Subject: [PATCH 3/3] Updated script for bot updates --- package.json | 1 + scripts/{updatebot.ts => update-bot.ts} | 0 2 files changed, 1 insertion(+) rename scripts/{updatebot.ts => update-bot.ts} (100%) diff --git a/package.json b/package.json index 26dc9d8..65ba03b 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "db:studio": "drizzle-kit studio", "db:start": "docker compose -f dev-db.yml up -d", "db:stop": "docker compose -f dev-db.yml down", + "bot:update": "tsx scripts/update-bot.ts", "push:prod": "tsx scripts/deploy-commands.ts", "push:dev": "tsx scripts/dev-deploy.ts", "delete:dev": "tsx scripts/delete-commands.ts" diff --git a/scripts/updatebot.ts b/scripts/update-bot.ts similarity index 100% rename from scripts/updatebot.ts rename to scripts/update-bot.ts