pub struct ResolvedConfig {
pub store_root: Utf8PathBuf,
pub log_dir: Utf8PathBuf,
pub log_path: Utf8PathBuf,
pub config_dir: Utf8PathBuf,
pub config_path: Utf8PathBuf,
pub contact_email: Option<String>,
pub unpaywall_email: Option<String>,
}Expand description
Snapshot of the env-var + default-fallback config that doiget would
use on the current machine.
Phase 1 surface: env vars only (DOIGET_STORE_ROOT, DOIGET_LOG_PATH,
DOIGET_CONTACT_EMAIL, DOIGET_UNPAYWALL_EMAIL) layered over
XDG / known-folder defaults. Phase 2 will layer the user config.toml
underneath the env vars per docs/CONFIG.md §1.
Issue #142: log_path is resolved from DOIGET_LOG_PATH — the ONLY
log env var docs/CONFIG.md §4 documents — using the exact same
resolution the provenance-log writer
(commands::fetch::resolve_log_path / commands::audit_log) uses, so
config show reports the path the writer actually uses. The previously
read, undocumented DOIGET_LOG_DIR has been dropped.
Fields§
§store_root: Utf8PathBufRoot of the on-disk paper store. Default: $HOME/papers.
log_dir: Utf8PathBufDirectory holding doiget’s append-only logs. Derived from
log_path’s parent so it always agrees with the writer.
log_path: Utf8PathBufJSON-Lines provenance log file path. DOIGET_LOG_PATH when set,
otherwise <config_dir>/doiget/access.jsonl (docs/CONFIG.md §4).
config_dir: Utf8PathBufDirectory holding config.toml and credentials.toml.
config_path: Utf8PathBufPath of the user config file (may not exist on disk yet).
contact_email: Option<String>Contact email for the polite User-Agent header (and Unpaywall fallback).
unpaywall_email: Option<String>Unpaywall-specific contact email; falls back to contact_email when unset.
Implementations§
Source§impl ResolvedConfig
impl ResolvedConfig
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Resolve the live config from process environment + platform defaults.
Errors only if neither a home directory nor a config directory can
be determined for the current user (e.g. an unknown / locked-down
platform); on every realistic POSIX or Windows host this returns
Ok even with no DOIGET_* env vars set.