51a94b85d3
kgva can now be edited through openbureau-core instead of Decap: a small Node CMS (git subtree at cms/core) with a schema-driven editor at /admin, file-based login (no Supabase/Postgres), Markdown on disk. cms/kgva.config.js models the content (portfolio/pages/sections); docker-compose builds the core image (Hugo 0.163.3, no VITE_SUPABASE_URL → local-auth admin) and mounts the repo as the site. seed an admin via cms/seed-admin.mjs; deploy/provision-lxc.sh + ADMIN.md updated. Verified DB-less end-to-end on real content (staged): local login → schema-driven editor → 42 entries (de/en) → stats → create/preview/cleanup; unknown frontmatter (image galleries) preserved on save. The LIVE static site (CT130 timer→hugo→nginx) is unaffected — hugo ignores cms/; the CMS is dormant until provisioned. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
10 lines
624 B
JavaScript
10 lines
624 B
JavaScript
// Seed the first admin into the local users file (DB-less auth). Run once:
|
|
// docker compose run --rm cms node /site/cms/seed-admin.mjs you@mail yourpass
|
|
import { createUser, loadUsers } from '/app/src/auth-local.js';
|
|
const [email, password] = process.argv.slice(2);
|
|
if (!email || !password) { console.error('usage: seed-admin.mjs <email> <password>'); process.exit(1); }
|
|
if ((await loadUsers()).some((u) => (u.email || '').toLowerCase() === email.toLowerCase())) {
|
|
console.log('user already exists:', email); process.exit(0);
|
|
}
|
|
console.log('seeded admin', email, await createUser({ email, password, role: 'admin' }));
|