From 19ed9cbfa040a2358d7cb8c9ca3d45112a61530d Mon Sep 17 00:00:00 2001 From: Matthew Lopez <73856503+MatthewL246@users.noreply.github.com> Date: Sun, 28 Apr 2024 12:54:06 -0400 Subject: [PATCH] Fix account server patches --- ...pass-console-status-verification-for-cemu.patch | 6 +++--- .../account/custom-license-agreement-text.patch | 14 +++++++------- ...isable-hardcoded-3ds-friends-access-level.patch | 12 ++++++------ ...tastore-signature-secret-from-environment.patch | 10 +++++----- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/patches/account/bypass-console-status-verification-for-cemu.patch b/patches/account/bypass-console-status-verification-for-cemu.patch index fe42c17..d7c5dcb 100644 --- a/patches/account/bypass-console-status-verification-for-cemu.patch +++ b/patches/account/bypass-console-status-verification-for-cemu.patch @@ -1,9 +1,9 @@ diff --git i/src/middleware/console-status-verification.ts w/src/middleware/console-status-verification.ts -index cb1b7d3..3e4fa05 100644 +index a26d9b6..ad3783b 100644 --- i/src/middleware/console-status-verification.ts +++ w/src/middleware/console-status-verification.ts -@@ -6,6 +6,18 @@ import { getValueFromHeaders } from '@/util'; - import { HydratedDeviceDocument } from '@/types/mongoose/device'; +@@ -5,6 +5,18 @@ import { Device } from '@/models/device'; + import { getValueFromHeaders } from '@/util'; async function consoleStatusVerificationMiddleware(request: express.Request, response: express.Response, next: express.NextFunction): Promise { + if ( diff --git a/patches/account/custom-license-agreement-text.patch b/patches/account/custom-license-agreement-text.patch index 2bdcb43..5803e7f 100644 --- a/patches/account/custom-license-agreement-text.patch +++ b/patches/account/custom-license-agreement-text.patch @@ -1,8 +1,8 @@ -diff --git i/src/services/nnid/routes/content.ts w/src/services/nnid/routes/content.ts -index b4d1ac3..9a8b374 100644 ---- i/src/services/nnid/routes/content.ts -+++ w/src/services/nnid/routes/content.ts -@@ -39,14 +39,14 @@ router.get('/agreements/:type/:region/:version', (request: express.Request, resp +diff --git i/src/services/nnas/routes/content.ts w/src/services/nnas/routes/content.ts +index a60cc30..80b0224 100644 +--- i/src/services/nnas/routes/content.ts ++++ w/src/services/nnas/routes/content.ts +@@ -37,14 +37,14 @@ router.get('/agreements/:type/:region/:version', (request: express.Request, resp }, main_text: { '@index': '1', @@ -19,7 +19,7 @@ index b4d1ac3..9a8b374 100644 }, }, type: 'NINTENDO-NETWORK-EULA', -@@ -72,14 +72,14 @@ router.get('/agreements/:type/:region/:version', (request: express.Request, resp +@@ -70,14 +70,14 @@ router.get('/agreements/:type/:region/:version', (request: express.Request, resp }, main_text: { '@index': '1', @@ -36,7 +36,7 @@ index b4d1ac3..9a8b374 100644 }, }, type: 'NINTENDO-NETWORK-EULA', -@@ -105,14 +105,14 @@ router.get('/agreements/:type/:region/:version', (request: express.Request, resp +@@ -103,14 +103,14 @@ router.get('/agreements/:type/:region/:version', (request: express.Request, resp }, main_text: { '@index': '1', diff --git a/patches/account/disable-hardcoded-3ds-friends-access-level.patch b/patches/account/disable-hardcoded-3ds-friends-access-level.patch index c8f0d91..bcd2200 100644 --- a/patches/account/disable-hardcoded-3ds-friends-access-level.patch +++ b/patches/account/disable-hardcoded-3ds-friends-access-level.patch @@ -1,19 +1,19 @@ diff --git i/src/services/nasc/routes/ac.ts w/src/services/nasc/routes/ac.ts -index e556434..07bbba6 100644 +index 1a8c616..5abadfc 100644 --- i/src/services/nasc/routes/ac.ts +++ w/src/services/nasc/routes/ac.ts -@@ -25,13 +25,7 @@ router.post('/', async (request: express.Request, response: express.Response): P +@@ -23,13 +23,7 @@ router.post('/', async (request: express.Request, response: express.Response): P return; } -- // TODO: REMOVE AFTER PUBLIC LAUNCH +- // TODO - REMOVE AFTER PUBLIC LAUNCH - // * LET EVERYONE IN THE `test` FRIENDS SERVER - // * THAT WAY EVERYONE CAN GET AN ASSIGNED PID -- let serverAccessLevel: string = 'test'; +- let serverAccessLevel = 'test'; - if (titleID !== '0004013000003202') { - serverAccessLevel = nexAccount.server_access_level; - } -+ const serverAccessLevel: string = nexAccount.server_access_level; ++ const serverAccessLevel = nexAccount.server_access_level; - const server: HydratedServerDocument | null = await getServerByTitleID(titleID, serverAccessLevel); + const server = await getServerByTitleID(titleID, serverAccessLevel); diff --git a/patches/account/load-datastore-signature-secret-from-environment.patch b/patches/account/load-datastore-signature-secret-from-environment.patch index fa3d77e..37e79ef 100644 --- a/patches/account/load-datastore-signature-secret-from-environment.patch +++ b/patches/account/load-datastore-signature-secret-from-environment.patch @@ -1,5 +1,5 @@ diff --git i/src/services/datastore/routes/upload.ts w/src/services/datastore/routes/upload.ts -index 3ceccda..12f853b 100644 +index 6e3585e..c7e6b32 100644 --- i/src/services/datastore/routes/upload.ts +++ w/src/services/datastore/routes/upload.ts @@ -1,4 +1,3 @@ @@ -9,10 +9,10 @@ index 3ceccda..12f853b 100644 import Dicer from 'dicer'; @@ -6,7 +5,7 @@ import { uploadCDNAsset } from '@/util'; - const router: express.Router = express.Router(); + const router = express.Router(); --const signatureSecret: Buffer = fs.readFileSync(`${__dirname}/../../../../certs/nex/datastore/secret.key`); -+const signatureSecret: Buffer = Buffer.from(process.env.PN_ACT_CONFIG_DATASTORE_SIGNATURE_SECRET || '', 'hex'); +-const signatureSecret = fs.readFileSync(`${__dirname}/../../../../certs/nex/datastore/secret.key`); ++const signatureSecret = Buffer.from(process.env.PN_ACT_CONFIG_DATASTORE_SIGNATURE_SECRET || '', 'hex'); function multipartParser(request: express.Request, response: express.Response, next: express.NextFunction): void { - const RE_BOUNDARY: RegExp = /^multipart\/.+?(?:; boundary=(?:(?:"(.+)")|(?:([^\s]+))))$/i; + const RE_BOUNDARY = /^multipart\/.+?(?:; boundary=(?:(?:"(.+)")|(?:([^\s]+))))$/i;