Commit Graph

8 Commits

Author SHA1 Message Date
95e0d8fce1 ci: cap build to 2 of 4 cores so the Pi5 stays responsive
The self-hosted runner builds on the Pi5 alongside live services; the
unthrottled build saturated all cores (Go compiler + esbuild) and took the
reverse-proxied sites down. Add BUILD_CPUS build-arg → GOMAXPROCS in both
build stages (caps the Go compiler and Vite's esbuild) and go build -p,
plus nice/ionice on the build. Slower build, responsive host.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 22:35:39 +02:00
cd588197b9 feat: Authentik OIDC SSO, allow/deny RBAC, admin console & Gitea CI
All checks were successful
build-and-push / build (push) Successful in 15m15s
Authentication & RBAC
- Add confidential OIDC client (Authentik) with /auth/oidc/login +
  /auth/oidc/callback: discovery, code exchange, id_token verify (go-oidc),
  groups claim → role (Archivum-admin → admin, else user). Sessions carry groups.
- Rework ACL into an allow/deny model (new `effect` column + migration).
  db.EffectiveAccess resolves user + all groups over the path and its ancestors:
  default deny, explicit deny always beats allow.
- Enforce ACL for ALL non-admin users (not just guest) across list/read/save/
  delete/move/create/history/diff/images/upload. Admins bypass.
- Seed built-in Archivum-admin / Archivum-reader groups; login allow-list on
  users & groups; public (guest) user access is ACL-configurable.

Admin API & UI
- New GraphQL ops: oidcConfig/updateOidcConfig, group CRUD, membership,
  setUserRole/setUserLogin/setGroupLogin, userGroups, loginOptions.
- Rebuilt AdminView: SSO config, user/group management + membership, login
  toggles, and an allow/deny access-control matrix per path.
- LoginView: "Sign in with Authentik" + public-user option; OIDC callback route.

Rendering/editor
- Fix bug where inline marks (bold/italic/code/strike/link) were dropped on
  TipTap→AsciiDoc save. Add RENDERING_IMPROVEMENTS.md with proposals.

CI / build
- .gitea/workflows/build.yaml: build on the Pi5 runner, push
  localhost:5000/archivum:{latest,<sha>}. Add .dockerignore; bump Go image to 1.25.
- Docs: ARCHITECTURE.md, README.md, docs/AUTHENTIK_SETUP.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 21:58:50 +02:00
4ba3b7dd49 fix: bind mounts from DOCKER_PATH + real storage reads from disk
docker-compose.yml:
- Switch from named volumes back to bind mounts driven by DOCKER_PATH in .env
- DOCKER_PATH/config → /config, DOCKER_PATH/data → /data
- Works with both Windows paths (C:\...) and Linux paths (/opt/...)

server.go:
- Wire in storage.Store so documents query reads real .adoc files from disk
- handleDocuments: calls store.List("") and store.Read(slug) for actual content
- extractTitle: parses first "= Title" line from AsciiDoc, falls back to slug
- handleSetup: also initialises store after writing config so docs appear immediately
- Single document query (document(slug:...)) reads and returns full content

.env.example:
- Clarify DOCKER_PATH usage with Windows and Linux examples
- Show resulting directory layout on host

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 14:45:08 +02:00
65aefb47ed fix: container permissions and volume setup
Problems fixed:
- archivum user (UID 1000) could not write to bind-mounted /config or /data
  because Docker (especially on Windows/WSL2) creates volumes owned by root
- /data/wiki and /data/db subdirectories were never created, causing
  "no such file or directory" when the app tried to write files

Changes:
- docker/entrypoint.sh: runs as root, creates /config /data/wiki /data/db,
  chowns them to PUID:PGID, then drops privileges via su-exec
- Dockerfile: install su-exec + git, copy entrypoint, remove build-time
  USER directive (privilege drop happens at runtime via entrypoint)
- docker-compose.yml: switch local dev to named volumes so Docker manages
  ownership automatically (avoids Windows/WSL2 bind-mount permission issues);
  add TZ env var; explicit comments on how to switch to bind mounts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 14:38:23 +02:00
66eafd9d3c docs: add production deployment example with volumes and .env
- docker/docker-compose.prod.yml: pulls image from 192.168.0.19:5000,
  mounts config/, wiki/ and db/ as separate volumes, health check, TZ support
- .env.example: fully commented template for all env vars
- .gitignore: ignore .env, always track .env.example
- README: deployment section with step-by-step guide, volume table, backup commands
- config.go: default db_path to /data/db/archivum.db (matches prod volume layout)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:54:39 +02:00
2aa055868c fix: use npm install instead of npm ci (no package-lock.json yet)
Switch back to npm ci once package-lock.json is committed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:19:43 +02:00
2bc544ccae fix: Dockerfile no longer requires go.sum to exist before first build
Removed go.sum from the COPY cache layer — go mod download -x creates it
when absent. Added empty backend/go.sum for local tooling (gopls, go build).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:17:37 +02:00
e6b64e3344 feat: Archivum skeleton — Go/GraphQL backend + Vue 3 PWA frontend
Full project scaffold: multi-stage Dockerfile (ARM64/AMD64), AsciiDoc↔TipTap
bridge, Setup Wizard, CodeMirror source editor, Git-backed storage layer,
LDAP+JWT auth skeleton, Tailwind mobile-first layout, and VS Code build/push
tasks targeting registry at 192.168.0.19:5000.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:07:01 +02:00