Commit Graph

19 Commits

Author SHA1 Message Date
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
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
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
c8b63bf8c4 docs: API documentation and JSON schema updates 2026-04-10 18:31:38 +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
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
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
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
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