From d58875478252a174cf0afb0e4247f81f69c975c5 Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Tue, 6 Aug 2024 09:38:43 +0500 Subject: [PATCH 01/14] Add script to generate Apple SSO client Secret --- scripts/get-apple-sso-client-secret.js | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 scripts/get-apple-sso-client-secret.js diff --git a/scripts/get-apple-sso-client-secret.js b/scripts/get-apple-sso-client-secret.js new file mode 100644 index 0000000000..ad1d043576 --- /dev/null +++ b/scripts/get-apple-sso-client-secret.js @@ -0,0 +1,50 @@ +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ + + +var jwt = require('jsonwebtoken'); + +const getAppleClientSecret = () => { + const privateKey = fs.readFileSync('Path to Apple SSO Secret Key File.p8'); + const keyId = "XXXXXXXXXX"; // Key ID of the Secret Key generated in Apple Developer Account. + const teamId = "XXXXXXXXXX"; // Team ID of the Apple Developer Account. It can be found in the app ID on the Apple Developer Account. + const clientId = "XXXXXXXXXX"; // The client ID of the service ID created in the Apple Developer Account. + + const headers = { + kid: keyId, + typ: "JWT", + } + const claims = { + 'iss': teamId, + 'aud': 'https://appleid.apple.com', + 'sub': clientId, + } + token = jwt.sign(claims, privateKey, { + algorithm: 'ES256', + header: headers, + expiresIn: '180d' // The token will expire in 180 days. The token can be set to expire in a shorter time but not more than 6 months. + }); + return token +} \ No newline at end of file From 491cae09f87a1e3f4c01f961feae1b528bc5fd3d Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Tue, 6 Aug 2024 11:30:10 +0500 Subject: [PATCH 02/14] Update code to generate Apple SSO Client Secret --- package.json | 1 + scripts/generate-apple-client-secret.ts | 61 +++++++++++++++++++++++++ scripts/get-apple-sso-client-secret.js | 50 -------------------- 3 files changed, 62 insertions(+), 50 deletions(-) create mode 100644 scripts/generate-apple-client-secret.ts delete mode 100644 scripts/get-apple-sso-client-secret.js diff --git a/package.json b/package.json index 8cc0894fb1..be9a81cd67 100755 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "lint": "prettier --check \"packages/**/*.{ts,tsx}\"", "local": "npm run dev-docker && cross-env VITE_LOCAL_BUILD=true LOCAL=true concurrently -n agones,server,worldserver,mediaserver,client npm:dev-agones-silent \"cd packages/server && npm run start\" \"cd packages/instanceserver && npm run start\" \"cd packages/instanceserver && npm run start-channel\" \"cd packages/client && npm run local\"", "make-user-admin": "cross-env ts-node --swc scripts/make-user-admin.ts", + "create-apple-sso-secret": "cross-env ts-node --swc scripts/generate-apple-client-secret.ts", "migrate": "cd packages/server-core && npm run migrate", "migrate:rollback": "cd packages/server-core && npm run migrate:rollback", "migrate:unlock": "cd packages/server-core && npm run migrate:unlock", diff --git a/scripts/generate-apple-client-secret.ts b/scripts/generate-apple-client-secret.ts new file mode 100644 index 0000000000..dd7694f743 --- /dev/null +++ b/scripts/generate-apple-client-secret.ts @@ -0,0 +1,61 @@ +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ + +import logger from '@etherealengine/server-core/src/ServerLogger' +import cli from 'cli' + +var jwt = require('jsonwebtoken') +const fs = require('fs') +cli.enable('status') + +cli.main(async () => { + try { + const privateKey = fs.readFileSync('Path to Apple SSO Secret Key File.p8') + const keyId = 'XXXXXXXXXX' // Key ID of the Secret Key generated in Apple Developer Account. + const teamId = 'XXXXXXXXXX' // Team ID of the Apple Developer Account. It can be found in the app ID on the Apple Developer Account. + const clientId = 'XXXXXXXXXX' // The client ID of the service ID created in the Apple Developer Account. + const headers = { + kid: keyId, + typ: 'JWT' + } + const claims = { + iss: teamId, + aud: 'https://appleid.apple.com', + sub: clientId + } + logger.info( + await jwt.sign(claims, privateKey, { + algorithm: 'ES256', + header: headers, + expiresIn: '180d' // The token will expire in 180 days. The token can be set to expire in a shorter time but not more than 6 months. + }) + ) + process.exit(0) + } catch (err) { + console.log('Error while generating client secret for Apple') + console.log(err) + cli.fatal(err) + } +}) diff --git a/scripts/get-apple-sso-client-secret.js b/scripts/get-apple-sso-client-secret.js deleted file mode 100644 index ad1d043576..0000000000 --- a/scripts/get-apple-sso-client-secret.js +++ /dev/null @@ -1,50 +0,0 @@ -/* -CPAL-1.0 License - -The contents of this file are subject to the Common Public Attribution License -Version 1.0. (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at -https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. -The License is based on the Mozilla Public License Version 1.1, but Sections 14 -and 15 have been added to cover use of software over a computer network and -provide for limited attribution for the Original Developer. In addition, -Exhibit A has been modified to be consistent with Exhibit B. - -Software distributed under the License is distributed on an "AS IS" basis, -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the -specific language governing rights and limitations under the License. - -The Original Code is Ethereal Engine. - -The Original Developer is the Initial Developer. The Initial Developer of the -Original Code is the Ethereal Engine team. - -All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 -Ethereal Engine. All Rights Reserved. -*/ - - -var jwt = require('jsonwebtoken'); - -const getAppleClientSecret = () => { - const privateKey = fs.readFileSync('Path to Apple SSO Secret Key File.p8'); - const keyId = "XXXXXXXXXX"; // Key ID of the Secret Key generated in Apple Developer Account. - const teamId = "XXXXXXXXXX"; // Team ID of the Apple Developer Account. It can be found in the app ID on the Apple Developer Account. - const clientId = "XXXXXXXXXX"; // The client ID of the service ID created in the Apple Developer Account. - - const headers = { - kid: keyId, - typ: "JWT", - } - const claims = { - 'iss': teamId, - 'aud': 'https://appleid.apple.com', - 'sub': clientId, - } - token = jwt.sign(claims, privateKey, { - algorithm: 'ES256', - header: headers, - expiresIn: '180d' // The token will expire in 180 days. The token can be set to expire in a shorter time but not more than 6 months. - }); - return token -} \ No newline at end of file From bcc1f7f3d3c576fc14b9af7d5aefe2da577617d8 Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Tue, 6 Aug 2024 11:33:26 +0500 Subject: [PATCH 03/14] Refactor pieces of code --- scripts/generate-apple-client-secret.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate-apple-client-secret.ts b/scripts/generate-apple-client-secret.ts index dd7694f743..57e5a9fd59 100644 --- a/scripts/generate-apple-client-secret.ts +++ b/scripts/generate-apple-client-secret.ts @@ -32,8 +32,8 @@ cli.enable('status') cli.main(async () => { try { - const privateKey = fs.readFileSync('Path to Apple SSO Secret Key File.p8') - const keyId = 'XXXXXXXXXX' // Key ID of the Secret Key generated in Apple Developer Account. + const privateKey = fs.readFileSync('Path to Apple SSO secret key.p8') + const keyId = 'XXXXXXXXXX' // Key ID of the Secret Key generated in Apple Developer Account. It can be found in the assoisated Key on Apple Developer Account. const teamId = 'XXXXXXXXXX' // Team ID of the Apple Developer Account. It can be found in the app ID on the Apple Developer Account. const clientId = 'XXXXXXXXXX' // The client ID of the service ID created in the Apple Developer Account. const headers = { From 7c280a539a3b593e346935cf163ae5505c3a5b40 Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Tue, 6 Aug 2024 11:54:51 +0500 Subject: [PATCH 04/14] Use CLI to pass the Apple SSO secret generation args --- package.json | 2 +- scripts/generate-apple-client-secret.ts | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index be9a81cd67..f46a5a4b38 100755 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "lint": "prettier --check \"packages/**/*.{ts,tsx}\"", "local": "npm run dev-docker && cross-env VITE_LOCAL_BUILD=true LOCAL=true concurrently -n agones,server,worldserver,mediaserver,client npm:dev-agones-silent \"cd packages/server && npm run start\" \"cd packages/instanceserver && npm run start\" \"cd packages/instanceserver && npm run start-channel\" \"cd packages/client && npm run local\"", "make-user-admin": "cross-env ts-node --swc scripts/make-user-admin.ts", - "create-apple-sso-secret": "cross-env ts-node --swc scripts/generate-apple-client-secret.ts", + "create-apple-sso-secret": "cross-env ts-node --swc scripts/generate-apple-client-secret.ts --secretKeyPath '' --keyId '' --teamId '' --clientId ''", "migrate": "cd packages/server-core && npm run migrate", "migrate:rollback": "cd packages/server-core && npm run migrate:rollback", "migrate:unlock": "cd packages/server-core && npm run migrate:unlock", diff --git a/scripts/generate-apple-client-secret.ts b/scripts/generate-apple-client-secret.ts index 57e5a9fd59..a49599eba6 100644 --- a/scripts/generate-apple-client-secret.ts +++ b/scripts/generate-apple-client-secret.ts @@ -32,18 +32,24 @@ cli.enable('status') cli.main(async () => { try { - const privateKey = fs.readFileSync('Path to Apple SSO secret key.p8') - const keyId = 'XXXXXXXXXX' // Key ID of the Secret Key generated in Apple Developer Account. It can be found in the assoisated Key on Apple Developer Account. - const teamId = 'XXXXXXXXXX' // Team ID of the Apple Developer Account. It can be found in the app ID on the Apple Developer Account. - const clientId = 'XXXXXXXXXX' // The client ID of the service ID created in the Apple Developer Account. + const creds = cli.parse({ + secretKeyPath: ['', 'Path to Apple SSO secret key.p8', 'string'], + keyId: ['', 'Key ID of the Secret Key generated in Apple Developer Account', 'string'], + teamId: ['', 'Team ID of the Apple Developer Account', 'string'], + clientId: ['', 'The client ID of the service ID created in the Apple Developer Account', 'string'] + }) + if (!creds.secretKeyPath || !creds.keyId || !creds.teamId || !creds.clientId) { + cli.fatal('Please provide all the required arguments') + } + const privateKey = fs.readFileSync(creds.secretKeyPath) const headers = { - kid: keyId, + kid: creds.keyId, typ: 'JWT' } const claims = { - iss: teamId, + iss: creds.teamId, aud: 'https://appleid.apple.com', - sub: clientId + sub: creds.clientId } logger.info( await jwt.sign(claims, privateKey, { From 455a78656e61eb9b15b2d128050ea860ba0afd39 Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Tue, 6 Aug 2024 12:33:07 +0500 Subject: [PATCH 05/14] chore: Update create-apple-sso-secret script to remove unnecessary arguments --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f46a5a4b38..be9a81cd67 100755 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "lint": "prettier --check \"packages/**/*.{ts,tsx}\"", "local": "npm run dev-docker && cross-env VITE_LOCAL_BUILD=true LOCAL=true concurrently -n agones,server,worldserver,mediaserver,client npm:dev-agones-silent \"cd packages/server && npm run start\" \"cd packages/instanceserver && npm run start\" \"cd packages/instanceserver && npm run start-channel\" \"cd packages/client && npm run local\"", "make-user-admin": "cross-env ts-node --swc scripts/make-user-admin.ts", - "create-apple-sso-secret": "cross-env ts-node --swc scripts/generate-apple-client-secret.ts --secretKeyPath '' --keyId '' --teamId '' --clientId ''", + "create-apple-sso-secret": "cross-env ts-node --swc scripts/generate-apple-client-secret.ts", "migrate": "cd packages/server-core && npm run migrate", "migrate:rollback": "cd packages/server-core && npm run migrate:rollback", "migrate:unlock": "cd packages/server-core && npm run migrate:unlock", From f4d08128aa4ee84867551e0dc231458110c5e722 Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Tue, 6 Aug 2024 12:51:29 +0500 Subject: [PATCH 06/14] Fix imports --- scripts/generate-apple-client-secret.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate-apple-client-secret.ts b/scripts/generate-apple-client-secret.ts index a49599eba6..4af74f4c9b 100644 --- a/scripts/generate-apple-client-secret.ts +++ b/scripts/generate-apple-client-secret.ts @@ -25,9 +25,9 @@ Ethereal Engine. All Rights Reserved. import logger from '@etherealengine/server-core/src/ServerLogger' import cli from 'cli' +import fs from 'fs' +import jwt from 'jsonwebtoken' -var jwt = require('jsonwebtoken') -const fs = require('fs') cli.enable('status') cli.main(async () => { From 99588e83f30dc44cbf8a45a0438ce2f2f1ba5e88 Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Tue, 6 Aug 2024 12:53:05 +0500 Subject: [PATCH 07/14] Format document and fix imports --- scripts/generate-apple-client-secret.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/generate-apple-client-secret.ts b/scripts/generate-apple-client-secret.ts index 4af74f4c9b..47211ac2d7 100644 --- a/scripts/generate-apple-client-secret.ts +++ b/scripts/generate-apple-client-secret.ts @@ -26,7 +26,8 @@ Ethereal Engine. All Rights Reserved. import logger from '@etherealengine/server-core/src/ServerLogger' import cli from 'cli' import fs from 'fs' -import jwt from 'jsonwebtoken' + +const jwt = require('jsonwebtoken') cli.enable('status') From b280eb07c8a273e0de64d28f589cb94339aa161d Mon Sep 17 00:00:00 2001 From: hanzlamateen Date: Tue, 6 Aug 2024 14:48:30 +0500 Subject: [PATCH 08/14] Fixed import of JWT --- scripts/generate-apple-client-secret.ts | 29 +++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/generate-apple-client-secret.ts b/scripts/generate-apple-client-secret.ts index 47211ac2d7..ade018367a 100644 --- a/scripts/generate-apple-client-secret.ts +++ b/scripts/generate-apple-client-secret.ts @@ -26,8 +26,7 @@ Ethereal Engine. All Rights Reserved. import logger from '@etherealengine/server-core/src/ServerLogger' import cli from 'cli' import fs from 'fs' - -const jwt = require('jsonwebtoken') +import Jwt from 'jsonwebtoken' cli.enable('status') @@ -42,23 +41,25 @@ cli.main(async () => { if (!creds.secretKeyPath || !creds.keyId || !creds.teamId || !creds.clientId) { cli.fatal('Please provide all the required arguments') } - const privateKey = fs.readFileSync(creds.secretKeyPath) - const headers = { - kid: creds.keyId, - typ: 'JWT' - } + const privateKey = fs.readFileSync(creds.secretKeyPath, { encoding: 'utf-8' }) + const claims = { iss: creds.teamId, aud: 'https://appleid.apple.com', sub: creds.clientId } - logger.info( - await jwt.sign(claims, privateKey, { - algorithm: 'ES256', - header: headers, - expiresIn: '180d' // The token will expire in 180 days. The token can be set to expire in a shorter time but not more than 6 months. - }) - ) + + const clientSecret = Jwt.sign(claims, privateKey, { + algorithm: 'ES256', + header: { + alg: 'ES256', + kid: creds.keyId, + typ: 'JWT' + }, + expiresIn: '180d' // The token will expire in 180 days. The token can be set to expire in a shorter time but not more than 6 months. + }) + + logger.info(clientSecret) process.exit(0) } catch (err) { console.log('Error while generating client secret for Apple') From d8579489d245351d2195fd8ec0e465c1197f2f65 Mon Sep 17 00:00:00 2001 From: hanzlamateen Date: Tue, 6 Aug 2024 14:49:39 +0500 Subject: [PATCH 09/14] Reverted encoding in file read --- scripts/generate-apple-client-secret.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate-apple-client-secret.ts b/scripts/generate-apple-client-secret.ts index ade018367a..255c9bd617 100644 --- a/scripts/generate-apple-client-secret.ts +++ b/scripts/generate-apple-client-secret.ts @@ -41,7 +41,7 @@ cli.main(async () => { if (!creds.secretKeyPath || !creds.keyId || !creds.teamId || !creds.clientId) { cli.fatal('Please provide all the required arguments') } - const privateKey = fs.readFileSync(creds.secretKeyPath, { encoding: 'utf-8' }) + const privateKey = fs.readFileSync(creds.secretKeyPath) const claims = { iss: creds.teamId, From 9d4d2e2b30548db3a8fbdfd9d0ccc82150c5740b Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Tue, 6 Aug 2024 14:53:56 +0500 Subject: [PATCH 10/14] Remove unncessary encoding while reading the file --- scripts/generate-apple-client-secret.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate-apple-client-secret.ts b/scripts/generate-apple-client-secret.ts index ade018367a..255c9bd617 100644 --- a/scripts/generate-apple-client-secret.ts +++ b/scripts/generate-apple-client-secret.ts @@ -41,7 +41,7 @@ cli.main(async () => { if (!creds.secretKeyPath || !creds.keyId || !creds.teamId || !creds.clientId) { cli.fatal('Please provide all the required arguments') } - const privateKey = fs.readFileSync(creds.secretKeyPath, { encoding: 'utf-8' }) + const privateKey = fs.readFileSync(creds.secretKeyPath) const claims = { iss: creds.teamId, From a820b1889c023a98e1b13728fd03b3309522a32c Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Tue, 6 Aug 2024 15:11:38 +0500 Subject: [PATCH 11/14] Remove licence details for the time being --- scripts/generate-apple-client-secret.ts | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/scripts/generate-apple-client-secret.ts b/scripts/generate-apple-client-secret.ts index 255c9bd617..34142a96e2 100644 --- a/scripts/generate-apple-client-secret.ts +++ b/scripts/generate-apple-client-secret.ts @@ -1,28 +1,3 @@ -/* -CPAL-1.0 License - -The contents of this file are subject to the Common Public Attribution License -Version 1.0. (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at -https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. -The License is based on the Mozilla Public License Version 1.1, but Sections 14 -and 15 have been added to cover use of software over a computer network and -provide for limited attribution for the Original Developer. In addition, -Exhibit A has been modified to be consistent with Exhibit B. - -Software distributed under the License is distributed on an "AS IS" basis, -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the -specific language governing rights and limitations under the License. - -The Original Code is Ethereal Engine. - -The Original Developer is the Initial Developer. The Initial Developer of the -Original Code is the Ethereal Engine team. - -All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 -Ethereal Engine. All Rights Reserved. -*/ - import logger from '@etherealengine/server-core/src/ServerLogger' import cli from 'cli' import fs from 'fs' From f549b840cd33080af2654643bab0a0a2ee349895 Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Thu, 8 Aug 2024 13:14:17 +0500 Subject: [PATCH 12/14] Rename the script for generating the client secret for Apple --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be9a81cd67..f69ea0c4e8 100755 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "lint": "prettier --check \"packages/**/*.{ts,tsx}\"", "local": "npm run dev-docker && cross-env VITE_LOCAL_BUILD=true LOCAL=true concurrently -n agones,server,worldserver,mediaserver,client npm:dev-agones-silent \"cd packages/server && npm run start\" \"cd packages/instanceserver && npm run start\" \"cd packages/instanceserver && npm run start-channel\" \"cd packages/client && npm run local\"", "make-user-admin": "cross-env ts-node --swc scripts/make-user-admin.ts", - "create-apple-sso-secret": "cross-env ts-node --swc scripts/generate-apple-client-secret.ts", + "generate-apple-client-secret": "cross-env ts-node --swc scripts/generate-apple-client-secret.ts", "migrate": "cd packages/server-core && npm run migrate", "migrate:rollback": "cd packages/server-core && npm run migrate:rollback", "migrate:unlock": "cd packages/server-core && npm run migrate:unlock", From 8beeb0fed61231aed338eb9b2ca9ca1f1e8c9e59 Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Thu, 8 Aug 2024 13:27:50 +0500 Subject: [PATCH 13/14] Fix build checks --- package.json | 1 - scripts/generate-apple-client-secret.ts | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f69ea0c4e8..8cc0894fb1 100755 --- a/package.json +++ b/package.json @@ -70,7 +70,6 @@ "lint": "prettier --check \"packages/**/*.{ts,tsx}\"", "local": "npm run dev-docker && cross-env VITE_LOCAL_BUILD=true LOCAL=true concurrently -n agones,server,worldserver,mediaserver,client npm:dev-agones-silent \"cd packages/server && npm run start\" \"cd packages/instanceserver && npm run start\" \"cd packages/instanceserver && npm run start-channel\" \"cd packages/client && npm run local\"", "make-user-admin": "cross-env ts-node --swc scripts/make-user-admin.ts", - "generate-apple-client-secret": "cross-env ts-node --swc scripts/generate-apple-client-secret.ts", "migrate": "cd packages/server-core && npm run migrate", "migrate:rollback": "cd packages/server-core && npm run migrate:rollback", "migrate:unlock": "cd packages/server-core && npm run migrate:unlock", diff --git a/scripts/generate-apple-client-secret.ts b/scripts/generate-apple-client-secret.ts index 34142a96e2..255c9bd617 100644 --- a/scripts/generate-apple-client-secret.ts +++ b/scripts/generate-apple-client-secret.ts @@ -1,3 +1,28 @@ +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ + import logger from '@etherealengine/server-core/src/ServerLogger' import cli from 'cli' import fs from 'fs' From bd923ac2e7b3527adb7edf83fc3b9f48de07c0f4 Mon Sep 17 00:00:00 2001 From: Murad Khateeb Date: Thu, 8 Aug 2024 13:59:11 +0500 Subject: [PATCH 14/14] Add script to generate Apple client secret --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 8cc0894fb1..f69ea0c4e8 100755 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "lint": "prettier --check \"packages/**/*.{ts,tsx}\"", "local": "npm run dev-docker && cross-env VITE_LOCAL_BUILD=true LOCAL=true concurrently -n agones,server,worldserver,mediaserver,client npm:dev-agones-silent \"cd packages/server && npm run start\" \"cd packages/instanceserver && npm run start\" \"cd packages/instanceserver && npm run start-channel\" \"cd packages/client && npm run local\"", "make-user-admin": "cross-env ts-node --swc scripts/make-user-admin.ts", + "generate-apple-client-secret": "cross-env ts-node --swc scripts/generate-apple-client-secret.ts", "migrate": "cd packages/server-core && npm run migrate", "migrate:rollback": "cd packages/server-core && npm run migrate:rollback", "migrate:unlock": "cd packages/server-core && npm run migrate:unlock",