- Introduced a new authentication system using session cookies for the web dashboard and API tokens for sync clients. - Replaced the old SERVER_PASSWORD scheme with a more secure API token mechanism. - Added routes for user setup, login, logout, and credential updates. - Implemented middleware to require session and API token for protected routes. - Updated web UI to handle authentication states and provide user feedback. - Enhanced error handling in API requests and responses. - Updated README to reflect new authentication flow and database requirements.
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
container_name: collabtable-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
- POSTGRES_DB=collabtable
|
|
- POSTGRES_USER=collabtable
|
|
- POSTGRES_PASSWORD=collabtable
|
|
volumes:
|
|
- pg_data:/var/lib/postgresql/data
|
|
networks:
|
|
- collabtable-network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U collabtable"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
server:
|
|
build: .
|
|
container_name: collabtable-server
|
|
restart: unless-stopped
|
|
environment:
|
|
- PORT=3000
|
|
- NODE_ENV=production
|
|
# Session cookie for the admin web dashboard (see src/routes/authRoutes.ts)
|
|
- COOKIE_SECURE=false
|
|
# Retry DB initialization instead of crashing immediately on startup races
|
|
- DB_INIT_RETRY_INTERVAL_MS=5000
|
|
- DB_INIT_RETRY_MAX_ATTEMPTS=0
|
|
# Clamp future client timestamps during sync to avoid resend loops
|
|
- SYNC_MAX_FUTURE_SKEW_MS=0
|
|
- DATABASE_URL=postgres://collabtable:collabtable@postgres:5432/collabtable
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- collabtable-network
|
|
|
|
volumes:
|
|
pg_data:
|
|
|
|
networks:
|
|
collabtable-network:
|
|
driver: bridge
|