Samsung/Chrome on Android 16 refused to offer installation. manifest.json now has
absolute start_url/scope ('/'), prefer_related_applications:false, two screenshots
(narrow 1080x1920 + wide 1920x1080 captured from production) and app shortcuts.
Verified with CDP: Page.getInstallabilityErrors -> [], Page.getAppManifest ->
errors [] with 2 screenshots / 2 shortcuts, screenshots served as image/png, service
worker controlling the page. VERSION bumped to 2026.11.24.4.
- ui/pwa.js: register with updateViaCache:'none', check for updates on load, every
30 min, on tab focus and on 'online'; controllerchange reloads the page itself but
waits while the user is typing in a form (admin edits survive), retrying on blur/hide
- sw.js: precache the maskable icon; bump VERSION -> 2026.11.24.2
- scripts/bump-version.mjs: bump sw.js VERSION + <meta app-version> together, --check
fails on drift; wired into
> [email protected] check
> node --check ui/app.js && node --check ui/data.js && node --check ui/router.js && node --check ui/ui.js && node --check ui/pwa.js && node --check ui/views/home.js && node --check ui/views/admin.js && node --check sw.js && node --check server/publish.mjs && node --check server/db.mjs && node --check scripts/bump-version.mjs && node scripts/bump-version.mjs --check
[version] ตรงกันที่ 2026.11.24.2, exposed as
> [email protected] version
> node scripts/bump-version.mjs
[version] ตั้งเป็น 2026.11.24.3 แล้ว (sw.js + index.html)
- README/AGENTS: document the PWA behaviour and the bump workflow
Verified in Chrome: SPA route changes keep timeOrigin and navigation count at 1 (no
reload), a simulated deploy (version bump -> reg.update) replaced the cache from
hobbypj-2026.11.24.1 to .2 with the old cache deleted and the page reloading by
itself, Page.getAppManifest errors: [], and with the network emulated offline the
shell + 6 cards still render while an uncached file fails.
Base docker-compose.yml now matches Dokploy's model: expose only (no published host
port), no fixed container_name, named volume hobbypj-data, traefik.docker.network
label. Local port mapping + ./data bind moved to docker-compose.override.yml with
'volumes: !override' (otherwise compose appends two mounts on /app/data and SQLite
fails with 'disk I/O error').
Verified locally: override mode serves on PORT env (8113) from ./data; base mode
(named volume, no host port) answers inside the container on 8090 and seeds 6 rows.
README: Dokploy deploy steps (service hobbypj-contents, container port = PORT,
domain www.hobbypj.com) + note not to run the dev server and the container on the
same ./data.
- .dockerignore: exclude data/*.sqlite*, data/backups, data/projects.migrated.json so a
fresh container always seeds from data/projects.json (the dev DB was being baked in)
- publish.mjs: log a hint that requests through a published port are not loopback, so a
container without ADMIN_TOKEN cannot write
- .env.example / README / AGENTS.md: document the ADMIN_TOKEN requirement for containers
Verified with docker 27.4.0: image build, PORT env (8110/8112 incl. .env), seed 6 rows,
PUT with x-admin-token, VACUUM INTO backup, SQLite on a Windows bind mount
(integrity_check ok), persistence across restart, compose up with PORT + volume override.
- GET /api/projects now returns writable: canWrite(req) + token_required, so the
backoffice no longer claims it can save when ADMIN_TOKEN is set (PUT answered 403)
- PUT response exposes database + backup (forward-slash relative paths), drop the
dead payload.backup assignment
- fail fast with a Thai hint when the database cannot be opened (permissions or
corrupt file) instead of an unhandled stack trace
- AGENTS.md: document the two response fields
- server/db.mjs: schema (site + projects), transactional replace, WAL, VACUUM INTO backups (keep 10), JSON export, first-run seed from data/projects.json
- publish.mjs: read/write through the database, export mirror JSON for git/static/offline, validate duplicate project_id
- ui/data.js: read live data from /api/projects first, fall back to data/projects.json
- Dockerfile/compose/.env.example: DB_PATH, drop experimental sqlite warning flag
- docs: AGENTS.md + README describe the database layer and traps
- server: GET /api/local-projects scans sibling folders for index.html
(title from <title>/<h1>, generic titles fall back to the folder name,
sorted by newest edit) and GET /projects/<folder>/ serves that folder
- both endpoints are loopback-only; node_modules/.git/.hermes blocked and
path traversal rejected; WORKSPACE_DIR=none disables the feature
- home: new 'โปรเจคในเครื่อง' list (2 columns >=700px) that hides itself when
the API is absent, so the live static site never shows fake rows
- SW skips /projects/* so other projects' files are never cached; version 2026.11.19.5
- docs: README/AGENTS/DESIGN cover the endpoints, the loopback rule and the layout
- ui/auth.js: derive PBKDF2-HMAC-SHA256(name:password) with a per-deploy salt
(250k iterations) and compare against the verifier in constant time
- config/admin-credentials.json holds salt/iterations/verifier only — no password
- server/set-admin-password.mjs generates/rotates that file (CLI or hidden prompt)
- login is async now: button shows a pending state; config load errors surface in the form
- SW precaches the credentials file; version bumped to 2026.11.19.4
- docs: README/AGENTS explain rotation and the residual limits of a client-side gate
- ui/auth.js: name/password check, session kept in sessionStorage (new tab asks again),
5 wrong attempts lock the form for 30s
- admin view renders a login card until authenticated; adds an explicit logout button
- SW precache includes auth.js, version bumped to 2026.11.19.3 (meta + sw.js in sync)
- docs: AGENTS.md notes the gate is client-side; real protection is the server ADMIN_TOKEN
- drop the SSL note from hero meta, footer column and meta description
- footer becomes two columns; ssl_note removed from data schema, payload and server serializer
- content-only change: service worker version unchanged (network-first)