Commit Graph

40 Commits

Author SHA1 Message Date
0798b76c3a Merge feat/git-sync: git-synk med SSH-nyckelstöd
All checks were successful
build-and-push / build (push) Successful in 2m6s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-02 23:11:26 +02:00
e181e8e68e feat(gitsync): synka wiki-repot mot remote över SSH
- ed25519-deploy-nyckel genereras av servern (config-volymen, 0600),
  GIT_SSH_COMMAND med egen known_hosts (accept-new)
- inställningar: remote-URL, live-gren, read-only, auto-synk-intervall
- bakgrundssynk: endast fast-forward, flaggar attention vid merge-behov
- pull/push, skapa/byt gren, merge-popup (ours/theirs per fil eller allt),
  abort, reset från remote med automatisk backup-gren
- headless-konfig via config.json eller updateGitSync-mutationen
- openssh-client tillagd i runtime-imagen; mutex kring alla git-operationer

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-02 23:10:34 +02:00
952ff5f951 ci: re-trigger build (previous run interrupted by host overload)
All checks were successful
build-and-push / build (push) Successful in 1m4s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 22:39:51 +02:00
9180033543 feat(acl): tree-based access editor + permission-aware UI
Some checks failed
build-and-push / build (push) Failing after 1h0m8s
Admin — Access Control is now a folder/file tree. Pick a user/group, click a
node to set an allow and/or deny rule there; each node shows the subject's
*effective* rights (letters S V R E C D M) and allow/deny "set here" badges,
computed server-side incl. group membership, inherited folder rules and
deny-wins. New queries: myAccess(paths) and subjectAccess(subjectType,subjectId,paths).

Main UI — actions are hidden when the current (non-admin) user lacks the
permission: create folder/document (Sidebar), drag-to-move, and Save/Delete in
the document view. Adds a permission-gated Delete button to the document
toolbar. Admins bypass and see everything.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 20:28:16 +02:00
d4cea04941 fix(oidc): don't strip issuer trailing slash (Authentik discovery match)
All checks were successful
build-and-push / build (push) Successful in 9m0s
go-oidc requires the issuer passed to NewProvider to exactly match the issuer
in the discovery document. Authentik returns ".../application/o/<slug>/" with a
trailing slash; we were stripping it, causing "issuer did not match". Pass the
issuer verbatim and fall back to the alternate slash form.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 23:03:15 +02:00
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
d808b0289f partial implement (Save) 2026-04-16 07:01:57 +02:00
d571f156a6 feat: add LDAP support and guest user functionality
- Introduced BaseDN configuration for LDAP in the config.
- Enhanced User model to include IsLDAP field.
- Updated database queries to handle LDAP users.
- Implemented GraphQL queries for LDAP browsing and user authentication type.
- Added ACL management for users and groups, including guest user permissions.
- Updated frontend to support LDAP login and guest user login.
- Improved error handling and user feedback in login and ACL management.
2026-04-15 00:42:40 +02:00
Björn Blomberg
61f33d350a feat: enhance LDAP integration with new configuration options and browsing capabilities 2026-04-14 16:07:52 +02:00
Björn Blomberg
d6fd50e511 Merge remote-tracking branch 'origin/main' 2026-04-14 09:21:19 +02:00
Björn Blomberg
6a81de8bac feat: add LinkDialog and CreateItemDialog components; enhance editor with footnote and include functionalities 2026-04-14 09:18:49 +02:00
8666d1f6b3 docs: update README with Docker Compose setup instructions and environment variable configuration 2026-04-13 22:53:45 +02:00
Björn Blomberg
e89d2c87f0 feat: add syntax highlighting and enhance document editing features
- Import GitHub dark theme for highlight.js in main.ts
- Pass slug prop to VisualEditor in DocumentView.vue for version and normal editing modes
- Update Vite configuration to increase maximum cache size and add media proxy
- Add new dependencies for Tiptap extensions and highlight.js in package.json and package-lock.json
2026-04-13 15:14:46 +02:00
Björn Blomberg
a8c854e61b fix: update .gitignore to include autogenerated PDF files 2026-04-13 10:59:53 +02:00
Björn Blomberg
f12743b158 fix: update .gitignore to exclude additional directories and remove package-lock.json 2026-04-13 10:58:17 +02:00
Björn Blomberg
a46d56e2fc feat: integrate @tailwindcss/typography and enhance folder picker functionality
- Added @tailwindcss/typography dependency to package.json and tailwind.config.js.
- Updated FolderPicker.vue to include additional properties (isGitRepo, hasDocuments) for directories.
- Enhanced Sidebar.vue with folder creation and document handling features, including drag-and-drop functionality.
- Implemented createFolder and moveDocument mutations in gql.ts for managing folder and document operations.
- Added logic to handle folder creation and document creation prompts in Sidebar.vue.
- Updated the layout and interactions in Sidebar.vue to improve user experience.
2026-04-13 10:55:02 +02:00
376b946e73 Implement AsciiDoc and TipTap conversion logic, including new Admonition node and CodeBlock extension; add DiffViewer and HistoryPanel components for document version comparison; introduce password hashing utility with SHA-256. 2026-04-12 22:28:15 +02:00
Björn Blomberg
05b773c14c first working login and editing of file. bugg is för rendering with tiptap 2026-04-10 19:56:21 +02:00
Björn Blomberg
41dc1d9988 fix: handle UNAUTHORIZED responses by clearing session and reloading 2026-04-10 18:56:26 +02:00
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