1use {
2 serde::{Deserialize, Serialize},
3 smbcloud_model::project::Project,
4};
5
6#[derive(Deserialize, Serialize)]
8pub struct Config {
9 pub name: String,
10 pub description: Option<String>,
11 pub project: Project,
12 pub projects: Option<Vec<Project>>,
13}
14
15impl Config {
16 pub fn ssh_key_path(&self, user_id: i32) -> String {
17 let home = dirs::home_dir().expect("Could not determine home directory");
19 let key_path = home.join(".ssh").join(format!("id_{}@smbcloud", user_id));
20 let key_path_str = key_path.to_string_lossy().to_string();
21 println!("Use key path: {}", key_path_str);
22 key_path_str
23 }
24}