mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-10 00:27:50 +00:00
This commit is contained in:
parent
6be6f892a4
commit
100a7b65a6
3 changed files with 53 additions and 6 deletions
12
src/main.rs
12
src/main.rs
|
@ -11,7 +11,7 @@ use hyper::Uri;
|
|||
use hyper::{header::HeaderValue, Body, Request, Response};
|
||||
use log::info;
|
||||
use once_cell::sync::Lazy;
|
||||
use redlib::client::{canonical_path, proxy, CLIENT};
|
||||
use redlib::client::{canonical_path, proxy, rate_limit_check, CLIENT};
|
||||
use redlib::server::{self, RequestExt};
|
||||
use redlib::utils::{error, redirect, ThemeAssets};
|
||||
use redlib::{config, duplicates, headers, instance_info, post, search, settings, subreddit, user};
|
||||
|
@ -146,6 +146,16 @@ async fn main() {
|
|||
)
|
||||
.get_matches();
|
||||
|
||||
match rate_limit_check().await {
|
||||
Ok(()) => {
|
||||
info!("[✅] Rate limit check passed");
|
||||
},
|
||||
Err(e) => {
|
||||
log::error!("[❌] Rate limit check failed: {}", e);
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
let address = matches.get_one::<String>("address").unwrap();
|
||||
let port = matches.get_one::<String>("port").unwrap();
|
||||
let hsts = matches.get_one("hsts").map(|m: &String| m.as_str());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue