Skip to content

Commit 7594a83

Browse files
authored
Merge pull request #39 from OpenMined/madhava/vault-path
fixing vault path
2 parents 8d78a9c + 1178abc commit 7594a83

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/syftbox/app.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::syftbox::storage::SyftBoxStorage;
1+
use crate::syftbox::storage::{SyftBoxStorage, SyftStorageConfig};
22
use anyhow::{Context, Result};
33
use serde::{Deserialize, Serialize};
44
use serde_yaml;
@@ -75,6 +75,16 @@ struct RuleSet {
7575
impl SyftBoxApp {
7676
/// Create a new SyftBox app, ensuring all necessary directories and files exist
7777
pub fn new(data_dir: &Path, email: &str, app_name: &str) -> Result<Self> {
78+
Self::with_vault_path(data_dir, email, app_name, None)
79+
}
80+
81+
/// Create a new SyftBox app with an explicit vault path override
82+
pub fn with_vault_path(
83+
data_dir: &Path,
84+
email: &str,
85+
app_name: &str,
86+
vault_path: Option<&Path>,
87+
) -> Result<Self> {
7888
let app_data_dir = data_dir
7989
.join("datasites")
8090
.join(email)
@@ -83,7 +93,13 @@ impl SyftBoxApp {
8393

8494
let rpc_dir = app_data_dir.join("rpc");
8595

86-
let storage = SyftBoxStorage::new(data_dir);
96+
let storage = SyftBoxStorage::with_config(
97+
data_dir,
98+
&SyftStorageConfig {
99+
vault_path: vault_path.map(|p| p.to_path_buf()),
100+
..Default::default()
101+
},
102+
);
87103

88104
let app = Self {
89105
app_name: app_name.to_string(),

0 commit comments

Comments
 (0)