From fa5c7f92e671a70f0cb7b0f8e24278aee183eacc Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Wed, 31 Jul 2024 18:07:30 +0100 Subject: [PATCH 1/3] Upgrade @types/uuid to v10 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9126a28..2d47693 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@types/clone-deep": "^4.0.4", "@types/express": "^4.17.20", "@types/jest": "^29.0.0", - "@types/uuid": "^9.0.0", + "@types/uuid": "^10.0.0", "body-parser": "^1.20.2", "canvas": "^2.11.2", "clone-deep": "^4.0.1", diff --git a/yarn.lock b/yarn.lock index 184c1d5..e13db6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1314,10 +1314,10 @@ resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.5.tgz#74fef9ffbaa198eb8b588be029f38b00299caa2c" integrity sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw== -"@types/uuid@^9.0.0": - version "9.0.8" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.8.tgz#7545ba4fc3c003d6c756f651f3bf163d8f0f29ba" - integrity sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA== +"@types/uuid@^10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d" + integrity sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ== "@types/ws@^8.5.10": version "8.5.10" From 89c6dc527ab9f2ad9a0fcf836559a1f07c246b8b Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 2 Aug 2024 18:20:23 +0100 Subject: [PATCH 2/3] Document the google drive sync process (#328) #82 Reviewed-on: https://git.vylpes.xyz/External/card-drop/pulls/328 Reviewed-by: VylpesTester Co-authored-by: Ethan Lane Co-committed-by: Ethan Lane --- docs/google-drive-sync.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docs/google-drive-sync.md diff --git a/docs/google-drive-sync.md b/docs/google-drive-sync.md new file mode 100644 index 0000000..1847f70 --- /dev/null +++ b/docs/google-drive-sync.md @@ -0,0 +1,35 @@ +# Google Drive Sync + +The bot relies on an external sync between the local file system and Google +Drive in order to get newer cards to the bot. This is done using +[Rclone](https://rclone.org/). + +The process for this is done by once the `/gdrivesync` command is executed by +an admin user of the bot, which calls the system shell to run rclone to the +card folder. + +- The admins who can run the command is specifed in `$BOT_ADMINS`, which are +discord user ids separated by commas. +- The card folder is located at `$DATA_DIR/cards`. +- The source requires rclone's remote to be setup as `card-drop-gdrive`. + +The exact command it runs is: `rclone sync card-drop-gdrive: $DATA_DIR/cards`. + +Once it syncs the database will reread all the cards for updates and then load +them into the bot to be given. + +## Safe Mode +Safe mode is a function of the bot which disables the `/drop` command function +and any other functions which rely on the card metadata. Safe mode is activated +upon failure to sync properly. It is disabled once errors are resolved. + +The reason for safe mode is to ensure that the bot stays online for admins to +be able to resync the bot in case there's an error without it crashing. + +## Google Drive +Please see the Rclone documentation on how to setup a remote using Google +Drive. You will need to make an app password for this. + +- scope: `drive.readonly` +- root\_folder\_id: The folder id where the cards are located, this can be found + by looking at the url when viewing the folder in the browser in google drive. From 01f4f9b9f511b0bb1837eeb1e52709d8c2e27042 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Wed, 31 Jul 2024 18:07:30 +0100 Subject: [PATCH 3/3] Upgrade @types/uuid to v10 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9126a28..2d47693 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@types/clone-deep": "^4.0.4", "@types/express": "^4.17.20", "@types/jest": "^29.0.0", - "@types/uuid": "^9.0.0", + "@types/uuid": "^10.0.0", "body-parser": "^1.20.2", "canvas": "^2.11.2", "clone-deep": "^4.0.1", diff --git a/yarn.lock b/yarn.lock index 184c1d5..e13db6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1314,10 +1314,10 @@ resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.5.tgz#74fef9ffbaa198eb8b588be029f38b00299caa2c" integrity sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw== -"@types/uuid@^9.0.0": - version "9.0.8" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.8.tgz#7545ba4fc3c003d6c756f651f3bf163d8f0f29ba" - integrity sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA== +"@types/uuid@^10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d" + integrity sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ== "@types/ws@^8.5.10": version "8.5.10"