Main configuration file: base.toml
Key sections and fields:
server:host,port,api_prefixdatabase:url,timeout_ms,idle_timeout_ms,acquire_timeout_ms,max_connections,min_connectionsllm:temperature,prompt_max_token,endpoint,model,api_keyagent:max_history,plan_suffix,search_plan_suffix,verifier_user_promptsearch:serp_api_key- root-level fields:
name,version,log
server: HTTP entrypoint that exposes routes, APIs, and docs.worker: Task entrypoint handling feed-related background jobs (async/scheduled). Shares the same configuration loading logic asserver(seeAPP_PROFILE).- Important: In production you must run both
serverandworker. Not runningworkerwill break background processing (fetch/parse/enqueue/consume), leading to stale data or backlog.
Override precedence (from lowest to highest):
base.toml- Profile override selected by
APP_PROFILE - (Optional) Environment variables, if a provider is implemented in the
configcrate
At runtime, the environment variable APP_PROFILE decides which override file to load:
| APP_PROFILE | Override file | Notes |
|---|---|---|
dev |
base.dev.toml |
Development mode, usually more verbose |
prod |
base.prod.toml |
Production mode |
| unset | base.prod.toml |
Defaults to production override |
| other | base.prod.toml |
Treated as production if not extended |
Examples:
APP_PROFILE=dev cargo run -p server
APP_PROFILE=prod ./target/release/server
./target/release/server # APP_PROFILE unset → production override
APP_PROFILE=dev cargo run -p worker
APP_PROFILE=prod ./target/release/worker
./target/release/worker # APP_PROFILE unset → production overrideIf you need a new profile (e.g., staging), extend the selection logic in the config crate and add base.staging.toml.
Development (you can combine with tools like cargo watch):
APP_PROFILE=dev cargo run -p server
APP_PROFILE=dev cargo run -p workerProduction:
cargo build -p server --release
cargo build -p worker --release
APP_PROFILE=prod ./target/release/server
APP_PROFILE=prod ./target/release/workerIn production, run both processes separately (or containers) and manage them with systemd/supervisord/Kubernetes for supervision and restarts.
Ensure the current working directory contains:
base.tomlbase.dev.toml(if using dev)base.prod.toml
cargo build -p server --release
cargo build -p worker --releaseArtifacts:
./target/release/server./target/release/worker
Recommended deployment bundle:
- Binaries:
serverandworker base.tomlbase.prod.toml- (Optional)
base.dev.toml(if dev can be enabled in specific environments)
base.dev.toml: development overrides (currently onlynameandlog)base.prod.toml: production overrides- Selection is controlled entirely by
APP_PROFILE - Extend by adding more override files and selection logic
Controlled by the log configuration (tracing env filter syntax):
- Dev example:
debug,sqlx=off - Prod example:
info,sqlx=warn
Prefer putting changes in override files rather than editing the base config directly.
Generated and served via the utoipa stack:
- Swagger UI: possibly at
/swagger-ui - Scalar UI: possibly at
/scalar - OpenAPI JSON: possibly at
/api-doc/openapi.json
(Check the route mounting code in the server crate to confirm actual paths and update this section if they differ.)
Default development DSN:
postgresql://postgres:testpassword@127.0.0.1:5432/wisland_feed?sslmode=disable
Checklist:
- PostgreSQL is running.
- Database
wisland_feedexists:createdb wisland_feed. - Account, password, and network access are correct.
Migrations (generic example, check the migration crate for the actual implementation):
cargo run -p migrationIf there are custom subcommands (e.g., generate / up / down), document them here after reviewing the code.
# Aliyun OSS
APP_OSS.ACCESS_KEY_ID="Aliyun OSS access key id"
APP_OSS.ACCESS_KEY_SECRET="Aliyun OSS access key secret"
APP_OSS.BUCKET="Aliyun OSS bucket name" # e.g., yyzjupload-dev
APP_OSS.ENDPOINT="oss-cn-shanghai.aliyuncs.com"
APP_OSS.PREFIX="Prefix path inside the bucket" # e.g., wisland-feed
# RSS and workers
APP_RSS.WORKERS.PULL_SOURCES.CRON="* 1 * * * *"
APP_RSS.WORKERS.UPDATE_USER_INTEREST_METADATA.CONCURRENCY=1