From 151ad7b5aa4f9df67c6738a98c4fef5b15481586 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 3 Nov 2020 19:05:08 +0100 Subject: [PATCH] adding cookie_key field, better error message on outdated config. bump cfg version --- src/config.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index 98da773..07c9114 100644 --- a/src/config.rs +++ b/src/config.rs @@ -9,7 +9,7 @@ pub const PAYLOAD_LIMIT: usize = 10_000_000; pub const PROXY_TIMEOUT: u64 = 15; pub const CONFIG_FILE: &str = "./config.toml"; -pub const CONFIG_VERSION: u8 = 1; +pub const CONFIG_VERSION: u8 = 2; pub const ADJ_LIST_FILE: &str = "./adj-list.txt"; pub const NAME_LIST_FILE: &str = "./name-list.txt"; @@ -49,6 +49,7 @@ pub struct Config { pub admin_password: String, pub prune_days: u16, pub debug_mode: bool, + pub cookie_key: String, pub config_version: u8, } @@ -64,7 +65,7 @@ impl Config { conffile .read_to_string(&mut confstr) .expect("Couldn't read config to string"); - toml::from_str(&confstr).expect("Couldn't deserialize the config") + toml::from_str(&confstr).expect("Couldn't deserialize the config. Please update at https://git.42l.fr/neil/sncf/wiki/Upgrade-from-a-previous-version --- Error") } // if config.config_version doesn't match the hardcoded version,