|
|
@ -185,19 +185,24 @@ macro_rules! make_config { |
|
|
|
} |
|
|
|
} |
|
|
|
}}; |
|
|
|
( @build $value:expr, $config:expr, gen, $default_fn:expr ) => {{ |
|
|
|
let f: &dyn Fn(&ConfigItems) -> _ = &$default_fn; |
|
|
|
f($config) |
|
|
|
}}; |
|
|
|
} |
|
|
|
|
|
|
|
//STRUCTURE:
|
|
|
|
// /// Short description (without this they won't appear on the list)
|
|
|
|
// group {
|
|
|
|
// /// Friendly Name |> Description (Optional)
|
|
|
|
// name: type, is_editable, none_action, <default_value (Optional)>
|
|
|
|
// name: type, is_editable, action, <default_value (Optional)>
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// Where none_action applied when the value wasn't provided and can be:
|
|
|
|
// Where action applied when the value wasn't provided and can be:
|
|
|
|
// def: Use a default value
|
|
|
|
// auto: Value is auto generated based on other values
|
|
|
|
// option: Value is optional
|
|
|
|
// gen: Value is always autogenerated and it's original value ignored
|
|
|
|
make_config! { |
|
|
|
folders { |
|
|
|
/// Data folder |> Main data folder
|
|
|
@ -266,6 +271,11 @@ make_config! { |
|
|
|
|
|
|
|
/// Advanced settings
|
|
|
|
advanced { |
|
|
|
/// Client IP header |> If not present, the remote IP is used.
|
|
|
|
/// Set to the string "none" (without quotes), to disable any headers and just use the remote IP
|
|
|
|
ip_header: String, true, def, "X-Real-IP".to_string(); |
|
|
|
/// Internal IP header property, used to avoid recomputing each time
|
|
|
|
_ip_header_enabled: bool, false, gen, |c| &c.ip_header.trim().to_lowercase() != "none"; |
|
|
|
/// Positive icon cache expiry |> Number of seconds to consider that an already cached icon is fresh. After this period, the icon will be redownloaded
|
|
|
|
icon_cache_ttl: u64, true, def, 2_592_000; |
|
|
|
/// Negative icon cache expiry |> Number of seconds before trying to download an icon that failed again.
|
|
|
|