fix: replace critical hardcoded paths (A-4.2 P3)
Issues: 4 remaining critical paths affecting release Fixed: - health.rs: models path -> path_utils::models_dir() - config.rs: STORAGE_ROOT -> relative fallback - storage/output_dir.rs: backup -> relative fallback - tmdb/probe.rs: scripts -> path_utils::scripts_dir() Verification: cargo check --lib passes Impact: All paths now have portable fallbacks
This commit is contained in:
+7
-1
@@ -235,7 +235,13 @@ pub static MEDIA_BASE_URL: Lazy<String> = Lazy::new(|| {
|
||||
|
||||
pub static STORAGE_ROOT: Lazy<String> = Lazy::new(|| {
|
||||
env::var("MOMENTRY_STORAGE_ROOT")
|
||||
.unwrap_or_else(|_| "/Users/accusys/momentry/var/sftpgo/data".to_string())
|
||||
.unwrap_or_else(|_| {
|
||||
std::env::current_exe()
|
||||
.ok()
|
||||
.and_then(|p| p.parent().map(|d| d.join("var/sftpgo/data")))
|
||||
.map(|p| p.to_string_lossy().to_string())
|
||||
.unwrap_or_else(|| "var/sftpgo/data".to_string())
|
||||
})
|
||||
});
|
||||
|
||||
pub static SERVE_BASE_URL: Lazy<String> = Lazy::new(|| {
|
||||
|
||||
Reference in New Issue
Block a user