pub struct Config {Show 22 fields
pub archive_root: PathBuf,
pub archive_profile: ArchiveOutputProfile,
pub default_concurrency: usize,
pub default_delay_ms: u64,
pub max_depth: usize,
pub max_pages: usize,
pub max_page_size_bytes: u64,
pub max_asset_size_bytes: u64,
pub max_total_archive_size_bytes: u64,
pub include_url_patterns: Vec<String>,
pub exclude_url_patterns: Vec<String>,
pub ocr_enabled: bool,
pub ocr_backend_command: String,
pub user_agent: String,
pub timeout_secs: u64,
pub retry_count: usize,
pub ai_pack_token_budget: usize,
pub render_js: bool,
pub render_js_auto: bool,
pub browser_command: Option<String>,
pub browser_profile: Option<PathBuf>,
pub render_wait_ms: u64,
}Expand description
Siteforge runtime configuration.
Values can be loaded from YAML with Config::load or constructed
directly for library use. Relative paths resolve from the current working
directory when operations run.
Fields§
§archive_root: PathBufRoot directory where archive directories are created.
archive_profile: ArchiveOutputProfileArtifact volume/profile for newly created archives.
default_concurrency: usizeDefault concurrent page fetch count.
default_delay_ms: u64Default politeness delay between requests to the same origin, in milliseconds.
max_depth: usizeDefault maximum link depth for full-site crawls.
max_pages: usizeDefault maximum number of pages to fetch per archive.
max_page_size_bytes: u64Maximum bytes to read for a page response body. 0 means no body cap.
max_asset_size_bytes: u64Maximum bytes to read for an asset response body. 0 means no body cap.
max_total_archive_size_bytes: u64Maximum total archive bytes. 0 disables the total archive cap.
include_url_patterns: Vec<String>Optional URL glob allow-list. Empty means all in-scope URLs are eligible.
exclude_url_patterns: Vec<String>URL glob deny-list applied after scope checks.
ocr_enabled: boolEnable OCR extraction for likely code/image assets.
ocr_backend_command: StringShell command template for OCR. {input} is replaced with the asset path.
user_agent: StringUser-Agent sent by the HTTP fetcher and browser renderer.
timeout_secs: u64Per-request timeout in seconds.
retry_count: usizeNumber of retry attempts for retryable fetch failures.
ai_pack_token_budget: usizeDefault token budget for generated AI context packs.
render_js: boolRender pages with a browser before parsing when enabled.
render_js_auto: boolWith render_js, only render thin SPA-like pages instead of every page.
browser_command: Option<String>Optional browser command or executable for JavaScript rendering.
browser_profile: Option<PathBuf>Optional browser user-data directory/profile for authorized content.
render_wait_ms: u64Browser virtual-time wait budget in milliseconds.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(path: Option<&Path>) -> Result<Self>
pub fn load(path: Option<&Path>) -> Result<Self>
Load YAML configuration from path, or the platform default path when None.
Missing files return Config::default. A configured concurrency of zero
is normalized to one.
Sourcepub fn default_path() -> Result<PathBuf>
pub fn default_path() -> Result<PathBuf>
Return the platform default configuration path.
Sourcepub fn ensure_default_file() -> Result<PathBuf>
pub fn ensure_default_file() -> Result<PathBuf>
Create the platform default configuration file when missing and return its path.
Sourcepub fn resolved_archive_root(&self) -> Result<PathBuf>
pub fn resolved_archive_root(&self) -> Result<PathBuf>
Resolve Config::archive_root to an absolute path.