- staging/prod: postgres:16-alpine per the llmdev Docker spec (healthcheck,
log and memory limits, no host port); the app builds DATABASE_URI from
POSTGRES_PASSWORD and waits for a healthy database; MongoDB kept for one
release (rollback path, transfer source)
- dev: PostgreSQL replaces MongoDB and Mongo Express (host port 5433, checked
and registered); integration test rewritten with pg
- deploy.sh: pg_dump (and, during the switch, mongodump) before the build
- pg/@types/pg pinned to the adapter's 8.20.0 (one copy, no type clash)
- docs: CLAUDE.md, architecture/testing steering, deploy workflow, DOCKER.md;
staging switch runbook in the design
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- scripts/transfer-content.ts: export (shared config + MongoDB adapter,
locale 'all', drafts, upload files) and import (PostgreSQL, one transaction,
refuses a non-empty target); pure helpers in src/lib/content-transfer.ts
- LegalPages: the section anchor is its own field; as the array row id it was
a table-wide primary key in PostgreSQL and the two pages collided
- Products.status: own enumName; the default name equalled the drafts
_status enum, so only draft/published were accepted
- baseline migration regenerated
Verified on a staging copy (disposable MongoDB + PostgreSQL on llmdev): counts
match, all 14 public pages (hu/en) render identical text, partner logo loads,
second import writes nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- postgresAdapter (uuid ids, no push, prodMigrations), DATABASE_URI
- src/payload.shared.ts: the config without the db adapter, shared with the
one-off MongoDB content transfer
- baseline migration 20260929_200306_initial (86 tables; applied twice on a
disposable PostgreSQL 16: second run is a no-op)
- seed copy (references, hosting plans) moved to src/content/seeds/
- MongoDB data migrations, their helpers/tests and the dead lib/mongodb.ts
removed (kept in git history)
- npm scripts for the Payload CLI (works now that the package is ESM)
Branch only: staging has no PostgreSQL yet (tasks 3.x).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Payload CLI failed with ERR_REQUIRE_ASYNC_MODULE on Node 22 and 26 alike:
without "type": "module" it loaded payload.config.ts as CommonJS and could
not require the top-level-await ESM @payloadcms/richtext-lexical. Following
the official Payload template: "type": "module", CommonJS jest files and the
content schema renamed to .cjs, ESLint globs updated. Next's standalone
server.js is ESM and starts; 516 unit tests, tsc, lint and build are green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mongo-express 8081 -> 8082 (8081 is the staging app), grafana 3001 -> 3012
(3001 is step). All dev ports are reserved in the llmdev port registry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/check-ports.sh checks a port list or a compose file (locally or on a
remote host over SSH) before anything is built or started; a port counts as
owned only by the same compose project and service. deploy.sh runs it before
the build; tests are part of the pre-deploy suite. Found: the dev compose
clashes on llmdev (3001: step, 8081: mozdit staging).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Payload db-postgres (uuid ids, no push), fresh baseline migration, one-off
lossless data migration from the staging MongoDB, Compose per the llmdev Docker
spec, pg_dump backups, Node 22 for the Payload CLI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds dark: counterparts to the fixed Tailwind colours (cards, sections,
text, borders, status messages) and explicit colours for the form fields.
About and legal pages already use the theme tokens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dark: variant now matches data-theme="dark" (toggle) or the system
preference when no theme is stored, like the design tokens. Other subpage
views (Services, About, Contact, Legal) still need dark: classes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Products collection (interim mirror of the PLATFM-14 catalogue contract):
lifecycle status, product type, required whole-forint net price, yearly
billing, service definition, per-product English gate
- HostingPlans global: page copy, comparison labels, VAT rate (27%)
- Gate: production shows only active plans, staging all but retired; with no
showable plan the page is 404 and left out of the menu and the sitemap
- /hu/tarhely-csomagok <-> /en/hosting-plans via PAGE_SLUGS (hreflang,
language switcher, CTA page picker)
- Seed migration 20260929_hosting_plans: mIT Start (14 900 Ft/yr, 5 mailboxes)
and mIT Mid (23 900 Ft/yr) as drafts, English AI draft; idempotent
- Production SEO suite expects at least 12 sitemap URLs; new SMOKE-10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision 2026-09-29: variant B, yearly billing only, mIT Start raised
to 5 mailboxes. Price is required; "request a quote" only for larger needs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dark navy background, white text; name on the logo is
"Atlantisz Pihenőpark & Halásztanya". Not used on the site yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Atlantisz logo has white lettering made for a dark header, invisible
on our light background, and its official name differs between the logo
and the admin entry. The partner_references migration now classifies it
as a pending client reference in environments where it has not run yet;
the follow-up 20260929_atlantisz_pending migration moves the already
granted staging entry to pending, touching only the automatic
classification (a later admin decision is left alone).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per the managed web operations research (PLATFM-13), a client must not be
shown as a "partner" and names/logos need written permission. Partners
now carry a required relationship category and a publication permission
(default: none) with the permission's location and review date; only
entries with written permission, a category and a logo are public.
The homepage shows clients ("Akik már minket választottak") and other
relationships in separate blocks via ReferencesSection; every partner
shows its relationship type. The section copy moved from a hard-coded
constant into the Home global (localized). The 20260929_partner_references
migration marks Angele Pihenőház as a client reference with written
permission (owner-confirmed), hides any other uncategorised entry, and
seeds the copy in hu + en. The JSON seed uses the same source.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The site promised more than the production server delivers (99.9%,
"nearly 100%", 1–100 GB SSD, unlimited traffic, 1–20 GB per mailbox,
Python/Node/PostgreSQL, DNSSEC, developer API, worldwide name servers,
immediate response). The 20260929_service_claims migration applies the
owner-confirmed texts C1–C14 (docs/termekkor-es-szerverkapacitas-
elemzes.md, ch. 9) and adds the 90% mailbox warning feature.
reviseContent() only replaces an exact Hungarian match, only rewrites
English that is still the old AI draft (human edits are kept and
reported), inserts list items once, and sends an approved page back to
ai-draft when its English changed. Published doc + latest version only.
Legal texts (terms, privacy) are left for legal review. The translation
memory gains the new pairs. Verified on a staging DB copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compare the website's service claims with the production server
analysis (iron.mozdit.hu), review that analysis, propose the advertised
package range, and list open questions for the owner. Sync Plane + TODO.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The staging noindex (MITHOME-116) hinges on a build variable; leaking it
into production would silently drop the site from Google. deploy.sh now
refuses to build production when NEXT_PUBLIC_DEPLOY_ENV=staging is set,
and after every deploy runs scripts/check-indexability.sh, expecting an
indexable production and a blocked staging (node tests cover both ways,
stray noindex and unreachable endpoints; added to pre-deploy tests).
A separate Playwright project, production-seo (npm run
test:seo:production), checks robots.txt, that all 12 sitemap URLs are
final/indexable with self canonicals and sitemap hreflangs, SSR content
and links, the / -> /hu redirect and real 404s; host redirects are gated
until the production domain is live. Verified on a production-mode build
of a staging DB copy (5 passed) and failing as expected against staging.
eslint now ignores generated test output (playwright-report, test-results,
coverage), which broke the pre-deploy lint after local e2e runs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/lib/seo.ts is the single source for page alternates (self canonical
+ hreflang hu/en/x-default), sitemap entries (every page in both
languages, with alternates) and robots rules. Per the user's decisions
every page is announced in both languages regardless of the English
approval status, and staging is never indexed: robots.txt disallows
all, the sitemap is empty and every page carries a noindex meta.
Home and catch-all page metadata now carry alternates and a locale-
correct og:url. Staging smoke SMOKE-09 checks hreflang, canonical,
noindex and robots.txt. Documented in architecture.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A compact "HU | EN" switcher next to the theme toggle (desktop) and the
menu button (mobile). Each link opens the current page in the other
language with its translated slug (/hu/szolgaltatasok <-> /en/services),
unknown pages fall back to the language's home. English is always
offered (user decision), even before a page's English is approved.
Links carry lang/hrefLang, the active one aria-current, and the group a
localized accessible name. No flags: a flag marks a country, not a
language. Unit and component tests plus staging smoke SMOKE-08.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sync localized legal pages, English translation status, non-destructive
AI draft import, validated English legal pages and the admin validation
prompt into content-management, and the approved-English-only gate into
public-site.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SIGTERM/SIGINT handlers were re-registered on every module evaluation,
and a build worker receiving both signals logged again after logger.end(),
raising ERR_STREAM_WRITE_AFTER_END during `next build`. Guard with an own
flag (winston's readable-stream@3 Logger has no writableEnded) and register
the handlers once per process with process.once.
Closes MITHOME-126
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found during the live check on a staging copy: the embedded browser
denied the async Clipboard API, so "copy prompt" failed silently. The
panel now falls back to a selection copy and finally leaves the prompt
selected with a Ctrl/Cmd+C hint; covered by component tests.
Payload only shows a generic "field is invalid" toast for the rejected
approval, so the legal pages' status field description now states the
two-model rule next to the field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Validation of legal translations is a manual flow (user decision): copy
the prompt, run it in any vendor's model, paste the answer back. The
legal validation block now holds the prompt panel and a list of reviews
(model, date, verdict, pasted answer, notes) instead of a model list and
report link. Approval needs two distinct models whose latest complete
review does not reject; a newer review supersedes a model's rejection.
The locale path collector now looks through row/collapsible wrappers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
buildLegalValidationPrompt() is the single review template: the criteria
(meaning, GDPR terminology, obligation strength, preserved markers,
clarity), a severity table output with a final verdict, and the
Hungarian/English text of every section paired by id, missing English
flagged as high severity. The legal page sidebar shows it through the
LegalValidationPrompt UI field (hu + en read from REST with draft=true
and no locale fallback) with copy and refresh buttons.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Legal pages get a sidebar "legal validation" record (validating models,
date, report reference). Their English translation status can only be
set to "approved" when at least two distinct models, the date and the
report are recorded; page globals are unaffected. The admin description
states that model review does not replace legal advice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/content/translations/en.json is a reviewable hu -> en memory built
from the live staging content (179 texts). Tests guard every entry:
placeholders, HTML, legal markup and e-mail/URL literals must survive.
fillEnglishDraft() fills only empty English values whose Hungarian text
exactly matches a memory key (lists all-or-nothing) and moves the page
status none -> ai-draft; it never sets "approved" or overwrites English.
The 20260929_en_ai_draft migration applies it to every global and legal
page (published doc + latest version), reports untranslated texts, and
wraps legacy values first so it does not depend on migration order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every page global and legal page gets a shared "English translation
status" sidebar field (none / AI draft awaiting review / approved).
The content adapter reads through readGated(): an English page renders
English text only when its translation is approved, otherwise the
Hungarian text of the same page, while links keep resolving to /en/...
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Legal page title, last-updated text and section titles/contents become
localized; slug and section ids stay shared. A Payload migration wraps
existing values into { hu: value } on every legal page and its whole
version history, like the globals migration (MITHOME-111).
The migration helper now handles collections as well as globals
(rewriteDocs) and can scope version rewrites to the latest working copy,
which the upcoming English import needs. Migration tests share an
in-memory Mongo fake that honours query filters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Legal pages localization, English translation status with a public
gate, a non-destructive AI-draft import from a hu->en translation
memory, and mandatory multi-model validation of legal translations
with a copyable validation prompt in the admin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
General rule: links to another host open in a new tab with
rel="noopener noreferrer"; internal paths, mailto: and tel: stay in the
same tab. Behaviour was inconsistent before — the home Webmail button
opened in the same tab while the other webmail links did not, and the
CTA and header relied on a manual "external" switch.
src/lib/external-link.ts decides from the URL (externalLinkProps for
JSX, openExternalLinksInNewTab for CMS-provided HTML in About paragraphs,
legal pages and the GDPR label). All link sites use it; the manual
"external" CTA checkbox and NavigationItem flag are removed so the rule
cannot be bypassed. Rule documented in architecture.md and CLAUDE.md;
staging smoke SMOKE-07 checks every external homepage link.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sync the localized page globals and lossless locale migration
requirements into the content-management spec.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The home hero CTA stored a free-text href "/kapcsolat" that predated the
locale-prefixed routing (MITHOME-114), so the main call-to-action led to
a 404. Internal targets were typed by hand and could never follow the
locale or its translated slug.
CTA links now choose between an internal page (home/about/services/
contact/privacy/terms) and an external URL. Page links are resolved per
request with localePath(), giving /hu/kapcsolat and /en/contact; external
links (webmail) keep their localized href. A Payload migration converts
existing internal paths to page links on the published global and every
draft/version, idempotently and independent of the locale migration's
order. The global-doc iteration shared with MITHOME-111 moved to
src/lib/migrate-global-docs.ts; the JSON seed emits the new shape too.
Verified on a copy of the staging DB: both migrations ran on startup,
/hu and /en CTAs point to their contact pages (200), webmail unchanged,
admin shows the selector, toggles the fields and blocks publishing a URL
link without a URL.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mark MITHOME-111 done. Document the mandatory pre-deploy mongodump and
the restore-based rollback for releases that carry Payload data
migrations, and record the live verification results in the OpenSpec
tasks (staging DB copy: hu/draft/version content unchanged, en falls
back, second run is a no-op).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mark every translatable text/textarea field of the Home, About, Services,
Contact and Common globals as localized. Icons, row ids, the external
flag and the postal address stay shared; CTA hrefs are localized because
internal routes differ per locale. String lists (paragraphs, bullets,
features, spec items) are localized at array level so locales can have
different item counts; structured rows share order/icons and localize
only their inner text.
Existing data is not re-seeded (that would overwrite admin edits): a
Payload migration wraps legacy values into { hu: value } on the published
global and every draft/version record, idempotently, and runs on
production startup via prodMigrations. Paths are derived from the Global
configs themselves so the migration cannot drift from the schema.
OpenSpec change: openspec/changes/localize-globals-mithome-111
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Content layer description across the AI-agent steering docs still
described the pre-migration JSON system as the live, current mechanism
— rule #1 in CLAUDE.md and the Content row in architecture.md
explicitly told future work (and future agent sessions) to edit
proto/src/content/pages/*.json directly, which the live site hasn't
read since MITHOME-91.
Rewrote, per the ticket's named targets:
- .agent/steering/architecture.md: system overview, the Content layer
table row, rule #1, and the Content Management code example now
describe Payload Globals/Collections + the payload-content.ts Local
API adapter, with /admin as the editing surface.
- CLAUDE.md: Stack line now names Payload CMS, rule #1 rewritten the
same way, and the project-structure tree gets the (frontend)/(payload)
route groups, globals/, collections/, and payload.config.ts that were
entirely missing from it.
Also fixed directly-adjacent staleness found while doing this pass —
same "how is content edited" documentation debt, just not literally
named in the ticket:
- .agent/AGENTS.md: same project-structure tree gap as CLAUDE.md.
- .agent/workflows/new-feature.md: step 3 told contributors to edit
the JSON file directly; now points at the Payload config + admin.
- .agent/workflows/review.md: the example "flag hardcoded text" review
comment suggested moving it into the JSON file.
- .agent/steering/development-rules.md: the TRADEOFF code example
literally used "JSON content management vs CMS" as a live open
decision — that decision is resolved, updated the example to match.
- README.md: the entire "Tartalomkezelés" section and a "CMS
Publikálás gomb" paragraph described the retired content-editor.js
workflow (git-push-based publish, JSON directory tour) as current;
also dropped a dead link to docs/felhasznaloi-utmutato.md, deleted
in MITHOME-93.
Doc-only change, no proto/ source touched — no gate to run beyond a
sanity re-read of each edited file.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
User request: the partner logos were laid out with flex-wrap, which
doesn't align items into clean rows/columns. Switched to CSS grid
(grid-cols-1 sm:grid-cols-2 md:grid-cols-3), so it never exceeds 3
columns regardless of viewport width or partner count.
w-fit + mx-auto (not inline-grid + mx-auto) so the grid centers
correctly even with fewer partners than 3 — auto margins don't center
inline-level boxes, but do for block-level ones sized to their content.
Verified live in the browser at 1200px width with 5 temporary test
partners (reusing an existing Media doc, deleted after): renders as a
3-then-2 grid, centered, no console errors.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds the two test categories the ticket asked for, replacing the old
content-JSON-schema-only testing story now that Payload is the real
source of truth:
1. src/payload-config.test.ts — fast, DB-free unit tests over the
Collection/Global config objects themselves. WHY not importing
payload.config.ts directly: it pulls in the real `payload` and
`@payloadcms/db-mongodb` packages as values (not just types), which
are ESM-only and Jest's default transformIgnorePatterns skips
node_modules entirely — confirmed by trying it
(`SyntaxError: Cannot use import statement outside a module` from
payload's own dist). Individual collection/global files only ever
`import type` from 'payload' (erased at compile time), so they're
safely importable in isolation. Two of the assertions are
deliberate regression guards for real bugs found earlier this
session (MITHOME-121): Media.access.read must stay public, and
Partners.logo must stay optional.
2. scripts/test-payload-local-api.ts (npm run test:payload) — exercises
every src/lib/payload-content.ts getter plus a full
create/findByID/delete cycle against a real, already-migrated
MongoDB. WHY a plain node script instead of a Jest integration
config: same ESM problem as above, and Payload's dependency graph
is too broad to safely add to transformIgnorePatterns — this
follows the same working `node --import tsx` pattern already used
by migrate-content-to-payload.ts. Not wired into
pre-deploy-tests.sh (needs a live, pre-migrated MongoDB, same
reasoning as the removed CMS integration tests); run manually or
before a release.
3. Fixed the pre-existing (Docker-stack-gated, so silently never
caught) staleness in integration.test.ts and e2e-docker.test.ts:
unprefixed routes (/rolunk) → locale-prefixed (/hu/rolunk), and
Mongo assertions against the old site_config/contact_submissions
collections → the real globals/legal-pages/partners/
contact-submissions collections Payload actually uses. Also fixed
an unrelated stale error-message assertion for spam detection that
never matched the route's real string.
Verified: full gate green (tsc, lint, 63 unit tests — 13 new — build),
and separately ran test:payload live against the dev MongoDB (8/8
passed, including the write/read/delete cycle actually hitting Mongo).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
/api/contact used to write straight to a raw, Payload-external MongoDB
collection (contact_submissions, via proto/src/lib/mongodb.ts's
getCollection) — the client had no way to see incoming messages except
by reading the database directly. Rate limiting, length caps, email
validation, and spam-keyword filtering all stay on the route exactly
as before; only the persistence target changed.
New: src/collections/ContactSubmissions.ts (name, email, subject,
message, gdprConsent checkbox, status select defaulting to "new").
Deliberately no custom `access` block — Payload's default
(authenticated-only for every REST operation) is exactly right here:
the client reads submissions in the admin, nobody can read or write
them through the public REST API, and the route's own write uses the
Local API (payload.create), which runs with overrideAccess: true by
default and so isn't blocked by that same rule. No versions/drafts
(a submission is a fact, not editable content) and no field-level
length/format validation duplicated in the collection, matching the
ticket's explicit scope: those checks live on the route.
route.ts: replaced getCollection()/insertOne() with
getPayload({config}).create({ collection: 'contact-submissions', ... }).
Removed the now-unused getCollection() helper from lib/mongodb.ts
(checkMongoConnection/getDb stay, used by /api/health) and its test.
Test gotcha worth documenting: next/jest's SWC transform rewrites the
`@payload-config` tsconfig-path alias to a real relative specifier at
transform time, so `jest.mock('@payload-config', ...)` never actually
intercepts what route.ts requires — it silently falls through to the
real payload.config.ts (mongooseAdapter, live Mongo needed). Fixed by
mocking the resolved relative path instead
(`jest.mock('../../../payload.config', ...)`); documented inline in
route.unit.test.ts for whoever hits this next (MITHOME-96 will need
the same trick for other Payload-backed routes/collections).
Verified live end-to-end, not just the test suite: submitted the real
contact form on /hu/kapcsolat, got the success message, found the
submission in /admin/collections/contact-submissions with all fields
correct (including gdprConsent checked and status "Új"/New), then
deleted the test record. Zero console errors in a fresh tab. Gate:
tsc, lint, unit tests (50 passed — one fewer than before, the removed
getCollection test), production build all green.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
User request: there was no way to get from the Payload admin back to
the public website — confirmed live (read_page on the admin nav showed
only internal links: collections, globals, account, logout).
Added a "🌐 Honlap megnyitása" link next to the QuickSearch box
(src/components/admin/QuickSearch.tsx — same header slot, no new
admin.components entry or importmap regen needed since the export name
didn't change). Opens in a new tab, points at siteConfig.general.url
(NEXT_PUBLIC_SITE_URL), so it resolves to the correct site per
environment automatically — stage.mozdit.hu on staging, the production
domain once that's live.
Verified live in the browser: link renders next to the search box,
resolves to the expected URL (find() confirmed the href), zero new
console errors in a fresh tab. Gate: tsc, lint, unit tests (51 passed),
production build all green.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
User request: don't force a logo upload to save a Partner — allow
saving name+url first, logo later. Removed `required: true` from
Partners.ts logo field. The frontend (getPartners(), payload-content.ts)
already filters out logo-less partners before rendering, so this is
safe: a partner without a logo just doesn't show on the public site
yet, nothing breaks.
While verifying this live (create a partner without a logo, check the
public homepage doesn't break), found a real, previously-undetected
bug that predates this change: partner logos never actually loaded on
the public site at all. Payload's default collection read access is
"authenticated users only" (Boolean(user)), and Media.ts never
overrode it — so GET /api/media/file/<name> always 403'd for anyone
not logged into the admin. Next.js's image optimizer (/_next/image)
fetches that URL server-side without forwarding the browser's admin
session cookie, so it always got a 403 back, which it reports as "The
requested resource isn't a valid image" (400) — the <img> silently
rendered as a broken image icon on the homepage the whole time. Fixed
by adding `access: { read: () => true }` to Media.ts — write
operations (create/update/delete) stay admin-only via Payload's
default.
Verified live in the browser: created a Partner with only name+url via
the admin (saved successfully, no required-field error), confirmed it
correctly does NOT appear on the public homepage (no logo yet), then
deleted that test record. Separately, in a fresh unauthenticated tab,
confirmed the existing Partner's logo now actually renders on /hu
(previously a broken image icon) — curl-verified both
/api/media/file/<name> and /_next/image?url=... return 200 without any
auth. Zero console errors. Gate: tsc, lint, unit tests (51 passed),
production build all green.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds a search box to the top of every Payload admin page
(admin.components.header) that searches by text across every field of
every Global and Collection, in both locales — something Payload has
no built-in equivalent for: collection list views only search their
own title/slug fields, and Globals have no list view at all.
Implementation is deliberately client-side and index-free rather than
@payloadcms/plugin-search (a server-side search collection kept in
sync via hooks): this project's entire content is 5 Globals + 2 small
Collections, so a plugin-managed search index would be disproportionate
maintenance for the actual data volume — the same reasoning already
applied to the logo editor (MITHOME-118). On first use, the component
fetches every Global/Collection doc in both locales via the existing
REST API (same-origin, admin session cookie), recursively flattens
every field to (path, value) pairs client-side, and filters by
case-insensitive substring as the user types. Each result links
straight to the right edit view (global or collection/id).
New: src/components/admin/QuickSearch.tsx. Registered via
payload.config.ts admin.components.header, which required a
generate:importmap run — the useful gotcha this surfaced: Payload
resolves component paths against admin.importMap.baseDir, which
defaults to process.cwd() (the proto/ the CLI is run from), not
dirname(payload.config.ts) — so the path needed to be
'./src/components/admin/QuickSearch#QuickSearch', not
'./components/admin/QuickSearch#QuickSearch'. Documented inline.
Verified live in the browser (not just tsc/lint): search finds matches
in both a Global (Home hero.cta.secondary.text / services description)
and a Collection (Partners name/url), shows source + field path +
locale + a snippet per result, clicking a result navigates to the
correct edit view, and the search state persists across client-side
admin navigation since the header component doesn't remount. Zero
console errors in a fresh tab. Full gate green: tsc, lint, unit tests
(51 passed), production build.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Server-side nginx config isn't tracked anywhere in this repo, which is
exactly how an orphaned vhost went unnoticed: it used to reverse-proxy
to the old CMS (content-editor.js, port 4001), retired in MITHOME-93.
After that service was stopped/disabled, the vhost silently kept
serving its still-valid TLS cert as nginx's apparent fallback for any
unmatched *.mozdit.hu subdomain — which is what produced a real-looking
(but harmless) Firefox "this site may be impersonating" warning when
the user mistyped a URL.
Repointed the vhost (server-side, not in this repo) to reverse-proxy
/admin, /api/ and /_next/ to the same staging app container Payload
already runs on (127.0.0.1:8081) — same backend as stage.mozdit.hu,
just a friendlier admin-specific URL. Root redirects straight to
/admin; anything else redirects to the canonical stage.mozdit.hu to
avoid serving the public site twice. Reused the existing Let's Encrypt
cert (no new certbot run needed).
This commit only adds docs/nginx-vhosts.md, documenting what's live on
the server and why, since nginx config itself isn't part of this
repo's source of truth.
Verified live: TLS cert now matches cms.stage.llmdev.mozdit.hu (no more
mismatch warning), GET / redirects to /admin (302), GET /admin returns
200 with correctly loaded assets (checked in a real browser, zero
console errors), GET /rolunk redirects to stage.mozdit.hu, GET
/api/health proxies through correctly, and POST /api/users/login with
the real staging admin credentials returns 200 through this domain too.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Follow-up to MITHOME-97: after every deploy, a brand-new database
(first-ever deploy, or a volume wipe) leaves the Payload admin behind
the "Create first user" screen — someone has to notice and fill it in
by hand, which means environments can silently end up with no known
admin credentials, or with whatever a random person happened to type
in at the time.
deploy.sh now calls Payload's built-in `POST /api/users/first-register`
REST endpoint right after the healthcheck passes, using ADMIN_EMAIL /
ADMIN_PASSWORD from the environment's .env file. That endpoint only
succeeds when the `users` collection is completely empty (throws 403
Forbidden otherwise) — which makes this naturally idempotent: the
first deploy against a fresh database creates the known admin, every
later deploy gets a harmless 403 and skips it. It never overwrites an
existing user's password. Missing ADMIN_EMAIL/ADMIN_PASSWORD in the
env file just skips the step with a warning, it doesn't fail the
deploy.
Documented the new variables in .env.staging.example and
.env.production.example (next to the existing PAYLOAD_SECRET
instructions), and the new deploy.sh step 4 in
.agent/workflows/deploy.md. Also dropped a stale "Content Editor is
staging feliratot kap" line from the same doc (that behavior belonged
to the CMS retired in MITHOME-93 and no longer exists).
Verified locally against real Payload instances (not just reading the
code): a fresh, empty MongoDB returns 200 and creates the user; a
second call against the same now-non-empty database returns 403 and
changes nothing; a database that already had a different user (the
existing dev DB) also correctly returns 403.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
scripts/deploy_to_stage_on_local.sh restarted a
"mozdit-content-editor.service" systemd unit after every staging deploy
— the old custom CMS's own service (content-editor.js, retired in
MITHOME-93). Left in place, the next staging deploy would pull the
commit that deletes content-editor.js and then try to restart a
service pointing at a now-missing script.
Removed the restart from the deploy script; the server-side systemd
unit itself (if still installed) needs a manual stop/disable — out of
reach from here (no SSH access in this session), flagging it to the
user instead.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>