Compare commits

..
2 Commits
Author SHA1 Message Date
Do SikiandClaude Sonnet 5 58947328d7 sync: mark MITHOME-98 done in TODO.md
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 10:32:37 +02:00
Do SikiandClaude Sonnet 5 8b2546a987 fix(docker): authenticate the dev app's MongoDB URI (MITHOME-98)
docker-compose.dev.yml's mongodb service sets MONGO_INITDB_ROOT_USERNAME/
PASSWORD, which makes the official mongo image enable --auth — but the
app service's MONGODB_URI was unauthenticated
(mongodb://mongodb:27017/mozdit). Same bug class as MITHOME-32
(staging/production), but that ticket covers docker-compose.staging.yml
/docker-compose.prod.yml specifically, not this dev file — hence the
separate MITHOME-98.

Why /api/health never caught it: that route is a pure liveness check
and never touches MongoDB. Only an endpoint that actually performs a
DB operation exercises the bug.

Verified live (docker compose -f docker-compose.dev.yml up --build):
- Reproduced the failure first: inside the running app container, a
  plain `mongodb://mongodb:27017/mozdit` connection's findOne() throws
  "Command find requires authentication" — confirms the hypothesis
  that the app fails only on a real query, not at startup.
- With the fix in place: POST /api/contact returns 200 with a
  submissionId, and the document is actually present in
  contact_submissions (checked via mongosh) — a real, previously-
  broken write path now works end to end.
- npm test: 58/58 passed (unaffected, as expected for a
  docker-compose/doc-only change).

Also fixed the same stale unauthenticated example in DOCKER.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 10:32:04 +02:00
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ mongosh "mongodb://admin:password123@localhost:27017/mozdit"
### 3. Alkalmazásból ### 3. Alkalmazásból
Az alkalmazás automatikusan csatlakozik: Az alkalmazás automatikusan csatlakozik:
``` ```
MONGODB_URI=mongodb://mongodb:27017/mozdit MONGODB_URI=mongodb://admin:password123@mongodb:27017/mozdit?authSource=admin
``` ```
## 🛠️ Fejlesztési Parancsok ## 🛠️ Fejlesztési Parancsok
+2
View File
@@ -63,6 +63,7 @@ Next.js 15 alapú weboldal a mozdIT Bt. számára, Docker Compose-szal deployolv
| MITHOME-82 | Biztonsági monitoring: detektáló script + cron | ✅ | | MITHOME-82 | Biztonsági monitoring: detektáló script + cron | ✅ |
| MITHOME-83 | Partnerek szekció a honlapon (logó + URL, CMS feltöltéssel) | ✅ | | MITHOME-83 | Partnerek szekció a honlapon (logó + URL, CMS feltöltéssel) | ✅ |
| MITHOME-84 | Logószerkesztő: háttér áttetszővé tétele (fehér eltávolítás) | ✅ | | MITHOME-84 | Logószerkesztő: háttér áttetszővé tétele (fehér eltávolítás) | ✅ |
| MITHOME-98 | Bug: dev docker-compose MongoDB URI nem hitelesített (auth hiányzott) | ✅ |
--- ---
@@ -159,6 +160,7 @@ docker-compose -f docker-compose.dev.yml down
--- ---
## Frissítési Napló ## Frissítési Napló
- **2026-09-10**: MITHOME-98 (dev docker-compose Mongo URI auth) kész. A `docker-compose.dev.yml` `app` service-e hitelesítés nélkül próbált kapcsolódni egy authot igénylő MongoDB-hez — élesben reprodukálva (findOne → "Command find requires authentication"), majd javítva és ellenőrizve (POST /api/contact valódi Mongo-írása). Ugyanaz a hibaosztály, mint MITHOME-32, de külön, dev-specifikus ticket, mert MITHOME-32 csak staging/production compose-t fed le. Branch: `fix/dev-mongo-uri-auth`.
- **2026-08-17**: Plane sync (`plane-sync.js`). Új MITHOME-27 (Production környezet) Backlog-ba; Custom CMS és Webmail bevéve a Plane-be (28/29, Done). `regenerate()` hiba javítva (szekció-elválasztó). - **2026-08-17**: Plane sync (`plane-sync.js`). Új MITHOME-27 (Production környezet) Backlog-ba; Custom CMS és Webmail bevéve a Plane-be (28/29, Done). `regenerate()` hiba javítva (szekció-elválasztó).
- **2026-08-17**: Plane sync futtatása (`plane-sync.js`). MITHOME-15, MITHOME-18 visszaminősítve Backlog-ba (Plane szerint), MITHOME-27/28 megtartva. - **2026-08-17**: Plane sync futtatása (`plane-sync.js`). MITHOME-15, MITHOME-18 visszaminősítve Backlog-ba (Plane szerint), MITHOME-27/28 megtartva.
- **2026-04-26**: Átállás Linear → Plane (MITHOME projekt). TODO.md teljes újraírva, 26 issue szinkronizálva. - **2026-04-26**: Átállás Linear → Plane (MITHOME projekt). TODO.md teljes újraírva, 26 issue szinkronizálva.
+5 -1
View File
@@ -12,7 +12,11 @@ services:
- "127.0.0.1:8080:3000" - "127.0.0.1:8080:3000"
environment: environment:
- NODE_ENV=development - NODE_ENV=development
- MONGODB_URI=mongodb://mongodb:27017/mozdit # WHY authSource=admin: the mongodb service below only creates a root
# user (via MONGO_INITDB_ROOT_USERNAME/PASSWORD), which forces --auth
# on the mongod process — an unauthenticated URI fails every query
# with "Command find requires authentication" (MITHOME-98).
- MONGODB_URI=mongodb://admin:password123@mongodb:27017/mozdit?authSource=admin
- MONGODB_DB=mozdit - MONGODB_DB=mozdit
- NEXT_PUBLIC_SITE_URL=http://localhost:8080 - NEXT_PUBLIC_SITE_URL=http://localhost:8080
- NEXT_PUBLIC_COMPANY_NAME=mozdIT Bt. - NEXT_PUBLIC_COMPANY_NAME=mozdIT Bt.