MCPcopy Create free account
hub / github.com/Firstyear/opensuse-proxy-cache / EnvConfig

Class EnvConfig

opensuse-proxy-cache/src/main.rs:1624–1693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1622#[derive(Debug, clap::Parser)]
1623#[clap(about = "OpenSUSE Caching Mirror Tool")]
1624struct EnvConfig {
1625 #[arg(short = 's', default_value = "17179869184", env = "CACHE_SIZE")]
1626 /// Disk size for cache content in bytes. Defaults to 16GiB
1627 cache_size: usize,
1628 #[arg(short = 'p', default_value = "/tmp/osuse_cache", env = "CACHE_PATH")]
1629 /// Path where cache content should be stored
1630 cache_path: PathBuf,
1631 #[arg(short = 'c', long = "cache_large_objects", env = "CACHE_LARGE_OBJECTS")]
1632 /// Should we cache large objects like ISO/vm images/boot images?
1633 cache_large_objects: bool,
1634 #[arg(short = 'w', long = "wonder_guard", env = "WONDER_GUARD")]
1635 /// Enables a bloom filter to prevent pre-emptive caching of one-hit-wonders
1636 wonder_guard: bool,
1637 #[arg(short = 'Z', long = "durable_fs", env = "DURABLE_FS")]
1638 /// Is this running on a consistent and checksummed fs? If yes, then we can skip
1639 /// internal crc32c sums on get().
1640 durable_fs: bool,
1641 #[arg(default_value = "[::]:8080", env = "BIND_ADDRESS", long = "addr")]
1642 /// Address to listen to for http
1643 bind_addr: String,
1644
1645 #[arg(long = "boot-services", env = "BOOT_SERVICES")]
1646 /// Enable a tftp server for pxe boot services
1647 boot_services: bool,
1648
1649 #[arg(
1650 env = "BOOT_ORIGIN",
1651 default_value = "http://localhost:8080",
1652 long = "boot_origin"
1653 )]
1654 /// The external URL of this server as seen by boot service clients
1655 boot_origin: Url,
1656
1657 #[arg(env = "TLS_BIND_ADDRESS", long = "tlsaddr")]
1658 /// Address to listen to for https (optional)
1659 tls_bind_addr: Option<String>,
1660 #[arg(env = "TLS_PEM_KEY", long = "tlskey")]
1661 /// Path to the TLS Key file in PEM format.
1662 tls_pem_key: Option<String>,
1663 #[arg(env = "TLS_PEM_CHAIN", long = "tlschain")]
1664 /// Path to the TLS Chain file in PEM format.
1665 tls_pem_chain: Option<String>,
1666 #[arg(env = "MIRROR_CHAIN", long = "mirrorchain")]
1667 /// Url to another proxy-cache instance to chain through.
1668 mirror_chain: Option<String>,
1669 #[arg(env = "ACME_CHALLENGE_DIR", long = "acmechallengedir")]
1670 /// Location to store acme challenges for lets encrypt if in use.
1671 acme_challenge_dir: Option<String>,
1672
1673 #[arg(env = "OAUTH2_CLIENT_ID", long = "oauth_client_id")]
1674 /// Oauth client id
1675 oauth_client_id: Option<String>,
1676 #[arg(env = "OAUTH2_CLIENT_SECRET", long = "oauth_client_secret")]
1677 /// Oauth client secret
1678 oauth_client_secret: Option<String>,
1679 #[arg(
1680 env = "OAUTH2_CLIENT_URL",
1681 default_value = "http://localhost:8080",

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected