From 5df92554c018abb203b6d0080bddd6ece349a799 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 19:49:11 +0000 Subject: [PATCH 01/13] Remove resolution for undici (#126) # Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - Remove resolution for undici, as it is no longer causing a vulnerability #125 ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) # How Has This Been Tested? Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration. # Checklist - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that provde my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules Reviewed-on: https://gitea.vylpes.xyz/External/card-drop/pulls/126 Reviewed-by: VylpesTester Co-authored-by: Ethan Lane Co-committed-by: Ethan Lane --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 2e1904c..e3bc5f4 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "typeorm": "0.3.17" }, "resolutions": { - "**/undici": "^5.26.2" }, "devDependencies": { "@types/node": "^20.0.0", From 1ee7bb8630bbdecd482ef39bd955bd4669790300 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 19:51:59 +0000 Subject: [PATCH 02/13] Update drone script to use rsync (#121) # Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - Update drone pipelines to use resync > **NOTE:** This requires a new repository secret - `ssh_key` > **NOTE:** This requires moving the cards directory into the new appdata folder #56 ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) # How Has This Been Tested? Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration. - This can only be tested once merged, so no testing has been done, but a check has been done by me as a review # Checklist - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that provde my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules Reviewed-on: https://gitea.vylpes.xyz/External/card-drop/pulls/121 Reviewed-by: VylpesTester Co-authored-by: Ethan Lane Co-committed-by: Ethan Lane --- .dev.env | 2 + .drone.yml | 66 +++++++++++++++++++-------- .prod.env | 2 + .stage.env | 2 + src/Functions/CardMetadataFunction.ts | 2 +- src/bot.ts | 3 +- src/buttonEvents/Reroll.ts | 2 +- src/commands/drop.ts | 2 +- src/commands/gdrivesync.ts | 2 +- 9 files changed, 58 insertions(+), 25 deletions(-) diff --git a/.dev.env b/.dev.env index 14ad89c..46544de 100644 --- a/.dev.env +++ b/.dev.env @@ -16,6 +16,8 @@ BOT_ENV=4 ABOUT_FUNDING= ABOUT_REPO= +DATA_DIR= + DB_HOST=127.0.0.1 DB_PORT=3301 DB_NAME=carddrop diff --git a/.drone.yml b/.drone.yml index 3756b47..d8ca0e7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,16 +4,31 @@ kind: pipeline name: deployment steps: -- name: deploy - image: appleboy/drone-ssh +- name: build + image: node + commands: + - npm ci + - npm run build +- name: test + image: node + commands: + - npm test +- name: deploy to prod + image: drillster/drone-rsync settings: - host: 192.168.68.120 - username: vylpes - password: - from_secret: ssh_password - port: 22 + hosts: + - "minisforum.local" + user: vylpes + key: + from_secret: ssh_key + source: . + target: ~/apps/card-drop/card-drop_prod + recursive: true script: - - sh /home/vylpes/scripts/card-drop/deploy_prod.sh + - cd ~/apps/card-drop/card-drop_prod + - docker compose --file docker-compose.prod.yml up -d + - sleep 10 + - pm2 restart card-drop_prod || pm2 start --name card-drop_prod dist/bot.js trigger: event: @@ -25,16 +40,31 @@ kind: pipeline name: staging steps: -- name: stage - image: appleboy/drone-ssh +- name: build + image: node + commands: + - npm ci + - npm run build +- name: test + image: node + commands: + - npm test +- name: deploy to stage + image: drillster/drone-rsync settings: - host: 192.168.68.120 - username: vylpes - password: - from_secret: ssh_password - port: 22 + hosts: + - "minisforum.local" + user: vylpes + key: + from_secret: ssh_key + source: . + target: ~/apps/card-drop/card-drop_stage + recursive: true script: - - sh /home/vylpes/scripts/card-drop/deploy_stage.sh + - cd ~/apps/card-drop/card-drop_stage + - docker compose --file docker-compose.stage.yml up -d + - sleep 10 + - pm2 restart card-drop_stage || pm2 start --name card-drop_stage dist/bot.js trigger: branch: @@ -53,17 +83,13 @@ steps: commands: - npm ci - npm run build - - name: test image: node commands: - - npm ci - npm test trigger: branch: - - main - - develop - hotfix/* - feature/* - renovate/* diff --git a/.prod.env b/.prod.env index df28009..d252f1f 100644 --- a/.prod.env +++ b/.prod.env @@ -16,6 +16,8 @@ BOT_ENV=1 ABOUT_FUNDING= ABOUT_REPO= +DATA_DIR=/home/vylpes/appdata/card-drop/card-drop_prod + DB_HOST=127.0.0.1 DB_PORT=3321 DB_NAME=carddrop diff --git a/.stage.env b/.stage.env index 79dcc48..3ffed38 100644 --- a/.stage.env +++ b/.stage.env @@ -16,6 +16,8 @@ BOT_ENV=2 ABOUT_FUNDING= ABOUT_REPO= +DATA_DIR=/home/vylpes/appdata/card-drop/card-drop_stage + DB_HOST=127.0.0.1 DB_PORT=3311 DB_NAME=carddrop diff --git a/src/Functions/CardMetadataFunction.ts b/src/Functions/CardMetadataFunction.ts index 1d52a27..eefe2a7 100644 --- a/src/Functions/CardMetadataFunction.ts +++ b/src/Functions/CardMetadataFunction.ts @@ -26,7 +26,7 @@ export default class CardMetadataFunction { private static async FindMetadataJSONs(): Promise { const res: SeriesMetadata[] = []; - const seriesJSONs = await glob(path.join(process.cwd(), 'cards', '/**/*.json')); + const seriesJSONs = await glob(path.join(process.env.DATA_DIR!, 'cards', '/**/*.json')); for (let jsonPath of seriesJSONs) { console.log(`Reading file ${jsonPath}`); diff --git a/src/bot.ts b/src/bot.ts index 8bddbf4..d880244 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -14,6 +14,7 @@ const requiredConfigs: string[] = [ "BOT_OWNERID", "BOT_CLIENTID", "BOT_ENV", + "DATA_DIR", "DB_HOST", "DB_PORT", "DB_AUTH_USER", @@ -39,7 +40,7 @@ Registry.RegisterCommands(); Registry.RegisterEvents(); Registry.RegisterButtonEvents(); -if (!existsSync(`${process.cwd()}/cards`) && process.env.GDRIVESYNC_AUTO && process.env.GDRIVESYNC_AUTO == 'true') { +if (!existsSync(`${process.env.DATA_DIR}/cards`) && process.env.GDRIVESYNC_AUTO && process.env.GDRIVESYNC_AUTO == 'true') { console.log("Card directory not found, syncing..."); CoreClient.AllowDrops = false; diff --git a/src/buttonEvents/Reroll.ts b/src/buttonEvents/Reroll.ts index 3b86e72..7241db7 100644 --- a/src/buttonEvents/Reroll.ts +++ b/src/buttonEvents/Reroll.ts @@ -31,7 +31,7 @@ export default class Reroll extends ButtonEvent { let image: Buffer; const imageFileName = randomCard.card.path.split("/").pop()!; - image = readFileSync(path.join(process.cwd(), 'cards', randomCard.card.path)); + image = readFileSync(path.join(process.env.DATA_DIR!, 'cards', randomCard.card.path)); await interaction.deferReply(); diff --git a/src/commands/drop.ts b/src/commands/drop.ts index 2ecd936..fe08241 100644 --- a/src/commands/drop.ts +++ b/src/commands/drop.ts @@ -39,7 +39,7 @@ export default class Drop extends Command { let image: Buffer; const imageFileName = randomCard.card.path.split("/").pop()!; - image = readFileSync(path.join(process.cwd(), 'cards', randomCard.card.path)); + image = readFileSync(path.join(process.env.DATA_DIR!, 'cards', randomCard.card.path)); await interaction.deferReply(); diff --git a/src/commands/gdrivesync.ts b/src/commands/gdrivesync.ts index 8b60722..169e63c 100644 --- a/src/commands/gdrivesync.ts +++ b/src/commands/gdrivesync.ts @@ -29,7 +29,7 @@ export default class Gdrivesync extends Command { CoreClient.AllowDrops = false; - exec(`rclone sync card-drop-gdrive: ${process.cwd()}/cards`, async (error: ExecException | null) => { + exec(`rclone sync card-drop-gdrive: ${process.env.DATA_DIR}/cards`, async (error: ExecException | null) => { if (error) { await interaction.editReply(`Error while running sync command. Safe Mode has been activated. Code: ${error.code}`); await Config.SetValue('safemode', 'true'); From 736053fb8b9aaea52df79a762a7956587070a4ae Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 20:24:10 +0000 Subject: [PATCH 03/13] Use prescript --- .drone.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.drone.yml b/.drone.yml index d8ca0e7..102a7c0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -51,6 +51,7 @@ steps: - npm test - name: deploy to stage image: drillster/drone-rsync + secrets: ssh_key settings: hosts: - "minisforum.local" @@ -60,6 +61,8 @@ steps: source: . target: ~/apps/card-drop/card-drop_stage recursive: true + prescript: + - echo "$SSH_KEY" | tr -d '\r' | ssh-add - script: - cd ~/apps/card-drop/card-drop_stage - docker compose --file docker-compose.stage.yml up -d From bc494970a01b422cb29409d4882b8c381beb890d Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 20:25:15 +0000 Subject: [PATCH 04/13] Use ip address --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 102a7c0..b5fb01d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -54,7 +54,7 @@ steps: secrets: ssh_key settings: hosts: - - "minisforum.local" + - 192.168.68.120 user: vylpes key: from_secret: ssh_key From 70457ac8506e9368edb5b4bc5ee857eca07d2de2 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 20:27:38 +0000 Subject: [PATCH 05/13] Use on deploy script too --- .drone.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index b5fb01d..2652a03 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,15 +15,19 @@ steps: - npm test - name: deploy to prod image: drillster/drone-rsync + secrets: ssh_key settings: hosts: - - "minisforum.local" + - 192.168.68.120 user: vylpes key: from_secret: ssh_key source: . target: ~/apps/card-drop/card-drop_prod recursive: true + prescript: + - eval `ssh-agent -s` + - echo "$SSH_KEY" | tr -d '\r' | ssh-add - script: - cd ~/apps/card-drop/card-drop_prod - docker compose --file docker-compose.prod.yml up -d @@ -62,6 +66,7 @@ steps: target: ~/apps/card-drop/card-drop_stage recursive: true prescript: + - eval `ssh-agent -s` - echo "$SSH_KEY" | tr -d '\r' | ssh-add - script: - cd ~/apps/card-drop/card-drop_stage From c5d2edf0112e3e980766519e548e6702a5963f2c Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 20:34:18 +0000 Subject: [PATCH 06/13] Use alpine --- .drone.yml | 54 ++++++++++++++++-------------------------------------- 1 file changed, 16 insertions(+), 38 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2652a03..8ebec2f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,25 +14,14 @@ steps: commands: - npm test - name: deploy to prod - image: drillster/drone-rsync - secrets: ssh_key - settings: - hosts: - - 192.168.68.120 - user: vylpes - key: - from_secret: ssh_key - source: . - target: ~/apps/card-drop/card-drop_prod - recursive: true - prescript: - - eval `ssh-agent -s` - - echo "$SSH_KEY" | tr -d '\r' | ssh-add - - script: - - cd ~/apps/card-drop/card-drop_prod - - docker compose --file docker-compose.prod.yml up -d - - sleep 10 - - pm2 restart card-drop_prod || pm2 start --name card-drop_prod dist/bot.js + image: alpine + secrets: [ ssh_key ] + commands: + - apk add rsync openssh-client + - eval `ssh-agent -s` + - echo "$SSH_KEY" | tr -d '\r' | ssh-add - + - rsync -e "ssh -o StrictHostKeyChecking=no" -r ./* vylpes@192.168.68.120:/home/vylpes/apps/card-drop/card-drop_prod + - ssh vylpes@192.168.68.120 cd ~/apps/card-drop/card-drop_prod && docker compose --file docker-compose.prod.yml up -d && sleep 10 && pm2 start --name card-drop_prod dist/bot.js trigger: event: @@ -54,25 +43,14 @@ steps: commands: - npm test - name: deploy to stage - image: drillster/drone-rsync - secrets: ssh_key - settings: - hosts: - - 192.168.68.120 - user: vylpes - key: - from_secret: ssh_key - source: . - target: ~/apps/card-drop/card-drop_stage - recursive: true - prescript: - - eval `ssh-agent -s` - - echo "$SSH_KEY" | tr -d '\r' | ssh-add - - script: - - cd ~/apps/card-drop/card-drop_stage - - docker compose --file docker-compose.stage.yml up -d - - sleep 10 - - pm2 restart card-drop_stage || pm2 start --name card-drop_stage dist/bot.js + image: alpine + secrets: [ ssh_key ] + commands: + - apk add rsync openssh-client + - eval `ssh-agent -s` + - echo "$SSH_KEY" | tr -d '\r' | ssh-add - + - rsync -e "ssh -o StrictHostKeyChecking=no" -r ./* vylpes@192.168.68.120:/home/vylpes/apps/card-drop/card-drop_stage + - ssh vylpes@192.168.68.120 cd ~/apps/card-drop/card-drop_stage && docker compose --file docker-compose.stage.yml up -d && sleep 10 && pm2 start --name card-drop_stage dist/bot.js trigger: branch: From 526b42bb4a8d4da2f21b34d0d3881a12242808b6 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 20:40:06 +0000 Subject: [PATCH 07/13] Undo commit --- .drone.yml | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8ebec2f..d6697be 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,14 +14,25 @@ steps: commands: - npm test - name: deploy to prod - image: alpine + image: drillster/drone-rsync secrets: [ ssh_key ] - commands: - - apk add rsync openssh-client - - eval `ssh-agent -s` - - echo "$SSH_KEY" | tr -d '\r' | ssh-add - - - rsync -e "ssh -o StrictHostKeyChecking=no" -r ./* vylpes@192.168.68.120:/home/vylpes/apps/card-drop/card-drop_prod - - ssh vylpes@192.168.68.120 cd ~/apps/card-drop/card-drop_prod && docker compose --file docker-compose.prod.yml up -d && sleep 10 && pm2 start --name card-drop_prod dist/bot.js + settings: + hosts: + - 192.168.68.120 + user: vylpes + key: + from_secret: ssh_key + source: . + target: ~/apps/card-drop/card-drop_prod + recursive: true + prescript: + - eval `ssh-agent -s` + - echo "$SSH_KEY" | tr -d '\r' | ssh-add - + script: + - cd ~/apps/card-drop/card-drop_prod + - docker compose --file docker-compose.prod.yml up -d + - sleep 10 + - pm2 restart card-drop_prod || pm2 start --name card-drop_prod dist/bot.js trigger: event: @@ -43,14 +54,25 @@ steps: commands: - npm test - name: deploy to stage - image: alpine + image: drillster/drone-rsync secrets: [ ssh_key ] - commands: - - apk add rsync openssh-client - - eval `ssh-agent -s` - - echo "$SSH_KEY" | tr -d '\r' | ssh-add - - - rsync -e "ssh -o StrictHostKeyChecking=no" -r ./* vylpes@192.168.68.120:/home/vylpes/apps/card-drop/card-drop_stage - - ssh vylpes@192.168.68.120 cd ~/apps/card-drop/card-drop_stage && docker compose --file docker-compose.stage.yml up -d && sleep 10 && pm2 start --name card-drop_stage dist/bot.js + settings: + hosts: + - 192.168.68.120 + user: vylpes + key: + from_secret: ssh_key + source: . + target: ~/apps/card-drop/card-drop_stage + recursive: true + prescript: + - eval `ssh-agent -s` + - echo "$SSH_KEY" | tr -d '\r' | ssh-add - + script: + - cd ~/apps/card-drop/card-drop_stage + - docker compose --file docker-compose.stage.yml up -d + - sleep 10 + - pm2 restart card-drop_stage || pm2 start --name card-drop_stage dist/bot.js trigger: branch: From ffaf5336086fad4bdbf433b864e89a2c8aa77614 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 20:54:53 +0000 Subject: [PATCH 08/13] Redoo --- .drone.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index d6697be..9c604b3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,9 +25,6 @@ steps: source: . target: ~/apps/card-drop/card-drop_prod recursive: true - prescript: - - eval `ssh-agent -s` - - echo "$SSH_KEY" | tr -d '\r' | ssh-add - script: - cd ~/apps/card-drop/card-drop_prod - docker compose --file docker-compose.prod.yml up -d @@ -65,9 +62,6 @@ steps: source: . target: ~/apps/card-drop/card-drop_stage recursive: true - prescript: - - eval `ssh-agent -s` - - echo "$SSH_KEY" | tr -d '\r' | ssh-add - script: - cd ~/apps/card-drop/card-drop_stage - docker compose --file docker-compose.stage.yml up -d From 99f23cfb1cfaf9d5d327ae67ee1e449cc492d660 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 20:56:14 +0000 Subject: [PATCH 09/13] Add source --- .drone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.yml b/.drone.yml index 9c604b3..fe66331 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,6 +26,7 @@ steps: target: ~/apps/card-drop/card-drop_prod recursive: true script: + - source .bashrc - cd ~/apps/card-drop/card-drop_prod - docker compose --file docker-compose.prod.yml up -d - sleep 10 @@ -63,6 +64,7 @@ steps: target: ~/apps/card-drop/card-drop_stage recursive: true script: + - source .bashrc - cd ~/apps/card-drop/card-drop_stage - docker compose --file docker-compose.stage.yml up -d - sleep 10 From dd86ecd5a4d24b5e3c1921062df3d347bd15d498 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 21:00:44 +0000 Subject: [PATCH 10/13] Use exports in script --- .drone.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index fe66331..91d3643 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,7 +15,7 @@ steps: - npm test - name: deploy to prod image: drillster/drone-rsync - secrets: [ ssh_key ] + secrets: [ ssh_key, bot_token_prod ] settings: hosts: - 192.168.68.120 @@ -26,10 +26,13 @@ steps: target: ~/apps/card-drop/card-drop_prod recursive: true script: - - source .bashrc + - export PATH="$HOME/.yarn/bin:$PATH" + - export PATH="$HOME/.nodeuse/bin:$PATH" + - export BOT_TOKEN="$BOT_TOKEN_PROD" - cd ~/apps/card-drop/card-drop_prod - docker compose --file docker-compose.prod.yml up -d - sleep 10 + - cp .prod.env .env - pm2 restart card-drop_prod || pm2 start --name card-drop_prod dist/bot.js trigger: @@ -53,7 +56,7 @@ steps: - npm test - name: deploy to stage image: drillster/drone-rsync - secrets: [ ssh_key ] + secrets: [ ssh_key, bot_token_stage ] settings: hosts: - 192.168.68.120 @@ -64,10 +67,13 @@ steps: target: ~/apps/card-drop/card-drop_stage recursive: true script: - - source .bashrc + - export PATH="$HOME/.yarn/bin:$PATH" + - export PATH="$HOME/.nodeuse/bin:$PATH" + - export BOT_TOKEN="$BOT_TOKEN_STAGE" - cd ~/apps/card-drop/card-drop_stage - docker compose --file docker-compose.stage.yml up -d - sleep 10 + - cp .stage.env .env - pm2 restart card-drop_stage || pm2 start --name card-drop_stage dist/bot.js trigger: From e05059cb9b8ce45696f158654db4e417f499d37a Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 21:03:15 +0000 Subject: [PATCH 11/13] Add to renovate config to add label on PRs (#128) # Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - Update the renovate config so that the bot will add the `type/dependencies` label to the PRs #55 ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) # How Has This Been Tested? Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration. # Checklist - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that provde my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules Reviewed-on: https://gitea.vylpes.xyz/External/card-drop/pulls/128 Reviewed-by: VylpesTester Co-authored-by: Ethan Lane Co-committed-by: Ethan Lane --- renovate.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index e36bf04..7fa351c 100644 --- a/renovate.json +++ b/renovate.json @@ -1,4 +1,5 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "baseBranches": ["develop"] + "baseBranches": ["develop"], + "labels": ["type/dependencies"] } From fb874be76af6a91751fe12d44b8ae1107bb1ed3a Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 29 Dec 2023 22:12:04 +0000 Subject: [PATCH 12/13] Fix dropnumber and droprarity commands --- src/commands/stage/dropnumber.ts | 2 +- src/commands/stage/droprarity.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/stage/dropnumber.ts b/src/commands/stage/dropnumber.ts index a7de021..ddb53b1 100644 --- a/src/commands/stage/dropnumber.ts +++ b/src/commands/stage/dropnumber.ts @@ -47,7 +47,7 @@ export default class Dropnumber extends Command { const imageFileName = card.path.split("/").pop()!; try { - image = readFileSync(path.join(process.cwd(), 'cards', card.path)); + image = readFileSync(path.join(process.env.DATA_DIR!, 'cards', card.path)); } catch { await interaction.reply(`Unable to fetch image for card ${card.id}`); return; diff --git a/src/commands/stage/droprarity.ts b/src/commands/stage/droprarity.ts index efe431f..b3e3bb7 100644 --- a/src/commands/stage/droprarity.ts +++ b/src/commands/stage/droprarity.ts @@ -50,7 +50,7 @@ export default class Droprarity extends Command { const imageFileName = card.card.path.split("/").pop()!; try { - image = readFileSync(path.join(process.cwd(), 'cards', card.card.path)); + image = readFileSync(path.join(process.env.DATA_DIR!, 'cards', card.card.path)); } catch { await interaction.reply(`Unable to fetch image for card ${card.card.id}`); return; From 84749c338142977d04e5cdfd56cde79de6de8348 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 1 Jan 2024 16:09:49 +0000 Subject: [PATCH 13/13] Update dependency @types/node to v20.10.6 (#132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped)) | devDependencies | patch | [`20.10.5` -> `20.10.6`](https://renovatebot.com/diffs/npm/@types%2fnode/20.10.5/20.10.6) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://gitea.vylpes.xyz/External/card-drop/pulls/132 Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1e3658b..c56c9e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1660,9 +1660,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.10.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", - "integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==", + "version": "20.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", + "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", "dependencies": { "undici-types": "~5.26.4" }