Prepare the 0.3.0 release
CI / desktop (ubuntu-latest) (push) Successful in 2h34m54s
CI / mobile (push) Failing after 4m52s
CI / desktop (macos-latest) (push) Canceled after 0s
CI / desktop (windows-latest) (push) Canceled after 0s
CI / docker (push) Successful in 53m34s
Docs / build (push) Canceled after 0s
Docs / deploy (push) Canceled after 0s
CI / go (Media) (push) Successful in 13m0s
CI / go (Server) (push) Successful in 24m4s
CI / go (Web-App) (push) Successful in 12m35s
CI / frontend (push) Failing after 11m51s

CHANGELOG.md gets the 0.3.0 notes: everything since 0.2.0 by area, and
the steps for upgrading a 0.2.0 install (new compose files with a stock
PocketBase on 8070, pb_data at /pb/pb_data, the media service, and the
SMTP password to enter once more). The release workflow now uses the
tag's CHANGELOG section as the Gitea release text. A v0.2.0 compose stack
with data was upgraded in place to this commit and kept its data.

Also fixes what CI would have failed on:
- Server lint (golangci-lint v2.14): errors.Is/As for sentinel errors,
  the bbolt/errors package instead of the deprecated bolt error, one
  needless conversion, and commented nolints for gosec false positives.
- SPDX headers on Database/export-schema.sh and Server/entrypoint.sh.
- Prettier on two files; the generated pbschema/schema.json is ignored.
- The editor-bridge dist page rebuilt to match the phone app's copy.

PLAN.md and the upgrade guide point to the release notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-11-17 10:21:57 +01:00
1 parent e5da208974
commit cad42fbe89
19 files changed
+174 -29

No files matched your search

+22 -2
View File
@@ -216,11 +216,28 @@ jobs:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: CHANGELOG.md
sparse-checkout-cone-mode: false
# Each artifact lands in dist/<artifact name>/.
- uses: actions/download-artifact@v3
with:
path: dist
# The release text is the tag's section of CHANGELOG.md ("## 0.3.0 — …"
# up to the next "## "), empty when there is none.
- name: Release notes
env:
TAG: ${{ github.ref_name }}
run: |
v="${TAG#v}"
awk -v v="$v" '
/^## / { on = (index($0, "## " v " ") == 1 || $0 == "## " v); next }
on' CHANGELOG.md > notes.md
echo "$(wc -l < notes.md) lines of release notes for $v"
# Gitea's release API; a release made earlier for this tag (by hand or
# by a rerun) gets the files added instead of a second release.
- name: Release
@@ -234,9 +251,12 @@ jobs:
case "$TAG" in *-*) prerelease=true ;; esac
id=$(curl -fsS -H "$auth" "$API/releases/tags/$TAG" | jq -r .id) || id=""
if [ -z "$id" ]; then
id=$(jq -n --arg tag "$TAG" --argjson pre "$prerelease" \
'{tag_name: $tag, name: $tag, prerelease: $pre}' |
id=$(jq -n --arg tag "$TAG" --argjson pre "$prerelease" --rawfile body notes.md \
'{tag_name: $tag, name: $tag, body: $body, prerelease: $pre}' |
curl -fsS -X POST -H "$auth" -H "Content-Type: application/json" -d @- "$API/releases" | jq -r .id)
elif [ -s notes.md ]; then
jq -n --rawfile body notes.md '{body: $body}' |
curl -fsS -X PATCH -H "$auth" -H "Content-Type: application/json" -d @- "$API/releases/$id" > /dev/null
fi
for f in dist/*/*; do
name=$(basename "$f")
+2
View File
@@ -5,6 +5,8 @@ Spikes/
Desktop-App/build/
Desktop-App/frontend/bindings/
Packages/api-client/src/schema.d.ts
# Written by Database/export-schema.sh.
Server/internal/pbschema/schema.json
*.md
*.yaml
*.yml
+118
View File
@@ -0,0 +1,118 @@
# Changelog
What changed in each Docwell release. The release workflow copies a version's section into its release on Gitea.
## 0.3.0 — 2026-11-17
The AFFiNE parity work ([docs/AFFINE.md](docs/AFFINE.md), phases A–G), the integrations, and the last v2 rows of
[docs/FEATURES.md](docs/FEATURES.md). 0.2.0 was cut on 2026-11-03, so everything below is new.
### Upgrading from 0.2.0
The database container changed. Take a backup first (*Admin panel → Maintenance → Backups*), then:
1. **Use the 0.3.0 compose files.** If you copied `docker-compose.yml` (or a `prod` variant) into your own setup, take
the new one from `Docker/` or `Docker-AIO/`. The changes:
- `db` is now a stock PocketBase (`tajniak81/pocketbase-docker-root`). There is no `docwell-db` image anymore.
docwell-server applies Docwell's schema to PocketBase on every start, and keeps the existing data.
- PocketBase listens on **8070** instead of 8090. Change `DOCWELL_PB_URL` if you set it yourself.
- The `pb_data` volume is mounted at `/pb/pb_data` instead of `/pb_data`. Same volume, same contents; only the
path inside the container changed. If you use a host folder instead of a named volume, mount it at the new path.
- A new **`media`** service (docwell-media, ffmpeg for long recordings) sits on an internal network,
`docwell_media`, that only the server joins.
- The `DOCWELL_SMTP_*`, `DOCWELL_MAIL_FROM` and S3 settings go to the **server** now, not to `db`.
2. **Enter the SMTP password again** in *Admin panel → Email* if you set mail up there rather than through
`DOCWELL_SMTP_*`. PocketBase never gives the password back, so docwell-server keeps its own copy, and a password
saved before 0.3.0 isn't in it.
3. `docker compose pull && docker compose up -d`.
Optional new settings: `DOCWELL_ADMIN_EMAIL` / `DOCWELL_ADMIN_PASSWORD` create the first superadmin on an empty
instance, `PB_ENCRYPTION_KEY` encrypts PocketBase's stored settings, `DOCWELL_MEDIA_URL` / `DOCWELL_MEDIA_TOKEN` point
at docwell-media, and `DOCWELL_GOOGLE_*` / `DOCWELL_MICROSOFT_*` turn on Google Calendar and OneNote. They're all in
the [configuration guide](Docs-Site/guide/configuration.md).
There are also production compose files for local disk, S3, SeaweedFS and split SeaweedFS (`docker-compose.prod*.yml`
with matching `.env.prod*.example`).
### Editor
- Tables, to-dos, callouts, H4–H6, text colour and highlight, alignment, line numbers in code, inline PDF pages.
- Columns (`/columns`, 2–4, drag to resize, stacked on phones).
- Suggesting mode: suggested insertions and deletions that others accept or reject.
- The block grip menu, steadier block handles, and *Turn into* on the text toolbar.
- Date shortcuts, synced pages, editor settings per device, and split view.
### Organising pages
- Page properties, tags, *All docs*, collections and journals.
- Page icons set from the sidebar.
- Verified pages: mark a page as checked until a date, with a badge under the title and a notice when it runs out.
### Databases
- Table, kanban and calendar views stored in the page, with records that open as full pages.
- Relations and rollups, across pages too, and two-way relations.
- Links to records, records in search, and records on public pages.
### Edgeless mode
- Any page as a canvas, with its text as a live note. Mind maps, presentations, and canvas editing on phones.
### AI
- Bring your own provider: OpenAI-compatible, Anthropic or Ollama.
- Chat with citations from the workspace, writing actions in the editor, and an MCP server at `POST /mcp`.
- Audio transcripts (long recordings cut by docwell-media), PDFs as sources, scanned PDFs read for search, and monthly
limits per workspace and person.
- AI chat and writing on phones.
### Search
- Text inside files attached to pages.
- Scanned PDFs, read by AI where the workspace turns it on.
### Import, export and integrations
- Import from Confluence, Obsidian, Bear, OneNote, Readwise and CSV.
- Word and PNG export, and workspace snapshots that can be restored.
- Calendars on journal pages (iCal feeds and Google Calendar).
- The web clipper (Chrome and Firefox).
- A Slack app per workspace: channel news, previews of Docwell links, and `/docwell` search.
- GitHub, Linear and Figma link cards with status and details.
### Sharing
- Invite links, with approval when you want it.
- Switches for workspace sharing and link previews.
- Page views.
- Cleanup of files no page uses anymore.
### Languages
- German, French and Spanish, alongside English and Polish, in the web app, the admin panel and the phone app.
- The server's error messages, emails and push notifications in the same five languages.
### Phone app
- The Docwell icon, page layout in the reader, databases and live editing fixes, and the editor changes above.
### Fixes and maintenance
- The server's data folder is made writable on start, so a host bind mount or an older volume no longer stops search.
- Tighter error handling and lint fixes in the AI code; SPDX headers on every script.
### Known gaps
Not checked yet: iOS, the desktop app on macOS and Linux, the Android editor and canvas on a physical phone, hosted AI
providers (tested against a stand-in), real Google and Microsoft sign-ins, and link previews inside Slack and Discord.
PocketBase's own emails (address verification, password reset) are still English only.
## 0.2.0 — 2026-11-03
Phase 2, "team ready": page-level permissions and guests, comment threads and reactions, notifications and page
watching, templates, backlinks, table of contents, math, Mermaid, Draw.io and Excalidraw, OAuth, OIDC and two-step
codes, audit log, API tokens and webhooks, Notion and DOCX import, PDF export, the desktop app and the Android app.
## 0.1.0 — 2026-10-31
The first release: the MVP wiki (server, live editing, web app, admin panel) and the Docker images.
+1
View File
@@ -1,4 +1,5 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-or-later
# Regenerates Server/internal/pbschema/schema.json from pb_migrations.
#
# docwell-server applies that snapshot to PocketBase on every start, so after
+4 -2
View File
@@ -26,7 +26,9 @@ curl -fsS -X POST https://wiki.example.com/api/v1/admin/backups -H "Authorizatio
## Upgrades
1. Make a backup and download it.
2. Read the release notes for anything to do by hand.
2. Read the release notes (on the release, and in `CHANGELOG.md` in the repository) for anything to do by hand.
From 0.2.0 to 0.3.0 there is: new compose files (PocketBase as a stock image on port 8070, and a new `media`
service), and the SMTP password to enter once more if it was saved in the admin panel.
3. Pull and restart:
```bash
@@ -34,7 +36,7 @@ curl -fsS -X POST https://wiki.example.com/api/v1/admin/backups -H "Authorizatio
docker compose up -d
```
Pin a version with `DOCWELL_VERSION=0.1.0` in `.env` instead of following `latest`.
Pin a version with `DOCWELL_VERSION=0.3.0` in `.env` instead of following `latest`.
Database changes run on their own: docwell-server updates PocketBase's collections when it starts. Going back to an older version after a
migration is not supported; restore the backup instead.
+1 -1
View File
@@ -490,7 +490,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
`)});return}case`insertMarkdown`:this.insertMarkdown(e.markdown,e.mode);return;case`transcribed`:{let t=this.pendingTranscripts.get(e.id);if(!t)return;this.pendingTranscripts.delete(e.id),e.result&&this.words?t.resolve(Qp(e.result,this.words,GZ)):t.reject(Error(e.error||this.labels.blocks.transcribeFailed));return}default:throw Error(`unknown message ${e.type}`)}}requestTranscript(e,t){let n=this.nextTranscript++;return new Promise((r,i)=>{this.pendingTranscripts.set(n,{resolve:r,reject:i}),this.send({type:`transcribe`,id:n,src:e,name:t})})}insertMarkdown(e,t){let n=this.picked,r=n&&!n.editor.isDestroyed?n.editor:this.target,i=GZ(e);if(!i.trim())return;let a=r.state.doc.content.size,o=Math.min(n?.from??r.state.selection.from,a),s=Math.min(n?.to??r.state.selection.to,a);if(t===`replace`)r.chain().focus().insertContentAt({from:o,to:s},i).run();else{let e=r.state.doc.resolve(s);r.chain().focus().insertContentAt(e.depth>=1?e.after(1):s,i).run()}this.picked=null}connect(e){this.provider?.destroy();let t=new BZ({url:e.url,page:e.page,token:()=>e.token});t.onChange(()=>this.send({type:`collab`,status:t.status})),this.provider=t,this.editor.destroy(),this.editor=this.create({collab:{provider:t,user:e.user}}),this.mode===`edgeless`&&this.openCanvas()}openCanvas(){this.closeCanvas();let e=document.createElement(`div`);e.className=`dw-bridge-canvas`,document.body.append(e),this.canvasEl=e,this.el.hidden=!0,this.canvas=xZ(e,{provider:this.provider??void 0,content:this.provider?void 0:this.lastContent??this.editor.getJSON(),editable:this.editable&&!!this.provider,pageTitle:()=>this.title,onNavigate:e=>this.send({type:`navigate`,path:e}),onError:e=>this.send({type:`error`,message:e instanceof Error?e.message:String(e)})})}closeCanvas(){this.canvas?.destroy(),this.canvas=null,this.canvasEl?.remove(),this.canvasEl=null,this.el.hidden=!1}create(e){return this.el.replaceChildren(),new Vp({element:this.el,editable:this.editable,extensions:UY({...e,files:this.files,labels:this.labels,onNavigate:e=>this.send({type:`navigate`,path:e})}),editorProps:{attributes:{class:`dw-prose`}},onUpdate:({editor:e})=>this.send({type:`change`,content:e.getJSON()}),onSelectionUpdate:()=>this.reportState(),onTransaction:()=>this.reportState(),onFocus:()=>this.reportState(),onBlur:()=>this.reportState()})}get target(){return this.inner&&!this.inner.isDestroyed?this.inner:this.editor}track(e){let t=(e instanceof Element?e.closest(`.ProseMirror`):null)?.editor;t&&(this.setInner(t===this.editor?null:t),this.reportState())}innerChanged=()=>this.reportState();innerGone=()=>{this.setInner(null),this.reportState()};setInner(e){if(e!==this.inner){if(this.inner){for(let e of[`selectionUpdate`,`transaction`,`focus`,`blur`])this.inner.off(e,this.innerChanged);this.inner.off(`destroy`,this.innerGone)}if(this.inner=e,e){for(let t of[`selectionUpdate`,`transaction`,`focus`,`blur`])e.on(t,this.innerChanged);e.on(`destroy`,this.innerGone)}}}reportOverlay(){let e=document.querySelector(VZ)!==null;e!==this.overlay&&(this.overlay=e,this.send({type:`overlay`,open:e}))}reportState(){let e=this.target;if(e.isDestroyed)return;let t={active:UZ.filter(([,t])=>t(e)).map(([e])=>e),canUndo:e.can().undo(),canRedo:e.can().redo(),focused:e.isFocused},n=JSON.stringify(t);n!==this.lastState&&(this.lastState=n,this.send({type:`state`,state:t}))}};function GZ(e){return _Z.parse(e.trim(),{async:!1,gfm:!0})}function KZ(e){if(e.isDestroyed)return;let t=e.view.props.nodeViews??{},n=Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)]));e.view.setProps({nodeViews:n})}function qZ(e){let t=JSON.stringify(e);window.DocwellNative?window.DocwellNative.postMessage(t):(window.parent.postMessage(t,`*`),console.debug(`[docwell bridge]`,e))}var JZ=new WZ(document.getElementById(`editor`),qZ);window.docwell={receive:e=>JZ.receive(e)};</script>
<style rel="stylesheet" crossorigin>/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:"Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-serif:"Source Serif 4 Variable", "Source Serif 4", "Iowan Old Style", Georgia, serif;--font-mono:"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--spacing:.25rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--radius-xs:4px;--radius-sm:6px;--radius-md:10px;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-surface:var(--dw-surface);--color-surface-sunken:var(--dw-surface-sunken);--color-surface-raised:var(--dw-surface-raised);--color-surface-hover:var(--dw-surface-hover);--color-line:var(--dw-line);--color-line-strong:var(--dw-line-strong);--color-ink:var(--dw-ink);--color-ink-muted:var(--dw-ink-muted);--color-ink-faint:var(--dw-ink-faint);--color-primary:var(--dw-primary);--color-primary-hover:var(--dw-primary-hover);--color-on-primary:var(--dw-on-primary);--color-accent:var(--dw-accent);--color-accent-soft:var(--dw-accent-soft);--color-selection:var(--dw-selection);--color-focus-ring:var(--dw-focus-ring);--color-success:var(--dw-success);--color-success-soft:var(--dw-success-soft);--color-warning:var(--dw-warning);--color-warning-soft:var(--dw-warning-soft);--color-danger:var(--dw-danger);--color-danger-soft:var(--dw-danger-soft);--color-on-danger:var(--dw-on-danger);--color-info:var(--dw-info);--color-info-soft:var(--dw-info-soft);--color-code-bg:var(--dw-code-bg);--text-ui-xs:12px;--text-ui-xs--line-height:16px;--text-ui-xs--letter-spacing:.01em;--text-ui-xs--font-weight:500;--text-ui-sm:13px;--text-ui-sm--line-height:18px;--text-ui-md:14px;--text-ui-md--line-height:20px;--text-doc-h1:30px;--text-doc-h1--line-height:38px;--text-doc-h2:24px;--text-doc-h2--line-height:32px;--text-doc-h3:18px;--text-doc-h3--line-height:28px;--text-doc-body:16px;--text-doc-body--line-height:27px;--text-code:14px;--text-code--line-height:22px;--shadow-menu:var(--dw-shadow-menu);--shadow-dialog:var(--dw-shadow-dialog);--container-doc:720px;--container-doc-wide:1040px;--spacing-control-sm:28px;--spacing-control-md:34px}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-varLine truncated
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:"Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-serif:"Source Serif 4 Variable", "Source Serif 4", "Iowan Old Style", Georgia, serif;--font-mono:"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--spacing:.25rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--radius-xs:4px;--radius-sm:6px;--radius-md:10px;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-surface:var(--dw-surface);--color-surface-sunken:var(--dw-surface-sunken);--color-surface-raised:var(--dw-surface-raised);--color-surface-hover:var(--dw-surface-hover);--color-line:var(--dw-line);--color-line-strong:var(--dw-line-strong);--color-ink:var(--dw-ink);--color-ink-muted:var(--dw-ink-muted);--color-ink-faint:var(--dw-ink-faint);--color-primary:var(--dw-primary);--color-primary-hover:var(--dw-primary-hover);--color-on-primary:var(--dw-on-primary);--color-accent:var(--dw-accent);--color-accent-soft:var(--dw-accent-soft);--color-selection:var(--dw-selection);--color-focus-ring:var(--dw-focus-ring);--color-success:var(--dw-success);--color-success-soft:var(--dw-success-soft);--color-warning:var(--dw-warning);--color-warning-soft:var(--dw-warning-soft);--color-danger:var(--dw-danger);--color-danger-soft:var(--dw-danger-soft);--color-on-danger:var(--dw-on-danger);--color-info:var(--dw-info);--color-info-soft:var(--dw-info-soft);--color-code-bg:var(--dw-code-bg);--text-ui-xs:12px;--text-ui-xs--line-height:16px;--text-ui-xs--letter-spacing:.01em;--text-ui-xs--font-weight:500;--text-ui-sm:13px;--text-ui-sm--line-height:18px;--text-ui-md:14px;--text-ui-md--line-height:20px;--text-doc-h1:30px;--text-doc-h1--line-height:38px;--text-doc-h2:24px;--text-doc-h2--line-height:32px;--text-doc-h3:18px;--text-doc-h3--line-height:28px;--text-doc-body:16px;--text-doc-body--line-height:27px;--text-code:14px;--text-code--line-height:22px;--shadow-menu:var(--dw-shadow-menu);--shadow-dialog:var(--dw-shadow-dialog);--container-doc:720px;--container-doc-wide:1040px;--spacing-control-sm:28px;--spacing-control-md:34px}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-varLine truncated
/*$vite$:1*/</style>
</head>
<body>
+1 -1
View File
@@ -67,7 +67,7 @@ func run(url, email, password, out string) error {
if err := enc.Encode(cols); err != nil {
return err
}
if err := os.WriteFile(out, buf.Bytes(), 0o644); err != nil {
if err := os.WriteFile(out, buf.Bytes(), 0o644); err != nil { //nolint:gosec // a checked-in source file, readable like the others
return err
}
fmt.Printf("wrote %d collections to %s\n", len(cols), out)
+1
View File
@@ -1,4 +1,5 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-or-later
# docwell-server entrypoint. Started as root only to make the data directory
# writable for the docwell user: a host bind mount, or a volume created by an
# older image, arrives owned by root, and the search index could not be
+5 -6
View File
@@ -6,6 +6,7 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"log/slog"
@@ -164,9 +165,7 @@ func TestOpenAIDriver(t *testing.T) {
}
func asProviderError(err error, out **ProviderError) bool {
pe, ok := err.(*ProviderError)
*out = pe
return ok
return errors.As(err, out)
}
func TestOllamaDriver(t *testing.T) {
@@ -297,7 +296,7 @@ func TestTranscribeDriver(t *testing.T) {
t.Fatalf("text = %q, %v", text, err)
}
o, _ := NewProvider(KindOllama, srv.URL, "", srv.Client())
if _, err := o.Transcribe(context.Background(), "m", "a.mp3", nil); err != ErrNoTranscription {
if _, err := o.Transcribe(context.Background(), "m", "a.mp3", nil); !errors.Is(err, ErrNoTranscription) {
t.Fatalf("ollama = %v", err)
}
}
@@ -324,7 +323,7 @@ func TestScannedPDFIsDetected(t *testing.T) {
if err := doc.Output(&buf); err != nil {
t.Fatal(err)
}
if _, err := extractText("scan.pdf", buf.Bytes()); err != errNoPDFText {
if _, err := extractText("scan.pdf", buf.Bytes()); !errors.Is(err, errNoPDFText) {
t.Fatalf("err = %v", err)
}
}
@@ -352,7 +351,7 @@ func TestPDFGoesWithTheQuestion(t *testing.T) {
t.Fatalf("parts = %v", parts)
}
o, _ := NewProvider(KindOllama, srv.URL, "", srv.Client())
if _, err := o.Chat(context.Background(), ChatRequest{PDF: []byte("x")}, func(string) {}); err != ErrNoDocuments {
if _, err := o.Chat(context.Background(), ChatRequest{PDF: []byte("x")}, func(string) {}); !errors.Is(err, ErrNoDocuments) {
t.Fatalf("ollama = %v", err)
}
}
+1 -1
View File
@@ -56,7 +56,7 @@ func (p *anthropicProvider) Chat(ctx context.Context, req ChatRequest, onDelta f
maxTokens = 16000
}
params := anthropic.BetaMessageNewParams{
Model: anthropic.Model(req.Model),
Model: req.Model,
MaxTokens: maxTokens,
}
if req.System != "" {
+5 -5
View File
@@ -74,7 +74,7 @@ func splitWithFFmpeg(ctx context.Context, ffmpeg, name string, data []byte, max
if err := os.WriteFile(in, data, 0o600); err != nil {
return nil, err
}
cmd := exec.CommandContext(ctx, ffmpeg, "-nostdin", "-hide_banner", "-loglevel", "error",
cmd := exec.CommandContext(ctx, ffmpeg, "-nostdin", "-hide_banner", "-loglevel", "error", //nolint:gosec // ffmpeg is the configured binary; the arguments are fixed and the input is our own temp file
"-i", in, "-vn", "-ac", "1", "-ar", "16000", "-c:a", "libmp3lame", "-b:a", "32k",
"-f", "segment", "-segment_time", fmt.Sprint(segmentSeconds), "-reset_timestamps", "1",
filepath.Join(dir, "part%03d.mp3"))
@@ -93,7 +93,7 @@ func splitWithFFmpeg(ctx context.Context, ffmpeg, name string, data []byte, max
sort.Strings(files)
var parts [][]byte
for _, f := range files {
b, err := os.ReadFile(f)
b, err := os.ReadFile(f) //nolint:gosec // f comes from a glob inside our own temp dir
if err != nil {
return nil, err
}
@@ -242,12 +242,12 @@ func splitWAV(base string, data []byte, max int) ([]audioPiece, error) {
chunk := samples[off:min(off+per, len(samples))]
var b bytes.Buffer
b.WriteString("RIFF")
_ = binary.Write(&b, binary.LittleEndian, uint32(4+8+len(fmtChunk)+8+len(chunk)))
_ = binary.Write(&b, binary.LittleEndian, uint32(4+8+len(fmtChunk)+8+len(chunk))) //nolint:gosec // pieces are a few MB, far below 4 GB
b.WriteString("WAVEfmt ")
_ = binary.Write(&b, binary.LittleEndian, uint32(len(fmtChunk)))
_ = binary.Write(&b, binary.LittleEndian, uint32(len(fmtChunk))) //nolint:gosec // pieces are a few MB, far below 4 GB
b.Write(fmtChunk)
b.WriteString("data")
_ = binary.Write(&b, binary.LittleEndian, uint32(len(chunk)))
_ = binary.Write(&b, binary.LittleEndian, uint32(len(chunk))) //nolint:gosec // pieces are a few MB, far below 4 GB
b.Write(chunk)
out = append(out, audioPiece{Name: fmt.Sprintf("%s-%03d.wav", base, len(out)+1), Data: b.Bytes()})
}
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"bytes"
"context"
"encoding/binary"
"errors"
"os/exec"
"testing"
)
@@ -95,7 +96,7 @@ func TestSplitWAV(t *testing.T) {
if got != 10000 {
t.Fatalf("samples = %d", got)
}
if _, err := splitAudio(context.Background(), "x.m4a", make([]byte, 100), 10); err != errNeedsFFmpeg {
if _, err := splitAudio(context.Background(), "x.m4a", make([]byte, 100), 10); !errors.Is(err, errNeedsFFmpeg) {
t.Fatalf("m4a without ffmpeg = %v", err)
}
}
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"context"
"crypto/rand"
"encoding/hex"
"errors"
"fmt"
"slices"
"sort"
@@ -532,7 +533,7 @@ func userError(err error) string {
return e.Message
}
switch {
case err == ErrRefused:
case errors.Is(err, ErrRefused):
return "The model declined to answer this."
case strings.Contains(err.Error(), "context deadline exceeded"), strings.Contains(err.Error(), "context canceled"):
return "The answer took too long and was stopped."
+1 -1
View File
@@ -117,7 +117,7 @@ func (s *Service) SaveInstanceSettings(ctx context.Context, c access.Caller, in
return InstanceSettings{}, apperr.Forbidden("superadmin role required")
}
if in.WorkspaceTokenLimit < 0 {
return InstanceSettings{}, apperr.InvalidFields(map[string]string{"workspaceTokenLimit": "Use 0 for no limit, or a positive number."})
return InstanceSettings{}, apperr.InvalidFields(map[string]string{"workspaceTokenLimit": "Use 0 for no limit, or a positive number."}) //nolint:gosec // a message, not a credential
}
_, id, err := s.instanceSettings(ctx)
if err != nil {
+1 -1
View File
@@ -509,7 +509,7 @@ func (s *Service) SaveSettings(ctx context.Context, c access.Caller, wsID string
return Settings{}, err
}
if in.MonthlyTokenLimit < 0 {
return Settings{}, apperr.InvalidFields(map[string]string{"monthlyTokenLimit": "Use 0 for no limit, or a positive number."})
return Settings{}, apperr.InvalidFields(map[string]string{"monthlyTokenLimit": "Use 0 for no limit, or a positive number."}) //nolint:gosec // a message, not a credential
}
ignored := []string{}
for _, id := range in.Ignored {
+3 -2
View File
@@ -15,6 +15,7 @@ import (
"time"
bolt "go.etcd.io/bbolt"
bolterrors "go.etcd.io/bbolt/errors"
)
// Store keeps embedding vectors per workspace in a bbolt file (ADR-15). It
@@ -125,7 +126,7 @@ func (s *Store) SetMeta(ws string, m Meta) error {
func (s *Store) DropWorkspace(ws string) error {
return s.db.Update(func(tx *bolt.Tx) error {
err := tx.Bucket(bucketWS).DeleteBucket([]byte(ws))
if errors.Is(err, bolt.ErrBucketNotFound) {
if errors.Is(err, bolterrors.ErrBucketNotFound) {
return nil
}
return err
@@ -258,7 +259,7 @@ func dropChunks(b *bolt.Bucket, source string) error {
func encodeChunk(c Chunk) []byte {
meta, _ := json.Marshal(c)
out := make([]byte, 4+4*len(c.Vector), 4+4*len(c.Vector)+len(meta))
binary.LittleEndian.PutUint32(out, uint32(len(c.Vector)))
binary.LittleEndian.PutUint32(out, uint32(len(c.Vector))) //nolint:gosec // embedding vectors have a few thousand dimensions
for i, f := range c.Vector {
binary.LittleEndian.PutUint32(out[4+4*i:], math.Float32bits(f))
}
@@ -6,6 +6,7 @@
{{end}}
</ul>
<p>
Du bekommst diese E-Mail, weil du ungelesene Benachrichtigungen hast. <a href="{{.SettingsLink}}">Schalte diese E-Mails aus</a>
Du bekommst diese E-Mail, weil du ungelesene Benachrichtigungen hast.
<a href="{{.SettingsLink}}">Schalte diese E-Mails aus</a>
in deinen Benachrichtigungseinstellungen.
</p>
+1 -1
View File
@@ -41,7 +41,7 @@ func (p Provider) Enabled() bool { return p.ClientID != "" && p.ClientSecret !=
// point them at a stand-in (go build -ldflags "-X …").
var (
GoogleAuthURL = "https://accounts.google.com/o/oauth2/v2/auth"
GoogleTokenURL = "https://oauth2.googleapis.com/token"
GoogleTokenURL = "https://oauth2.googleapis.com/token" //nolint:gosec // an endpoint, not a credential
MicrosoftLogin = "https://login.microsoftonline.com"
)
+1 -3
View File
@@ -6,9 +6,7 @@ import { browserLocale, supportedLocales } from "../i18n";
type Messages = { [key: string]: string | Messages };
const files = import.meta.glob<Messages>("./*.json", { eager: true, import: "default" });
const messages = Object.fromEntries(
Object.entries(files).map(([path, m]) => [path.replace(/^\.\/|\.json$/g, ""), m]),
);
const messages = Object.fromEntries(Object.entries(files).map(([path, m]) => [path.replace(/^\.\/|\.json$/g, ""), m]));
/** Every message as "path.to.key" → text. */
function flatten(m: Messages, prefix = ""): Map<string, string> {