chore: update paths from momentry_core_0.1 to momentry_core
This commit is contained in:
@@ -765,7 +765,7 @@ async fn health_detailed(State(state): State<AppState>) -> Json<DetailedHealthRe
|
||||
let scripts_base = crate::core::config::SCRIPTS_DIR.clone();
|
||||
let scripts_dir = std::path::Path::new(&scripts_base);
|
||||
let scripts_path = scripts_dir.to_path_buf();
|
||||
let models_path = std::path::PathBuf::from("/Users/accusys/momentry_core_0.1/models");
|
||||
let models_path = std::path::PathBuf::from("/Users/accusys/momentry_core/models");
|
||||
|
||||
let py_files = std::fs::read_dir(&scripts_path)
|
||||
.map(|d| {
|
||||
@@ -1589,7 +1589,7 @@ async fn register_single_file(
|
||||
pre.get("probe_json").cloned().unwrap_or_default()
|
||||
} else {
|
||||
let scripts_dir = std::env::var("MOMENTRY_SCRIPTS_DIR")
|
||||
.unwrap_or_else(|_| "/Users/accusys/momentry_core_0.1/scripts".to_string());
|
||||
.unwrap_or_else(|_| "/Users/accusys/momentry_core/scripts".to_string());
|
||||
let python_path = std::env::var("MOMENTRY_PYTHON_PATH")
|
||||
.unwrap_or_else(|_| "/opt/homebrew/bin/python3.11".to_string());
|
||||
crate::core::probe::unified::unified_probe(&path, &scripts_dir, &python_path).await
|
||||
@@ -1682,7 +1682,7 @@ async fn register_single_file(
|
||||
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
||||
.unwrap_or_else(|_| "/Users/accusys/momentry/output_dev".to_string());
|
||||
let scripts_dir = std::env::var("MOMENTRY_SCRIPTS_DIR")
|
||||
.unwrap_or_else(|_| "/Users/accusys/momentry_core_0.1/scripts".to_string());
|
||||
.unwrap_or_else(|_| "/Users/accusys/momentry_core/scripts".to_string());
|
||||
let python_path = std::env::var("MOMENTRY_PYTHON_PATH")
|
||||
.unwrap_or_else(|_| "/opt/homebrew/bin/python3.11".to_string());
|
||||
|
||||
@@ -3897,7 +3897,7 @@ async fn doc_redirect() -> axum::response::Redirect {
|
||||
async fn wasm_doc_handler() -> Result<impl axum::response::IntoResponse, (StatusCode, &'static str)>
|
||||
{
|
||||
let path =
|
||||
std::path::Path::new("/Users/accusys/momentry_core_0.1/docs_v1.0/doc_wasm/index.html");
|
||||
std::path::Path::new("/Users/accusys/momentry_core/docs_v1.0/doc_wasm/index.html");
|
||||
match tokio::fs::read_to_string(path).await {
|
||||
Ok(html) => Ok(([("content-type", "text/html; charset=utf-8")], html)),
|
||||
Err(_) => Err((StatusCode::NOT_FOUND, "Doc not found")),
|
||||
@@ -3910,7 +3910,7 @@ async fn wasm_doc_file_handler(
|
||||
if file.contains("..") || file.contains("//") {
|
||||
return Err((StatusCode::NOT_FOUND, "Invalid path"));
|
||||
}
|
||||
let base = std::path::Path::new("/Users/accusys/momentry_core_0.1/docs_v1.0/doc_wasm");
|
||||
let base = std::path::Path::new("/Users/accusys/momentry_core/docs_v1.0/doc_wasm");
|
||||
let path = base.join(&file);
|
||||
if !path.exists() || !path.starts_with(base) {
|
||||
return Err((StatusCode::NOT_FOUND, "File not found"));
|
||||
@@ -3961,7 +3961,7 @@ async fn serve_doc(
|
||||
mode: Option<&str>,
|
||||
) -> Result<impl axum::response::IntoResponse, (StatusCode, &'static str)> {
|
||||
let authorized = check_doc_auth(state, headers).await;
|
||||
let project_root = std::path::Path::new("/Users/accusys/momentry_core_0.1");
|
||||
let project_root = std::path::Path::new("/Users/accusys/momentry_core");
|
||||
let base_dir = match mode {
|
||||
Some("dev") => project_root.join("docs_v1.0").join("doc_developer"),
|
||||
_ => project_root.join("docs_v1.0").join("doc"),
|
||||
@@ -3990,7 +3990,7 @@ async fn serve_doc_file(
|
||||
file: &str,
|
||||
) -> Result<impl axum::response::IntoResponse, (StatusCode, &'static str)> {
|
||||
let authorized = check_doc_auth(state, headers).await;
|
||||
let project_root = std::path::Path::new("/Users/accusys/momentry_core_0.1");
|
||||
let project_root = std::path::Path::new("/Users/accusys/momentry_core");
|
||||
let base_dir = match mode {
|
||||
Some("dev") => project_root.join("docs_v1.0").join("doc_developer"),
|
||||
_ => project_root.join("docs_v1.0").join("doc"),
|
||||
|
||||
Reference in New Issue
Block a user