From 6541d6d0fc9fe3f274bc83a8a2512fba05e7d42d Mon Sep 17 00:00:00 2001 From: lamtruong28 Date: Fri, 20 Nov 2026 14:20:35 +0700 Subject: [PATCH] Disable zoom, select text, auto fill token --- .env.template | 38 ++++++++++++++++++------------------- scripts/install.bat | 43 ++++++++++++++++++++++++++++++++++++------ templates/startup.html | 13 +++++++++++-- 3 files changed, 67 insertions(+), 27 deletions(-) diff --git a/.env.template b/.env.template index 772843e..343f8b9 100644 --- a/.env.template +++ b/.env.template @@ -2,33 +2,33 @@ VITE_PORT = 3000 VITE_API_BASE_URL = /api/v1/ VITE_API_WS_URL = /ws/ -VITE_SECURITY_CODE = +VITE_SECURITY_CODE = "00" # Backend environments DEBUG = False -SECRET_KEY = -ALLOWED_HOSTS = -PER_PAGE_SIZE = +SECRET_KEY = +ALLOWED_HOSTS = localhost,proxy +PER_PAGE_SIZE = 10 # Database -MYSQL_PORT= -DATABASE_NAME = -DATABASE_USER = -DATABASE_PASSWORD = -DATABASE_HOST = +MYSQL_PORT=3306 +DATABASE_NAME = walmart_db +DATABASE_USER = root +DATABASE_PASSWORD = digitoolsolutions +DATABASE_HOST = mysql -DJANGO_SUPERUSER_USERNAME = -DJANGO_SUPERUSER_EMAIL = -DJANGO_SUPERUSER_PASSWORD = +DJANGO_SUPERUSER_USERNAME = superadmin +DJANGO_SUPERUSER_EMAIL = admin@gmail.com +DJANGO_SUPERUSER_PASSWORD = admin # Redis -REDIS_PORT = +REDIS_PORT=6379 # Watchtower -WATCHTOWER_HTTP_API_TOKEN = -UPDATE_HOOK_TOKEN = -WATCHTOWER_URL = +WATCHTOWER_HTTP_API_TOKEN = +UPDATE_HOOK_TOKEN = +WATCHTOWER_URL = http://watchtower:8080/v1/update # Registry Images -FRONTEND_IMAGE = -BACKEND_IMAGE = -RELEASE_API_URL = +FRONTEND_IMAGE = gitea.digitoolsolutions.synology.me/dts/tv-walmart-fe:latest +BACKEND_IMAGE = gitea.digitoolsolutions.synology.me/dts/tv-walmart-be:latest +RELEASE_API_URL = https://server.digitoolsolutions.synology.me/api/v1/system/release/latest/ diff --git a/scripts/install.bat b/scripts/install.bat index 6327c38..b2bc70c 100644 --- a/scripts/install.bat +++ b/scripts/install.bat @@ -64,9 +64,27 @@ if exist "%ROOT_DIR%.env.example" set "ENV_SAMPLE=%ROOT_DIR%.env.example" if "%ENV_SAMPLE%"=="" if exist "%ROOT_DIR%.env.template" set "ENV_SAMPLE=%ROOT_DIR%.env.template" if "%ENV_SAMPLE%"=="" goto :ENV_CLEANUP -copy /Y "%ENV_SAMPLE%" "%ROOT_DIR%.env" >nul -echo [ACTION REQUIRED] Created .env from sample. Configure it in Notepad, save, and close... -start /wait notepad.exe "%ROOT_DIR%.env" + +echo - Generating .env with secure random SECRET_KEY and Watchtower tokens... +powershell -NoProfile -ExecutionPolicy Bypass -Command ^ + "$tpl = Get-Content -Raw -Path '%ENV_SAMPLE%';" ^ + "$rng = [System.Security.Cryptography.RandomNumberGenerator]::Create();" ^ + "$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.ToCharArray();" ^ + "$b1 = New-Object byte[] 50; $rng.GetBytes($b1);" ^ + "$secret = -join ($b1 | ForEach-Object { $chars[$_ %% $chars.Length] });" ^ + "$b2 = New-Object byte[] 32; $rng.GetBytes($b2); $wtToken = ([BitConverter]::ToString($b2) -replace '-','').ToLower();" ^ + "$b3 = New-Object byte[] 32; $rng.GetBytes($b3); $hookToken = ([BitConverter]::ToString($b3) -replace '-','').ToLower();" ^ + "$tpl = $tpl -replace '', $secret;" ^ + "$tpl = [regex]::Replace($tpl, '', $wtToken, 1);" ^ + "$tpl = [regex]::Replace($tpl, '', $hookToken, 1);" ^ + "$utf8NoBom = New-Object System.Text.UTF8Encoding $false;" ^ + "[System.IO.File]::WriteAllText('%ROOT_DIR%.env', $tpl, $utf8NoBom);" ^ + "if ($tpl -match 'nul reg add "%EDGE_POL%" /v "ClearBrowsingDataOnExit" /t REG_DWORD /d 0 /f >nul reg add "%EDGE_POL%" /v "RestoreOnStartup" /t REG_DWORD /d 4 /f >nul +reg add "%EDGE_POL%" /v "ShowHomeButton" /t REG_DWORD /d 0 /f >nul +reg add "%EDGE_POL%" /v "HomepageLocation" /t REG_SZ /d "file:///C:/KioskApp/startup.html" /f >nul +reg add "%EDGE_POL%" /v "NewTabPageLocation" /t REG_SZ /d "file:///C:/KioskApp/startup.html" /f >nul +reg add "%EDGE_POL%" /v "DeveloperToolsAvailability" /t REG_DWORD /d 2 /f >nul +reg add "%EDGE_POL%" /v "AllowDeletingBrowserHistory" /t REG_DWORD /d 0 /f >nul +reg add "%EDGE_POL%" /v "PrintingEnabled" /t REG_DWORD /d 0 /f >nul +reg add "%EDGE_POL%" /v "DownloadRestrictions" /t REG_DWORD /d 3 /f >nul +reg add "%EDGE_POL%" /v "BookmarkBarEnabled" /t REG_DWORD /d 0 /f >nul +reg add "%EDGE_POL%" /v "AutofillAddressEnabled" /t REG_DWORD /d 0 /f >nul +reg add "%EDGE_POL%" /v "AutofillCreditCardEnabled" /t REG_DWORD /d 0 /f >nul +reg add "%EDGE_POL%" /v "PasswordManagerEnabled" /t REG_DWORD /d 0 /f >nul +reg add "%EDGE_POL%" /v "HideFirstRunExperience" /t REG_DWORD /d 1 /f >nul +reg add "%EDGE_POL%" /v "TranslateEnabled" /t REG_DWORD /d 0 /f >nul powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "$user = '%KIOSK_USER%';" ^ @@ -436,7 +467,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "$profilePath = (Get-ItemProperty $profReg -ErrorAction SilentlyContinue).ProfileImagePath;" ^ "if ($profilePath) {" ^ " $hivePath = Join-Path $profilePath 'NTUSER.DAT';" ^ - " $edgeCmd = '\"' + $edge + '\" --kiosk \"file:///C:/KioskApp/startup.html\" --edge-kiosk-type=fullscreen --user-data-dir=\"C:\KioskBrowserData\" --no-first-run --disable-features=TranslateUI --allow-file-access-from-files';" ^ + " $edgeCmd = '\"' + $edge + '\" --kiosk \"file:///C:/KioskApp/startup.html\" --edge-kiosk-type=fullscreen --user-data-dir=\"C:\KioskBrowserData\" --no-first-run --allow-file-access-from-files --disable-pinch';" ^ " $loaded = $false;" ^ " if (-not (Test-Path \"Registry::HKEY_USERS\$sid\")) {" ^ " reg load \"HKU\$sid\" \"$hivePath\" >$null 2>&1;" ^ diff --git a/templates/startup.html b/templates/startup.html index 41cc4bf..38c5ca7 100644 --- a/templates/startup.html +++ b/templates/startup.html @@ -10,6 +10,15 @@ box-sizing: border-box; } + html, + body { + overscroll-behavior-x: none; + touch-action: pan-y; + -ms-content-zooming: none; + user-select: none; + -webkit-user-select: none; + } + body { display: flex; justify-content: center; @@ -45,7 +54,7 @@ #000 calc(100% - 12px) ); border-radius: 50%; - animation: spin 3s infinite ease-in-out; + animation: spin 5s infinite ease-in-out; } .loader::before, .loader::after { @@ -79,7 +88,7 @@ right/calc(200% + 1ch) 100%; -webkit-background-clip: text; background-clip: text; - animation: l7 3s infinite steps(100); + animation: l7 5s infinite steps(100); } .loader-text:before { content: "Loading...";