collabmd 0.1.18 → 0.1.20
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.
- package/README.md +107 -25
- package/docker-compose.yml +1 -1
- package/package.json +1 -1
- package/public/assets/css/style.css +1 -1
- package/public/assets/js/chunks/{preview-render-compiler-WD3A76I6.js → chunk-5QRWYPYT.js} +18 -18
- package/public/assets/js/chunks/chunk-HEWVH67U.js +9 -0
- package/public/assets/js/chunks/chunk-R3DDMJHH.js +1 -0
- package/public/assets/js/chunks/editor-session-TAV2VXTA.js +22 -0
- package/public/assets/js/chunks/preview-render-compiler-UZ4SZDQQ.js +1 -0
- package/public/assets/js/chunks/quick-switcher-controller-J7I3CUET.js +5 -0
- package/public/assets/js/{excalidraw-editor-LKW2AZBU.js → excalidraw-editor-ZDYKMZOL.js} +33 -33
- package/public/assets/js/excalidraw-editor.js +1 -1
- package/public/assets/js/main.js +100 -73
- package/public/assets/js/preview-render-worker.js +19 -19
- package/public/index.html +14 -4
- package/src/client/application/app-shell/git-feature.js +29 -1
- package/src/client/application/app-shell/presence-feature.js +2 -1
- package/src/client/application/app-shell/ui-feature.js +113 -1
- package/src/client/application/app-shell/workspace-feature.js +9 -0
- package/src/client/application/app-shell-elements.js +1 -0
- package/src/client/application/preview-render-compiler.js +55 -5
- package/src/client/application/preview-render-executor.js +8 -0
- package/src/client/application/preview-render-worker.js +13 -2
- package/src/client/application/preview-renderer.js +5 -0
- package/src/client/application/workspace-chrome-controller.js +12 -1
- package/src/client/application/workspace-coordinator.js +16 -7
- package/src/client/application/workspace-preview-controller.js +45 -5
- package/src/client/application/workspace-route-controller.js +4 -0
- package/src/client/bootstrap/collabmd-app-shell.js +19 -3
- package/src/client/domain/room.js +37 -0
- package/src/client/domain/vault-utils.js +46 -0
- package/src/client/infrastructure/comment-thread-store.js +98 -0
- package/src/client/infrastructure/editor-paste-utils.js +45 -0
- package/src/client/infrastructure/editor-session.js +10 -0
- package/src/client/infrastructure/editor-view-adapter.js +98 -7
- package/src/client/infrastructure/vault-api-client.js +17 -0
- package/src/client/presentation/backlinks-panel.js +157 -101
- package/src/client/presentation/comment-markdown-renderer.js +68 -0
- package/src/client/presentation/comment-ui-controller.js +352 -20
- package/src/client/presentation/file-explorer-controller.js +5 -0
- package/src/client/presentation/file-explorer-view.js +10 -2
- package/src/client/presentation/file-tree-state.js +7 -1
- package/src/client/presentation/git-panel-controller.js +73 -0
- package/src/client/presentation/image-lightbox-controller.js +394 -0
- package/src/client/presentation/outline-controller.js +25 -0
- package/src/client/styles/style.css +677 -21
- package/src/domain/comment-threads.js +95 -13
- package/src/domain/file-kind.js +16 -1
- package/src/server/infrastructure/git/errors.js +4 -1
- package/src/server/infrastructure/git/git-service.js +215 -1
- package/src/server/infrastructure/http/create-git-api-command-handler.js +6 -1
- package/src/server/infrastructure/http/create-git-api-query-handler.js +16 -1
- package/src/server/infrastructure/http/create-vault-api-command-handler.js +48 -2
- package/src/server/infrastructure/http/create-vault-api-query-handler.js +67 -1
- package/src/server/infrastructure/http/request-body.js +11 -2
- package/src/server/infrastructure/persistence/path-utils.js +1 -1
- package/src/server/infrastructure/persistence/pull-backup-store.js +283 -0
- package/src/server/infrastructure/persistence/vault-file-store.js +203 -2
- package/public/assets/js/chunks/chunk-BBHPYU2R.js +0 -1
- package/public/assets/js/chunks/chunk-OG2TNZEU.js +0 -9
- package/public/assets/js/chunks/chunk-QSTBGTWJ.js +0 -1
- package/public/assets/js/chunks/chunk-SR3U53EQ.js +0 -1
- package/public/assets/js/chunks/editor-session-IHFTYG5D.js +0 -22
- package/public/assets/js/chunks/quick-switcher-controller-JYDIJVAJ.js +0 -5
package/README.md
CHANGED
|
@@ -1,26 +1,61 @@
|
|
|
1
1
|
# CollabMD
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Realtime collaboration for Markdown folders, diagrams, and git-backed docs, without migrating your files.
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img src="
|
|
6
|
+
<img src="https://raw.githubusercontent.com/andes90/collabmd/master/docs/assets/collabmd-hero.webp" alt="CollabMD showing a file tree, markdown editor, live preview, and collaborator presence." width="100%">
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
10
|
<strong>Turn an existing markdown-and-diagram workspace into a realtime collaborative web app.</strong>
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
CollabMD turns a local Markdown folder, Obsidian-style vault, or docs repo into a collaborative workspace you can open in the browser.
|
|
14
|
+
|
|
15
|
+
Throughout this guide, **vault** simply means a regular folder on your computer that contains Markdown files.
|
|
16
|
+
|
|
17
|
+
- No migration: your files stay on disk
|
|
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
|
+
- Realtime editing with Yjs
|
|
20
|
+
- Mermaid, PlantUML, and Excalidraw support
|
|
21
|
+
- Source-anchored comments, chat, and presence
|
|
22
|
+
- Works with plain folders, Obsidian-style vaults, and git-backed docs
|
|
23
|
+
|
|
24
|
+
Requirements for the fastest first run:
|
|
25
|
+
|
|
26
|
+
- Node.js 24 for `npx` and source installs
|
|
27
|
+
- Homebrew only if you want the `brew install` path
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Run locally first, no Cloudflare tunnel required
|
|
33
|
+
npx collabmd@latest ~/my-vault --no-tunnel
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Open `http://localhost:1234`.
|
|
37
|
+
|
|
38
|
+
Expected startup output:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
CollabMD v0.x.y
|
|
42
|
+
Vault: /path/to/your-vault
|
|
43
|
+
Local: http://localhost:1234
|
|
44
|
+
Tunnel: disabled
|
|
45
|
+
Ready for collaboration. Press Ctrl+C to stop.
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Prefer Homebrew or source install? Jump to [Installation options](#installation-options).
|
|
16
49
|
|
|
17
50
|
## See it in action
|
|
18
51
|
|
|
19
|
-
|
|
52
|
+
See CollabMD editing the same workspace from two browsers in realtime:
|
|
20
53
|
|
|
21
|
-
|
|
54
|
+

|
|
22
55
|
|
|
23
|
-
|
|
56
|
+
Prefer video? [Open the WebM demo](https://raw.githubusercontent.com/andes90/collabmd/master/docs/assets/collabmd-demo.webm).
|
|
57
|
+
|
|
58
|
+
## Features
|
|
24
59
|
|
|
25
60
|
- **No migration** — point CollabMD at an existing markdown folder, diagram workspace, Obsidian-style vault, or git-backed docs repo
|
|
26
61
|
- **Local-files-first** — your filesystem remains the source of truth
|
|
@@ -40,12 +75,22 @@ Prefer video? [Open the WebM demo](./docs/assets/collabmd-demo.webm).
|
|
|
40
75
|
- Editing notes and diagrams together while keeping everything as plain files on disk
|
|
41
76
|
- Giving browser access to collaborators who do not use your local markdown setup
|
|
42
77
|
|
|
43
|
-
##
|
|
78
|
+
## Installation options
|
|
44
79
|
|
|
45
80
|
### Requirements
|
|
46
81
|
|
|
47
|
-
- macOS or
|
|
48
|
-
- Node.js 24
|
|
82
|
+
- macOS, Linux, or Windows (via WSL2)
|
|
83
|
+
- Node.js 24 for `npx` and source installs
|
|
84
|
+
|
|
85
|
+
### Run via npx (Node.js)
|
|
86
|
+
|
|
87
|
+
If you have Node.js installed, you can run CollabMD directly without installing it globally:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx collabmd@latest ~/my-vault --no-tunnel
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Open `http://localhost:1234`.
|
|
49
94
|
|
|
50
95
|
### Install with Homebrew
|
|
51
96
|
|
|
@@ -91,6 +136,16 @@ collabmd ~/my-vault --auth password
|
|
|
91
136
|
|
|
92
137
|
If `cloudflared` is installed, CollabMD starts a quick tunnel by default unless you pass `--no-tunnel`.
|
|
93
138
|
|
|
139
|
+
## Share with a collaborator
|
|
140
|
+
|
|
141
|
+
If you want to share the workspace over the internet, start with password auth:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
collabmd ~/my-vault --auth password
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Then share the printed URL and password with your collaborator. If `cloudflared` is installed, CollabMD will start a quick tunnel automatically unless you pass `--no-tunnel`.
|
|
148
|
+
|
|
94
149
|
## Safety first
|
|
95
150
|
|
|
96
151
|
- Treat the URL as write access to the vault unless you enable auth
|
|
@@ -98,6 +153,13 @@ If `cloudflared` is installed, CollabMD starts a quick tunnel by default unless
|
|
|
98
153
|
- If `cloudflared` is installed, CollabMD may expose the app through a Cloudflare Quick Tunnel unless you pass `--no-tunnel`
|
|
99
154
|
- `oidc` is reserved for a future implementation and is not usable yet
|
|
100
155
|
|
|
156
|
+
## Current limitations
|
|
157
|
+
|
|
158
|
+
- 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
|
|
160
|
+
- Source-anchored comments currently support markdown, Mermaid, and PlantUML text files, but not `.excalidraw`
|
|
161
|
+
- Windows use is supported via WSL2 rather than native Windows execution
|
|
162
|
+
|
|
101
163
|
## How it works
|
|
102
164
|
|
|
103
165
|
```bash
|
|
@@ -119,7 +181,7 @@ Comment threads are source-anchored and currently supported for markdown, Mermai
|
|
|
119
181
|
|
|
120
182
|
Markdown video embeds are opt-in and use standard image syntax such as `` or ``. 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.
|
|
121
183
|
|
|
122
|
-
Your filesystem is the source of truth. CollabMD reads files from disk, uses Yjs for realtime collaboration, and writes plain text back to disk
|
|
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.
|
|
123
185
|
|
|
124
186
|
## Usage
|
|
125
187
|
|
|
@@ -139,7 +201,7 @@ collabmd [directory] [options]
|
|
|
139
201
|
|--------|-------------|---------|
|
|
140
202
|
| `-p, --port` | Port to listen on | `1234` |
|
|
141
203
|
| `--host` | Host to bind to | `127.0.0.1` |
|
|
142
|
-
| `--auth` | Auth strategy: `none`, `password`, `oidc` | `none` |
|
|
204
|
+
| `--auth` | Auth strategy: `none`, `password`, `oidc` (`oidc` is reserved and not yet available) | `none` |
|
|
143
205
|
| `--auth-password` | Password for `--auth password` | generated per run |
|
|
144
206
|
| `--local-plantuml` | Start the bundled local docker-compose PlantUML service | off |
|
|
145
207
|
| `--no-tunnel` | Don't start Cloudflare Tunnel | tunnel on |
|
|
@@ -171,11 +233,17 @@ collabmd --local-plantuml
|
|
|
171
233
|
collabmd ~/Documents/Obsidian/MyVault
|
|
172
234
|
```
|
|
173
235
|
|
|
174
|
-
##
|
|
236
|
+
## Public access
|
|
175
237
|
|
|
176
|
-
|
|
238
|
+
CollabMD can optionally expose the session using a [Cloudflare Quick Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/). Since the editor uses same-origin WebSocket routing (`/ws/:file`), the tunnel works for both HTTP and collaboration traffic.
|
|
177
239
|
|
|
178
|
-
If you are exposing the
|
|
240
|
+
If you are exposing the session publicly, `collabmd --auth password` is the intended first-line protection. When you do not pass `--auth-password`, CollabMD generates a password for that host run and prints it in the terminal. Restarting the app rotates that password and the signed session secret.
|
|
241
|
+
|
|
242
|
+
To share safely:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
collabmd ~/my-vault --auth password
|
|
246
|
+
```
|
|
179
247
|
|
|
180
248
|
`cloudflared` is optional. Install it only if you want public tunnel access:
|
|
181
249
|
|
|
@@ -196,11 +264,14 @@ TUNNEL_TARGET_URL=http://127.0.0.1:4000 collabmd
|
|
|
196
264
|
CLOUDFLARED_EXTRA_ARGS="--loglevel info" collabmd
|
|
197
265
|
```
|
|
198
266
|
|
|
267
|
+
For the full runtime env var reference, see the `Environment variables` details block in the Development section below.
|
|
268
|
+
|
|
199
269
|
## Docker / Coolify deployment
|
|
200
270
|
|
|
271
|
+
Published image: `ghcr.io/andes90/collabmd:latest`
|
|
272
|
+
|
|
201
273
|
```bash
|
|
202
|
-
docker
|
|
203
|
-
docker run -p 1234:1234 -v /path/to/vault:/data collabmd
|
|
274
|
+
docker run -p 1234:1234 -v /path/to/vault:/data ghcr.io/andes90/collabmd:latest
|
|
204
275
|
```
|
|
205
276
|
|
|
206
277
|
The container listens on `0.0.0.0:1234` and stores vault files at `/data`.
|
|
@@ -215,10 +286,10 @@ docker run \
|
|
|
215
286
|
-e COLLABMD_GIT_SSH_PRIVATE_KEY_B64="$(base64 < ~/.ssh/id_ed25519 | tr -d '\n')" \
|
|
216
287
|
-e COLLABMD_GIT_USER_NAME="CollabMD Bot" \
|
|
217
288
|
-e COLLABMD_GIT_USER_EMAIL="bot@example.com" \
|
|
218
|
-
collabmd
|
|
289
|
+
ghcr.io/andes90/collabmd:latest
|
|
219
290
|
```
|
|
220
291
|
|
|
221
|
-
For a full local and Docker test walkthrough, including key generation and deploy-key setup, see [docs/private-git-deployment.md](
|
|
292
|
+
For a full local and Docker test walkthrough, including key generation and deploy-key setup, see [docs/private-git-deployment.md](https://github.com/andes90/collabmd/blob/master/docs/private-git-deployment.md).
|
|
222
293
|
|
|
223
294
|
When `COLLABMD_GIT_REPO_URL` is set, CollabMD clones into `COLLABMD_VAULT_DIR` on first boot, then reuses that checkout on later starts. If the checkout already exists, startup validates that `origin` matches. Clean checkouts are fast-forwarded to the remote default branch; dirty checkouts are reused as-is and startup skips the sync.
|
|
224
295
|
|
|
@@ -237,7 +308,7 @@ docker run \
|
|
|
237
308
|
-e COLLABMD_GIT_SSH_KNOWN_HOSTS_FILE=/run/secrets/collabmd_known_hosts \
|
|
238
309
|
-e COLLABMD_GIT_USER_NAME="CollabMD Bot" \
|
|
239
310
|
-e COLLABMD_GIT_USER_EMAIL="bot@example.com" \
|
|
240
|
-
collabmd
|
|
311
|
+
ghcr.io/andes90/collabmd:latest
|
|
241
312
|
```
|
|
242
313
|
|
|
243
314
|
### Local docker-compose with a private PlantUML server
|
|
@@ -246,16 +317,16 @@ The included `docker-compose.yml` runs a prebuilt CollabMD image together with a
|
|
|
246
317
|
|
|
247
318
|
```bash
|
|
248
319
|
mkdir -p data/vault
|
|
249
|
-
docker build -t collabmd:local .
|
|
250
320
|
docker compose up
|
|
251
321
|
```
|
|
252
322
|
|
|
253
323
|
Open `http://localhost:1234`.
|
|
254
324
|
|
|
255
|
-
By default, compose uses `COLLABMD_IMAGE=collabmd:
|
|
325
|
+
By default, compose uses `COLLABMD_IMAGE=ghcr.io/andes90/collabmd:latest`. If you want to test a local image while developing instead:
|
|
256
326
|
|
|
257
327
|
```bash
|
|
258
|
-
|
|
328
|
+
docker build -t collabmd:local .
|
|
329
|
+
COLLABMD_IMAGE=collabmd:local docker compose up
|
|
259
330
|
```
|
|
260
331
|
|
|
261
332
|
The PlantUML container is also published on loopback by default at `http://127.0.0.1:18080`, so the host-based CLI can reuse it with:
|
|
@@ -302,6 +373,16 @@ For a standard Coolify reverse-proxy setup, the default same-origin WebSocket ro
|
|
|
302
373
|
|
|
303
374
|
Health check: `GET /health`
|
|
304
375
|
|
|
376
|
+
## Troubleshooting
|
|
377
|
+
|
|
378
|
+
- `npx collabmd@latest` fails immediately: confirm you are running Node.js 24, which is the supported runtime for source and npm usage
|
|
379
|
+
- 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
|
+
- Port `1234` is already in use: pass `--port 3000` or set `PORT` to another free port
|
|
381
|
+
- Tunnel did not start: install `cloudflared`, or pass `--no-tunnel` to stay local-only
|
|
382
|
+
- `--local-plantuml` fails: make sure Docker is installed and running, or point `PLANTUML_SERVER_URL` at another PlantUML server
|
|
383
|
+
- 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
|
+
- WSL2 path issues: run CollabMD against a directory inside your Linux filesystem when possible rather than a mounted Windows path
|
|
385
|
+
|
|
305
386
|
## Development
|
|
306
387
|
|
|
307
388
|
Install dependencies:
|
|
@@ -420,6 +501,7 @@ scripts/
|
|
|
420
501
|
| `HTTP_HEADERS_TIMEOUT_MS` | Header read timeout | `60000` |
|
|
421
502
|
| `HTTP_REQUEST_TIMEOUT_MS` | Request timeout | `30000` |
|
|
422
503
|
| `WS_HEARTBEAT_INTERVAL_MS` | Heartbeat interval for evicting dead clients | `30000` |
|
|
504
|
+
| `WS_ROOM_IDLE_GRACE_MS` | Delay before closing empty collaboration rooms to disk | `15000` |
|
|
423
505
|
| `WS_MAX_BUFFERED_AMOUNT_BYTES` | Max outbound buffer per WebSocket | `16777216` |
|
|
424
506
|
| `WS_MAX_PAYLOAD_BYTES` | Max inbound WebSocket frame | `16777216` |
|
|
425
507
|
| `CLOUDFLARED_BIN` | `cloudflared` binary path | `cloudflared` |
|
|
@@ -445,7 +527,7 @@ cp .env.example .env
|
|
|
445
527
|
- `.obsidian`, `.git`, `.trash`, and `node_modules` directories are ignored.
|
|
446
528
|
- Only `.md`, `.markdown`, and `.mdx` files are indexed.
|
|
447
529
|
- 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.
|
|
448
|
-
- `docker compose up
|
|
530
|
+
- `docker compose up` uses the included local PlantUML service and avoids the public renderer by default. The initial git clone may also require a longer health-check grace period than a purely local vault.
|
|
449
531
|
- `collabmd --local-plantuml` and `npm run start:local-plantuml` will start the local PlantUML compose service first, then run CollabMD against `http://127.0.0.1:${PLANTUML_HOST_PORT:-18080}`.
|
|
450
532
|
|
|
451
533
|
## License
|
package/docker-compose.yml
CHANGED
package/package.json
CHANGED