flora is a fast and secure runtime that lets you write discord bots for your servers, with a rich TypeScript SDK, without worrying about running infrastructure. [mirror]
1# Flora configuration template. To begin, copy this file to `config.toml` and fill in the values.
2
3# Logging config. This is the same as `RUST_LOG`'s format.
4#
5# Can also be specified via environment variable `RUST_LOG`.
6#
7# Default value: "flora::runtime=info,flora=info"
8# log_level = "flora::runtime=info,flora=info"
9
10# Secrets configuration.
11[secrets]
12# 32-byte key for encrypting stored secrets and deriving placeholders.
13# Example: a 64-char hex string or 32 raw ASCII bytes.
14#
15# Can also be specified via environment variable `SECRETS_MASTER_KEY`.
16#
17# Required! This value must be specified.
18# master_key =
19
20# Discord config.
21[discord]
22# Discord bot token.
23#
24# Can also be specified via environment variable `DISCORD_TOKEN`.
25#
26# Required! This value must be specified.
27# bot_token =
28
29# Discord client ID for OAuth.
30#
31# Can also be specified via environment variable `DISCORD_CLIENT_ID`.
32#
33# Required! This value must be specified.
34# client_id =
35
36# Discord client secret for OAuth.
37#
38# Can also be specified via environment variable `DISCORD_CLIENT_SECRET`.
39#
40# Required! This value must be specified.
41# client_secret =
42
43# Discord redirect URI for OAuth. Must match the one in the Discord developer portal, and has to be exposed like so: `https://<host>/auth/callback`
44#
45# Can also be specified via environment variable `DISCORD_REDIRECT_URI`.
46#
47# Default value: "http://localhost:3000/auth/callback"
48# redirect_uri = "http://localhost:3000/auth/callback"
49
50# Database (PostgreSQL) config.
51[database]
52# Database URL.
53#
54# Can also be specified via environment variable `DATABASE_URL`.
55#
56# Default value: "postgres://user:pass@localhost:5433/flora"
57# url = "postgres://user:pass@localhost:5433/flora"
58
59# Maximum number of connections to the database.
60#
61# Can also be specified via environment variable `DATABASE_MAX_CONNECTIONS`.
62#
63# Default value: 5
64# max_connections = 5
65
66# Cache (Valkey) config.
67[cache]
68# Cache URL.
69#
70# Can also be specified via environment variable `CACHE_URL`.
71#
72# Default value: "redis://127.0.0.1:5434/0"
73# url = "redis://127.0.0.1:5434/0"
74
75# Pool size.
76#
77# Can also be specified via environment variable `CACHE_POOL_SIZE`.
78#
79# Default value: 10
80# pool_size = 10
81
82# Runtime config.
83[runtime]
84# Maximum number of worker threads for guild isolates.
85# Default: 4
86# Max: 64
87#
88# Can also be specified via environment variable `RUNTIME_MAX_WORKERS`.
89#
90# Default value: 4
91# max_workers = 4
92
93# Command queue capacity per worker.
94# Default: 1024
95#
96# Can also be specified via environment variable `RUNTIME_WORKER_QUEUE_CAPACITY`.
97#
98# Default value: 1024
99# worker_queue_capacity = 1024
100
101# Timeout in seconds for runtime bootstrap (0 disables).
102#
103# Can also be specified via environment variable `RUNTIME_BOOT_TIMEOUT_SECS`.
104#
105# Default value: 5
106# boot_timeout_secs = 5
107
108# Timeout in seconds for script/module load (0 disables).
109#
110# Can also be specified via environment variable `RUNTIME_LOAD_TIMEOUT_SECS`.
111#
112# Default value: 30
113# load_timeout_secs = 30
114
115# Timeout in seconds for per-event dispatch (0 disables).
116#
117# Can also be specified via environment variable `RUNTIME_DISPATCH_TIMEOUT_SECS`.
118#
119# Default value: 3
120# dispatch_timeout_secs = 3
121
122# Timeout in milliseconds for Discord REST requests.
123# Default: 8000
124#
125# Can also be specified via environment variable `RUNTIME_REST_TIMEOUT_MS`.
126#
127# Default value: 8000
128# rest_timeout_ms = 8000
129
130# Maximum number of concurrent Discord REST requests per guild.
131# Default: 4
132#
133# Can also be specified via environment variable `RUNTIME_GUILD_CONCURRENCY`.
134#
135# Default value: 4
136# guild_concurrency = 4
137
138# Max script size in bytes (SDK + deployment). Default: 8MB.
139#
140# Can also be specified via environment variable `RUNTIME_MAX_SCRIPT_BYTES`.
141#
142# Default value: 8388608
143# max_script_bytes = 8388608
144
145# Maximum number of deployment files accepted by bundler.
146#
147# Can also be specified via environment variable `RUNTIME_MAX_BUNDLE_FILES`.
148#
149# Default value: 200
150# max_bundle_files = 200
151
152# Maximum total deployment bundle source bytes accepted by bundler.
153#
154# Can also be specified via environment variable `RUNTIME_MAX_BUNDLE_TOTAL_BYTES`.
155#
156# Default value: 1048576
157# max_bundle_total_bytes = 1048576
158
159# Maximum number of cron jobs per guild (or default runtime).
160#
161# Can also be specified via environment variable `RUNTIME_MAX_CRON_JOBS`.
162#
163# Default value: 32
164# max_cron_jobs = 32
165
166# Timeout in seconds for cron handler execution (0 disables).
167#
168# Can also be specified via environment variable `RUNTIME_CRON_TIMEOUT_SECS`.
169#
170# Default value: 5
171# cron_timeout_secs = 5
172
173# Timeout in milliseconds for migration quiesce (0 disables).
174#
175# Can also be specified via environment variable `RUNTIME_MIGRATION_TIMEOUT_MS`.
176#
177# Default value: 500
178# migration_timeout_ms = 500
179
180# Show internal runtime stack frames in user-facing error messages.
181#
182# Can also be specified via environment variable `RUNTIME_SHOW_INTERNAL_STACK_FRAMES`.
183#
184# Default value: false
185# show_internal_stack_frames = false
186
187# API server config.
188[api]
189# Port to listen on.
190#
191# Can also be specified via environment variable `API_PORT`.
192#
193# Default value: 3000
194# port = 3000
195
196# Bind address.
197#
198# Can also be specified via environment variable `API_ADDRESS`.
199#
200# Default value: "0.0.0.0"
201# address = "0.0.0.0"
202
203# Secret key for signing cookies.
204#
205# Can also be specified via environment variable `API_SECRET`.
206#
207# Required! This value must be specified.
208# secret =
209
210# Cookie TTL in seconds. Default is 30 days.
211#
212# Can also be specified via environment variable `API_COOKIE_TTL_SECS`.
213#
214# Default value: 2592000
215# cookie_ttl_secs = 2592000
216
217# Whether to use secure cookies.
218#
219# Can also be specified via environment variable `API_COOKIE_SECURE`.
220#
221# Default value: false
222# cookie_secure = false
223
224# Build service configuration.
225[build_service]
226# Base URL of the internal build service.
227#
228# Can also be specified via environment variable `BUILD_SERVICE_URL`.
229#
230# Default value: "http://localhost:3001"
231# url = "http://localhost:3001"
232
233# Shared secret for authenticating requests to the build service.
234#
235# Can also be specified via environment variable `BUILD_SERVICE_SECRET`.
236#
237# Required! This value must be specified.
238# secret =