From 9cc88cfcb85d53757c0b8ca8b0acd682ea15aee3 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 1 Jul 2023 13:22:04 +0000 Subject: [PATCH 1/3] feat: use emoji icons from Hangar --- backend/src/plugins/Cases/caseIcons.ts | 20 +++++++++++--------- backend/src/utils.ts | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/backend/src/plugins/Cases/caseIcons.ts b/backend/src/plugins/Cases/caseIcons.ts index 3c6858043..3d18cd128 100644 --- a/backend/src/plugins/Cases/caseIcons.ts +++ b/backend/src/plugins/Cases/caseIcons.ts @@ -1,13 +1,15 @@ import { CaseTypes } from "../../data/CaseTypes"; +// These emoji icons are hosted on the Hangar server +// If you'd like your self-hosted instance to use these icons, check #add-your-bot on that server export const caseIcons: Record = { - [CaseTypes.Ban]: "<:case_ban:742540201443721317>", - [CaseTypes.Unban]: "<:case_unban:742540201670475846>", - [CaseTypes.Note]: "<:case_note:742540201368485950>", - [CaseTypes.Warn]: "<:case_warn:742540201624338454>", - [CaseTypes.Kick]: "<:case_kick:742540201661825165>", - [CaseTypes.Mute]: "<:case_mute:742540201817145364>", - [CaseTypes.Unmute]: "<:case_unmute:742540201489858643>", - [CaseTypes.Deleted]: "<:case_deleted:742540201473343529>", - [CaseTypes.Softban]: "<:case_softban:742540201766813747>", + [CaseTypes.Ban]: "<:case_ban:906897178176393246>", + [CaseTypes.Unban]: "<:case_unban:906897177824067665>", + [CaseTypes.Note]: "<:case_note:906897177832476743>", + [CaseTypes.Warn]: "<:case_warn:906897177840844832>", + [CaseTypes.Kick]: "<:case_kick:906897178310639646>", + [CaseTypes.Mute]: "<:case_mute:906897178147057664>", + [CaseTypes.Unmute]: "<:case_unmute:906897177819881523>", + [CaseTypes.Deleted]: "<:case_deleted:906897178209968148>", + [CaseTypes.Softban]: "<:case_softban:906897177828278274>", }; diff --git a/backend/src/utils.ts b/backend/src/utils.ts index 566e07302..1bb4d6ce6 100644 --- a/backend/src/utils.ts +++ b/backend/src/utils.ts @@ -553,7 +553,7 @@ export function convertMSToDelayString(ms: number): string { return result; } -export function successMessage(str: string, emoji = "<:zep_check:650361014180904971>") { +export function successMessage(str: string, emoji = "<:zep_check:906897402101891093>") { return emoji ? `${emoji} ${str}` : str; } From ee3ef7c77f0205715a7910aa2e35462082658750 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 1 Jul 2023 16:14:15 +0000 Subject: [PATCH 2/3] fix: broken prod migrations --- backend/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/package.json b/backend/package.json index ba826ce2e..2ff53482a 100644 --- a/backend/package.json +++ b/backend/package.json @@ -19,11 +19,11 @@ "watch-api": "cross-env NODE_ENV=development tsc-watch --onSuccess \"npm run start-api-dev\"", "typeorm": "node -r ./register-tsconfig-paths.js ./node_modules/typeorm/cli.js", "migrate": "npm run typeorm -- migration:run -d dist/backend/src/data/dataSource.js", - "migrate-prod": "npm run migrate", - "migrate-dev": "npm run build && npm run migrate", + "migrate-prod": "cross-env NODE_ENV=production npm run migrate", + "migrate-dev": "cross-env NODE_ENV=development npm run build && npm run migrate", "migrate-rollback": "npm run typeorm -- migration:revert -d dist/backend/src/data/dataSource.js", - "migrate-rollback-prod": "npm run migrate", - "migrate-rollback-dev": "npm run build && npm run migrate", + "migrate-rollback-prod": "cross-env NODE_ENV=production npm run migrate", + "migrate-rollback-dev": "cross-env NODE_ENV=development npm run build && npm run migrate", "test": "npm run build && npm run run-tests", "run-tests": "ava", "test-watch": "tsc-watch --onSuccess \"npx ava\"" From be40bbae9cc4fa1551426638ec2dd1d4071be74a Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 1 Jul 2023 17:09:23 +0000 Subject: [PATCH 3/3] fix: api key verification/dashboard login --- backend/src/api/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/api/auth.ts b/backend/src/api/auth.ts index f44863568..85e42ecb4 100644 --- a/backend/src/api/auth.ts +++ b/backend/src/api/auth.ts @@ -149,7 +149,7 @@ export function initAuth(app: express.Express) { export function apiTokenAuthHandlers() { return [ - passport.authenticate("api-token", { failWithError: true }), + passport.authenticate("api-token", { failWithError: true, session: false }), // eslint-disable-next-line @typescript-eslint/no-unused-vars (err, req: Request, res: Response, next) => { return res.status(401).json({ error: err.message });