March 3, 2024, 12:44 p.m.

I was looking for a decent wiki solution I can self host, supports OIDC and has an editor that works (read: does not break basic macOS / iOS spelling features and auto correct). Bonus points if it is free to use but allows me to pay for it. Turns out outline does all of this. It even comes with export features and an API that deserves the name! Looks and feels a lot like Notion.

The configuration example just dumps all config options in one file and the Docker compose file comes with its own reverse proxy. So for documentation here are my two files to run the service properly for a four to five users. You likely want to tune concurrency, rate limiter and connection pools a bit for more users.

This is the config I am using for OIDC sign in and email notifications.

NODE_ENV=production
SECRET_KEY=
UTILS_SECRET=

DATABASE_URL=postgres://x:y@postgres:5432/outline
DATABASE_CONNECTION_POOL_MIN=1
DATABASE_CONNECTION_POOL_MAX=10
PGSSLMODE=disable

REDIS_URL=redis://redis:6379

URL=https://...
PORT=3100

FILE_STORAGE=local
FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
FILE_STORAGE_UPLOAD_MAX_SIZE=262144000

OIDC_CLIENT_ID=
OIDC_CLIENT_SECRET=
OIDC_AUTH_URI=
OIDC_TOKEN_URI=
OIDC_USERINFO_URI=
OIDC_LOGOUT_URI=

OIDC_USERNAME_CLAIM=preferred_username
OIDC_DISPLAY_NAME=OpenID Connect
OIDC_SCOPES=openid profile email

FORCE_HTTPS=false
ENABLE_UPDATES=true
WEB_CONCURRENCY=2

LOG_LEVEL=info

SMTP_HOST=
SMTP_PORT=587
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_FROM_EMAIL=
SMTP_REPLY_EMAIL=
SMTP_SECURE=true

DEFAULT_LANGUAGE=en_US

RATE_LIMITER_ENABLED=true
RATE_LIMITER_REQUESTS=1000
RATE_LIMITER_DURATION_WINDOW=60

And here is the docker-compose.yaml only exposing the app server to Caddy, the reverse proxy.

version: "3.2"
services:

  outline:
    image: docker.getoutline.com/outlinewiki/outline:latest
    restart: unless-stopped
    container_name: outline
    networks:
      - outline
      - caddy_internal
    env_file: ./docker.env
    ports:
      - "3100:3100"
    volumes:
      - ...:/var/lib/outline/data
    depends_on:
      - postgres
      - redis

  redis:
    image: redis
    networks:
      - outline
    env_file: ./docker.env
    ports:
      - "6379:6379"
    volumes:
      - ...:/redis.conf
    command: ["redis-server", "/redis.conf"]
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 30s
      retries: 3

  postgres:
    image: postgres
    networks:
      - outline
    env_file: ./docker.env
    ports:
      - "5432:5432"
    volumes:
      - ...:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD", "pg_isready -U outline"]
      interval: 30s
      timeout: 20s
      retries: 3
    environment:
      POSTGRES_USER: 'x'
      POSTGRES_PASSWORD: 'y'
      POSTGRES_DB: 'outline'

networks:
  outline:
    external: false
  caddy_internal:
    external: true

I kept the file as close to their example as possible, even if it goes a bit against my usual style.

posted on March 3, 2024, 12:44 p.m. in TIL, homelab, self-hosting