collabmd 0.1.20 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +98 -9
  2. package/bin/collabmd.js +3 -2
  3. package/docker-compose.yml +13 -1
  4. package/package.json +2 -1
  5. package/public/assets/css/style.css +1 -1
  6. package/public/assets/js/chunks/{chunk-HEWVH67U.js → chunk-CYK7KO7W.js} +8 -8
  7. package/public/assets/js/chunks/chunk-GFDM7YCF.js +1 -0
  8. package/public/assets/js/chunks/editor-session-S5AT7BMV.js +22 -0
  9. package/public/assets/js/chunks/{preview-render-compiler-UZ4SZDQQ.js → preview-render-compiler-6Y7TKXFJ.js} +1 -1
  10. package/public/assets/js/chunks/{quick-switcher-controller-J7I3CUET.js → quick-switcher-controller-A6SKH5HI.js} +1 -1
  11. package/public/assets/js/{excalidraw-editor-ZDYKMZOL.js → excalidraw-editor-5YWMGLKF.js} +145 -62
  12. package/public/assets/js/excalidraw-editor.js +1 -1
  13. package/public/assets/js/main.js +503 -182
  14. package/public/assets/js/preview-render-worker.js +15 -15
  15. package/public/index.html +104 -84
  16. package/src/client/application/app-shell/git-feature.js +304 -27
  17. package/src/client/application/app-shell/ui-feature.js +69 -7
  18. package/src/client/application/app-shell/workspace-feature.js +46 -0
  19. package/src/client/application/app-shell-elements.js +2 -0
  20. package/src/client/application/mermaid-preview-hydrator.js +1 -1
  21. package/src/client/application/plantuml-preview-hydrator.js +1 -1
  22. package/src/client/application/workspace-coordinator.js +147 -18
  23. package/src/client/application/workspace-preview-controller.js +34 -0
  24. package/src/client/application/workspace-route-controller.js +104 -0
  25. package/src/client/bootstrap/collabmd-app-shell.js +107 -0
  26. package/src/client/domain/runtime-paths.js +5 -0
  27. package/src/client/domain/vault-utils.js +2 -2
  28. package/src/client/excalidraw-editor.js +52 -3
  29. package/src/client/infrastructure/auth-client.js +219 -52
  30. package/src/client/infrastructure/browser-navigation-port.js +20 -0
  31. package/src/client/infrastructure/editor-collaboration-client.js +4 -0
  32. package/src/client/infrastructure/editor-session.js +51 -7
  33. package/src/client/infrastructure/editor-view-adapter.js +297 -53
  34. package/src/client/infrastructure/runtime-config.js +66 -0
  35. package/src/client/infrastructure/workspace-sync-client.js +324 -0
  36. package/src/client/presentation/comment-ui-controller.js +274 -31
  37. package/src/client/presentation/comments-panel.js +2 -2
  38. package/src/client/presentation/excalidraw-embed-controller.js +60 -2
  39. package/src/client/presentation/file-explorer-controller.js +15 -3
  40. package/src/client/presentation/file-explorer-view.js +152 -11
  41. package/src/client/presentation/file-history-view-controller.js +806 -0
  42. package/src/client/presentation/git-diff-view-controller.js +718 -121
  43. package/src/client/presentation/git-panel-controller.js +458 -66
  44. package/src/client/presentation/layout-controller.js +1 -1
  45. package/src/client/styles/components/actions.css +89 -0
  46. package/src/client/styles/components/feedback.css +43 -0
  47. package/src/client/styles/components/navigation.css +68 -0
  48. package/src/client/styles/components/scrollbars.css +104 -0
  49. package/src/client/styles/components/states.css +289 -0
  50. package/src/client/styles/components/surfaces.css +155 -0
  51. package/src/client/styles/features/backlinks.css +213 -0
  52. package/src/client/styles/features/collaboration-chat.css +228 -0
  53. package/src/client/styles/features/collaboration-dialogs.css +154 -0
  54. package/src/client/styles/features/collaboration-presence.css +103 -0
  55. package/src/client/styles/features/collaboration-ui.css +3 -0
  56. package/src/client/styles/features/comment-card.css +236 -0
  57. package/src/client/styles/features/comment-markdown.css +127 -0
  58. package/src/client/styles/features/comment-overlays.css +60 -0
  59. package/src/client/styles/features/comments-drawer.css +120 -0
  60. package/src/client/styles/features/comments.css +4 -0
  61. package/src/client/styles/features/diagram-preview.css +227 -0
  62. package/src/client/styles/features/diff-commit.css +268 -0
  63. package/src/client/styles/features/diff-lines.css +160 -0
  64. package/src/client/styles/features/diff-toolbar.css +98 -0
  65. package/src/client/styles/features/diff.css +3 -0
  66. package/src/client/styles/features/embedded-preview.css +218 -0
  67. package/src/client/styles/features/git-branch.css +155 -0
  68. package/src/client/styles/features/git-files.css +105 -0
  69. package/src/client/styles/features/git-history.css +339 -0
  70. package/src/client/styles/features/git.css +3 -0
  71. package/src/client/styles/features/media-lightbox.css +157 -0
  72. package/src/client/styles/features/outline.css +115 -0
  73. package/src/client/styles/features/preview-content.css +3 -0
  74. package/src/client/styles/features/preview-markdown.css +201 -0
  75. package/src/client/styles/features/preview-sidebars.css +2 -0
  76. package/src/client/styles/features/quick-switcher.css +167 -0
  77. package/src/client/styles/foundation/themes.css +347 -0
  78. package/src/client/styles/foundation/tokens.css +66 -0
  79. package/src/client/styles/foundation/utilities.css +36 -0
  80. package/src/client/styles/layout/editor-page.css +203 -0
  81. package/src/client/styles/layout/overlays.css +132 -0
  82. package/src/client/styles/layout/responsive.css +251 -0
  83. package/src/client/styles/layout/shell.css +314 -0
  84. package/src/client/styles/layout/sidebar.css +176 -0
  85. package/src/client/styles/layout/view-modes.css +92 -0
  86. package/src/client/styles/overrides/codemirror.css +53 -0
  87. package/src/client/styles/overrides/highlightjs.css +7 -0
  88. package/src/client/styles/overrides/vendor.css +2 -0
  89. package/src/client/styles/primitives/controls.css +276 -0
  90. package/src/client/styles/style.css +25 -4901
  91. package/src/domain/wiki-link-resolver.js +16 -5
  92. package/src/domain/workspace-change.js +68 -0
  93. package/src/domain/workspace-room.js +3 -0
  94. package/src/server/auth/create-auth-service.js +373 -15
  95. package/src/server/auth/session-cookie.js +30 -4
  96. package/src/server/config/env.js +121 -5
  97. package/src/server/create-app-server.js +49 -10
  98. package/src/server/domain/backlink-index.js +94 -1
  99. package/src/server/domain/collaboration/collaboration-room.js +281 -69
  100. package/src/server/domain/collaboration/room-registry.js +64 -10
  101. package/src/server/index.js +3 -1
  102. package/src/server/infrastructure/git/command-runner.js +2 -1
  103. package/src/server/infrastructure/git/git-service.js +48 -2
  104. package/src/server/infrastructure/git/history-service.js +683 -0
  105. package/src/server/infrastructure/git/parsers.js +30 -0
  106. package/src/server/infrastructure/git/responses.js +85 -19
  107. package/src/server/infrastructure/http/create-auth-api-handler.js +30 -2
  108. package/src/server/infrastructure/http/create-git-api-command-handler.js +55 -43
  109. package/src/server/infrastructure/http/create-git-api-handler.js +4 -0
  110. package/src/server/infrastructure/http/create-git-api-query-handler.js +61 -0
  111. package/src/server/infrastructure/http/create-request-handler.js +22 -0
  112. package/src/server/infrastructure/http/create-vault-api-command-handler.js +58 -14
  113. package/src/server/infrastructure/http/create-vault-api-handler.js +3 -0
  114. package/src/server/infrastructure/http/create-vault-api-query-handler.js +3 -1
  115. package/src/server/infrastructure/http/http-response.js +65 -28
  116. package/src/server/infrastructure/persistence/vault-file-store.js +163 -52
  117. package/src/server/infrastructure/workspace/file-system-sync-service.js +488 -0
  118. package/src/server/infrastructure/workspace/workspace-mutation-coordinator.js +551 -0
  119. package/public/assets/js/chunks/chunk-R3DDMJHH.js +0 -1
  120. package/public/assets/js/chunks/editor-session-TAV2VXTA.js +0 -22
package/README.md CHANGED
@@ -17,6 +17,7 @@ Throughout this guide, **vault** simply means a regular folder on your computer
17
17
  - No migration: your files stay on disk
18
18
  - Your filesystem stays the source of truth: CollabMD does not move, rename, or delete files unless you explicitly do that in the app
19
19
  - Realtime editing with Yjs
20
+ - External filesystem edits sync back into the app and connected browsers
20
21
  - Mermaid, PlantUML, and Excalidraw support
21
22
  - Source-anchored comments, chat, and presence
22
23
  - Works with plain folders, Obsidian-style vaults, and git-backed docs
@@ -60,6 +61,7 @@ Prefer video? [Open the WebM demo](https://raw.githubusercontent.com/andes90/col
60
61
  - **No migration** — point CollabMD at an existing markdown folder, diagram workspace, Obsidian-style vault, or git-backed docs repo
61
62
  - **Local-files-first** — your filesystem remains the source of truth
62
63
  - **Realtime collaboration** — multiple people can edit the same file at the same time via Yjs
64
+ - **External edit sync** — changes made from tools like Obsidian or direct file writes are reflected back into open documents and the file explorer
63
65
  - **Markdown with context** — live preview, wiki-links, backlinks, outline, quick switcher, and scroll sync
64
66
  - **Source-anchored comments** — comment on lines or selected text with inline markers, preview bubbles, and thread cards
65
67
  - **Collaboration built in** — collaborator presence, follow mode, and team chat
@@ -150,13 +152,14 @@ Then share the printed URL and password with your collaborator. If `cloudflared`
150
152
 
151
153
  - Treat the URL as write access to the vault unless you enable auth
152
154
  - `--auth password` protects `/api/*` and `/ws/*` with a host password and signed session cookie
155
+ - `--auth oidc` signs users in with Google and uses the verified Google name/email as the in-app identity and git commit author
153
156
  - If `cloudflared` is installed, CollabMD may expose the app through a Cloudflare Quick Tunnel unless you pass `--no-tunnel`
154
- - `oidc` is reserved for a future implementation and is not usable yet
157
+ - `--auth oidc` requires a stable `PUBLIC_BASE_URL`; Quick Tunnel URLs are not supported for OIDC
155
158
 
156
159
  ## Current limitations
157
160
 
158
161
  - Single-instance deployment only: collaboration room state is kept in-process and is not shared across replicas
159
- - `oidc` auth is reserved for a future implementation and is not usable yet
162
+ - `oidc` currently supports Google only
160
163
  - Source-anchored comments currently support markdown, Mermaid, and PlantUML text files, but not `.excalidraw`
161
164
  - Windows use is supported via WSL2 rather than native Windows execution
162
165
 
@@ -181,7 +184,7 @@ Comment threads are source-anchored and currently supported for markdown, Mermai
181
184
 
182
185
  Markdown video embeds are opt-in and use standard image syntax such as `![Video](https://www.youtube.com/watch?v=...)` or `![Video](https://cdn.example.com/demo.webm)`. The preview currently supports public YouTube URLs plus direct public `https` video files ending in `.mp4`, `.webm`, or `.ogg`. The editor toolbar also includes a `Video` action that inserts the same Markdown syntax for you.
183
186
 
184
- Your filesystem is the source of truth. CollabMD reads files from disk, uses Yjs for realtime collaboration, and continuously writes plain text back to disk as you type.
187
+ Your filesystem is the source of truth. CollabMD reads files from disk, uses Yjs for realtime collaboration, and continuously writes plain text back to disk as you type. External changes from tools like Obsidian, direct file writes, or git-driven file updates are watched and reconciled back into live rooms and the explorer.
185
188
 
186
189
  ## Usage
187
190
 
@@ -201,7 +204,7 @@ collabmd [directory] [options]
201
204
  |--------|-------------|---------|
202
205
  | `-p, --port` | Port to listen on | `1234` |
203
206
  | `--host` | Host to bind to | `127.0.0.1` |
204
- | `--auth` | Auth strategy: `none`, `password`, `oidc` (`oidc` is reserved and not yet available) | `none` |
207
+ | `--auth` | Auth strategy: `none`, `password`, `oidc` | `none` |
205
208
  | `--auth-password` | Password for `--auth password` | generated per run |
206
209
  | `--local-plantuml` | Start the bundled local docker-compose PlantUML service | off |
207
210
  | `--no-tunnel` | Don't start Cloudflare Tunnel | tunnel on |
@@ -226,6 +229,12 @@ collabmd --auth password
226
229
  # Require an explicit password
227
230
  collabmd --auth password --auth-password "shared-secret"
228
231
 
232
+ # Use Google OIDC on a stable public domain
233
+ PUBLIC_BASE_URL=https://notes.example.com \
234
+ AUTH_OIDC_CLIENT_ID=your-google-client-id \
235
+ AUTH_OIDC_CLIENT_SECRET=your-google-client-secret \
236
+ collabmd --auth oidc --no-tunnel
237
+
229
238
  # Use the local docker-compose PlantUML service
230
239
  collabmd --local-plantuml
231
240
 
@@ -256,6 +265,39 @@ To disable the tunnel:
256
265
  collabmd --no-tunnel
257
266
  ```
258
267
 
268
+ ### Google OIDC setup
269
+
270
+ `--auth oidc` uses Google OpenID Connect with the authorization code + PKCE flow.
271
+
272
+ For the full Google Cloud Console walkthrough, including where to create the OAuth client and copy the client ID/client secret, see [docs/google-oidc-setup.md](https://github.com/andes90/collabmd/blob/master/docs/google-oidc-setup.md).
273
+
274
+ Required environment variables:
275
+
276
+ ```bash
277
+ PUBLIC_BASE_URL=https://notes.example.com
278
+ AUTH_OIDC_CLIENT_ID=your-google-client-id
279
+ AUTH_OIDC_CLIENT_SECRET=your-google-client-secret
280
+ ```
281
+
282
+ In Google Cloud Console, create a Web application OAuth client and register this redirect URI:
283
+
284
+ ```text
285
+ https://notes.example.com/api/auth/oidc/callback
286
+ ```
287
+
288
+ If you mount the app under a subpath with `BASE_PATH=/collabmd`, the redirect URI becomes:
289
+
290
+ ```text
291
+ https://notes.example.com/collabmd/api/auth/oidc/callback
292
+ ```
293
+
294
+ Notes:
295
+
296
+ - OIDC requires a stable public URL and is not compatible with ephemeral Cloudflare Quick Tunnel URLs
297
+ - After sign-in, the verified Google name/email become the displayed app identity and the default in-app git commit author
298
+ - You can restrict sign-in to exact users with `AUTH_OIDC_ALLOWED_EMAILS` or entire domains with `AUTH_OIDC_ALLOWED_DOMAINS`
299
+ - The CLI disables the tunnel automatically when `--auth oidc` is active
300
+
259
301
  You can also configure the tunnel via environment variables:
260
302
 
261
303
  ```bash
@@ -276,6 +318,26 @@ docker run -p 1234:1234 -v /path/to/vault:/data ghcr.io/andes90/collabmd:latest
276
318
 
277
319
  The container listens on `0.0.0.0:1234` and stores vault files at `/data`.
278
320
 
321
+ ### Kubernetes / Helm
322
+
323
+ CollabMD now includes a Helm chart at [`packaging/helm/collabmd`](./packaging/helm/collabmd).
324
+
325
+ Use it when you want a Kubernetes-native deployment with:
326
+
327
+ - one supported application replica
328
+ - a persistent volume mounted at `/data`
329
+ - optional ingress
330
+ - optional bundled PlantUML
331
+ - secret-backed auth and private git bootstrap settings
332
+
333
+ Quick start:
334
+
335
+ ```bash
336
+ helm install collabmd ./packaging/helm/collabmd
337
+ ```
338
+
339
+ For examples covering ingress, OIDC, PlantUML, and private git bootstrap, see [packaging/helm/collabmd/README.md](./packaging/helm/collabmd/README.md).
340
+
279
341
  To bootstrap `/data` from a private git repository instead, pass the repo URL plus SSH credentials:
280
342
 
281
343
  ```bash
@@ -322,6 +384,24 @@ docker compose up
322
384
 
323
385
  Open `http://localhost:1234`.
324
386
 
387
+ To test Google OIDC locally with the included compose setup, register this redirect URI in Google Cloud Console:
388
+
389
+ ```text
390
+ http://localhost:1234/api/auth/oidc/callback
391
+ ```
392
+
393
+ Then start compose with the OIDC env vars:
394
+
395
+ ```bash
396
+ AUTH_STRATEGY=oidc \
397
+ PUBLIC_BASE_URL=http://localhost:1234 \
398
+ AUTH_OIDC_CLIENT_ID=your-google-client-id \
399
+ AUTH_OIDC_CLIENT_SECRET=your-google-client-secret \
400
+ docker compose up
401
+ ```
402
+
403
+ If you change `COLLABMD_HOST_PORT`, update `PUBLIC_BASE_URL` and the Google redirect URI to match that host port.
404
+
325
405
  By default, compose uses `COLLABMD_IMAGE=ghcr.io/andes90/collabmd:latest`. If you want to test a local image while developing instead:
326
406
 
327
407
  ```bash
@@ -341,9 +421,11 @@ To use an existing vault on your machine instead of `./data/vault`:
341
421
  HOST_VAULT_DIR=/absolute/path/to/vault docker compose up
342
422
  ```
343
423
 
424
+ `HOST_VAULT_DIR` controls the host-side bind mount source. The app uses `COLLABMD_VAULT_DIR` for the in-container vault path and defaults that to `/data` in Docker.
425
+
344
426
  To bootstrap the compose-managed vault from a private repo, set the git env vars in `.env` and keep `HOST_VAULT_DIR` on a persistent host path. For file-based SSH auth, point `COLLABMD_GIT_SSH_PRIVATE_KEY_FILE` and `COLLABMD_GIT_SSH_KNOWN_HOSTS_FILE` at mounted secret paths; for simpler setups, set `COLLABMD_GIT_SSH_PRIVATE_KEY_B64` instead.
345
427
 
346
- If you want the in-app Git commit action to work inside the container, also set `COLLABMD_GIT_USER_NAME` and `COLLABMD_GIT_USER_EMAIL` so CollabMD can configure the checkout identity automatically.
428
+ If you want the in-app Git commit action to work inside the container without OIDC, also set `COLLABMD_GIT_USER_NAME` and `COLLABMD_GIT_USER_EMAIL` so CollabMD can configure the checkout identity automatically. With `AUTH_STRATEGY=oidc`, CollabMD uses the signed-in Google identity for each commit instead.
347
429
 
348
430
  To change the host port:
349
431
 
@@ -379,6 +461,8 @@ Health check: `GET /health`
379
461
  - The app is reachable only from localhost: pass `--host 0.0.0.0` or set `HOST=0.0.0.0` when you intend to expose it on your network
380
462
  - Port `1234` is already in use: pass `--port 3000` or set `PORT` to another free port
381
463
  - Tunnel did not start: install `cloudflared`, or pass `--no-tunnel` to stay local-only
464
+ - `--auth oidc` fails on startup: set `PUBLIC_BASE_URL`, `AUTH_OIDC_CLIENT_ID`, and `AUTH_OIDC_CLIENT_SECRET`, and make sure the Google redirect URI matches `/api/auth/oidc/callback`
465
+ - Google login loops back to the auth screen: verify the configured `PUBLIC_BASE_URL` matches the browser URL and that your reverse proxy forwards HTTPS correctly
382
466
  - `--local-plantuml` fails: make sure Docker is installed and running, or point `PLANTUML_SERVER_URL` at another PlantUML server
383
467
  - Private git bootstrap fails on startup: verify `COLLABMD_GIT_REPO_URL` plus either `COLLABMD_GIT_SSH_PRIVATE_KEY_FILE` or `COLLABMD_GIT_SSH_PRIVATE_KEY_B64`
384
468
  - WSL2 path issues: run CollabMD against a directory inside your Linux filesystem when possible rather than a mounted Windows path
@@ -485,16 +569,21 @@ scripts/
485
569
  | `AUTH_PASSWORD` | Shared password for `AUTH_STRATEGY=password` | generated per run |
486
570
  | `AUTH_SESSION_COOKIE_NAME` | Session cookie name | `collabmd_auth` |
487
571
  | `AUTH_SESSION_SECRET` | Cookie signing secret | generated per run |
572
+ | `PUBLIC_BASE_URL` | Stable public app origin required for `AUTH_STRATEGY=oidc` | |
573
+ | `AUTH_OIDC_CLIENT_ID` | Google OAuth client ID used for `AUTH_STRATEGY=oidc` | |
574
+ | `AUTH_OIDC_CLIENT_SECRET` | Google OAuth client secret used for `AUTH_STRATEGY=oidc` | |
575
+ | `AUTH_OIDC_ALLOWED_EMAILS` | Comma-separated exact email allowlist for `AUTH_STRATEGY=oidc` | |
576
+ | `AUTH_OIDC_ALLOWED_DOMAINS` | Comma-separated email domain allowlist for `AUTH_STRATEGY=oidc` | |
488
577
  | `BASE_PATH` | URL path prefix for subpath deployments | |
489
578
  | `PLANTUML_SERVER_URL` | Upstream PlantUML server base URL used for server-side SVG rendering | `https://www.plantuml.com/plantuml` |
490
- | `COLLABMD_VAULT_DIR` | Vault directory path | current directory |
579
+ | `COLLABMD_VAULT_DIR` | Vault directory path | CLI: current directory, server entrypoint: `data/vault`, Docker: `/data` |
491
580
  | `COLLABMD_GIT_ENABLED` | Enable or disable git integration in the UI and API | `true` |
492
581
  | `COLLABMD_GIT_REPO_URL` | Remote git repository used to bootstrap the vault checkout | |
493
582
  | `COLLABMD_GIT_SSH_PRIVATE_KEY_FILE` | SSH private key file path for remote git auth; preferred over base64 input | |
494
583
  | `COLLABMD_GIT_SSH_PRIVATE_KEY_B64` | Base64-encoded SSH private key used when no key file path is provided | |
495
584
  | `COLLABMD_GIT_SSH_KNOWN_HOSTS_FILE` | Optional `known_hosts` file path for strict SSH host verification | |
496
- | `COLLABMD_GIT_USER_NAME` | Git author/committer name configured for in-app commits in git-backed deployments | |
497
- | `COLLABMD_GIT_USER_EMAIL` | Git author/committer email configured for in-app commits in git-backed deployments | |
585
+ | `COLLABMD_GIT_USER_NAME` | Fallback git author/committer name for in-app commits when OIDC is not active | |
586
+ | `COLLABMD_GIT_USER_EMAIL` | Fallback git author/committer email for in-app commits when OIDC is not active | |
498
587
  | `WS_BASE_PATH` | WebSocket base path | `/ws` |
499
588
  | `PUBLIC_WS_BASE_URL` | Public WebSocket URL override for reverse proxies | |
500
589
  | `HTTP_KEEP_ALIVE_TIMEOUT_MS` | Keep-alive timeout | `5000` |
@@ -523,7 +612,7 @@ cp .env.example .env
523
612
  - The filesystem is the source of truth; Yjs provides the collaboration layer.
524
613
  - When `COLLABMD_GIT_REPO_URL` is set, startup clones the configured repo into `COLLABMD_VAULT_DIR` on first boot and reuses an existing same-origin checkout on later starts.
525
614
  - If `COLLABMD_GIT_SSH_KNOWN_HOSTS_FILE` is not set, SSH falls back to `StrictHostKeyChecking=accept-new`.
526
- - CollabMD assumes it is the only writer while a file is open; there is no live `fs.watch` reconciliation.
615
+ - External filesystem edits are reconciled back into active rooms and the explorer. Ambiguous watcher bursts still fall back to batched workspace reconciliation.
527
616
  - `.obsidian`, `.git`, `.trash`, and `node_modules` directories are ignored.
528
617
  - Only `.md`, `.markdown`, and `.mdx` files are indexed.
529
618
  - PlantUML preview rendering is server-side and uses `PLANTUML_SERVER_URL`; point it at a self-hosted renderer if you do not want to use the public PlantUML service.
package/bin/collabmd.js CHANGED
@@ -61,12 +61,14 @@ if (values.help) {
61
61
  process.exit(0);
62
62
  }
63
63
 
64
- const vaultPath = resolve(positionals[0] || '.');
65
64
  const port = parseInt(values.port ?? process.env.PORT ?? '1234', 10) || 1234;
66
65
  const host = values.host || process.env.HOST || '127.0.0.1';
67
66
  const enableTunnel = !values['no-tunnel'];
68
67
  const useLocalPlantUml = values['local-plantuml'];
69
68
 
69
+ const { resolveCliVaultDir, loadConfig } = await import('../src/server/config/env.js');
70
+ const vaultPath = resolveCliVaultDir(positionals);
71
+
70
72
  process.env.COLLABMD_VAULT_DIR = vaultPath;
71
73
  process.env.PORT = String(port);
72
74
  process.env.HOST = host;
@@ -101,7 +103,6 @@ if (useLocalPlantUml) {
101
103
  }
102
104
 
103
105
  const { createAppServer } = await import('../src/server/create-app-server.js');
104
- const { loadConfig } = await import('../src/server/config/env.js');
105
106
  const { prepareConfigForStartup } = await import('../src/server/startup/git-remote-bootstrap.js');
106
107
 
107
108
  const config = loadConfig({ vaultDir: vaultPath });
@@ -6,7 +6,19 @@ services:
6
6
  environment:
7
7
  HOST: 0.0.0.0
8
8
  PORT: 1234
9
+ AUTH_STRATEGY: ${AUTH_STRATEGY:-none}
10
+ AUTH_PASSWORD: ${AUTH_PASSWORD:-}
11
+ AUTH_SESSION_COOKIE_NAME: ${AUTH_SESSION_COOKIE_NAME:-collabmd_auth}
12
+ AUTH_SESSION_SECRET: ${AUTH_SESSION_SECRET:-}
13
+ PUBLIC_BASE_URL: ${PUBLIC_BASE_URL:-http://localhost:1234}
14
+ AUTH_OIDC_CLIENT_ID: ${AUTH_OIDC_CLIENT_ID:-}
15
+ AUTH_OIDC_CLIENT_SECRET: ${AUTH_OIDC_CLIENT_SECRET:-}
16
+ AUTH_OIDC_ALLOWED_EMAILS: ${AUTH_OIDC_ALLOWED_EMAILS:-}
17
+ AUTH_OIDC_ALLOWED_DOMAINS: ${AUTH_OIDC_ALLOWED_DOMAINS:-}
18
+ BASE_PATH: ${BASE_PATH:-}
19
+ PUBLIC_WS_BASE_URL: ${PUBLIC_WS_BASE_URL:-}
9
20
  PLANTUML_SERVER_URL: http://plantuml:8080
21
+ COLLABMD_VAULT_DIR: ${COLLABMD_VAULT_DIR:-/data}
10
22
  COLLABMD_GIT_REPO_URL: ${COLLABMD_GIT_REPO_URL:-}
11
23
  COLLABMD_GIT_SSH_PRIVATE_KEY_FILE: ${COLLABMD_GIT_SSH_PRIVATE_KEY_FILE:-}
12
24
  COLLABMD_GIT_SSH_PRIVATE_KEY_B64: ${COLLABMD_GIT_SSH_PRIVATE_KEY_B64:-}
@@ -25,7 +37,7 @@ services:
25
37
  volumes:
26
38
  - type: bind
27
39
  source: ${HOST_VAULT_DIR:-./data/vault}
28
- target: /data
40
+ target: ${COLLABMD_VAULT_DIR:-/data}
29
41
  # Optional: mount secret files when using file-based SSH auth.
30
42
  # - type: bind
31
43
  # source: ${HOST_SSH_KEY_FILE}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "collabmd",
3
- "version": "0.1.20",
3
+ "version": "0.1.23",
4
4
  "type": "module",
5
5
  "description": "Collaborative markdown vault — like Obsidian, but online. Serve any directory of markdown files for realtime collaborative editing.",
6
6
  "repository": {
@@ -71,6 +71,7 @@
71
71
  "lib0": "^0.2.0",
72
72
  "markdown-it": "^14.1.0",
73
73
  "mermaid": "^11.13.0",
74
+ "openid-client": "^6.8.2",
74
75
  "react": "^19.2.0",
75
76
  "react-dom": "^19.2.0",
76
77
  "ws": "^8.0.0",