buckethead.config.settings¶
Env-driven configuration via pydantic-settings. All env vars use the
BUCKETHEAD_ prefix with __ as the nesting delimiter.
Call BucketHeadSettings() to load from env and .to_bucket_config() to
produce the BucketConfig that BucketSQLite accepts.
buckethead.config.settings
¶
Unified env-driven settings for BucketHead.
One pydantic-settings tree, one convention. Every env var starts with
BUCKETHEAD_ and uses __ as the nesting delimiter, so
BUCKETHEAD_ONEPASSWORD__VAULT lands in settings.onepassword.vault.
Sub-models split along the grain of the codebase:
bucket/snapshot— provider-neutral runtime config. An S3-compatible bucket name + creds + endpoint, plus the key/branch the snapshot lives under.cloudflare/onepassword— per-backend config, keyed to the names registered inprovisioning/factories.py. Adding a new cloud or secret store means one new sub-model here + one new branch in the factory; no new env-name convention to invent.
Runtime code reaches BucketConfig via to_bucket_config(), which
enforces that the fields SQLite-over-S3 actually needs are present.
BucketEnv
¶
Bases: BaseModel
S3-compatible bucket addressing + credentials.
SnapshotEnv
¶
Bases: BaseModel
Where the snapshot lives inside the bucket.
CloudflareEnv
¶
Bases: BaseModel
Cloudflare-specific knobs.
account_id is dual-purpose: provisioning uses it for API calls,
and runtime uses it to derive the S3 endpoint when
bucket.endpoint_url is unset and cloud == 'cloudflare-r2'.
OnePasswordEnv
¶
Bases: BaseModel
1Password-specific knobs used by provisioning.
BucketHeadSettings
¶
Bases: BaseSettings
to_bucket_config
¶
to_bucket_config() -> BucketConfig
Resolve runtime config into a BucketConfig.
Raises ValueError when required fields aren't set. Derives the
R2 endpoint from cloudflare.account_id when bucket.endpoint_url
is unset and cloud == 'cloudflare-r2'.