Struct cargo_registry::config::Config [] [src]

pub struct Config {
    pub uploader: Uploader,
    pub session_key: String,
    pub git_repo_checkout: PathBuf,
    pub gh_client_id: String,
    pub gh_client_secret: String,
    pub db_url: String,
    pub env: Env,
    pub max_upload_size: u64,
    pub mirror: Replica,
    pub api_protocol: String,
}

Fields

Trait Implementations

impl Clone for Config
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Config
[src]

[src]

Formats the value using the given formatter.

impl Default for Config
[src]

[src]

Returns a default value for the application's config

Sets the following default values: - Config::max_upload_size: 10MiB - Config::api_protocol: https

Pulls values from the following environment variables: - GIT_REPO_CHECKOUT: The directory where the registry index was cloned. - MIRROR: Is this instance of cargo_registry a mirror of crates.io. - HEROKU: Is this instance of cargo_registry currently running on Heroku. - S3_BUCKET: The S3 bucket used to store crate files. If not present during development, cargo_registry will fall back to a local uploader. - S3_REGION: The region in which the bucket was created. Optional if US standard. - S3_ACCESS_KEY: The access key to interact with S3. Optional if running a mirror. - S3_SECRET_KEY: The secret key to interact with S3. Optional if running a mirror. - SESSION_KEY: The key used to sign and encrypt session cookies. - GH_CLIENT_ID: The client ID of the associated GitHub application. - GH_CLIENT_SECRET: The client secret of the associated GitHub application. - DATABASE_URL: The URL of the postgres database to use.