sharedauth.NewWithStore now treats an empty AUTHGUARD_URL as "pending" (still gated, failing closed) rather than permanently disabled, so a ProjectConfigurator-registered CollabTable no longer needs AUTHGUARD_URL set at all. Add AUTH_DISABLED (default false) to opt into the old fully-open behavior explicitly via sharedauth.Disabled(), and update both READMEs/.env.example to document the three resulting states. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CollabTable Server
The CollabTable backend is a small Go net/http service backed by PostgreSQL. It serves the
Svelte dashboard and the Android synchronization API from one container.
Features
- REST API for lists, fields, items, and item values
- Transactional HTTP synchronization with soft-delete tombstones
- Notification polling for background refreshes
- Multi-user browser sessions (with per-account roles/admin user management) authenticated
through AuthGuard, a centralized identity service shared across projects (optional -- see
AUTHGUARD_URLbelow) - Long-lived bearer API token for Android and other sync clients (independent of AuthGuard)
- Embedded SvelteKit dashboard
- Idempotent PostgreSQL schema initialization
Quick start with Docker
cd ..
docker build -f docker/Dockerfile -t collabtable-server .
docker run -d --name collabtable-server --restart unless-stopped \
-p 8080:8080 \
-e DATABASE_URL=postgres://user:password@host:5432/collabtable \
-e AUTHGUARD_URL=https://auth.example.com \
-e COOKIE_SECURE=false \
collabtable-server
Open http://localhost:8080 to create the first account. Generate an API token from
the dashboard's Settings menu and enter it in the Android app.
Local development
The backend requires Go 1.26+ and PostgreSQL. The dashboard requires Node.js 22+.
cp .env.example .env
go test ./...
go run .
To build the dashboard for the embedded production binary:
cd ../frontend
npm ci
npm run check
npm run build
cd ..
Copy-Item -Recurse -Force frontend/build backend/web
go -C backend build -o collabtable-server .
The Dockerfile performs those dashboard and Go build steps automatically.
API
All Android synchronization routes are prefixed with /api/ and require:
Authorization: Bearer <api-token>
The Android app also sends x-device-id, which is used to avoid showing a device its own
notification events.
Authentication
GET /api/auth/statusPOST /api/auth/setupPOST /api/auth/loginPOST /api/auth/logoutPOST /api/auth/credentialsGET /api/auth/token/statusPOST /api/auth/token/regenerate
Browser authentication proxies to AuthGuard (AUTHGUARD_URL), which sets and reads its own
auth_session HTTP-only cookie; CollabTable itself mints no session token. Any number of
accounts can exist, with user/admin/superadmin roles managed via /api/auth/users.
AuthGuard integration has three states: AUTHGUARD_URL set (used immediately); unset with
AUTH_DISABLED unset/false (the default -- "pending": auth stays fully enabled/gated, waiting
for ProjectConfigurator's push, failing closed on auth calls until then); or AUTH_DISABLED=true
(authentication fully off -- no login screen, nothing gated). Only set AUTH_DISABLED=true for
local development or a deployment you are certain does not need access control. API tokens are
unrelated to AuthGuard (see below), hashed at rest, and shown only when generated.
Data
GET|POST /api/listsGET|PUT|DELETE /api/lists/:idGET /api/fields/list/:listIdPOST /api/fieldsPUT|DELETE /api/fields/:idGET /api/items/list/:listIdGET /api/items/:itemId/valuesPOST /api/itemsPOST /api/items/valuesPUT|DELETE /api/items/:idPOST /api/syncGET /api/notifications/poll?since=<timestamp-ms>
Dashboard and health
GET /healthis public.GET /web/datarequires the admin session.GET /web/inforequires the admin session./,/about, and/lists/:idserve the embedded dashboard SPA.
Environment variables
PORT— HTTP port, default8080APP_VERSION— optional version displayed in the dashboard, defaultdevCOOKIE_SECURE— set totruewhen served over HTTPSDATABASE_URL— PostgreSQL connection string, requiredAUTHGUARD_URL— optional bootstrap/override base URL of the AuthGuard identity service CollabTable authenticates against, default unset (pending). Leaving it unset does not disable authentication -- it leaves the service "pending" until ProjectConfigurator pushes a URL, failing closed on auth calls until then. UseAUTH_DISABLEDto actually turn auth off.AUTH_DISABLED— settrueto disable authentication entirely (no login screen, nothing gated, every request treated as authenticated), defaultfalse. For local development or a standalone deployment with no AuthGuard integration at all.DB_INIT_RETRY_INTERVAL_MS— startup retry delay, default5000DB_INIT_RETRY_MAX_ATTEMPTS— maximum startup attempts,0retries foreverSYNC_MAX_FUTURE_SKEW_MS— allowed client timestamp skew, default0NOTIF_RETENTION_MS— notification retention period, default seven days
The Go server initializes the existing CollabTable tables in place, so switching from the previous server does not require a data export or schema conversion.
License
MIT