Secure auth route, fix quilt deps bug, optimize queries more (#374)

* Secure auth route, fix quilt deps bug, optimize queries more

* Add to_lowercase for multiple hashes functions
This commit is contained in:
Geometrically
2022-06-17 16:56:28 -07:00
committed by GitHub
parent 355689ed19
commit 782bb11894
15 changed files with 842 additions and 592 deletions

View File

@@ -253,9 +253,7 @@ async fn main() -> std::io::Result<()> {
})
.with_interval(std::time::Duration::from_secs(60))
.with_max_requests(300)
.with_ignore_key(
dotenv::var("RATE_LIMIT_IGNORE_KEY").ok(),
),
.with_ignore_key(dotenv::var("RATE_LIMIT_IGNORE_KEY").ok()),
)
.app_data(web::Data::new(pool.clone()))
.app_data(web::Data::new(file_host.clone()))
@@ -296,6 +294,11 @@ fn check_env_vars() -> bool {
failed |= true;
}
if parse_strings_from_var("ALLOWED_CALLBACK_URLS").is_none() {
warn!("Variable `ALLOWED_CALLBACK_URLS` missing in dotenv or not a json array of strings");
failed |= true;
}
failed |= check_var::<String>("SITE_URL");
failed |= check_var::<String>("CDN_URL");
failed |= check_var::<String>("LABRINTH_ADMIN_KEY");