X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=backend%2Fsrc%2Fconsts.rs;h=754b96470291f33991a02898def74e351589e49d;hb=d28e765e39e70ad2ab9a42885c786d5d8ba9ba40;hp=d84c21d0677bec86fcdba3b7e7eafa179fac9091;hpb=108476e3554ea3a25dca5b5ab260f38c1e734221;p=recipes.git diff --git a/backend/src/consts.rs b/backend/src/consts.rs index d84c21d..754b964 100644 --- a/backend/src/consts.rs +++ b/backend/src/consts.rs @@ -1,4 +1,12 @@ + +use std::time::Duration; + pub const FILE_CONF: &str = "conf.ron"; pub const DB_DIRECTORY: &str = "data"; -pub const DB_FILENAME: &str = "data/recipes.sqlite"; -pub const SQL_FILENAME: &str = "sql/version_{VERSION}.sql"; \ No newline at end of file +pub const DB_FILENAME: &str = "recipes.sqlite"; +pub const SQL_FILENAME: &str = "sql/version_{VERSION}.sql"; +pub const VALIDATION_TOKEN_DURATION: i64 = 1 * 60 * 60; // 1 hour. [s]. +pub const REVERSE_PROXY_IP_HTTP_FIELD: &str = "x-real-ip"; +pub const COOKIE_AUTH_TOKEN_NAME: &str = "auth_token"; +pub const AUTHENTICATION_TOKEN_SIZE: usize = 32; // Number of alphanumeric characters for cookie authentication token. +pub const SEND_EMAIL_TIMEOUT: Duration = Duration::from_secs(60);