Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ desktop-app
wiki
node_modules
*.md
!sample.md
LICENSE
docker-compose.yml
Dockerfile
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Preserve the exact package bytes used by Subresource Integrity on every OS.
assets/vendor/** -text
66 changes: 66 additions & 0 deletions .github/workflows/full-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Full Chromium E2E Regression

on:
push:
branches:
- fix/compact-private-sharing-20261120
pull_request:
branches: [main]
paths:
- '.github/workflows/full-e2e.yml'
- 'index.html'
- 'v2/**'
- 'script.js'
- 'sharing-*.js'
- 'sw.js'
- 'styles.css'
- 'assets/secure-renderers/**'
- 'scripts/build-private-renderers.mjs'
- 'scripts/build-share-routes.mjs'
- 'functions/api/share/**'
- 'tests/e2e/**'
- 'tests/helpers/**'
- 'package.json'
- 'package-lock.json'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: full-e2e-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
chromium:
name: Chromium E2E (shard ${{ matrix.shard }}/4)
runs-on: ubuntu-24.04
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: npm
- run: npm ci
- run: npm run build
- run: node desktop-app/prepare.js
- run: npx playwright install --with-deps chromium
- name: Run full Chromium suite, sharded
run: npx playwright test --project=chromium --shard=${{ matrix.shard }}/4 --workers=2 --retries=0 --reporter=line
- name: Upload failure evidence
if: failure()
uses: actions/upload-artifact@v4
with:
name: chromium-e2e-shard-${{ matrix.shard }}-failure
path: |
test-results/
playwright-report/
if-no-files-found: ignore
retention-days: 7
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Non-code commits (documentation, planning, README-only updates) are excluded.

## Unreleased

- **Encrypted sharing:** Added client-side encryption for new snapshots, managed media and Live Share, with role signatures, fresh peer proofs, bounded replay histories and unchanged expiry for existing shares. Added user-held encrypted document recovery, protected private previews, locally bundled core libraries, stronger Docker headers, and documented free-plan usage controls.

---

## v3.10.6
Expand Down
48 changes: 6 additions & 42 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,23 @@ FROM nginx:alpine

# PERF-019: Only copy necessary web files (exclude .git, desktop-app, wiki, etc.)
COPY index.html /usr/share/nginx/html/
COPY v2/ /usr/share/nginx/html/v2/
COPY workspace-storage.js /usr/share/nginx/html/
COPY visual-settings-adapters.js /usr/share/nginx/html/
COPY visual-settings-store.js /usr/share/nginx/html/
COPY script.js /usr/share/nginx/html/
COPY script.js native-markdown-source.js browser-drop-source.js preview-worker.js /usr/share/nginx/html/
COPY sharing-crypto.js sharing-media.js sharing-live.js sharing-recovery.js /usr/share/nginx/html/
COPY styles.css /usr/share/nginx/html/
COPY sw.js /usr/share/nginx/html/
COPY RELEASE_NOTES /usr/share/nginx/html/
COPY RELEASE_NOTES sample.md /usr/share/nginx/html/
COPY manifest.json /usr/share/nginx/html/
COPY robots.txt /usr/share/nginx/html/
COPY sitemap.xml /usr/share/nginx/html/
COPY assets/ /usr/share/nginx/html/assets/
COPY seo/locales.mjs /usr/share/nginx/html/seo/
COPY seo/welcome-content.mjs /usr/share/nginx/html/seo/

# Create a custom nginx configuration with compression and security
# PERF-020: Added gzip compression for text-based assets
RUN echo 'server { \
listen 80; \
server_name localhost; \
root /usr/share/nginx/html; \
index index.html; \
\
# Enable gzip compression (PERF-020) \
gzip on; \
gzip_vary on; \
gzip_proxied any; \
gzip_comp_level 6; \
gzip_min_length 256; \
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml; \
\
# Handle client-side routing for SPA \
location / { \
try_files $uri $uri/ /index.html; \
} \
\
# Cache static assets \
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { \
expires 1y; \
add_header Cache-Control "public, immutable"; \
} \
\
# Security headers \
add_header X-Frame-Options "SAMEORIGIN" always; \
add_header X-Content-Type-Options "nosniff" always; \
add_header X-XSS-Protection "1; mode=block" always; \
add_header Referrer-Policy "strict-origin-when-cross-origin" always; \
# PERF-029: Content Security Policy for defense-in-depth \
add_header Content-Security-Policy "default-src '"'"'self'"'"'; base-uri '"'"'self'"'"'; object-src '"'"'none'"'"'; script-src '"'"'self'"'"' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net '"'"'unsafe-inline'"'"'; worker-src '"'"'self'"'"'; connect-src '"'"'self'"'"' https://api.github.com https://raw.githubusercontent.com https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://kroki.io https://www.plantuml.com https://mermaid.ink https://paulrosen.github.io; img-src '"'"'self'"'"' data: blob: https:; style-src '"'"'self'"'"' '"'"'unsafe-inline'"'"' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net; font-src '"'"'self'"'"' data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net; media-src '"'"'self'"'"' blob: data:; manifest-src '"'"'self'"'"'" always; \
}' > /etc/nginx/conf.d/default.conf

# Expose port 80
COPY nginx.conf /etc/nginx/conf.d/default.conf
RUN nginx -t
EXPOSE 80

# Start nginx
CMD ["nginx", "-g", "daemon off;"]

14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

Markdown Viewer is an open source, local-first workspace for developers, writers, students, researchers, and anyone working with `.md` or `.markdown` files. Go beyond plain text. Organize multiple documents, review with anchored comments without changing the Markdown, and render diagrams, maps, charts, math, 3D models, and music—all in one focused workspace.

Turn a document into a Share Snapshot link for quick handoffs, or start access-controlled Live Share for real-time co-editing, live cursors, anchored comments, and threaded replies. Everyday editing stays on your device. No account is required, and the application includes no ads, analytics, telemetry, or subscriptions.
Turn a document into an encrypted Share Snapshot link for quick handoffs, or start encrypted Live Share for real-time co-editing, live cursors, anchored comments, and threaded replies. Everyday editing stays on your device. No account is required, and the application includes no ads, analytics, telemetry, or subscriptions.

<p align="center">
<img src="https://github.com/user-attachments/assets/5a0d6fda-96f0-4baf-bf7a-0ffbe5119eab" alt="Application UI" width="90%" />
Expand All @@ -74,7 +74,7 @@ Turn a document into a Share Snapshot link for quick handoffs, or start access-c

- **Import and export:** open local files or GitHub content from branches, tags, commit SHAs, and optionally private repositories; export Markdown, standalone HTML, PNG, Standard PDF/Save as PDF, or Rendered PDF with remembered Light or Dark appearance and complete rich-content preparation for PDF and PNG.

- **Optional sharing:** create a Share Snapshot with View only or Can edit access, or start a temporary Live Share room with host, Can edit, and View only capabilities.
- **Optional sharing:** create an encrypted Share Snapshot with View only or Can edit access, or start an encrypted Live Share room with role-based signatures. Keep complete links private: they carry decryption keys. Existing shares retain their original expiry.

<p align="center">
<img src="https://github.com/user-attachments/assets/0b2080e8-6ba8-4dac-a58a-d043fadeeb61" alt="Live share" width="90%" />
Expand Down Expand Up @@ -112,15 +112,17 @@ Markdown Viewer is local-first, not network-free. The following table shows the
| Workflow | Default data path |
| :--- | :--- |
| Editing, local imports, Preview, Workspace autosave, and most exports | On the device |
| Web libraries and uncached renderer dependencies | CDN requests in the web/PWA build |
| Core web libraries / optional uncached renderer dependencies | Bundled local core assets / CDN requests for optional renderers |
| GitHub import and emoji lookup | Public content uses GitHub APIs and raw-content hosts; private content uses an optional PAT only with `api.github.com` |
| PlantUML, D2, Graphviz, Vega-Lite, WaveDrom, and some diagram previews | Diagram source can be sent to PlantUML, Kroki, or mermaid.ink |
| Consented image, GIF, and video insertion | Public, content-addressed Cloudflare media storage for 90 days |
| Consented image, GIF, and video insertion | Encrypted Cloudflare media storage for 90 days |
| Large Share Snapshot | Cloudflare KV for 90 days |
| Live Share | WebSocket relay through a Cloudflare Durable Object; document content is not persisted server-side |
| External images, media, links, and map tiles | The referenced external host |

Share Snapshot and Live Share URLs are bearer links. Anyone who obtains a valid link and capability can use the access it grants. Live Share is not end-to-end encrypted. See [Privacy and Security](wiki/Privacy-and-Security.md) before using network features with sensitive content.
Share Snapshot and Live Share URLs are bearer links. Anyone who obtains a valid link and capability can use the access it grants. New snapshots, managed media, and live rooms use client-side encryption; complete links contain decryption keys. See [Privacy and Security](wiki/Privacy-and-Security.md) before using network features with sensitive content.

Encrypted document recovery files use a separate user-held key and restore as new local documents. See [recovery and rollout](docs/ENCRYPTED_SHARING.md) and [Cloudflare usage limits](docs/SHARING_USAGE.md).

## Visual Renderer Summary

Expand Down Expand Up @@ -164,7 +166,7 @@ Remote renderer services receive the source of the diagram they render. Do not s
- A local Markdown file larger than 10 MB is rejected.
- The GitHub credential vault stores up to 50 named PAT entries; each token name is limited to 60 characters.
- Managed source media is limited to 25 MiB before processing; stored payload limits are 300 KiB for still images, 5 MiB for GIFs, and 10 MiB for videos.
- Stored Share Snapshot content is limited to 8,000,000 characters and expires after 90 days.
- Stored Share Snapshot payloads are limited to 8 MiB before encryption and expire after 90 days.
- Live Share allows up to 64 WebSocket participants and 8 MB per live message.
- STL source is limited to 2 MiB and rendered geometry to 300,000 vertices.
- The desktop vault retains up to 20 recent history copies per document.
Expand Down
2 changes: 1 addition & 1 deletion _headers
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
Content-Security-Policy: default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; form-action 'none'; script-src 'self' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh 'sha256-DgMFO4QE+qqf2xNgeNb5gMKG6BtiiQFniYj21c88yME=' 'sha256-NnbK2LG1LUwYyZ1xgJN7k3oK4oTvHY4o9852VxwNA/o='; script-src-attr 'none'; worker-src 'self'; connect-src 'self' https://markdownviewer.pages.dev https://api.github.com https://raw.githubusercontent.com https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://kroki.io https://www.plantuml.com https://mermaid.ink https://paulrosen.github.io wss://markdownviewer.pages.dev; img-src 'self' data: blob: https:; style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net; style-src-attr 'unsafe-inline'; font-src 'self' data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net; media-src 'self' blob: data: https:; manifest-src 'self'; frame-src 'none'; upgrade-insecure-requests
Content-Security-Policy: default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; form-action 'none'; script-src 'self' 'wasm-unsafe-eval' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh 'sha256-DgMFO4QE+qqf2xNgeNb5gMKG6BtiiQFniYj21c88yME=' 'sha256-NnbK2LG1LUwYyZ1xgJN7k3oK4oTvHY4o9852VxwNA/o='; script-src-attr 'none'; worker-src 'self' blob:; connect-src 'self' https://markdownviewer.pages.dev https://api.github.com https://raw.githubusercontent.com https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://kroki.io https://www.plantuml.com https://mermaid.ink https://paulrosen.github.io wss://markdownviewer.pages.dev; img-src 'self' data: blob: https:; style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net; style-src-attr 'unsafe-inline'; font-src 'self' data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net; media-src 'self' blob: data: https:; manifest-src 'self'; frame-src 'none'; upgrade-insecure-requests
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/bg.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "Шифровано споделяне. Пазете цялата връзка в тайна; тя съдържа ключа за дешифриране.",
"Delete snapshot": "Изтриване на моментната снимка",
"Snapshot deleted.": "Моментната снимка е изтрита.",
"Connected to encrypted live room": "Свързано с шифрована стая на живо",
"Linking folder": "Свързване на папка",
"Scanning folder…": "Сканиране на папката…",
"Reading files…": "Четене на файлове…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/de.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "Verschlüsselte Freigabe. Halten Sie den vollständigen Link geheim; er enthält den Entschlüsselungsschlüssel.",
"Delete snapshot": "Momentaufnahme löschen",
"Snapshot deleted.": "Momentaufnahme gelöscht.",
"Connected to encrypted live room": "Mit verschlüsseltem Live-Raum verbunden",
"Linking folder": "Ordner wird verknüpft",
"Scanning folder…": "Ordner wird durchsucht…",
"Reading files…": "Dateien werden gelesen…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "Encrypted sharing. Keep the complete link private; it includes the decryption key.",
"Delete snapshot": "Delete snapshot",
"Snapshot deleted.": "Snapshot deleted.",
"Connected to encrypted live room": "Connected to encrypted live room",
"Linking folder": "Linking folder",
"Scanning folder…": "Scanning folder…",
"Reading files…": "Reading files…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/es.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "Uso compartido cifrado. Mantén privado el enlace completo; incluye la clave de descifrado.",
"Delete snapshot": "Eliminar instantánea",
"Snapshot deleted.": "Instantánea eliminada.",
"Connected to encrypted live room": "Conectado a la sala en vivo cifrada",
"Linking folder": "Vinculando carpeta",
"Scanning folder…": "Explorando carpeta…",
"Reading files…": "Leyendo archivos…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/fr.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "Partage chiffré. Gardez le lien complet privé ; il contient la clé de déchiffrement.",
"Delete snapshot": "Supprimer l’instantané",
"Snapshot deleted.": "Instantané supprimé.",
"Connected to encrypted live room": "Connecté à la salle en direct chiffrée",
"Linking folder": "Liaison du dossier",
"Scanning folder…": "Analyse du dossier…",
"Reading files…": "Lecture des fichiers…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/it.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "Condivisione crittografata. Mantieni privato il link completo: contiene la chiave di decrittazione.",
"Delete snapshot": "Elimina istantanea",
"Snapshot deleted.": "Istantanea eliminata.",
"Connected to encrypted live room": "Connesso alla stanza live crittografata",
"Linking folder": "Collegamento della cartella",
"Scanning folder…": "Scansione della cartella…",
"Reading files…": "Lettura dei file…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/ja.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "暗号化された共有です。完全なリンクには復号キーが含まれるため、秘密にしてください。",
"Delete snapshot": "スナップショットを削除",
"Snapshot deleted.": "スナップショットを削除しました。",
"Connected to encrypted live room": "暗号化されたライブルームに接続しました",
"Linking folder": "フォルダーをリンク中",
"Scanning folder…": "フォルダーをスキャン中…",
"Reading files…": "ファイルを読み込み中…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/ko.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "암호화된 공유입니다. 전체 링크에는 복호화 키가 포함되어 있으므로 비공개로 유지하세요.",
"Delete snapshot": "스냅샷 삭제",
"Snapshot deleted.": "스냅샷이 삭제되었습니다.",
"Connected to encrypted live room": "암호화된 라이브 룸에 연결됨",
"Linking folder": "폴더 연결 중",
"Scanning folder…": "폴더 검색 중…",
"Reading files…": "파일 읽는 중…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/pl.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "Udostępnianie szyfrowane. Zachowaj pełny link w tajemnicy; zawiera klucz odszyfrowywania.",
"Delete snapshot": "Usuń migawkę",
"Snapshot deleted.": "Migawka usunięta.",
"Connected to encrypted live room": "Połączono z szyfrowanym pokojem na żywo",
"Linking folder": "Łączenie folderu",
"Scanning folder…": "Skanowanie folderu…",
"Reading files…": "Odczytywanie plików…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/pt.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "Partilha encriptada. Mantenha a ligação completa privada; inclui a chave de desencriptação.",
"Delete snapshot": "Eliminar instantâneo",
"Snapshot deleted.": "Instantâneo eliminado.",
"Connected to encrypted live room": "Ligado à sala ao vivo encriptada",
"Linking folder": "Vinculando pasta",
"Scanning folder…": "Verificando pasta…",
"Reading files…": "Lendo arquivos…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/ru.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "Зашифрованный общий доступ. Храните полную ссылку в тайне: она содержит ключ расшифровки.",
"Delete snapshot": "Удалить снимок",
"Snapshot deleted.": "Снимок удалён.",
"Connected to encrypted live room": "Подключено к зашифрованной комнате",
"Linking folder": "Подключение папки",
"Scanning folder…": "Сканирование папки…",
"Reading files…": "Чтение файлов…",
Expand Down
4 changes: 4 additions & 0 deletions assets/i18n/tr.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"Encrypted sharing. Keep the complete link private; it includes the decryption key.": "Şifreli paylaşım. Şifre çözme anahtarını içerdiğinden bağlantının tamamını gizli tutun.",
"Delete snapshot": "Anlık görüntüyü sil",
"Snapshot deleted.": "Anlık görüntü silindi.",
"Connected to encrypted live room": "Şifreli canlı odaya bağlanıldı",
"Linking folder": "Klasör bağlanıyor",
"Scanning folder…": "Klasör taranıyor…",
"Reading files…": "Dosyalar okunuyor…",
Expand Down
Loading
Loading