Added configurable firmware path
All checks were successful
Build Project / test (push) Successful in 6m6s
All checks were successful
Build Project / test (push) Successful in 6m6s
This commit is contained in:
@@ -27,7 +27,11 @@ async fn main() -> std::io::Result<()> {
|
||||
}
|
||||
};
|
||||
let external_url = env::var("URL").unwrap_or("localhost".to_string());
|
||||
info!("Connecting to Database {}", db_url);
|
||||
let firmware_path = env::var("FIRMWARE_PATH").unwrap_or("/firmware".to_string());
|
||||
|
||||
info!("External URL: {external_url}");
|
||||
info!("Firmware path set to: {firmware_path}");
|
||||
info!("Connecting to Database {db_url}");
|
||||
|
||||
let db = Database::init(&db_url).await;
|
||||
db.init_db().await;
|
||||
@@ -36,7 +40,7 @@ async fn main() -> std::io::Result<()> {
|
||||
App::new()
|
||||
.app_data(web::Data::new(AppState {
|
||||
db: db.clone(),
|
||||
firmwares_path: PathBuf::from("./fw"),
|
||||
firmwares_path: PathBuf::from(firmware_path.clone()),
|
||||
hostname: external_url.clone(),
|
||||
}))
|
||||
.app_data(web::PayloadConfig::new(256 * 1024 * 1024)) //256MB
|
||||
|
||||
Reference in New Issue
Block a user