Replace Rusqlite by Sqlx and Actix by Axum (A lot of changes)

This commit is contained in:
Greg Burri 2024-11-03 10:13:31 +01:00
parent 57d7e7a3ce
commit 980c5884a4
28 changed files with 2860 additions and 2262 deletions

View file

@ -5,7 +5,13 @@ 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 = 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.
// Number of alphanumeric characters for cookie authentication token.
pub const AUTHENTICATION_TOKEN_SIZE: usize = 32;
pub const SEND_EMAIL_TIMEOUT: Duration = Duration::from_secs(60);
// 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).