use std::time::Duration; pub const FILE_CONF: &str = "conf.ron"; pub const TRANSLATION_FILE: &str = "translation.ron"; pub const DB_DIRECTORY: &str = "data"; pub const DB_FILENAME: &str = "recipes.sqlite"; pub const SQL_FILENAME: &str = "sql/version_{VERSION}.sql"; pub const VALIDATION_TOKEN_DURATION: i64 = 60 * 60; // [s]. (1 jour). pub const COOKIE_AUTH_TOKEN_NAME: &str = "auth_token"; pub const COOKIE_LANG_NAME: &str = "lang"; pub const VALIDATION_PASSWORD_RESET_TOKEN_DURATION: i64 = 60 * 60; // [s]. (1 jour). // Number of alphanumeric characters for tokens // (cookie authentication, password reset, validation token). pub const TOKEN_SIZE: usize = 32; pub const SEND_EMAIL_TIMEOUT: Duration = Duration::from_secs(60); pub const NUMBER_OF_CONCURRENT_HTTP_REQUEST_FOR_RATE_LIMIT: u64 = 20; pub const DURATION_FOR_RATE_LIMIT: Duration = Duration::from_secs(5); // HTTP headers, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers. // Common headers can be found in 'axum::http::header' (which is a re-export of the create 'http'). pub const REVERSE_PROXY_IP_HTTP_FIELD: &str = "x-real-ip"; // Set by the reverse proxy (Nginx). pub const MAX_DB_CONNECTION: u32 = 1; // To avoid database lock.