File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 1- use crate :: syftbox:: storage:: SyftBoxStorage ;
1+ use crate :: syftbox:: storage:: { SyftBoxStorage , SyftStorageConfig } ;
22use anyhow:: { Context , Result } ;
33use serde:: { Deserialize , Serialize } ;
44use serde_yaml;
@@ -75,6 +75,16 @@ struct RuleSet {
7575impl 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 ( ) ,
You can’t perform that action at this time.
0 commit comments