From 21dd3573978712c1ce7f88d04d99298925efe310 Mon Sep 17 00:00:00 2001 From: Lorenzune Date: Fri, 24 Apr 2026 15:59:55 +0200 Subject: [PATCH] Replace production domain references with examples --- docs/secure-runtime-modes.en.md | 36 +++++++++++++++--------------- docs/secure-runtime-modes.md | 36 +++++++++++++++--------------- public/asset-loader.js | 2 +- public/renderer-config.json | 14 ++++++------ public/ui-config.json | 18 +++++++-------- scripts/write-asset-loader.mjs | 2 +- src/bootstrap.ts | 2 +- src/components/login/LoginView.tsx | 8 +++---- src/secure-assets.ts | 2 +- vite.config.mjs | 4 ++-- 10 files changed, 62 insertions(+), 62 deletions(-) diff --git a/docs/secure-runtime-modes.en.md b/docs/secure-runtime-modes.en.md index c2d6fbf..5ff441e 100644 --- a/docs/secure-runtime-modes.en.md +++ b/docs/secure-runtime-modes.en.md @@ -16,9 +16,9 @@ This file controls everything at runtime. "distObfuscationEnabled": true, "secureAssetsEnabled": true, "secureApiEnabled": true, - "apiBaseUrl": "https://nitro.slogga.it:2096", - "plainConfigBaseUrl": "https://hotel.slogga.it/", - "plainGamedataBaseUrl": "https://hotel.slogga.it/client/nitro/gamedata/" + "apiBaseUrl": "https://nitro.example.com:2096", + "plainConfigBaseUrl": "https://hotel.example.com/", + "plainGamedataBaseUrl": "https://hotel.example.com/client/nitro/gamedata/" } ``` @@ -38,16 +38,16 @@ This file controls everything at runtime. - `apiBaseUrl` - Nitro emulator / API base URL - - example: `https://nitro.slogga.it:2096` + - example: `https://nitro.example.com:2096` - it is best to always set this explicitly, so you do not depend on the hardcoded fallback - `plainConfigBaseUrl` - base URL for plain config files - - usually: `https://hotel.slogga.it/` + - usually: `https://hotel.example.com/` - `plainGamedataBaseUrl` - base URL for plain gamedata files - - usually: `https://hotel.slogga.it/client/nitro/gamedata/` + - usually: `https://hotel.example.com/client/nitro/gamedata/` ## 2. `Nitro-V3/src/bootstrap.ts` @@ -71,7 +71,7 @@ This file controls everything at runtime. The current fallback is: ```ts -(window as any).NitroSecureApiUrl = clientMode.apiBaseUrl || 'http://192.168.1.52:2096/'; +(window as any).NitroSecureApiUrl = clientMode.apiBaseUrl || 'https://nitro.example.com:2096/'; ``` So in production it is better to always set `apiBaseUrl` inside `client-mode.json`. @@ -114,7 +114,7 @@ This file still defines the paths used by the renderer. You can use: ```json -"gamedata.url": "https://nitro.slogga.it:2096/nitro-sec/file?kind=gamedata&file=" +"gamedata.url": "https://nitro.example.com:2096/nitro-sec/file?kind=gamedata&file=" ``` and the equivalent secure URLs for the other gamedata resources. @@ -124,7 +124,7 @@ and the equivalent secure URLs for the other gamedata resources. You can use plain classic paths, for example: ```json -"gamedata.url": "https://hotel.slogga.it/client/nitro/gamedata" +"gamedata.url": "https://hotel.example.com/client/nitro/gamedata" ``` or you can keep the renderer config as-is and let `secure-assets.ts` handle the fallback conversion. @@ -214,9 +214,9 @@ nitro.secure.master_key=change-me-to-a-long-random-secret "distObfuscationEnabled": true, "secureAssetsEnabled": true, "secureApiEnabled": true, - "apiBaseUrl": "https://nitro.slogga.it:2096", - "plainConfigBaseUrl": "https://hotel.slogga.it/", - "plainGamedataBaseUrl": "https://hotel.slogga.it/client/nitro/gamedata/" + "apiBaseUrl": "https://nitro.example.com:2096", + "plainConfigBaseUrl": "https://hotel.example.com/", + "plainGamedataBaseUrl": "https://hotel.example.com/client/nitro/gamedata/" } ``` @@ -239,9 +239,9 @@ nitro.secure.master_key=a-long-random-secret "distObfuscationEnabled": true, "secureAssetsEnabled": false, "secureApiEnabled": false, - "apiBaseUrl": "https://nitro.slogga.it:2096", - "plainConfigBaseUrl": "https://hotel.slogga.it/", - "plainGamedataBaseUrl": "https://hotel.slogga.it/client/nitro/gamedata/" + "apiBaseUrl": "https://nitro.example.com:2096", + "plainConfigBaseUrl": "https://hotel.example.com/", + "plainGamedataBaseUrl": "https://hotel.example.com/client/nitro/gamedata/" } ``` @@ -261,9 +261,9 @@ nitro.secure.api.enabled=false "distObfuscationEnabled": false, "secureAssetsEnabled": false, "secureApiEnabled": false, - "apiBaseUrl": "https://nitro.slogga.it:2096", - "plainConfigBaseUrl": "https://hotel.slogga.it/", - "plainGamedataBaseUrl": "https://hotel.slogga.it/client/nitro/gamedata/" + "apiBaseUrl": "https://nitro.example.com:2096", + "plainConfigBaseUrl": "https://hotel.example.com/", + "plainGamedataBaseUrl": "https://hotel.example.com/client/nitro/gamedata/" } ``` diff --git a/docs/secure-runtime-modes.md b/docs/secure-runtime-modes.md index fc36fb5..3b59b39 100644 --- a/docs/secure-runtime-modes.md +++ b/docs/secure-runtime-modes.md @@ -16,9 +16,9 @@ Questo file controlla tutto a runtime. "distObfuscationEnabled": true, "secureAssetsEnabled": true, "secureApiEnabled": true, - "apiBaseUrl": "https://nitro.slogga.it:2096", - "plainConfigBaseUrl": "https://hotel.slogga.it/", - "plainGamedataBaseUrl": "https://hotel.slogga.it/client/nitro/gamedata/" + "apiBaseUrl": "https://nitro.example.com:2096", + "plainConfigBaseUrl": "https://hotel.example.com/", + "plainGamedataBaseUrl": "https://hotel.example.com/client/nitro/gamedata/" } ``` @@ -38,16 +38,16 @@ Questo file controlla tutto a runtime. - `apiBaseUrl` - base URL dell’emulatore / API Nitro - - esempio: `https://nitro.slogga.it:2096` + - esempio: `https://nitro.example.com:2096` - meglio valorizzarlo sempre, così non dipendi dal fallback hardcoded - `plainConfigBaseUrl` - base URL dei file config plain - - normalmente: `https://hotel.slogga.it/` + - normalmente: `https://hotel.example.com/` - `plainGamedataBaseUrl` - base URL del gamedata plain - - normalmente: `https://hotel.slogga.it/client/nitro/gamedata/` + - normalmente: `https://hotel.example.com/client/nitro/gamedata/` ## 2. `Nitro-V3/src/bootstrap.ts` @@ -71,7 +71,7 @@ Questo file controlla tutto a runtime. Il fallback attuale è: ```ts -(window as any).NitroSecureApiUrl = clientMode.apiBaseUrl || 'http://192.168.1.52:2096/'; +(window as any).NitroSecureApiUrl = clientMode.apiBaseUrl || 'https://nitro.example.com:2096/'; ``` Quindi in produzione conviene sempre valorizzare `apiBaseUrl` dentro `client-mode.json`. @@ -114,7 +114,7 @@ Questo file continua a definire i path usati dal renderer. Puoi usare: ```json -"gamedata.url": "https://nitro.slogga.it:2096/nitro-sec/file?kind=gamedata&file=" +"gamedata.url": "https://nitro.example.com:2096/nitro-sec/file?kind=gamedata&file=" ``` e gli altri URL secure equivalenti. @@ -124,7 +124,7 @@ e gli altri URL secure equivalenti. Conviene usare i path plain classici, per esempio: ```json -"gamedata.url": "https://hotel.slogga.it/client/nitro/gamedata" +"gamedata.url": "https://hotel.example.com/client/nitro/gamedata" ``` oppure lasciare il renderer configurato com’è e demandare il fallback a `secure-assets.ts`. @@ -214,9 +214,9 @@ nitro.secure.master_key=change-me-to-a-long-random-secret "distObfuscationEnabled": true, "secureAssetsEnabled": true, "secureApiEnabled": true, - "apiBaseUrl": "https://nitro.slogga.it:2096", - "plainConfigBaseUrl": "https://hotel.slogga.it/", - "plainGamedataBaseUrl": "https://hotel.slogga.it/client/nitro/gamedata/" + "apiBaseUrl": "https://nitro.example.com:2096", + "plainConfigBaseUrl": "https://hotel.example.com/", + "plainGamedataBaseUrl": "https://hotel.example.com/client/nitro/gamedata/" } ``` @@ -239,9 +239,9 @@ nitro.secure.master_key=una-chiave-lunga-random "distObfuscationEnabled": true, "secureAssetsEnabled": false, "secureApiEnabled": false, - "apiBaseUrl": "https://nitro.slogga.it:2096", - "plainConfigBaseUrl": "https://hotel.slogga.it/", - "plainGamedataBaseUrl": "https://hotel.slogga.it/client/nitro/gamedata/" + "apiBaseUrl": "https://nitro.example.com:2096", + "plainConfigBaseUrl": "https://hotel.example.com/", + "plainGamedataBaseUrl": "https://hotel.example.com/client/nitro/gamedata/" } ``` @@ -261,9 +261,9 @@ nitro.secure.api.enabled=false "distObfuscationEnabled": false, "secureAssetsEnabled": false, "secureApiEnabled": false, - "apiBaseUrl": "https://nitro.slogga.it:2096", - "plainConfigBaseUrl": "https://hotel.slogga.it/", - "plainGamedataBaseUrl": "https://hotel.slogga.it/client/nitro/gamedata/" + "apiBaseUrl": "https://nitro.example.com:2096", + "plainConfigBaseUrl": "https://hotel.example.com/", + "plainGamedataBaseUrl": "https://hotel.example.com/client/nitro/gamedata/" } ``` diff --git a/public/asset-loader.js b/public/asset-loader.js index e02be4d..be407cc 100644 --- a/public/asset-loader.js +++ b/public/asset-loader.js @@ -49,7 +49,7 @@ const renderShell = () => { const root = document.getElementById("root"); if(!root || root.firstChild) return; - root.innerHTML = '
'; + root.innerHTML = '
'; }; const decodeAsset = (bytes) => { diff --git a/public/renderer-config.json b/public/renderer-config.json index 634694b..6b769d7 100644 --- a/public/renderer-config.json +++ b/public/renderer-config.json @@ -1,11 +1,11 @@ { - "socket.url": "ws://192.168.1.52:2096", - "api.url": "http://192.168.1.52:2096", - "asset.url": "https://hotel.slogga.it/client/nitro/bundled", - "image.library.url": "https://hotel.slogga.it/client/c_images/", - "hof.furni.url": "https://hotel.slogga.it/client/c_images/dcr/hof_furni", - "images.url": "https://hotel.slogga.it/client/nitro/images", - "gamedata.url": "http://192.168.1.52:2096/nitro-sec/file?kind=gamedata&file=", + "socket.url": "wss://nitro.example.com:2096", + "api.url": "https://nitro.example.com:2096", + "asset.url": "https://hotel.example.com/client/nitro/bundled", + "image.library.url": "https://hotel.example.com/client/c_images/", + "hof.furni.url": "https://hotel.example.com/client/c_images/dcr/hof_furni", + "images.url": "https://hotel.example.com/client/nitro/images", + "gamedata.url": "https://nitro.example.com:2096/nitro-sec/file?kind=gamedata&file=", "sounds.url": "${asset.url}/sounds/%sample%.mp3", "external.texts.url": [ "${gamedata.url}/ExternalTexts.json", diff --git a/public/ui-config.json b/public/ui-config.json index 50cef22..f625755 100644 --- a/public/ui-config.json +++ b/public/ui-config.json @@ -1,8 +1,8 @@ { "image.library.notifications.url": "${image.library.url}notifications/%image%.png", "achievements.images.url": "${image.library.url}Quests/%image%.png", - "camera.url": "https://hotel.slogga.it/client/camera/", - "thumbnails.url": "https://hotel.slogga.it/client/camera/thumbnail/%thumbnail%.png", + "camera.url": "https://hotel.example.com/client/camera/", + "thumbnails.url": "https://hotel.example.com/client/camera/thumbnail/%thumbnail%.png", "url.prefix": "", "habbopages.url": "/gamedata/habbopages/", "group.homepage.url": "${url.prefix}/groups/%groupid%/id", @@ -30,9 +30,9 @@ "show.google.ads": false, "loginview": { "images": { - "background": "https://hotel.slogga.it/client/nitro/images/reception/background_gradient_apr25.png", "drape": "https://hotel.slogga.it/client/nitro/images/reception/drape.png", - "left": "https://hotel.slogga.it/client/nitro/images/reception/mute_reception_backdrop_left.png", - "right": "https://hotel.slogga.it/client/nitro/images/reception/background_right.png" + "background": "https://hotel.example.com/client/nitro/images/reception/background_gradient_apr25.png", "drape": "https://hotel.example.com/client/nitro/images/reception/drape.png", + "left": "https://hotel.example.com/client/nitro/images/reception/mute_reception_backdrop_left.png", + "right": "https://hotel.example.com/client/nitro/images/reception/background_right.png" } }, "navigator.room.models": [ @@ -1575,11 +1575,11 @@ }, "loginview": { "images": { - "background": "https://hotel.slogga.it/client/nitro/images/reception/background_gradient_apr25.png", + "background": "https://hotel.example.com/client/nitro/images/reception/background_gradient_apr25.png", "background.colour": "#6eadc8", - "drape": "https://hotel.slogga.it/client/nitro/images/reception/drape.png", - "left": "https://hotel.slogga.it/client/nitro/images/reception/mute_reception_backdrop_left.png", - "right": "https://hotel.slogga.it/client/nitro/images/reception/background_right.png" + "drape": "https://hotel.example.com/client/nitro/images/reception/drape.png", + "left": "https://hotel.example.com/client/nitro/images/reception/mute_reception_backdrop_left.png", + "right": "https://hotel.example.com/client/nitro/images/reception/background_right.png" }, "widgets": { "slot.1.widget": "promoarticle", diff --git a/scripts/write-asset-loader.mjs b/scripts/write-asset-loader.mjs index b33aa36..5b3aa5d 100644 --- a/scripts/write-asset-loader.mjs +++ b/scripts/write-asset-loader.mjs @@ -52,7 +52,7 @@ const loader = `(() => { const renderShell = () => { const root = document.getElementById("root"); if(!root || root.firstChild) return; - root.innerHTML = '
'; + root.innerHTML = '
'; }; const decodeAsset = (bytes) => { diff --git a/src/bootstrap.ts b/src/bootstrap.ts index 077a6c9..a9d95c3 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -27,7 +27,7 @@ const cacheBustUrl = (path: string): string => return url.toString(); }; -(window as any).NitroSecureApiUrl = clientMode.apiBaseUrl || 'http://192.168.1.52:2096/'; +(window as any).NitroSecureApiUrl = clientMode.apiBaseUrl || 'https://nitro.example.com:2096/'; (window as any).NitroClientMode = clientMode; (window as any).NitroConfig = { 'config.urls': [ diff --git a/src/components/login/LoginView.tsx b/src/components/login/LoginView.tsx index e22daf5..28575a3 100644 --- a/src/components/login/LoginView.tsx +++ b/src/components/login/LoginView.tsx @@ -61,11 +61,11 @@ const MAX_ATTEMPTS = 5; const LOCK_WINDOW_MS = 60_000; const LOCK_DURATION_MS = 2 * 60_000; const DEFAULT_LOGIN_IMAGES: Record = { - background: 'https://hotel.slogga.it/client/nitro/images/reception/background_gradient_apr25.png', + background: 'https://hotel.example.com/client/nitro/images/reception/background_gradient_apr25.png', 'background.colour': '#6eadc8', - drape: 'https://hotel.slogga.it/client/nitro/images/reception/drape.png', - left: 'https://hotel.slogga.it/client/nitro/images/reception/mute_reception_backdrop_left.png', - right: 'https://hotel.slogga.it/client/nitro/images/reception/background_right.png' + drape: 'https://hotel.example.com/client/nitro/images/reception/drape.png', + left: 'https://hotel.example.com/client/nitro/images/reception/mute_reception_backdrop_left.png', + right: 'https://hotel.example.com/client/nitro/images/reception/background_right.png' }; const LOGIN_LOCALES: LoginLocale[] = [ { code: 'it', file: 'it', label: 'Italiano', flag: flagIt }, diff --git a/src/secure-assets.ts b/src/secure-assets.ts index f0af707..a44e9d0 100644 --- a/src/secure-assets.ts +++ b/src/secure-assets.ts @@ -194,7 +194,7 @@ const getApiBase = (): string => if(typeof configured === 'string' && configured.length) return configured.replace(/\/$/, ''); - return 'http://localhost:8443/'; + return 'https://nitro.example.com:2096/'; }; const getPlainAssetBase = (kind: 'config' | 'gamedata'): string => diff --git a/vite.config.mjs b/vite.config.mjs index b8c6e4a..5922a33 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -18,12 +18,12 @@ export default defineConfig({ }, proxy: { '/api': { - target: process.env.AUTH_PROXY_TARGET || 'http://192.168.1.52:2096/', + target: process.env.AUTH_PROXY_TARGET || 'https://nitro.example.com:2096/', changeOrigin: true, ws: true, }, '/nitro-sec': { - target: process.env.NITRO_PROXY_TARGET || 'http://192.168.1.52:2096/', + target: process.env.NITRO_PROXY_TARGET || 'https://nitro.example.com:2096/', changeOrigin: true, ws: true, }