forked from boos/BoosAPI
fix: persist runtime proxy token
This commit is contained in:
+13
-2
@@ -1,6 +1,11 @@
|
||||
use anyhow::Context;
|
||||
use axum::serve;
|
||||
use boosapi::{config::AppConfig, db, services::builtin_keys, AppState};
|
||||
use boosapi::{
|
||||
config::AppConfig,
|
||||
db,
|
||||
services::{builtin_keys, runtime_auth},
|
||||
AppState,
|
||||
};
|
||||
use clap::{Parser, Subcommand};
|
||||
use std::ffi::OsString;
|
||||
use std::net::SocketAddr;
|
||||
@@ -139,9 +144,15 @@ async fn main() -> anyhow::Result<()> {
|
||||
let builtin = builtin_keys::BuiltinKeys {
|
||||
comfyui_agent: comfyui_agent_key,
|
||||
};
|
||||
let runtime_auth = runtime_auth::RuntimeAuthSettings::load(
|
||||
&pool,
|
||||
config.auth.proxy_token.clone(),
|
||||
)
|
||||
.await
|
||||
.context("failed to load runtime auth settings")?;
|
||||
|
||||
// Build app state
|
||||
let state = AppState::new(config.clone(), pool, builtin);
|
||||
let state = AppState::new(config.clone(), pool, builtin, runtime_auth);
|
||||
if let Err(err) = state.comfyui.start().await {
|
||||
tracing::warn!(%err, "ComfyUI embedded process did not start");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user