Skip to content

Relay Configuration

The relay server is configured entirely through environment variables. There is no config file.

VariableDefaultDescription
PORT8080HTTP port to listen on
DB_PATH/data/relay.dbPath to the SQLite database
RETENTION_DAYS7How long to keep clips before deleting them
MAX_BODY_MB20Maximum clip size in megabytes
AUTH_TOKENIf set, all requests must include Authorization: Bearer <token>
CORS_ORIGINS*Allowed CORS origins (comma-separated)
LOG_LEVELinfoLog level: debug, info, warn, error
Terminal window
docker run -d \
-p 8080:8080 \
-v cinch-data:/data \
-e RETENTION_DAYS=14 \
-e MAX_BODY_MB=50 \
-e AUTH_TOKEN=your-secret-token \
-e LOG_LEVEL=info \
ghcr.io/jinmugo/cinch-relay:latest
services:
relay:
image: ghcr.io/jinmugo/cinch-relay:latest
ports:
- "8080:8080"
volumes:
- cinch-data:/data
environment:
RETENTION_DAYS: "14"
MAX_BODY_MB: "50"
AUTH_TOKEN: "${CINCH_TOKEN}"
restart: unless-stopped
volumes:
cinch-data:

After deploying, tell the CLI where to find your relay:

Terminal window
cinch config set relay-url https://relay.example.com

Or set the environment variable:

Terminal window
export CINCH_RELAY_URL=https://relay.example.com

The relay uses a single SQLite file. Its schema is minimal:

CREATE TABLE clips (
id INTEGER PRIMARY KEY AUTOINCREMENT,
payload BLOB NOT NULL,
mime_type TEXT NOT NULL DEFAULT 'text/plain',
created_at INTEGER NOT NULL, -- Unix timestamp
expires_at INTEGER NOT NULL -- Unix timestamp
);

Clips are deleted by a background goroutine that runs every hour and removes rows where expires_at < now().

The database is safe to back up with a standard SQLite copy while the relay is running — SQLite’s WAL mode is enabled by default.