fix: filebrowser scroll+lang hover+black-flash+shell one-line
- filebrowser: select() only scrollIntoView on keyboard, not hover - lang-switch: .lang-switch:hover → invert rule (header excluded before) - black-flash: color-scheme light; dark script sets colorScheme - shell: flex-wrap nowrap; keepEnd() scrolls on input Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,36 +1,68 @@
|
||||
# Admin (openbureau-core CMS)
|
||||
# Admin (Decap CMS)
|
||||
|
||||
The site is edited through **openbureau-core** — a small Node CMS (vendored at
|
||||
`cms/core`) that builds the Hugo site and serves it together with an editor at
|
||||
`/admin`. It is **DB-less**: file-based login (`auth: 'local'`) and Markdown on
|
||||
disk. No Supabase, no Postgres.
|
||||
A lightweight, git-based editor at `/admin`. It commits markdown straight to the
|
||||
Gitea repo — no database, no server. The public site stays static; rebuilding it
|
||||
after an edit is a separate step (see *Deploy* below).
|
||||
|
||||
## What's where
|
||||
## 1. Put the repo on Gitea
|
||||
|
||||
- `cms/kgva.config.js` — the content model (collections + fields) the editor renders.
|
||||
- `cms/core/` — the engine (git subtree of `git.openbureau.ch/karim/openbureau-core`).
|
||||
Update it with:
|
||||
`git subtree pull --prefix=cms/core https://git.openbureau.ch/karim/openbureau-core.git main --squash`
|
||||
- `cms/.env` — `JWT_SECRET` (sign-in secret) + `ADMIN_EMAILS`. Copy from `.env.example`.
|
||||
- `cms/users.json` — the user store (bcrypt hashes). Git-ignored. Seed with:
|
||||
`docker compose run --rm cms node /site/cms/seed-admin.mjs you@mail yourpass`
|
||||
The site must live in a Gitea repo (e.g. `git.kgva.ch/karim/kgva`). Set the same
|
||||
`repo` and `branch` in `static/admin/config.yml`.
|
||||
|
||||
## Run
|
||||
## 2. Create a Gitea OAuth app
|
||||
|
||||
In Gitea: **Settings → Applications → Create OAuth2 application**.
|
||||
|
||||
- Redirect URI: `https://<your-site>/admin/`
|
||||
- Copy the **Client ID** into `static/admin/config.yml` → `backend.app_id`.
|
||||
|
||||
Decap uses PKCE, so no client secret and no auth proxy are needed.
|
||||
|
||||
## 3. Edit
|
||||
|
||||
Open `https://<your-site>/admin/`, log in with Gitea. New project:
|
||||
*Portfolio → New Project*; images upload into `static/img` and are referenced as
|
||||
`/img/...`. Saving commits to the repo on the configured branch.
|
||||
|
||||
## 4. Deploy (rebuild after an edit)
|
||||
|
||||
Because the site is baked into the Docker image, a commit must trigger a rebuild.
|
||||
Pick one:
|
||||
|
||||
- **Manual:** on the host, `docker compose up -d --build`.
|
||||
- **Gitea Actions** (`.gitea/workflows/deploy.yml`), sketch:
|
||||
|
||||
```yaml
|
||||
on: { push: { branches: [main] } }
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: docker compose up -d --build # on a runner with access to the host
|
||||
```
|
||||
|
||||
(Adjust to your Proxmox/LXC setup — same place OPENBUREAU deploys.)
|
||||
|
||||
- **Webhook:** point a Gitea webhook at a tiny script on the host that runs the
|
||||
`docker compose` line.
|
||||
|
||||
## Local editing (no auth)
|
||||
|
||||
```
|
||||
cp cms/.env.example cms/.env # set JWT_SECRET (openssl rand -hex 32)
|
||||
docker compose build
|
||||
docker compose run --rm cms node /site/cms/seed-admin.mjs karim@gabrielevarano.ch <pw> # once
|
||||
docker compose up -d
|
||||
npx decap-server # in one terminal
|
||||
# uncomment `local_backend: true` in config.yml
|
||||
hugo server # in another
|
||||
# open http://localhost:1313/admin/
|
||||
```
|
||||
|
||||
Open `http://<host>:8080/admin/`, log in, edit. *Speichern* writes the Markdown,
|
||||
*Vorschau* builds a draft preview, *Publizieren* rebuilds the public site.
|
||||
## Self-hosting the CMS bundle (optional)
|
||||
|
||||
## Deploy
|
||||
To avoid the CDN (in the spirit of the colophon), download the bundle once and
|
||||
point `static/admin/index.html` at it:
|
||||
|
||||
A single container (Hugo build + Node serve). See `deploy/` —
|
||||
`provision-lxc.sh` stands up an LXC and does all of the above (incl. a seeded
|
||||
admin whose password lands in `cms/ADMIN_PASSWORD.txt`); `Caddyfile` terminates
|
||||
TLS and reverse-proxies the domain. Safe cutover: provision a NEW container on a
|
||||
temporary IP, verify, point Caddy at it, then retire the old one.
|
||||
```
|
||||
curl -L https://unpkg.com/decap-cms@^3.3.3/dist/decap-cms.js \
|
||||
-o static/admin/decap-cms.js
|
||||
# then in index.html: <script src="/admin/decap-cms.js"></script>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user