Repository navigation
fix: hardening kesiapan rilis (header keamanan, bootstrap DB baru, rate limit demo, 503 gateway) - #5
Merged
Merged
Conversation
- Security headers on the live web app: Coolify serves dist/ with `serve`, which ignores Netlify's _headers. Add public/serve.json with nosniff, frame DENY, referrer/permissions policy, HSTS and the same cache rules. - Fresh database self-provisions: the migration runner applies the foundation SQL (base-schema, production-bootstrap) when public.stores is missing, so a new project or disaster-recovery deploy no longer crashes on migration 20260430_0002. Copies live in backend/bootstrap (the Docker context is backend/ only); a test keeps them identical to database/. - Rate-limit /api/auth/demo-login: each call bcrypt-hashes and reseeds the demo accounts, and it was the only unthrottled auth endpoint. - npm audit fix (non-breaking): clears the critical @capacitor/android and proxy-addr advisories and the body-parser DoS advisory. - Tests: e2e-local runs only its own spec (the offline spec needs the production build and has its own runner); the fresh-db smoke ignores the demo store's seeded inventory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e keeps the JSON error Cloudflare replaces 502/504 origin responses with its own HTML page, so the app showed a generic Bad gateway instead of the Mayar or AI error message. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ringkasan
Perbaikan dari audit kesiapan rilis. Semua masalah ini ditemukan saat menguji sistem live dan menjalankan suite lokal.
Yang berubah
public/serve.json): Coolify menyajikandist/denganserve, yang mengabaikan_headersmilik Netlify, sehingga situs live tidak mengirim header keamanan sama sekali. Sekarang ada nosniff,X-Frame-Options: DENY, referrer/permissions policy, HSTS, dan aturan cache yang sama dengan_headers.backend/scripts/run-migrations.mjs,backend/bootstrap/): kalaupublic.storesbelum ada, runner menerapkanbase-schemadanproduction-bootstrapsebelum migrasi. Sebelumnya deploy ke database kosong crash di20260430_0002. File SQL disalin kebackend/karena konteks Docker hanyabackend/;bootstrapSql.test.tsmemastikan salinannya identik dengandatabase/./api/auth/demo-login: satu-satunya endpoint auth tanpa batas, padahal tiap panggilan menjalankan bcrypt dan seeding ulang akun demo.npm audit fix(tanpa breaking change): menutup advisory critical@capacitor/androiddanproxy-addr, serta advisory DoSbody-parser.e2e-localhanya menjalankan spec miliknya (spec offline butuh build production dan punya runner sendiri); smoke fresh-db mengabaikan inventory toko demo.Catatan untuk reviewer
@insforge/sdk→zod@3yang belum punya perbaikan upstream. Backend hanya mengimpor tipe dari SDK itu dan memvalidasi request dengan[email protected]yang sudah ditambal.NODE_ENV=production, dan Sentry masih menunggu key dari pemilik akun.Tes
npm run check: lint, typecheck, 454 tes (212 frontend + 242 backend), build web dan backend: lolostest:e2e:local(3/3) dantest:e2e:offline(1/1): lolossmoke:local:mayar: semua 24 cek lolossmoke:local:fresh-db: lolos[email protected](versi yang sama dengan container)demo-loginmembalas 429 setelah batas tercapai🤖 Generated with Claude Code