pub struct Config {
pub bind: String,
pub cache_root: PathBuf,
pub upstream: String,
pub upstream_auth_header: Option<String>,
pub serve_token: Option<String>,
pub fetch_ttl_seconds: u64,
pub max_concurrent_requests: usize,
pub max_decoded_body_mb: u64,
pub cache_max_mb: u64,
pub git_binary: String,
pub log: String,
pub log_format: LogFormat,
}Fields§
§bind: StringAddress to bind the HTTP server to.
cache_root: PathBufDirectory holding the bare mirror caches.
upstream: StringUpstream git base URL, e.g. https://git.example.com. Requested repo
paths are appended to this to locate the origin.
upstream_auth_header: Option<String>Optional header injected on upstream clone/fetch for auth, e.g.
Authorization: Bearer <token>. Read from the environment so the token
never appears in argv (and it is passed to git via env, not -c, so it
stays out of the child’s argv too).
serve_token: Option<String>Optional bearer token clients must present (Authorization: Bearer ...).
Unset = serve anonymously (intended for a network-restricted deployment).
fetch_ttl_seconds: u64Skip the upstream fetch on info/refs if the mirror was refreshed within
this many seconds. Coalesces bursts of clones for the same repo. 0 =
always fetch (freshest, more upstream load).
max_concurrent_requests: usizeMaximum number of requests handled concurrently, shared across all
connections. Excess requests queue until a slot frees. This bounds the
concurrent upstream clone/fetch work a burst can trigger (the slot is held
for the handler, then released before the packfile streams, so it caps
setup rather than in-flight streaming). 0 = unlimited. Complementary to
any ingress-level rate limiting.
max_decoded_body_mb: u64Maximum size, in MiB, of a decoded git-upload-pack request body (the
client’s want/have negotiation). Bounds in-memory buffering and defuses a
gzip decompression bomb - a small compressed body can expand ~1000x. This
caps only the negotiation request, never the streamed packfile response,
so raising it is rarely needed even for very large repositories.
cache_max_mb: u64Maximum total size, in MiB, of the on-disk mirror cache. When a clone or
fetch pushes the total over this, least-recently-used idle mirrors are
evicted in the background until it is back under; an evicted mirror is
transparently re-cloned on its next request. 0 = unlimited: no eviction
and no accounting, so the cache grows without bound (the default).
git_binary: StringPath to the git binary.
log: StringLog filter directive (e.g. info, git_cache_proxy=debug,tower=warn).
Overridden by the RUST_LOG environment variable when set.
log_format: LogFormatLog output format.
Trait Implementations§
Source§impl Args for Config
impl Args for Config
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Config
impl CommandFactory for Config
Source§impl FromArgMatches for Config
impl FromArgMatches for Config
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.