Repository navigation
Expand file tree
/
Copy pathdocker.env.example
More file actions
248 lines (207 loc) · 10.9 KB
/
Copy pathdocker.env.example
File metadata and controls
248 lines (207 loc) · 10.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# Craig Docker self-host configuration
#
# cp docker.env.example docker.env # then fill in the [REQUIRED] values below
# docker compose up -d
#
# Look through [REQUIRED] values that must be filled in order for Craig to start properly.
#
# If you are utilizing this bot for other users, please distinguish it from Craig itself
# so we don't get invalid support requests and we can be happy.
######################################################################################################
### Docker Compose
######################################################################################################
# These are only read when you run `docker compose --env-file docker.env ...` (or set them in your
# shell); plain `docker compose up` uses the defaults shown here.
# Image tag from ghcr.io/craigchat/craig (`latest`, a release tag or a branch name)
CRAIG_IMAGE_TAG=latest
# Version label baked in when building the image locally (`docker compose build`)
CRAIG_VERSION=local
# Host interface the ports are published on. Keep 127.0.0.1 behind a reverse proxy on the same
# host; 0.0.0.0 exposes the services directly (no TLS, so dashboard login only works on localhost).
CRAIG_BIND_ADDRESS=127.0.0.1
CRAIG_FERRET_HOST_PORT=9100
CRAIG_DASHBOARD_HOST_PORT=9200
CRAIG_ENNUIZEL_HOST_PORT=9001
CRAIG_WEBAPP_HOST_PORT=9002
# Seconds each Craig container waits for Postgres and Redis on start
CRAIG_STARTUP_TIMEOUT=90
######################################################################################################
### Postgres (db container + all apps)
######################################################################################################
# The database container creates this user/database on first start.
# Changing these after the first start DOES NOT change the existing database!
POSTGRES_USER=craig
# [REQUIRED] Generate with `openssl rand -hex 24`
POSTGRES_PASSWORD=
POSTGRES_DB=craig
# DATABASE_URL=postgresql://user:password@host:5432/craig
DATABASE_POOL_MAX=5
DATABASE_CONNECTION_TIMEOUT=10000
# [REQUIRED] for the dashboard and cloud drive uploads: encrypts tokens stored in the database
# Format is <version>:<key>, generate the key with `openssl rand -base64 32`. To rotate, append a
# higher version (1:<key>,2:<key>), restart all services, run `pnpm encrypt-tokens --write`, then
# remove the old key and restart again
TOKEN_ENCRYPTION_KEYS=1:
######################################################################################################
### Redis (all apps)
######################################################################################################
# REDIS_HOST=redis
# REDIS_PORT=6379
REDIS_DATABASE=0
REDIS_PREFIX=craig:
######################################################################################################
### Public URLs (shared by the bot, ferret, kitchen and the dashboard)
######################################################################################################
# Where ferret (the download page, port 9100) is reachable.
DOWNLOAD_URL=http://localhost:9100
# Where the dashboard (port 9200) is reachable, without a trailing slash.
DASHBOARD_URL=http://localhost:9200
PUBLIC_BASE_URL=http://localhost:9200
# Linked from the bot's /info command
CRAIG_HOMEPAGE=https://craig.chat/
######################################################################################################
### Discord Bot
######################################################################################################
# REQUIRED. From https://discord.com/developers/applications -> your app -> Bot / General Information
BOT_TOKEN=
BOT_APPLICATION_ID=
# Custom status text
BOT_STATUS_TEXT=Recording VCs
# Comma-separated Discord user IDs that bypass maintenance mode
ELEVATED_USERS=
# Application ID used in the /info invite link (defaults to BOT_APPLICATION_ID)
INVITE_CLIENT_ID=
# Craig.chat's planned-maintenance notices are shown in the bot unless this is set
DISABLE_STATUS_CHECK=true
# Recording size limits in bytes (local recordings, webapp, webapp Opus)
SIZE_LIMIT=536870912
SIZE_LIMIT_WEB=4294967296
SIZE_LIMIT_WEB_OPUS=1073741824
# This is used to map recording benefits to tiers, feel free to modify, but this default gives everyone all benefits
REWARD_TIERS_JSON={"-1":{"recordHours":24,"downloadExpiryHours":720,"features":["mix","auto","drive","glowers","eccontinuous","ecflac","mp3"]},"0":{"recordHours":24,"downloadExpiryHours":720,"features":["mix","auto","drive","glowers","eccontinuous","ecflac","mp3"]}}
# Sharding. Leave empty to use Discord's recommended shard count and concurrency.
BOT_SHARD_COUNT=
BOT_SHARD_CONCURRENCY=
BOT_READY_TIMEOUT=60000
BOT_RESPAWN=true
# Control API used by botctl. Disabled unless BOT_CONTROL_PORT is set. Not hosted in this image, a non-local BOT_CONTROL_HOST requires BOT_CONTROL_TOKEN.
BOT_CONTROL_HOST=127.0.0.1
# BOT_CONTROL_PORT=9300
# BOT_CONTROL_TOKEN=
BOT_CONTROL_ALLOW_EVAL=false
BOT_CONTROL_ALLOWED_CIDRS=
BOT_CONTROL_TRUST_HEADER=
# Optional: Discord webhook URL for system notifs
SYSTEM_NOTIFICATION_URL=
# error, warn, info or debug
LOGGER_LEVEL=info
# Optional: Sentry error reporting for the bot
SENTRY_DSN=
SENTRY_ENV=
SENTRY_SAMPLE_RATE=1
######################################################################################################
### Kitchen (cooks recordings into downloads; internal only, port 9000)
######################################################################################################
# How long finished jobs and temp files are kept (ms format: 30m, 6h, 1d)
JOB_EXPIRATION=1d
TMP_EXPIRATION=6h
# Cron for cleaning expired jobs/files
KITCHEN_CRON_TIME="0 * * * *"
KITCHEN_CLEAN_FILES=true
# Persist the job list to Redis so it survives restarts
SAVE_JOBS=true
# Max concurrent jobs (empty = unlimited)
QUEUE_SIZE=
# Priority for ffmpeg and other cook processes
PROC_NICENESS=10
PROC_IONICE=3
PROC_CHRT_IDLE=true
# taskset CPU list for cook processes, e.g. 2-7 (empty = any CPU)
PROC_TASKSET_CPU_MAP=
UNIQUE_KITCHEN_ID=primary
# Optional: transcription via RunPod. DOWNLOAD_URL_PREFIX must be a public URL RunPod can fetch
# files in /data/downloads from, e.g. https://dl.example.com/dl/
RUNPOD_TRANSCRIPTION_ENDPOINT_ID=
RUNPOD_API_KEY=
DOWNLOAD_URL_PREFIX=
######################################################################################################
### Shared website variables (ferret & dashboard)
######################################################################################################
PUBLIC_CRAIG_ENV=selfhosted
# Optional: Plausible analytics host.
PUBLIC_PLAUSIBLE_HOSTNAME=
######################################################################################################
### Ferret (download page, port 9100)
######################################################################################################
# Defaults to the origin of DOWNLOAD_URL; set only if ferret is served elsewhere
# FERRET_ORIGIN=
# Rate-limit the recording API per client IP (see "Reverse proxy")
RATE_LIMIT=true
# Let nginx serve finished downloads via X-Accel-Redirect (see /_accel_dl/ in nginx.conf).
# Leave empty to stream downloads through ferret.
DOWNLOADS_ACCEL_PATH=
# The Ennuizel (in-browser editor) download option opens PUBLIC_ENNUIZEL_URL, a hosted Ennuizel
# editor. PUBLIC_ENNUIZEL_API_HOSTNAME is the host the editor streams the recording from; leave it
# empty to use ferret's own host (nginx.conf proxies /api/ennuizel to the streamer on 9001).
# The editor is served over HTTPS, so ferret must be on HTTPS for this to work.
PUBLIC_ENNUIZEL_URL=https://ez.craig.horse
PUBLIC_ENNUIZEL_API_HOSTNAME=
######################################################################################################
### Webapp server (port 9002, lets people use the webapp)
### See https://docs.craig.chat/features/webapp/
######################################################################################################
# The webapp client UI is not part of this repo. Keep this off unless you host a webapp client that
# connects to this server, and set WEBAPP_CONNECT_URL to it ({id} and {key} are filled in).
WEBAPP_ENABLED=false
# [REQUIRED] if enabled: shared secret between the bot and the webapp server (`openssl rand -hex 32`)
WEBAPP_TOKEN=
WEBAPP_CONNECT_URL=https://web.craig.chat/?id={id}&key={key}&custom=webapp-server.example.com
######################################################################################################
### Dashboard (port 9200)
######################################################################################################
# [REQUIRED] Discord app -> OAuth2. Add DISCORD_REDIRECT_URI to the app's redirect list.
PUBLIC_DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
DISCORD_REDIRECT_URI=http://localhost:9200/api/login
# [REQUIRED] Signs login sessions (`openssl rand -hex 32`)
JWT_SECRET=
######################################################################################################
### Cloud drive uploads (dashboard links accounts, kitchen uploads)
######################################################################################################
# Each service is enabled when its client ID and secret are set. Register this redirect URI with
# the provider: {PUBLIC_BASE_URL}/api/connections/<google|microsoft|dropbox|box>/callback
# Kitchen reads the same IDs (as GOOGLE_CLIENT_ID etc.); the container maps them for you.
PUBLIC_GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
PUBLIC_MICROSOFT_CLIENT_ID=
MICROSOFT_CLIENT_SECRET=
# Defaults to {PUBLIC_BASE_URL}/api/connections/microsoft/callback
MICROSOFT_CLIENT_REDIRECT=
PUBLIC_DROPBOX_CLIENT_ID=
DROPBOX_CLIENT_SECRET=
# Required for Dropbox: your Dropbox app's folder name (files go to Apps/<name>/)
DROPBOX_FOLDER_NAME=
PUBLIC_BOX_CLIENT_ID=
BOX_CLIENT_SECRET=
######################################################################################################
### Tasks (scheduled jobs)
######################################################################################################
TASKS_TIMEZONE=America/New_York
# Comma-separated job names to disable: cleanRecordings
TASKS_IGNORE=
# Deletes expired recordings from /data/rec
RECORDING_CLEAN_CRON="*/30 * * * *"
# Expiry for recordings whose expiry is unknown
RECORDING_FALLBACK_EXPIRATION=24h
# Comma-separated recording IDs to never delete, or true to never delete any
RECORDING_SKIP_IDS=
RECORDING_SKIP_ALL=false
######################################################################################################
### Reverse proxy (ferret, dashboard, webapp server and Ennuizel streamer)
######################################################################################################
# Behind a reverse proxy every request comes from the Docker gateway IP, so rate limits hit all
# visitors at once. Uncomment once these are ONLY reachable through the proxy: ferret and the
# dashboard then fail requests without the header, and direct requests could spoof it.
# Behind Cloudflare -> nginx you can use ADDRESS_HEADER=CF-Connecting-IP instead.
# ADDRESS_HEADER=X-Forwarded-For
# XFF_DEPTH=1