Our Personal Data Server from scratch! tranquil.farm
pds rust database fun oauth atproto
238
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(example.toml): lewis forgot about confique

Lewis: May this revision serve well! <lu5a@proton.me>

+107 -24
+16 -13
crates/tranquil-config/src/lib.rs
··· 109 109 pub storage: StorageConfig, 110 110 111 111 #[config(nested)] 112 + pub tranquil_store: TranquilStoreConfig, 113 + 114 + #[config(nested)] 112 115 pub cache: CacheConfig, 113 116 114 117 #[config(nested)] ··· 143 146 144 147 #[config(nested)] 145 148 pub scheduled: ScheduledConfig, 146 - 147 - #[config(nested)] 148 - pub tranquil_store: TranquilStoreConfig, 149 149 } 150 150 151 151 impl TranquilConfig { ··· 656 656 #[config(env = "S3_BUCKET")] 657 657 pub s3_bucket: Option<String>, 658 658 659 - /// Custom S3 endpoint URL (for MinIO, R2, etc.). 659 + /// Custom S3 endpoint URL. 660 660 #[config(env = "S3_ENDPOINT")] 661 661 pub s3_endpoint: Option<String>, 662 662 663 + /// Repository backend: `postgres` by default, or `tranquil-store`, our embedded db. 664 + /// tranquil-store is EXPERIMENTAL!!!! RISK OF TOTAL DATA LOSS. 663 665 #[config(env = "REPO_BACKEND", default = "postgres")] 664 666 pub repo_backend: String, 665 667 } ··· 674 676 675 677 #[derive(Debug, Config)] 676 678 pub struct CacheConfig { 677 - /// Cache backend: `ripple` (default, built-in gossip) or `valkey`. 679 + /// Cache backend: `ripple` by default, or `valkey`. 678 680 #[config(env = "CACHE_BACKEND", default = "ripple")] 679 681 pub backend: String, 680 682 ··· 774 776 775 777 #[derive(Debug, Config)] 776 778 pub struct SignalConfig { 779 + /// Protocol state is stored in postgres' signal_* tables. 780 + /// Link a device via the admin API before enabling. 777 781 #[config(env = "SIGNAL_ENABLED", default = false)] 778 782 pub enabled: bool, 779 783 } ··· 1124 1128 1125 1129 /// Maximum age of events retained in the eventlog before pruning. 1126 1130 /// Per the atproto firehose spec, the relay backfill window only needs 1127 - /// to cover "hours or days". Default: 7 days. 1131 + /// to cover "hours or days". 1128 1132 #[config(env = "EVENT_RETENTION_MAX_AGE_SECS", default = 604800)] 1129 1133 pub event_retention_max_age_secs: u64, 1130 1134 1131 1135 /// Interval in seconds between event retention prune passes. 1132 - /// Set to 0 to disable. Default: hourly. 1136 + /// Set to 0 to disable. 1133 1137 #[config(env = "EVENT_RETENTION_INTERVAL_SECS", default = 3600)] 1134 1138 pub event_retention_interval_secs: u64, 1135 1139 } 1136 1140 1137 1141 #[derive(Debug, Config)] 1138 1142 pub struct TranquilStoreConfig { 1139 - /// Directory for tranquil-store data (metastore, eventlog). 1143 + /// Directory for tranquil-store data: the metastore, eventlog, and blockstore. 1140 1144 #[config( 1141 1145 env = "TRANQUIL_STORE_DATA_DIR", 1142 1146 default = "/var/lib/tranquil-pds/store" 1143 1147 )] 1144 1148 pub data_dir: String, 1145 1149 1146 - /// Fjall block cache size in megabytes. Defaults to 20% of system RAM 1147 - /// when unset. 1150 + /// Fjall block cache size in megabytes. Defaults to 20% of system RAM when unset. 1148 1151 #[config(env = "TRANQUIL_STORE_MEMORY_BUDGET_MB")] 1149 1152 pub memory_budget_mb: Option<u64>, 1150 1153 ··· 1152 1155 #[config(env = "TRANQUIL_STORE_HANDLER_THREADS")] 1153 1156 pub handler_threads: Option<usize>, 1154 1157 1155 - /// Maximum total bytes of pending (unsynced) eventlog payloads. Appenders 1156 - /// block once this budget is exhausted until in-flight events drain via 1157 - /// fsync. Set to 0 to disable backpressure (unbounded). Default: 1 GiB. 1158 + /// Maximum total bytes of pending (unsynced) eventlog payloads. Appenders block 1159 + /// once this budget is exhausted until in-flight events drain via fsync. Set to 1160 + /// 0 to disable backpressure. Default: 1 GiB. 1158 1161 #[config( 1159 1162 env = "TRANQUIL_STORE_EVENTLOG_PENDING_BYTES_BUDGET", 1160 1163 default = 1_073_741_824
+91 -11
example.toml
··· 26 26 # Can also be specified via environment variable `PDS_USER_HANDLE_DOMAINS`. 27 27 #user_handle_domains = 28 28 29 - # List of domains available for user registration. 30 - # Defaults to the PDS hostname when not set. 31 - # 32 - # Can also be specified via environment variable `AVAILABLE_USER_DOMAINS`. 33 - #available_user_domains = 34 - 35 29 # Enable PDS-hosted did:web identities. Hosting did:web requires a 36 30 # long-term commitment to serve DID documents; opt-in only. 37 31 # ··· 94 88 # 95 89 # Default value: 10737418240 96 90 #max_blob_size = 10737418240 91 + 92 + [frontend] 93 + # Whether to enable the built in serving of the frontend. 94 + # 95 + # Can also be specified via environment variable `FRONTEND_ENABLED`. 96 + # 97 + # Default value: true 98 + #enabled = true 99 + 100 + # Directory to serve as the frontend. The oauth_client_metadata.json will have any references to 101 + # the frontend hostname replaced by the configured frontend hostname. 102 + # 103 + # Can also be specified via environment variable `FRONTEND_DIR`. 104 + # 105 + # Default value: "/var/lib/tranquil-pds/frontend" 106 + #dir = "/var/lib/tranquil-pds/frontend" 97 107 98 108 [database] 99 109 # PostgreSQL connection URL. ··· 210 220 # once this budget is exhausted until in-flight events drain via fsync. Set to 211 221 # 0 to disable backpressure. Default: 1 GiB. 212 222 # 213 - # Can also be specified via environment variable 214 - # `TRANQUIL_STORE_EVENTLOG_PENDING_BYTES_BUDGET`. 223 + # Can also be specified via environment variable `TRANQUIL_STORE_EVENTLOG_PENDING_BYTES_BUDGET`. 215 224 # 216 225 # Default value: 1073741824 217 226 #eventlog_pending_bytes_budget = 1073741824 ··· 219 228 # Maximum size of an individual eventlog payload in bytes. Single events 220 229 # larger than this are rejected at append time. Default: 256 MiB. 221 230 # 222 - # Can also be specified via environment variable 223 - # `TRANQUIL_STORE_EVENTLOG_MAX_EVENT_PAYLOAD`. 231 + # Can also be specified via environment variable `TRANQUIL_STORE_EVENTLOG_MAX_EVENT_PAYLOAD`. 224 232 # 225 233 # Default value: 268435456 226 234 #eventlog_max_event_payload = 268435456 235 + 236 + # Maximum size of an individual blockstore data file in bytes. When the 237 + # active data file reaches this size it is rolled over and becomes 238 + # eligible for compaction. Default: 256 MiB. 239 + # 240 + # Can also be specified via environment variable `TRANQUIL_STORE_MAX_BLOCKSTORE_FILE_SIZE`. 241 + # 242 + # Default value: 268435456 243 + #max_blockstore_file_size = 268435456 244 + 245 + # Maximum size of an individual eventlog segment file in bytes. When the 246 + # active segment reaches this size it is sealed and a new one is created. 247 + # Safe to change on a running instance. Default: 256 MiB. 248 + # 249 + # Can also be specified via environment variable `TRANQUIL_STORE_MAX_EVENTLOG_SEGMENT_SIZE`. 250 + # 251 + # Default value: 268435456 252 + #max_eventlog_segment_size = 268435456 227 253 228 254 [cache] 229 255 # Cache backend: `ripple` by default, or `valkey`. ··· 322 348 # Default value: 5000 323 349 #max_lag = 5000 324 350 351 + # Maximum concurrent full-repo exports, eg. getRepo without `since`. 352 + # 353 + # Can also be specified via environment variable `MAX_CONCURRENT_REPO_EXPORTS`. 354 + # 355 + # Default value: 4 356 + #max_concurrent_repo_exports = 4 357 + 325 358 # List of relay / crawler notification URLs. 326 359 # 327 360 # Can also be specified via environment variable `CRAWLERS`. ··· 369 402 # Link a device via the admin API before enabling. 370 403 # 371 404 # Can also be specified via environment variable `SIGNAL_ENABLED`. 405 + # 406 + # Default value: false 372 407 #enabled = false 373 408 374 409 [notifications] ··· 528 563 # Default value: 3600 529 564 #delete_check_interval_secs = 3600 530 565 566 + # Interval in seconds between data file compaction scans (tranquil-store only). 567 + # Set to 0 to disable. 568 + # 569 + # Can also be specified via environment variable `COMPACTION_INTERVAL_SECS`. 570 + # 571 + # Default value: 3600 572 + #compaction_interval_secs = 3600 573 + 574 + # Liveness ratio threshold below which a data file is compacted (0.0-1.0). 575 + # 576 + # Can also be specified via environment variable `COMPACTION_LIVENESS_THRESHOLD`. 577 + # 578 + # Default value: 0.7 579 + #compaction_liveness_threshold = 0.7 580 + 581 + # Grace period in milliseconds before a zero-refcount block can be removed by compaction. 582 + # 583 + # Can also be specified via environment variable `COMPACTION_GRACE_PERIOD_MS`. 584 + # 585 + # Default value: 600000 586 + #compaction_grace_period_ms = 600000 587 + 588 + # Interval in seconds between reachability walk runs (tranquil-store only). 589 + # Set to 0 to disable. Default: weekly. 590 + # 591 + # Can also be specified via environment variable `REACHABILITY_WALK_INTERVAL_SECS`. 592 + # 593 + # Default value: 604800 594 + #reachability_walk_interval_secs = 604800 595 + 596 + # Interval in seconds between continuous archival passes (tranquil-store only). 597 + # Sealed eventlog segments are copied to the archival destination each tick. 598 + # Set to 0 to disable. Default: 60 seconds. 599 + # 600 + # Can also be specified via environment variable `ARCHIVAL_INTERVAL_SECS`. 601 + # 602 + # Default value: 60 603 + #archival_interval_secs = 60 604 + 605 + # Archival destination directory for sealed eventlog segments. 606 + # If unset, archival is disabled. 607 + # 608 + # Can also be specified via environment variable `ARCHIVAL_DEST_DIR`. 609 + #archival_dest_dir = 610 + 531 611 # Maximum age of events retained in the eventlog before pruning. 532 612 # Per the atproto firehose spec, the relay backfill window only needs 533 613 # to cover "hours or days". 534 614 # 535 615 # Can also be specified via environment variable `EVENT_RETENTION_MAX_AGE_SECS`. 536 616 # 537 - # Default value: 604800 (7 days) 617 + # Default value: 604800 538 618 #event_retention_max_age_secs = 604800 539 619 540 620 # Interval in seconds between event retention prune passes.