|
|
@ -317,6 +317,12 @@ make_config! {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn validate_config(cfg: &ConfigItems) -> Result<(), Error> {
|
|
|
|
fn validate_config(cfg: &ConfigItems) -> Result<(), Error> {
|
|
|
|
|
|
|
|
if let Some(ref token) = cfg.admin_token {
|
|
|
|
|
|
|
|
if token.trim().is_empty() {
|
|
|
|
|
|
|
|
err!("`ADMIN_TOKEN` is enabled but has an empty value. To enable the admin page without token, use `DISABLE_ADMIN_TOKEN`")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if cfg.yubico_client_id.is_some() != cfg.yubico_secret_key.is_some() {
|
|
|
|
if cfg.yubico_client_id.is_some() != cfg.yubico_secret_key.is_some() {
|
|
|
|
err!("Both `YUBICO_CLIENT_ID` and `YUBICO_SECRET_KEY` need to be set for Yubikey OTP support")
|
|
|
|
err!("Both `YUBICO_CLIENT_ID` and `YUBICO_SECRET_KEY` need to be set for Yubikey OTP support")
|
|
|
|
}
|
|
|
|
}
|
|
|
|