Add IP location service
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
11
src/main.rs
11
src/main.rs
@ -9,7 +9,6 @@ use actix_session::SessionMiddleware;
|
||||
use actix_web::cookie::{Key, SameSite};
|
||||
use actix_web::middleware::Logger;
|
||||
use actix_web::{get, middleware, web, App, HttpResponse, HttpServer};
|
||||
use clap::Parser;
|
||||
|
||||
use basic_oidc::actors::bruteforce_actor::BruteForceActor;
|
||||
use basic_oidc::actors::openid_sessions_actor::OpenIDSessionsActor;
|
||||
@ -34,12 +33,7 @@ async fn health() -> &'static str {
|
||||
async fn main() -> std::io::Result<()> {
|
||||
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
|
||||
|
||||
let mut config: AppConfig = AppConfig::parse();
|
||||
|
||||
// In debug mode only, use dummy token
|
||||
if cfg!(debug_assertions) && config.token_key.is_empty() {
|
||||
config.token_key = String::from_utf8_lossy(&[32; 64]).to_string();
|
||||
}
|
||||
let config = AppConfig::get();
|
||||
|
||||
if !config.storage_path().exists() {
|
||||
log::error!(
|
||||
@ -73,7 +67,7 @@ async fn main() -> std::io::Result<()> {
|
||||
let bruteforce_actor = BruteForceActor::default().start();
|
||||
let openid_sessions_actor = OpenIDSessionsActor::default().start();
|
||||
let jwt_signer = JWTSigner::gen_from_memory().expect("Failed to generate JWKS key");
|
||||
let webauthn_manager = Arc::new(WebAuthManager::init(&config));
|
||||
let webauthn_manager = Arc::new(WebAuthManager::init(config));
|
||||
|
||||
log::info!("Server will listen on {}", config.listen_address);
|
||||
let listen_address = config.listen_address.to_string();
|
||||
@ -102,7 +96,6 @@ async fn main() -> std::io::Result<()> {
|
||||
.app_data(web::Data::new(users_actor.clone()))
|
||||
.app_data(web::Data::new(bruteforce_actor.clone()))
|
||||
.app_data(web::Data::new(openid_sessions_actor.clone()))
|
||||
.app_data(web::Data::new(config.clone()))
|
||||
.app_data(web::Data::new(clients))
|
||||
.app_data(web::Data::new(jwt_signer.clone()))
|
||||
.app_data(web::Data::new(webauthn_manager.clone()))
|
||||
|
Reference in New Issue
Block a user