Add multi-arch release images and a documentation site
CI / go (Server) (push) Canceled after 0s
CI / go (Web-App) (push) Canceled after 0s
CI / frontend (push) Canceled after 0s
CI / desktop (macos-latest) (push) Canceled after 0s
CI / desktop (ubuntu-latest) (push) Canceled after 0s
CI / desktop (windows-latest) (push) Canceled after 0s
CI / mobile (push) Canceled after 0s
CI / docker (push) Canceled after 0s
Docs / build (push) Canceled after 0s
Docs / deploy (push) Canceled after 0s
Release / images (., Docker-AIO/Dockerfile, docwell) (push) Canceled after 0s
Release / images (., Server/Dockerfile, docwell-server) (push) Canceled after 0s
Release / images (., Web-App/Dockerfile, docwell-web) (push) Canceled after 0s
Release / images (Database, Database/Dockerfile, docwell-db) (push) Canceled after 0s
CI / go (Server) (push) Canceled after 0s
CI / go (Web-App) (push) Canceled after 0s
CI / frontend (push) Canceled after 0s
CI / desktop (macos-latest) (push) Canceled after 0s
CI / desktop (ubuntu-latest) (push) Canceled after 0s
CI / desktop (windows-latest) (push) Canceled after 0s
CI / mobile (push) Canceled after 0s
CI / docker (push) Canceled after 0s
Docs / build (push) Canceled after 0s
Docs / deploy (push) Canceled after 0s
Release / images (., Docker-AIO/Dockerfile, docwell) (push) Canceled after 0s
Release / images (., Server/Dockerfile, docwell-server) (push) Canceled after 0s
Release / images (., Web-App/Dockerfile, docwell-web) (push) Canceled after 0s
Release / images (Database, Database/Dockerfile, docwell-db) (push) Canceled after 0s
Release: pushing a v* tag builds docwell-db, docwell-server, docwell-web and the all-in-one image for linux/amd64 and linux/arm64 and pushes them to GHCR, tagged with the version and latest. The build stages run on the build machine's platform and Go cross-compiles, so arm64 needs no emulation except for the final apk step (checked by building the server image for arm64). The compose files name the released images, so `docker compose up -d` runs a release and `--build` still builds the checkout; DOCWELL_REGISTRY and DOCWELL_VERSION pick them. Docs: Docs-Site is a VitePress site with a quick start, every configuration variable, reverse-proxy setups, backups and upgrades, a user guide, people and access, the admin panel and the API. CI builds it, and the Docs workflow publishes it to GitHub Pages. It lives outside docs/, which stays local planning material. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4d48049133
commit
dbe49b892f
29 files changed
+2941
-26
No files matched your search
@@ -66,6 +66,7 @@ jobs:
|
||||
- run: npm run typecheck
|
||||
- run: npm test
|
||||
- run: npm run build
|
||||
- run: npm run build:docs
|
||||
|
||||
desktop:
|
||||
strategy:
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
# Builds the documentation site (Docs-Site) and publishes it to GitHub Pages.
|
||||
# Enable Pages with "GitHub Actions" as the source in the repository settings.
|
||||
|
||||
name: Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: ["Docs-Site/**", ".github/workflows/docs.yml"]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0 # "last updated" dates come from git history
|
||||
- uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 24
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- name: Build
|
||||
env:
|
||||
# Project sites live under /<repository>/.
|
||||
DOCS_BASE: /${{ github.event.repository.name }}/
|
||||
run: npm run build:docs
|
||||
- uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: Docs-Site/.vitepress/dist
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
steps:
|
||||
- id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -0,0 +1,79 @@
|
||||
# Publishes the Docker images for a release: push a tag like v0.1.0.
|
||||
# Images go to ghcr.io/<repository owner>/<name>, for linux/amd64 and
|
||||
# linux/arm64, tagged with the version (0.1.0, 0.1) and latest.
|
||||
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: Version to stamp into the binaries (e.g. 0.1.0-rc1); images are tagged with it
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
images:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: docwell-db
|
||||
context: Database
|
||||
dockerfile: Database/Dockerfile
|
||||
- name: docwell-server
|
||||
context: .
|
||||
dockerfile: Server/Dockerfile
|
||||
- name: docwell-web
|
||||
context: .
|
||||
dockerfile: Web-App/Dockerfile
|
||||
- name: docwell
|
||||
context: .
|
||||
dockerfile: Docker-AIO/Dockerfile
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Version
|
||||
id: version
|
||||
run: |
|
||||
v="${{ inputs.version || github.ref_name }}"
|
||||
echo "value=${v#v}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.name }}
|
||||
tags: |
|
||||
type=semver,pattern={{version}},value=${{ steps.version.outputs.value }}
|
||||
type=semver,pattern={{major}}.{{minor}},value=${{ steps.version.outputs.value }}
|
||||
type=raw,value=${{ steps.version.outputs.value }},enable=${{ github.event_name == 'workflow_dispatch' }}
|
||||
type=raw,value=latest,enable=${{ github.event_name == 'push' && !contains(github.ref_name, '-') }}
|
||||
labels: |
|
||||
org.opencontainers.image.title=${{ matrix.name }}
|
||||
org.opencontainers.image.licenses=AGPL-3.0-or-later
|
||||
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ${{ matrix.context }}
|
||||
file: ${{ matrix.dockerfile }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
build-args: VERSION=${{ steps.version.outputs.value }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha,scope=${{ matrix.name }}
|
||||
cache-to: type=gha,mode=max,scope=${{ matrix.name }}
|
||||
@@ -41,3 +41,7 @@ coverage.out
|
||||
/Phone-App/assets/editor/*
|
||||
!/Phone-App/assets/editor/.gitkeep
|
||||
/Phone-App/android/build/
|
||||
|
||||
# Docs site build output and cache
|
||||
/Docs-Site/.vitepress/dist/
|
||||
/Docs-Site/.vitepress/cache/
|
||||
@@ -15,3 +15,4 @@ Database/
|
||||
Docker*/
|
||||
api/
|
||||
.claude/
|
||||
Docs-Site/.vitepress/cache/
|
||||
+3
-2
@@ -2,10 +2,11 @@
|
||||
FROM alpine:3.22
|
||||
|
||||
ARG PB_VERSION=0.40.6
|
||||
ARG TARGETARCH=amd64
|
||||
# Set by BuildKit for each platform (amd64, arm64); amd64 for the legacy builder.
|
||||
ARG TARGETARCH
|
||||
|
||||
RUN apk add --no-cache ca-certificates unzip wget \
|
||||
&& wget -q "https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_${TARGETARCH}.zip" -O /tmp/pb.zip \
|
||||
&& wget -q "https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_${TARGETARCH:-amd64}.zip" -O /tmp/pb.zip \
|
||||
&& unzip /tmp/pb.zip pocketbase -d /usr/local/bin \
|
||||
&& rm /tmp/pb.zip \
|
||||
&& apk del unzip wget
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# Docwell all-in-one: PocketBase + docwell-server + docwell-web in one container.
|
||||
# For small self-hosted installs; production setups should use Docker/ (separate services).
|
||||
# Build from the repository root: docker build -f Docker-AIO/Dockerfile -t docwell-aio .
|
||||
# Multi-arch: build stages run on the build machine's platform and Go
|
||||
# cross-compiles, so arm64 images build without emulation.
|
||||
|
||||
FROM node:24-alpine AS ui
|
||||
FROM --platform=$BUILDPLATFORM node:24-alpine AS ui
|
||||
WORKDIR /src
|
||||
COPY package.json package-lock.json tsconfig.base.json ./
|
||||
COPY Packages/ Packages/
|
||||
@@ -15,13 +17,14 @@ RUN mkdir -p Server/internal/admin/dist Web-App/internal/spa/dist \
|
||||
&& npm run build -w @docwell/web-app
|
||||
|
||||
# yrs (Rust Yjs) compiled to WebAssembly; the server embeds it (ADR-3).
|
||||
FROM rust:1-alpine AS yrs
|
||||
FROM --platform=$BUILDPLATFORM rust:1-alpine AS yrs
|
||||
RUN rustup target add wasm32-wasip1
|
||||
WORKDIR /src
|
||||
COPY Server/ycrdt-wasm/ ./
|
||||
RUN cargo build --locked --release --target wasm32-wasip1
|
||||
|
||||
FROM golang:1.26-alpine AS build
|
||||
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS build
|
||||
ARG TARGETOS TARGETARCH
|
||||
WORKDIR /src
|
||||
COPY Server/ Server/
|
||||
COPY Web-App/ Web-App/
|
||||
@@ -29,15 +32,15 @@ COPY --from=ui /src/Server/internal/admin/dist Server/internal/admin/dist
|
||||
COPY --from=yrs /src/target/wasm32-wasip1/release/docwell_yrs.wasm Server/internal/ycrdt/docwell_yrs.wasm
|
||||
COPY --from=ui /src/Web-App/internal/spa/dist Web-App/internal/spa/dist
|
||||
ARG VERSION=dev
|
||||
ENV CGO_ENABLED=0 GOWORK=off
|
||||
ENV CGO_ENABLED=0 GOWORK=off GOOS=$TARGETOS GOARCH=$TARGETARCH
|
||||
RUN cd Server && go build -trimpath -ldflags "-s -w -X main.Version=${VERSION}" -o /out/docwell-server ./cmd/docwell-server
|
||||
RUN cd Web-App && go build -trimpath -ldflags "-s -w -X main.Version=${VERSION}" -o /out/docwell-web ./cmd/docwell-web
|
||||
|
||||
FROM alpine:3.22
|
||||
ARG PB_VERSION=0.40.6
|
||||
ARG TARGETARCH=amd64
|
||||
ARG TARGETARCH
|
||||
RUN apk add --no-cache ca-certificates unzip wget \
|
||||
&& wget -q "https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_${TARGETARCH}.zip" -O /tmp/pb.zip \
|
||||
&& wget -q "https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_${TARGETARCH:-amd64}.zip" -O /tmp/pb.zip \
|
||||
&& unzip /tmp/pb.zip pocketbase -d /usr/local/bin && rm /tmp/pb.zip && apk del unzip
|
||||
COPY --from=build /out/ /usr/local/bin/
|
||||
COPY Database/pb_migrations /pb_migrations
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# Docwell all-in-one container.
|
||||
# docker compose up --build
|
||||
# PB_ADMIN_PASSWORD=... docker compose up -d # released image
|
||||
# PB_ADMIN_PASSWORD=... docker compose up --build # or build from this checkout
|
||||
# Open http://localhost:3000 (admin panel: http://localhost:3000/admin/)
|
||||
|
||||
name: docwell-aio
|
||||
|
||||
services:
|
||||
docwell:
|
||||
image: ${DOCWELL_REGISTRY:-ghcr.io/docwell}/docwell:${DOCWELL_VERSION:-latest}
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Docker-AIO/Dockerfile
|
||||
@@ -17,6 +19,7 @@ services:
|
||||
DOCWELL_WEB_URL: ${DOCWELL_WEB_URL:-http://localhost:3000}
|
||||
DOCWELL_SIGNUP_ENABLED: ${DOCWELL_SIGNUP_ENABLED:-true}
|
||||
DOCWELL_SIGNUP_DOMAINS: ${DOCWELL_SIGNUP_DOMAINS:-}
|
||||
DOCWELL_MAX_UPLOAD_MB: ${DOCWELL_MAX_UPLOAD_MB:-50}
|
||||
DOCWELL_SMTP_HOST: ${DOCWELL_SMTP_HOST:-}
|
||||
DOCWELL_SMTP_PORT: ${DOCWELL_SMTP_PORT:-587}
|
||||
DOCWELL_SMTP_USERNAME: ${DOCWELL_SMTP_USERNAME:-}
|
||||
|
||||
+9
-1
@@ -1,3 +1,7 @@
|
||||
# Which released images to run (docker compose pull). Ignored with --build.
|
||||
DOCWELL_REGISTRY=ghcr.io/docwell
|
||||
DOCWELL_VERSION=latest
|
||||
|
||||
# PocketBase superuser, used by docwell-db and docwell-server. Change these.
|
||||
PB_ADMIN_EMAIL=admin@docwell.test
|
||||
PB_ADMIN_PASSWORD=change-me-please
|
||||
@@ -7,7 +11,11 @@ DOCWELL_PUBLIC_URL=http://localhost:8080
|
||||
DOCWELL_WEB_URL=http://localhost:3000
|
||||
DOCWELL_COLLAB_URL=ws://localhost:8080/collab
|
||||
|
||||
# Sign-up. The first account always can sign up and becomes the instance admin.
|
||||
# Largest attachment in MB (1-100).
|
||||
DOCWELL_MAX_UPLOAD_MB=50
|
||||
|
||||
# Sign-up defaults; the admin panel can change them later.
|
||||
# The first account always can sign up and becomes the instance admin.
|
||||
DOCWELL_SIGNUP_ENABLED=true
|
||||
# Comma-separated email domains allowed to sign up (empty = any).
|
||||
DOCWELL_SIGNUP_DOMAINS=
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
# Docwell as three standalone services.
|
||||
# cp .env.example .env # then change the passwords
|
||||
# docker compose up --build
|
||||
# docker compose up -d # released images (DOCWELL_VERSION, default latest)
|
||||
# docker compose up --build # or build from this checkout
|
||||
# Web app: http://localhost:3000 API + admin panel: http://localhost:8080/admin/
|
||||
|
||||
name: docwell
|
||||
|
||||
services:
|
||||
db:
|
||||
image: ${DOCWELL_REGISTRY:-ghcr.io/docwell}/docwell-db:${DOCWELL_VERSION:-latest}
|
||||
build: ../Database
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
@@ -27,6 +29,7 @@ services:
|
||||
# ports: ["127.0.0.1:8090:8090"]
|
||||
|
||||
server:
|
||||
image: ${DOCWELL_REGISTRY:-ghcr.io/docwell}/docwell-server:${DOCWELL_VERSION:-latest}
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Server/Dockerfile
|
||||
@@ -44,6 +47,7 @@ services:
|
||||
# Defaults until a superadmin saves signup rules in the admin panel.
|
||||
DOCWELL_SIGNUP_ENABLED: ${DOCWELL_SIGNUP_ENABLED:-true}
|
||||
DOCWELL_SIGNUP_DOMAINS: ${DOCWELL_SIGNUP_DOMAINS:-}
|
||||
DOCWELL_MAX_UPLOAD_MB: ${DOCWELL_MAX_UPLOAD_MB:-50}
|
||||
volumes:
|
||||
# The search index (rebuilt from the database when missing).
|
||||
- server_data:/data
|
||||
@@ -51,6 +55,7 @@ services:
|
||||
- "8080:8080"
|
||||
|
||||
web:
|
||||
image: ${DOCWELL_REGISTRY:-ghcr.io/docwell}/docwell-web:${DOCWELL_VERSION:-latest}
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Web-App/Dockerfile
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import { defineConfig } from "vitepress";
|
||||
|
||||
// The Docwell documentation site. Build with `npm run build:docs`; the
|
||||
// Docs workflow publishes it to GitHub Pages.
|
||||
export default defineConfig({
|
||||
title: "Docwell",
|
||||
description: "Self-hosted knowledge base and collaborative document editor",
|
||||
// GitHub Pages serves project sites under /<repository>/; DOCS_BASE sets it.
|
||||
base: process.env.DOCS_BASE ?? "/",
|
||||
lang: "en",
|
||||
cleanUrls: true,
|
||||
// The quick start links to the local addresses Docwell runs on.
|
||||
ignoreDeadLinks: "localhostLinks",
|
||||
lastUpdated: true,
|
||||
head: [["link", { rel: "icon", href: "favicon.svg" }]],
|
||||
themeConfig: {
|
||||
logo: "/favicon.svg",
|
||||
nav: [
|
||||
{ text: "Quick start", link: "/guide/quick-start" },
|
||||
{ text: "Configuration", link: "/guide/configuration" },
|
||||
{ text: "API", link: "/reference/api" },
|
||||
],
|
||||
sidebar: [
|
||||
{
|
||||
text: "Run Docwell",
|
||||
items: [
|
||||
{ text: "Quick start", link: "/guide/quick-start" },
|
||||
{ text: "Configuration", link: "/guide/configuration" },
|
||||
{ text: "Behind a reverse proxy", link: "/guide/reverse-proxy" },
|
||||
{ text: "Backups and upgrades", link: "/guide/backups-upgrades" },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "Use Docwell",
|
||||
items: [
|
||||
{ text: "Workspaces, spaces and pages", link: "/guide/using-docwell" },
|
||||
{ text: "People and access", link: "/guide/access" },
|
||||
{ text: "Admin panel", link: "/guide/administration" },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "Reference",
|
||||
items: [
|
||||
{ text: "HTTP API", link: "/reference/api" },
|
||||
{ text: "Architecture", link: "/reference/architecture" },
|
||||
],
|
||||
},
|
||||
],
|
||||
search: { provider: "local" },
|
||||
footer: { message: "Released under the GNU AGPL v3.0 or later." },
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
# People and access
|
||||
|
||||
## Instance roles
|
||||
|
||||
| Role | Can |
|
||||
| --- | --- |
|
||||
| **superadmin** | Everything on the server: every organization, user and workspace, and the instance settings. The first account is one. |
|
||||
| **admin** | Their own organization: its people (never superadmins) and all of its workspaces. |
|
||||
| **user** | The workspaces they were added to. |
|
||||
|
||||
## Workspace roles
|
||||
|
||||
Organization admins and superadmins are owners of every workspace in their scope. Everyone else has the role they
|
||||
were given: **owner** > **admin** > **member** > **guest**. Nobody can give a role above their own or change their
|
||||
own role.
|
||||
|
||||
Guests only see spaces they were added to; members also see every open space.
|
||||
|
||||
## Space roles
|
||||
|
||||
| Role | Can |
|
||||
| --- | --- |
|
||||
| **admin** | Change the space's settings and members, empty its trash |
|
||||
| **editor** | Create, edit, move and trash pages, share them publicly |
|
||||
| **commenter** | Read and comment |
|
||||
| **viewer** | Read |
|
||||
|
||||
Workspace owners and admins are admins of every space. In an open space, members get the space's default role
|
||||
unless they were given another one.
|
||||
|
||||
## Groups
|
||||
|
||||
Workspace admins create **groups** in *Workspace settings → Groups*. A space can give a role to a whole group in
|
||||
*Space settings → Groups*. Someone in several groups, or with a role of their own too, gets the highest one.
|
||||
|
||||
## Inviting people
|
||||
|
||||
- **Into a workspace:** *Workspace settings → Members*, enter an email and a role, **Invite**. Someone who already
|
||||
has an account in the organization is added at once; anyone else gets an email with a link. If email is not set
|
||||
up, copy the link Docwell shows and send it yourself.
|
||||
- **Into an organization:** *Admin panel → Users → Invite people*.
|
||||
|
||||
Invites work even when sign-up is turned off, and expire after seven days. Pending invites can be resent or
|
||||
revoked.
|
||||
@@ -0,0 +1,31 @@
|
||||
# Admin panel
|
||||
|
||||
The admin panel is at `/admin/` on the API server (or on the web app's address in the all-in-one setup).
|
||||
Superadmins and organization admins can sign in; organization admins see only their organization.
|
||||
|
||||
| Section | What it is for |
|
||||
| --- | --- |
|
||||
| **Overview** | Number of users, workspaces, spaces, pages and files, storage used, pages open right now, and (for superadmins) version, uptime and database health. |
|
||||
| **Users** | Find, create, edit, disable and delete accounts; invite people by email; send a password-reset email. |
|
||||
| **Organizations** | Create, rename and delete organizations (superadmins), or manage your own. |
|
||||
| **Authentication** | Turn self-service sign-up on or off, limit it to email domains, and enable sign-in links by email. |
|
||||
| **Branding** | The server's name, accent colour and logo, shown on sign-in pages and in emails. |
|
||||
| **Email** | The SMTP server for all emails, with a test button. |
|
||||
| **Storage** | Keep uploaded files on docwell-db's disk or in an S3-compatible bucket, with a test button. |
|
||||
| **Maintenance** | Create, download and delete backups; see the background jobs (search indexing) and run them by hand. |
|
||||
|
||||
Everything except Users and Organizations is for superadmins only.
|
||||
|
||||
## Sign-in links
|
||||
|
||||
With **Sign-in links by email** on, the sign-in page offers *Email me a sign-in link*. The email holds a link and
|
||||
an 8-digit code; both work once, for 15 minutes. Email must be set up first.
|
||||
|
||||
## Moving to S3
|
||||
|
||||
Switching storage does not move files that were uploaded before: copy them from `pb_data/storage` to the bucket
|
||||
with your usual tools (for example `rclone`), keeping the folder structure, before switching.
|
||||
|
||||
## Rebuilding the search index
|
||||
|
||||
Search follows edits within a few seconds. If results ever look wrong, run **search.rebuild** in *Maintenance*.
|
||||
@@ -0,0 +1,40 @@
|
||||
# Backups and upgrades
|
||||
|
||||
Everything that matters lives in docwell-db's data directory (the `pb_data` volume): the database, page history
|
||||
and, unless files go to S3, the uploaded files. The search index in docwell-server's `/data` is rebuilt from it.
|
||||
|
||||
## Backups
|
||||
|
||||
In *Admin panel → Maintenance → Backups*, **Create backup** writes a zip of the database and its files into
|
||||
`pb_data/backups`. Download it and keep a copy somewhere else: a backup on the same disk does not survive the disk.
|
||||
|
||||
Backups made while people edit are consistent: PocketBase copies the database safely while it runs.
|
||||
|
||||
For scheduled backups, back up the `pb_data` volume with your usual tools (for example a nightly `docker run` of
|
||||
`restic` or `borg` against the volume), or call the API from cron:
|
||||
|
||||
```bash
|
||||
curl -fsS -X POST https://wiki.example.com/api/v1/admin/backups -H "Authorization: Bearer $TOKEN"
|
||||
```
|
||||
|
||||
### Restore
|
||||
|
||||
1. Stop Docwell: `docker compose down`.
|
||||
2. Replace the contents of the `pb_data` volume with the contents of the backup zip.
|
||||
3. Start Docwell again: `docker compose up -d`. The search index rebuilds on its own.
|
||||
|
||||
## Upgrades
|
||||
|
||||
1. Make a backup and download it.
|
||||
2. Read the release notes for anything to do by hand.
|
||||
3. Pull and restart:
|
||||
|
||||
```bash
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Pin a version with `DOCWELL_VERSION=0.1.0` in `.env` instead of following `latest`.
|
||||
|
||||
Database changes (migrations) run on their own when docwell-db starts. Going back to an older version after a
|
||||
migration is not supported; restore the backup instead.
|
||||
@@ -0,0 +1,59 @@
|
||||
# Configuration
|
||||
|
||||
Docwell is configured with environment variables, set in `.env` (separate services) or in the
|
||||
`environment:` section of `docker-compose.yml`. Many settings can also be changed later in the
|
||||
[admin panel](./administration); where both exist, the table says which wins.
|
||||
|
||||
## Database (docwell-db)
|
||||
|
||||
| Variable | Default | What it does |
|
||||
| --- | --- | --- |
|
||||
| `PB_ADMIN_EMAIL` | `admin@docwell.test` | The internal PocketBase superuser. docwell-server signs in with it. |
|
||||
| `PB_ADMIN_PASSWORD` | *(required)* | Its password. Also the key file links are signed with: changing it ends open file links (they renew on reload). |
|
||||
| `DOCWELL_WEB_URL` | `http://localhost:3000` | The web app's address. Links in emails open it. |
|
||||
| `DOCWELL_APP_NAME` | | The name in emails. When set it is applied at every start and overrides *Branding*. |
|
||||
| `DOCWELL_MAIL_FROM` | `no-reply@docwell.localhost` | Sender address. When set it overrides *Email → Sender address* at every start. |
|
||||
| `DOCWELL_SMTP_HOST` | | Mail server. When set, all `DOCWELL_SMTP_*` values are applied at every start and override *Admin panel → Email*. Leave it empty to manage mail in the admin panel. |
|
||||
| `DOCWELL_SMTP_PORT` | `587` | |
|
||||
| `DOCWELL_SMTP_USERNAME` | | |
|
||||
| `DOCWELL_SMTP_PASSWORD` | | |
|
||||
| `DOCWELL_SMTP_TLS` | `false` | `true` for implicit TLS (usually port 465). Port 587 upgrades with STARTTLS on its own. |
|
||||
|
||||
## API server (docwell-server)
|
||||
|
||||
| Variable | Default | What it does |
|
||||
| --- | --- | --- |
|
||||
| `DOCWELL_ADDR` | `:8080` | Listen address. |
|
||||
| `DOCWELL_PB_URL` | `http://127.0.0.1:8090` | Where docwell-db is. Keep it on a private network. |
|
||||
| `DOCWELL_PB_EMAIL`, `DOCWELL_PB_PASSWORD` | *(required)* | The PocketBase superuser (`PB_ADMIN_EMAIL`, `PB_ADMIN_PASSWORD`). |
|
||||
| `DOCWELL_PUBLIC_URL` | `http://localhost:8080` | The API's public address. Exported pages link attachments here. |
|
||||
| `DOCWELL_WEB_URL` | `http://localhost:3000` | The web app's address, for invite and share links. |
|
||||
| `DOCWELL_CORS_ORIGINS` | `http://localhost:5173,http://localhost:3000` | Comma-separated origins allowed to call the API from a browser: the web app's address. |
|
||||
| `DOCWELL_SIGNUP_ENABLED` | `true` | Self-service sign-up, until a superadmin saves *Authentication* in the admin panel. |
|
||||
| `DOCWELL_SIGNUP_DOMAINS` | | Comma-separated email domains allowed to sign up (empty: any), with the same rule. |
|
||||
| `DOCWELL_MAX_UPLOAD_MB` | `50` | Largest attachment, 1 to 100. |
|
||||
| `DOCWELL_DATA_DIR` | `./data` (`/data` in the image) | The search index. It is rebuilt from the database when missing, so a volume is optional but makes restarts faster. |
|
||||
| `DOCWELL_SHUTDOWN_TIMEOUT` | `15s` | How long to wait for requests and open pages to finish saving on shutdown. |
|
||||
|
||||
## Web app (docwell-web)
|
||||
|
||||
| Variable | Default | What it does |
|
||||
| --- | --- | --- |
|
||||
| `DOCWELL_WEB_ADDR` | `:3000` | Listen address. |
|
||||
| `DOCWELL_API_URL` | `http://localhost:8080` | The API's address, as browsers reach it. |
|
||||
| `DOCWELL_COLLAB_URL` | `ws://localhost:8080/collab` | The live-editing WebSocket (`wss://` behind HTTPS). |
|
||||
| `DOCWELL_PROXY_TARGET` | | When set (for example `http://server:8080`), docwell-web forwards `/api`, `/collab` and `/admin` to docwell-server, so browsers only talk to one address. The all-in-one image does this. |
|
||||
|
||||
## Compose
|
||||
|
||||
| Variable | Default | What it does |
|
||||
| --- | --- | --- |
|
||||
| `DOCWELL_REGISTRY` | `ghcr.io/docwell` | Where `docker compose pull` gets the images. |
|
||||
| `DOCWELL_VERSION` | `latest` | Which release to run, for example `0.1.0`. |
|
||||
|
||||
## Volumes
|
||||
|
||||
| Volume | Holds | Back it up? |
|
||||
| --- | --- | --- |
|
||||
| `pb_data` (docwell-db `/pb_data`) | the database, uploaded files (unless S3 is on), backups | **Yes** |
|
||||
| `server_data` (docwell-server `/data`) | the search index | No: it is rebuilt from the database |
|
||||
@@ -0,0 +1,72 @@
|
||||
# Quick start
|
||||
|
||||
Docwell runs as Docker containers. You need [Docker](https://docs.docker.com/get-docker/) with the Compose plugin
|
||||
on a machine with at least 1 GB of free memory. Images are published for `linux/amd64` and `linux/arm64`, so a
|
||||
Raspberry Pi 4 or an ARM cloud server works too.
|
||||
|
||||
There are two ways to run it:
|
||||
|
||||
| Setup | Containers | Use it for |
|
||||
| --- | --- | --- |
|
||||
| **All-in-one** | one, on port 3000 | trying Docwell, small teams, a home server |
|
||||
| **Separate services** | database, API server, web app | production, scaling, putting each part behind its own proxy |
|
||||
|
||||
## All-in-one
|
||||
|
||||
```bash
|
||||
git clone https://github.com/docwell/docwell.git
|
||||
cd docwell/Docker-AIO
|
||||
PB_ADMIN_PASSWORD='choose-a-long-password' docker compose up -d
|
||||
```
|
||||
|
||||
Open <http://localhost:3000>. The admin panel is at <http://localhost:3000/admin/>.
|
||||
|
||||
`PB_ADMIN_PASSWORD` protects the internal database account. Keep it secret and keep using the same value: the
|
||||
server signs file links with a key derived from it.
|
||||
|
||||
## Separate services
|
||||
|
||||
```bash
|
||||
git clone https://github.com/docwell/docwell.git
|
||||
cd docwell/Docker
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Edit `.env`: at least set `PB_ADMIN_PASSWORD`, and set `DOCWELL_PUBLIC_URL` and `DOCWELL_WEB_URL` to the
|
||||
addresses people will use. Then start it:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
- Web app: <http://localhost:3000>
|
||||
- API: <http://localhost:8080/api/v1/version>
|
||||
- Admin panel: <http://localhost:8080/admin/>
|
||||
|
||||
To build the images from your checkout instead of pulling released ones, add `--build`.
|
||||
|
||||
## First steps
|
||||
|
||||
1. **Create the first account.** The first person to sign up becomes the **superadmin** and can open the admin
|
||||
panel. Do this right away on a server others can reach.
|
||||
2. **Set up email** in *Admin panel → Email*, then send a test email. Without email, people cannot verify their
|
||||
address or reset a forgotten password, and invites have to be passed on by hand (Docwell shows the link).
|
||||
3. **Decide who may join** in *Admin panel → Authentication*: turn self-service sign-up off and invite people
|
||||
instead, or limit sign-up to your company's email domains.
|
||||
4. **Create an organization and a workspace.** In the web app, open *Settings → Organization* and create one; you
|
||||
become its admin. Then create a workspace, add spaces, and start writing.
|
||||
|
||||
## Try email locally
|
||||
|
||||
The separate-services setup ships a development mail catcher. In `.env` set `DOCWELL_SMTP_HOST=mailpit` and
|
||||
`DOCWELL_SMTP_PORT=1025`, start with the `dev` profile and read the emails at <http://localhost:8025>:
|
||||
|
||||
```bash
|
||||
docker compose --profile dev up -d
|
||||
```
|
||||
|
||||
## Next
|
||||
|
||||
- [Configuration](./configuration) lists every setting.
|
||||
- [Behind a reverse proxy](./reverse-proxy) adds HTTPS and your own domain.
|
||||
- [Backups and upgrades](./backups-upgrades) keeps your data safe.
|
||||
@@ -0,0 +1,63 @@
|
||||
# Behind a reverse proxy
|
||||
|
||||
Put Docwell behind a reverse proxy to serve it over HTTPS on your own domain. Live editing uses a WebSocket on
|
||||
`/collab`, so the proxy must pass WebSocket upgrades through.
|
||||
|
||||
## One address (recommended)
|
||||
|
||||
Run the all-in-one image, or set `DOCWELL_PROXY_TARGET=http://server:8080` on docwell-web, so the web app serves the
|
||||
API, the WebSocket and the admin panel from its own origin. Then the proxy needs a single route to port 3000.
|
||||
|
||||
Set these to the public address:
|
||||
|
||||
```ini
|
||||
DOCWELL_WEB_URL=https://wiki.example.com
|
||||
DOCWELL_PUBLIC_URL=https://wiki.example.com
|
||||
```
|
||||
|
||||
### Caddy
|
||||
|
||||
```txt
|
||||
wiki.example.com {
|
||||
reverse_proxy localhost:3000
|
||||
}
|
||||
```
|
||||
|
||||
Caddy gets a certificate and proxies WebSockets without extra settings.
|
||||
|
||||
### nginx
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name wiki.example.com;
|
||||
# ssl_certificate ... ;
|
||||
|
||||
client_max_body_size 100m; # uploads (DOCWELL_MAX_UPLOAD_MB) and imports
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 1h; # keep idle editing sessions open
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Two addresses
|
||||
|
||||
With separate services and no proxying in docwell-web, route the web app and the API separately, for example
|
||||
`wiki.example.com` → port 3000 and `api.wiki.example.com` → port 8080, and set:
|
||||
|
||||
```ini
|
||||
DOCWELL_WEB_URL=https://wiki.example.com
|
||||
DOCWELL_PUBLIC_URL=https://api.wiki.example.com
|
||||
DOCWELL_COLLAB_URL=wss://api.wiki.example.com/collab
|
||||
DOCWELL_CORS_ORIGINS=https://wiki.example.com
|
||||
```
|
||||
|
||||
Never expose docwell-db (port 8090): only docwell-server may talk to it.
|
||||
@@ -0,0 +1,54 @@
|
||||
# Workspaces, spaces and pages
|
||||
|
||||
## How content is organized
|
||||
|
||||
- An **organization** is a company or team. Everyone belongs to at most one.
|
||||
- A **workspace** belongs to an organization and holds spaces. Switch workspaces at the top of the sidebar.
|
||||
- A **space** groups pages, for example per team or project. It is **open** (every workspace member can open it)
|
||||
or **private** (only the people and groups added to it).
|
||||
- **Pages** nest inside each other. Drag them in the sidebar to reorder or move them.
|
||||
|
||||
## Writing
|
||||
|
||||
Pages save as you type, and everyone with the page open sees changes and cursors live.
|
||||
|
||||
| To | Do this |
|
||||
| --- | --- |
|
||||
| Insert a heading, list, quote, code block, divider, image or file | Type `/` and pick from the menu (keep typing to filter) |
|
||||
| Format text or add a link | Select it and use the toolbar that appears |
|
||||
| Mention someone | Type `@` and their name |
|
||||
| Add an image or file | Paste or drop it, or use `/image`, `/file` or the paperclip in the header |
|
||||
| Undo | Ctrl+Z (your own changes only) |
|
||||
| Fold the sidebar | Ctrl+/ |
|
||||
|
||||
**History** in the page header lists saved versions; you can view any of them and restore it. Restoring keeps the
|
||||
current text as a version too.
|
||||
|
||||
## Comments
|
||||
|
||||
Select text and choose **Comment** to start a discussion; the text stays highlighted and the comment appears in
|
||||
the **Comments** panel. People with the *commenter* role can comment without being able to edit. Authors and space
|
||||
admins can delete comments.
|
||||
|
||||
## Finding things
|
||||
|
||||
Press **Ctrl+K** (⌘K on a Mac) or click **Search** in the sidebar. With nothing typed it shows the pages you
|
||||
visited last; type to search titles and text in every space you can open. Star a page (☆ in the header) to keep it
|
||||
under **Favorites** in the sidebar.
|
||||
|
||||
## Sharing
|
||||
|
||||
**Share** in the page header shows who can open the page through its space and copies the page's link. Editors can
|
||||
turn on a **public link**: anyone with it can read the page (and, if you choose, the pages inside it) without an
|
||||
account. Turning it off makes the link stop working at once. Pages in the trash are never shown through a link.
|
||||
|
||||
## Import and export
|
||||
|
||||
- **Export:** the **⋯** menu in the page header saves the page as Markdown or HTML.
|
||||
- **Import:** **Import** on a space's page list creates a page per Markdown (`.md`, `.txt`) or HTML file. A leading
|
||||
`# Heading` becomes the title. Up to 20 files at once.
|
||||
|
||||
## Trash
|
||||
|
||||
**Move to trash** hides a page and everything inside it. Restore it from the space's **Trash**. Space admins can
|
||||
delete pages there for good.
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: Docwell
|
||||
text: Write it once, find it forever.
|
||||
tagline: An open-source, self-hosted wiki and collaborative document editor for teams.
|
||||
actions:
|
||||
- theme: brand
|
||||
text: Quick start
|
||||
link: /guide/quick-start
|
||||
- theme: alt
|
||||
text: Configuration
|
||||
link: /guide/configuration
|
||||
|
||||
features:
|
||||
- title: Write together
|
||||
details: Real-time co-editing with live cursors, a slash menu, mentions, inline comments and page history.
|
||||
- title: Organized and private
|
||||
details: Workspaces hold spaces of nested pages. Open or private spaces, roles per person or group.
|
||||
- title: Find anything
|
||||
details: Full-text search across everything you can open, from a Ctrl+K palette.
|
||||
- title: Share and move
|
||||
details: Public read-only links, Markdown and HTML import and export, image and file attachments.
|
||||
- title: Yours to run
|
||||
details: One docker compose up. Your data stays on your server, in PocketBase on disk or in S3.
|
||||
- title: Open source
|
||||
details: AGPL-3.0. Go and Vue, with web, desktop and mobile apps built on one API.
|
||||
---
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "@docwell/docs",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vitepress dev",
|
||||
"build": "vitepress build",
|
||||
"preview": "vitepress preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitepress": "^1.6.4"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="256" height="256" xmlns:c2pa="http://c2pa.org/manifest"><metadata><c2pa:manifest>AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYToyYTkxZWZlYi0yODk3LTQ3YmYtYjg5NC0yNGZmMDc2ZmEyYzIAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaK7zAT57eHfcF53QhFGGBLoAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDoyZjJmNWQ1Ny0zYTE0LTRhMmEtYjFhMy0yOTg3NGQzNmE4ZTNscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNoS+guuZJma+4SDlIHdQh43AAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlcnOha2luZ3JlZGllbnRzgaJjdXJseC1zZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jM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1,24 @@
|
||||
# HTTP API
|
||||
|
||||
docwell-server's API is described in [`api/openapi.yaml`](https://github.com/docwell/docwell/blob/main/api/openapi.yaml)
|
||||
(OpenAPI 3.1). It is the source of truth: the web, desktop and mobile apps use clients generated from it.
|
||||
|
||||
- Base path: `/api/v1`.
|
||||
- Authentication: sign in with `POST /api/v1/auth/login` and send the returned token as
|
||||
`Authorization: Bearer <token>`. Refresh it with `POST /api/v1/auth/refresh`.
|
||||
- Errors are JSON: `{"error": "<code>", "message": "...", "fields": {...}}`, where `fields` holds per-field
|
||||
messages for `validation` errors.
|
||||
- File links (`/api/v1/files/{id}`) also accept `?token=` with a short-lived token from `POST /api/v1/files/token`,
|
||||
because `<img>` tags cannot send headers.
|
||||
|
||||
Health checks for load balancers: `GET /healthz` (process up) and `GET /readyz` (database reachable).
|
||||
|
||||
## Example
|
||||
|
||||
```bash
|
||||
TOKEN=$(curl -s -X POST https://wiki.example.com/api/v1/auth/login \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"email":"me@example.com","password":"..."}' | jq -r .token)
|
||||
|
||||
curl -s https://wiki.example.com/api/v1/workspaces -H "Authorization: Bearer $TOKEN"
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
# Architecture
|
||||
|
||||
```txt
|
||||
browser / desktop / mobile
|
||||
│ HTTPS + WebSocket
|
||||
▼
|
||||
docwell-web ──(optional proxy)──▶ docwell-server ──▶ docwell-db
|
||||
(serves the app) (API, live editing, (PocketBase:
|
||||
search, admin panel) SQLite + files)
|
||||
```
|
||||
|
||||
- **docwell-db** is [PocketBase](https://pocketbase.io) with Docwell's schema. It stores accounts, pages, history,
|
||||
comments and files (on disk or in S3), and sends the account emails. It is private: only docwell-server talks to
|
||||
it, as a superuser.
|
||||
- **docwell-server** (Go) is the only public API. It enforces every access rule, relays live edits between editors
|
||||
(Yjs, merged with yrs compiled to WebAssembly), keeps the full-text index (Bleve) and serves the admin panel.
|
||||
- **docwell-web** (Go) serves the web app and can proxy the API, so browsers need one address.
|
||||
|
||||
Page content is a Yjs document; the server keeps a compacted copy plus the Tiptap JSON and plain text derived from
|
||||
it, which history, search, export and public links use.
|
||||
@@ -2,7 +2,19 @@
|
||||
|
||||
An open-source, self-hostable knowledge base and collaborative document editor. It is wiki-first like Docmost and Outline, and will grow Notion-style databases later.
|
||||
|
||||
> Status: **Phase 0 done; Phase 1 (MVP wiki) in progress.** Sign-in, organizations, workspaces, spaces, the page tree, the editor and real-time collaboration with page history work. Most of the MVP (search, comments, sharing, import and export) is still to come.
|
||||
> Status: **Phase 1 (MVP wiki) feature-complete, heading for release 0.1.** Phase 2 ("team ready") is next.
|
||||
|
||||
What works today:
|
||||
|
||||
- Accounts with email and password, sign-in links by email, invites, sign-up rules and an email-domain allow-list
|
||||
- Organizations, workspaces, groups, open and private spaces, and a page tree with drag and drop and a trash
|
||||
- Real-time co-editing with live cursors and page history; a slash menu, a formatting toolbar, mentions, images and file attachments
|
||||
- Inline comments, favorites, recently visited pages, full-text search with a Ctrl+K palette
|
||||
- Public read-only share links, Markdown and HTML import and export
|
||||
- An admin panel for users and invites, branding, sign-up rules, email, file storage (disk or S3), backups, background jobs and system health
|
||||
- English and Polish, light and dark themes, phone-sized layouts
|
||||
|
||||
User and operator documentation lives in [Docs-Site](Docs-Site) (a VitePress site: `npm run dev:docs`).
|
||||
|
||||
## Components
|
||||
|
||||
@@ -16,13 +28,14 @@ An open-source, self-hostable knowledge base and collaborative document editor.
|
||||
| `Packages/` | Shared frontend code: `@docwell/editor`, `@docwell/ui`, `@docwell/api-client`, and `@docwell/editor-bridge` (the editor as one HTML page for the phone app's WebView) | TypeScript |
|
||||
| `Docker/` | The three services as separate containers | docker compose |
|
||||
| `Docker-AIO/` | Everything in one container | docker compose |
|
||||
| `Docs-Site/` | User and operator documentation | VitePress |
|
||||
|
||||
## Quick start (Docker)
|
||||
|
||||
```bash
|
||||
cd Docker
|
||||
cp .env.example .env # change the passwords
|
||||
docker compose up --build
|
||||
docker compose up -d # released images; add --build to build this checkout
|
||||
```
|
||||
|
||||
- Web app: http://localhost:3000
|
||||
@@ -33,20 +46,23 @@ All-in-one container instead (one port, 3000; admin at http://localhost:3000/adm
|
||||
|
||||
```bash
|
||||
cd Docker-AIO
|
||||
PB_ADMIN_PASSWORD=change-me docker compose up --build
|
||||
PB_ADMIN_PASSWORD=change-me docker compose up -d
|
||||
```
|
||||
|
||||
**The first account you sign up becomes the superadmin**, which unlocks the admin panel. To test sign-up emails (verification, password reset) locally, set `DOCWELL_SMTP_HOST=mailpit` and `DOCWELL_SMTP_PORT=1025` in `.env`, start with `docker compose --profile dev up --build`, and read the emails at http://localhost:8025.
|
||||
|
||||
The [quick start guide](Docs-Site/guide/quick-start.md) covers first steps, HTTPS behind a reverse proxy, every configuration variable, and backups and upgrades.
|
||||
|
||||
## Authentication
|
||||
|
||||
Accounts live in PocketBase's built-in `users` auth collection. PocketBase stores the passwords, issues the tokens, and sends the verification and password-reset emails. It stays private: apps call `/api/v1/auth/*` on docwell-server, which forwards to PocketBase and adds Docwell's rules:
|
||||
|
||||
- sign-up on or off (`DOCWELL_SIGNUP_ENABLED`) and an email-domain allow-list (`DOCWELL_SIGNUP_DOMAINS`)
|
||||
- sign-up on or off and an email-domain allow-list (the admin panel; `DOCWELL_SIGNUP_ENABLED` and `DOCWELL_SIGNUP_DOMAINS` are the defaults)
|
||||
- invites, which work even with sign-up off
|
||||
- the first account becomes the superadmin
|
||||
- disabled accounts (`status = disabled`) can't sign in
|
||||
|
||||
Tokens are sent as `Authorization: Bearer <token>`. Email codes (OTP), MFA and OAuth2 providers are switched on in PocketBase's `users` collection settings; the web app already handles codes and MFA.
|
||||
Tokens are sent as `Authorization: Bearer <token>`. Sign-in links by email (PocketBase's email OTP) are switched on in the admin panel; MFA and OAuth2 providers are switched on in PocketBase's `users` collection settings, and the web app already handles codes and MFA.
|
||||
|
||||
## Organizations and rights
|
||||
|
||||
@@ -114,6 +130,12 @@ npm run generate
|
||||
|
||||
Desktop release builds set the update feed and its signing key; see [Desktop-App/updates.go](Desktop-App/updates.go). Development builds never update themselves.
|
||||
|
||||
The documentation site: `npm run dev:docs` (http://localhost:5173) and `npm run build:docs`. The Docs workflow publishes it to GitHub Pages.
|
||||
|
||||
### Releases
|
||||
|
||||
Push a tag like `v0.1.0`. The Release workflow builds `docwell-db`, `docwell-server`, `docwell-web` and the all-in-one `docwell` image for `linux/amd64` and `linux/arm64` and pushes them to `ghcr.io/<repository owner>/`. The compose files pull from `DOCWELL_REGISTRY` (default `ghcr.io/docwell`) at `DOCWELL_VERSION` (default `latest`).
|
||||
|
||||
## License
|
||||
|
||||
[GNU Affero General Public License v3.0 or later](LICENSE).
|
||||
+7
-4
@@ -1,7 +1,9 @@
|
||||
# docwell-server: Go API + embedded admin panel.
|
||||
# Build from the repository root: docker build -f Server/Dockerfile .
|
||||
# Multi-arch: build stages run on the build machine's platform and Go
|
||||
# cross-compiles, so arm64 images build without emulation.
|
||||
|
||||
FROM node:24-alpine AS admin
|
||||
FROM --platform=$BUILDPLATFORM node:24-alpine AS admin
|
||||
WORKDIR /src
|
||||
COPY package.json package-lock.json tsconfig.base.json ./
|
||||
COPY Packages/ Packages/
|
||||
@@ -12,19 +14,20 @@ RUN npm ci --no-audit --no-fund
|
||||
RUN mkdir -p Server/internal/admin/dist && npm run build -w @docwell/admin
|
||||
|
||||
# yrs (Rust Yjs) compiled to WebAssembly; the server embeds it (ADR-3).
|
||||
FROM rust:1-alpine AS yrs
|
||||
FROM --platform=$BUILDPLATFORM rust:1-alpine AS yrs
|
||||
RUN rustup target add wasm32-wasip1
|
||||
WORKDIR /src
|
||||
COPY Server/ycrdt-wasm/ ./
|
||||
RUN cargo build --locked --release --target wasm32-wasip1
|
||||
|
||||
FROM golang:1.26-alpine AS build
|
||||
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS build
|
||||
ARG TARGETOS TARGETARCH
|
||||
WORKDIR /src/Server
|
||||
COPY Server/ ./
|
||||
COPY --from=admin /src/Server/internal/admin/dist ./internal/admin/dist
|
||||
COPY --from=yrs /src/target/wasm32-wasip1/release/docwell_yrs.wasm ./internal/ycrdt/docwell_yrs.wasm
|
||||
ARG VERSION=dev
|
||||
RUN CGO_ENABLED=0 GOWORK=off go build -trimpath -ldflags "-s -w -X main.Version=${VERSION}" \
|
||||
RUN CGO_ENABLED=0 GOWORK=off GOOS=$TARGETOS GOARCH=$TARGETARCH go build -trimpath -ldflags "-s -w -X main.Version=${VERSION}" \
|
||||
-o /out/docwell-server ./cmd/docwell-server
|
||||
|
||||
FROM alpine:3.22
|
||||
|
||||
+6
-3
@@ -1,7 +1,9 @@
|
||||
# docwell-web: Go static server + embedded Vue web app.
|
||||
# Build from the repository root: docker build -f Web-App/Dockerfile .
|
||||
# Multi-arch: build stages run on the build machine's platform and Go
|
||||
# cross-compiles, so arm64 images build without emulation.
|
||||
|
||||
FROM node:24-alpine AS ui
|
||||
FROM --platform=$BUILDPLATFORM node:24-alpine AS ui
|
||||
WORKDIR /src
|
||||
COPY package.json package-lock.json tsconfig.base.json ./
|
||||
COPY Packages/ Packages/
|
||||
@@ -11,12 +13,13 @@ COPY Desktop-App/frontend/package.json Desktop-App/frontend/
|
||||
RUN npm ci --no-audit --no-fund
|
||||
RUN mkdir -p Web-App/internal/spa/dist && npm run build -w @docwell/web-app
|
||||
|
||||
FROM golang:1.26-alpine AS build
|
||||
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS build
|
||||
ARG TARGETOS TARGETARCH
|
||||
WORKDIR /src/Web-App
|
||||
COPY Web-App/ ./
|
||||
COPY --from=ui /src/Web-App/internal/spa/dist ./internal/spa/dist
|
||||
ARG VERSION=dev
|
||||
RUN CGO_ENABLED=0 GOWORK=off go build -trimpath -ldflags "-s -w -X main.Version=${VERSION}" \
|
||||
RUN CGO_ENABLED=0 GOWORK=off GOOS=$TARGETOS GOARCH=$TARGETARCH go build -trimpath -ldflags "-s -w -X main.Version=${VERSION}" \
|
||||
-o /out/docwell-web ./cmd/docwell-web
|
||||
|
||||
FROM alpine:3.22
|
||||
|
||||
@@ -17,6 +17,7 @@ export default ts.config(
|
||||
"Desktop-App/build/",
|
||||
"Desktop-App/frontend/bindings/",
|
||||
"Packages/api-client/src/schema.d.ts",
|
||||
"Docs-Site/.vitepress/cache/",
|
||||
],
|
||||
},
|
||||
js.configs.recommended,
|
||||
|
||||
Generated
+2223
-1
File diff suppressed because it is too large.
Load diff
+5
-2
@@ -7,7 +7,8 @@
|
||||
"Packages/*",
|
||||
"Server/admin",
|
||||
"Web-App/frontend",
|
||||
"Desktop-App/frontend"
|
||||
"Desktop-App/frontend",
|
||||
"Docs-Site"
|
||||
],
|
||||
"scripts": {
|
||||
"build:packages": "npm run build -w @docwell/api-client",
|
||||
@@ -23,7 +24,9 @@
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"format": "prettier --write .",
|
||||
"format:check": "prettier --check ."
|
||||
"format:check": "prettier --check .",
|
||||
"dev:docs": "npm run dev -w @docwell/docs",
|
||||
"build:docs": "npm run build -w @docwell/docs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
|
||||
Reference in new issue
Block a user