Commit Graph

20 Commits

Author SHA1 Message Date
Björn Blomberg
772a01c9be docs: append JSON schema to README 2026-04-10 18:33:48 +02:00
Björn Blomberg
c8b63bf8c4 docs: API documentation and JSON schema updates 2026-04-10 18:31:38 +02:00
Björn Blomberg
887669c34f docs: API documentation and JSON schema updates 2026-04-10 18:30:52 +02:00
Björn Blomberg
9d73beb736 feat: implement Git history, diff, and documentAtCommit resolvers 2026-04-10 18:29:55 +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
37056ff8a4 fix: add postcss.config.js so Tailwind CSS is actually compiled
Without this file Vite has no PostCSS plugins configured, so the
@tailwind base/components/utilities directives in main.css are silently
ignored and the built CSS file contains no styles at all.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 14:21:31 +02:00
542762e441 fix: double config path, stale service worker, empty op-name log
- main.go: DOCKER_PATH=/config + /config.json (was /config/config.json)
- vite.config.ts: skipWaiting+clientsClaim forces new SW immediately;
  navigateFallback: null prevents SW from serving stale index.html;
  globPatterns excludes HTML so navigation always hits the network
- server.go: gqlOpName handles shorthand { field } syntax

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 14:16:44 +02:00
8354f5d64c fix+feat: real setup persistence, request logging, improved SPA serving
- server.go now accepts configPath so setup mutation writes config.json to disk
- setup mutation parses GraphQL variables and persists config — no more setup loop
- request logger middleware logs every HTTP request with method/path/status/duration
- GraphQL handler logs operation name and setup/status decisions
- spaHandler simplified: serves real files directly, falls back to index.html
  only for paths that don't exist (fixes potential asset-serving issues)
- health endpoint returns JSON and 503 in setup mode
- main.go logs config path, storage path and db path on startup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 14:03:05 +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
d0db5cd59d fix: remove unused imports/variables caught by vue-tsc
- Remove unused app import in Sidebar.vue
- Remove unused toggleMode function in ThemeToggle.vue
- Remove unused theme variable in SetupWizard.vue
- Remove unused watch import in stores/theme.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:50:43 +02:00
d93f3bb888 fix+feat: SPA routing, theme system, modern UI, setup wizard improvements
Fixes:
- Go server now serves index.html for all non-asset paths (SPA fallback)
- Null guard on data.documents prevents undefined.length TypeError
- App.vue waits for checkStatus() before rendering AppLayout (race condition)
- PWA manifest no longer references missing icon files
- index.html applies theme class before paint to prevent flash

Features:
- Theme store: dark/light toggle + 6 accent color presets + custom hex picker
- ThemeToggle component in header dropdown
- CSS custom properties for accent color (--accent-400/500/600/700)
- Tailwind accent-* color utilities driven by CSS vars
- SetupWizard: 3-step flow, password confirmation, LDAP test button,
  animated toggle, review step, proper error/success states
- Sidebar: loading skeleton, active page highlight, null-safe document list
- Global .input, .btn-primary, .btn-secondary, .card component classes
- Stub GraphQL responses for setup/login/testLdapConnection

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:40:42 +02:00
87821e8988 fix: server starts even without config (REQUIRE_SETUP mode)
main.go no longer fatals on ErrRequireSetup — it passes cfg=nil to NewServer.
NewServer returns REQUIRE_SETUP on every GraphQL call when cfg is nil, and
also adds CORS headers and serves the Vue SPA from /srv/archivum/ui.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:25:23 +02:00
3e41191f45 fix: three TypeScript build errors in frontend
- Remove unused onMounted import in VisualEditor.vue
- Add missing @codemirror/theme-one-dark to devDependencies
- Add vite-env.d.ts so import.meta.env is typed correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:21:51 +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
770bd687be fix: missing fmt import in auth.go and writeFile helper in git.go
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:18:04 +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
8138abad4e feat: add VS Code Compose tasks for local full-stack testing
Adds Compose: Build & Up, Up, Down, Logs tasks for both Windows and Linux,
allowing the complete app to be tested locally via docker-compose on port 8080.
Updates README task table to reflect all available tasks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:14:22 +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
3db6fec664 Initial commit 2026-04-10 12:47:11 +02:00