feat: add migrations, test scripts, and utility tools
- Add database migrations (006-028) for face recognition, identity, file_uuid - Add test scripts for ASR, face, search, processing - Add portal frontend (Tauri) - Add config, benchmark, and monitoring utilities - Add model checkpoints and pretrained model references
This commit is contained in:
43
portal/src-tauri/src/config.rs
Normal file
43
portal/src-tauri/src/config.rs
Normal file
@@ -0,0 +1,43 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::Mutex;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct PortalConfig {
|
||||
pub api_base_url: String,
|
||||
pub api_key: String,
|
||||
pub timeout_secs: u64,
|
||||
}
|
||||
|
||||
impl Default for PortalConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
api_base_url: "http://127.0.0.1:3003".to_string(),
|
||||
api_key: "muser_68600856036340bcafc01930eb4bd839_1774418104_97221b69".to_string(),
|
||||
timeout_secs: 30,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static CONFIG: Mutex<Option<PortalConfig>> = Mutex::new(None);
|
||||
|
||||
pub fn init_config() {
|
||||
let mut config = CONFIG.lock().unwrap();
|
||||
if config.is_none() {
|
||||
let api_url = std::env::var("MOMENTRY_API_URL")
|
||||
.unwrap_or_else(|_| "http://127.0.0.1:3003".to_string());
|
||||
let api_key = std::env::var("MOMENTRY_API_KEY").unwrap_or_else(|_| {
|
||||
"muser_68600856036340bcafc01930eb4bd839_1774418104_97221b69".to_string()
|
||||
});
|
||||
|
||||
*config = Some(PortalConfig {
|
||||
api_base_url: api_url,
|
||||
api_key,
|
||||
timeout_secs: 30,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_config() -> PortalConfig {
|
||||
let config = CONFIG.lock().unwrap();
|
||||
config.clone().unwrap_or_default()
|
||||
}
|
||||
Reference in New Issue
Block a user