···109109 pub storage: StorageConfig,
110110111111 #[config(nested)]
112112+ pub tranquil_store: TranquilStoreConfig,
113113+114114+ #[config(nested)]
112115 pub cache: CacheConfig,
113116114117 #[config(nested)]
···143146144147 #[config(nested)]
145148 pub scheduled: ScheduledConfig,
146146-147147- #[config(nested)]
148148- pub tranquil_store: TranquilStoreConfig,
149149}
150150151151impl TranquilConfig {
···656656 #[config(env = "S3_BUCKET")]
657657 pub s3_bucket: Option<String>,
658658659659- /// Custom S3 endpoint URL (for MinIO, R2, etc.).
659659+ /// Custom S3 endpoint URL.
660660 #[config(env = "S3_ENDPOINT")]
661661 pub s3_endpoint: Option<String>,
662662663663+ /// Repository backend: `postgres` by default, or `tranquil-store`, our embedded db.
664664+ /// tranquil-store is EXPERIMENTAL!!!! RISK OF TOTAL DATA LOSS.
663665 #[config(env = "REPO_BACKEND", default = "postgres")]
664666 pub repo_backend: String,
665667}
···674676675677#[derive(Debug, Config)]
676678pub struct CacheConfig {
677677- /// Cache backend: `ripple` (default, built-in gossip) or `valkey`.
679679+ /// Cache backend: `ripple` by default, or `valkey`.
678680 #[config(env = "CACHE_BACKEND", default = "ripple")]
679681 pub backend: String,
680682···774776775777#[derive(Debug, Config)]
776778pub struct SignalConfig {
779779+ /// Protocol state is stored in postgres' signal_* tables.
780780+ /// Link a device via the admin API before enabling.
777781 #[config(env = "SIGNAL_ENABLED", default = false)]
778782 pub enabled: bool,
779783}
···1124112811251129 /// Maximum age of events retained in the eventlog before pruning.
11261130 /// Per the atproto firehose spec, the relay backfill window only needs
11271127- /// to cover "hours or days". Default: 7 days.
11311131+ /// to cover "hours or days".
11281132 #[config(env = "EVENT_RETENTION_MAX_AGE_SECS", default = 604800)]
11291133 pub event_retention_max_age_secs: u64,
1130113411311135 /// Interval in seconds between event retention prune passes.
11321132- /// Set to 0 to disable. Default: hourly.
11361136+ /// Set to 0 to disable.
11331137 #[config(env = "EVENT_RETENTION_INTERVAL_SECS", default = 3600)]
11341138 pub event_retention_interval_secs: u64,
11351139}
1136114011371141#[derive(Debug, Config)]
11381142pub struct TranquilStoreConfig {
11391139- /// Directory for tranquil-store data (metastore, eventlog).
11431143+ /// Directory for tranquil-store data: the metastore, eventlog, and blockstore.
11401144 #[config(
11411145 env = "TRANQUIL_STORE_DATA_DIR",
11421146 default = "/var/lib/tranquil-pds/store"
11431147 )]
11441148 pub data_dir: String,
1145114911461146- /// Fjall block cache size in megabytes. Defaults to 20% of system RAM
11471147- /// when unset.
11501150+ /// Fjall block cache size in megabytes. Defaults to 20% of system RAM when unset.
11481151 #[config(env = "TRANQUIL_STORE_MEMORY_BUDGET_MB")]
11491152 pub memory_budget_mb: Option<u64>,
11501153···11521155 #[config(env = "TRANQUIL_STORE_HANDLER_THREADS")]
11531156 pub handler_threads: Option<usize>,
1154115711551155- /// Maximum total bytes of pending (unsynced) eventlog payloads. Appenders
11561156- /// block once this budget is exhausted until in-flight events drain via
11571157- /// fsync. Set to 0 to disable backpressure (unbounded). Default: 1 GiB.
11581158+ /// Maximum total bytes of pending (unsynced) eventlog payloads. Appenders block
11591159+ /// once this budget is exhausted until in-flight events drain via fsync. Set to
11601160+ /// 0 to disable backpressure. Default: 1 GiB.
11581161 #[config(
11591162 env = "TRANQUIL_STORE_EVENTLOG_PENDING_BYTES_BUDGET",
11601163 default = 1_073_741_824
+91-11
example.toml
···2626# Can also be specified via environment variable `PDS_USER_HANDLE_DOMAINS`.
2727#user_handle_domains =
28282929-# List of domains available for user registration.
3030-# Defaults to the PDS hostname when not set.
3131-#
3232-# Can also be specified via environment variable `AVAILABLE_USER_DOMAINS`.
3333-#available_user_domains =
3434-3529# Enable PDS-hosted did:web identities. Hosting did:web requires a
3630# long-term commitment to serve DID documents; opt-in only.
3731#
···9488#
9589# Default value: 10737418240
9690#max_blob_size = 10737418240
9191+9292+[frontend]
9393+# Whether to enable the built in serving of the frontend.
9494+#
9595+# Can also be specified via environment variable `FRONTEND_ENABLED`.
9696+#
9797+# Default value: true
9898+#enabled = true
9999+100100+# Directory to serve as the frontend. The oauth_client_metadata.json will have any references to
101101+# the frontend hostname replaced by the configured frontend hostname.
102102+#
103103+# Can also be specified via environment variable `FRONTEND_DIR`.
104104+#
105105+# Default value: "/var/lib/tranquil-pds/frontend"
106106+#dir = "/var/lib/tranquil-pds/frontend"
9710798108[database]
99109# PostgreSQL connection URL.
···210220# once this budget is exhausted until in-flight events drain via fsync. Set to
211221# 0 to disable backpressure. Default: 1 GiB.
212222#
213213-# Can also be specified via environment variable
214214-# `TRANQUIL_STORE_EVENTLOG_PENDING_BYTES_BUDGET`.
223223+# Can also be specified via environment variable `TRANQUIL_STORE_EVENTLOG_PENDING_BYTES_BUDGET`.
215224#
216225# Default value: 1073741824
217226#eventlog_pending_bytes_budget = 1073741824
···219228# Maximum size of an individual eventlog payload in bytes. Single events
220229# larger than this are rejected at append time. Default: 256 MiB.
221230#
222222-# Can also be specified via environment variable
223223-# `TRANQUIL_STORE_EVENTLOG_MAX_EVENT_PAYLOAD`.
231231+# Can also be specified via environment variable `TRANQUIL_STORE_EVENTLOG_MAX_EVENT_PAYLOAD`.
224232#
225233# Default value: 268435456
226234#eventlog_max_event_payload = 268435456
235235+236236+# Maximum size of an individual blockstore data file in bytes. When the
237237+# active data file reaches this size it is rolled over and becomes
238238+# eligible for compaction. Default: 256 MiB.
239239+#
240240+# Can also be specified via environment variable `TRANQUIL_STORE_MAX_BLOCKSTORE_FILE_SIZE`.
241241+#
242242+# Default value: 268435456
243243+#max_blockstore_file_size = 268435456
244244+245245+# Maximum size of an individual eventlog segment file in bytes. When the
246246+# active segment reaches this size it is sealed and a new one is created.
247247+# Safe to change on a running instance. Default: 256 MiB.
248248+#
249249+# Can also be specified via environment variable `TRANQUIL_STORE_MAX_EVENTLOG_SEGMENT_SIZE`.
250250+#
251251+# Default value: 268435456
252252+#max_eventlog_segment_size = 268435456
227253228254[cache]
229255# Cache backend: `ripple` by default, or `valkey`.
···322348# Default value: 5000
323349#max_lag = 5000
324350351351+# Maximum concurrent full-repo exports, eg. getRepo without `since`.
352352+#
353353+# Can also be specified via environment variable `MAX_CONCURRENT_REPO_EXPORTS`.
354354+#
355355+# Default value: 4
356356+#max_concurrent_repo_exports = 4
357357+325358# List of relay / crawler notification URLs.
326359#
327360# Can also be specified via environment variable `CRAWLERS`.
···369402# Link a device via the admin API before enabling.
370403#
371404# Can also be specified via environment variable `SIGNAL_ENABLED`.
405405+#
406406+# Default value: false
372407#enabled = false
373408374409[notifications]
···528563# Default value: 3600
529564#delete_check_interval_secs = 3600
530565566566+# Interval in seconds between data file compaction scans (tranquil-store only).
567567+# Set to 0 to disable.
568568+#
569569+# Can also be specified via environment variable `COMPACTION_INTERVAL_SECS`.
570570+#
571571+# Default value: 3600
572572+#compaction_interval_secs = 3600
573573+574574+# Liveness ratio threshold below which a data file is compacted (0.0-1.0).
575575+#
576576+# Can also be specified via environment variable `COMPACTION_LIVENESS_THRESHOLD`.
577577+#
578578+# Default value: 0.7
579579+#compaction_liveness_threshold = 0.7
580580+581581+# Grace period in milliseconds before a zero-refcount block can be removed by compaction.
582582+#
583583+# Can also be specified via environment variable `COMPACTION_GRACE_PERIOD_MS`.
584584+#
585585+# Default value: 600000
586586+#compaction_grace_period_ms = 600000
587587+588588+# Interval in seconds between reachability walk runs (tranquil-store only).
589589+# Set to 0 to disable. Default: weekly.
590590+#
591591+# Can also be specified via environment variable `REACHABILITY_WALK_INTERVAL_SECS`.
592592+#
593593+# Default value: 604800
594594+#reachability_walk_interval_secs = 604800
595595+596596+# Interval in seconds between continuous archival passes (tranquil-store only).
597597+# Sealed eventlog segments are copied to the archival destination each tick.
598598+# Set to 0 to disable. Default: 60 seconds.
599599+#
600600+# Can also be specified via environment variable `ARCHIVAL_INTERVAL_SECS`.
601601+#
602602+# Default value: 60
603603+#archival_interval_secs = 60
604604+605605+# Archival destination directory for sealed eventlog segments.
606606+# If unset, archival is disabled.
607607+#
608608+# Can also be specified via environment variable `ARCHIVAL_DEST_DIR`.
609609+#archival_dest_dir =
610610+531611# Maximum age of events retained in the eventlog before pruning.
532612# Per the atproto firehose spec, the relay backfill window only needs
533613# to cover "hours or days".
534614#
535615# Can also be specified via environment variable `EVENT_RETENTION_MAX_AGE_SECS`.
536616#
537537-# Default value: 604800 (7 days)
617617+# Default value: 604800
538618#event_retention_max_age_secs = 604800
539619540620# Interval in seconds between event retention prune passes.