Просмотр исходного кода

bin/taud: clean up and change config file

ghassmo 3 лет назад
Родитель
Сommit
cd4d7ed0a9

BIN
bin/ircd/src/.buffers.rs.swp


+ 21 - 28
bin/tau/taud/src/jsonrpc.rs

@@ -1,7 +1,8 @@
-use async_std::sync::{Arc, Mutex};
+use async_std::sync::Mutex;
 use std::{fs::create_dir_all, path::PathBuf};
 
 use async_trait::async_trait;
+use crypto_box::SalsaBox;
 use fxhash::FxHashMap;
 use log::{debug, warn};
 use serde::{Deserialize, Serialize};
@@ -21,15 +22,14 @@ use crate::{
     error::{to_json_result, TaudError, TaudResult},
     month_tasks::MonthTasks,
     task_info::{Comment, TaskInfo},
-    util::Workspace,
 };
 
 pub struct JsonRpcInterface {
     dataset_path: PathBuf,
     notify_queue_sender: async_channel::Sender<TaskInfo>,
     nickname: String,
-    workspace: Arc<Mutex<String>>,
-    configured_ws: FxHashMap<String, Workspace>,
+    workspace: Mutex<String>,
+    workspaces: FxHashMap<String, SalsaBox>,
     p2p: net::P2pPtr,
 }
 
@@ -79,11 +79,11 @@ impl JsonRpcInterface {
         dataset_path: PathBuf,
         notify_queue_sender: async_channel::Sender<TaskInfo>,
         nickname: String,
-        workspace: Arc<Mutex<String>>,
-        configured_ws: FxHashMap<String, Workspace>,
+        workspaces: FxHashMap<String, SalsaBox>,
         p2p: net::P2pPtr,
     ) -> Self {
-        Self { dataset_path, nickname, workspace, configured_ws, notify_queue_sender, p2p }
+        let workspace = Mutex::new(workspaces.iter().last().unwrap().0.clone());
+        Self { dataset_path, nickname, workspace, workspaces, notify_queue_sender, p2p }
     }
 
     // RPCAPI:
@@ -122,9 +122,8 @@ impl JsonRpcInterface {
         debug!(target: "tau", "JsonRpc::add() params {:?}", params);
 
         let task: BaseTaskInfo = serde_json::from_value(params[0].clone())?;
-        let ws = self.workspace.lock().await.clone();
         let mut new_task: TaskInfo = TaskInfo::new(
-            ws,
+            self.workspace.lock().await.clone(),
             &task.title,
             &task.desc,
             &self.nickname,
@@ -146,9 +145,12 @@ impl JsonRpcInterface {
     // <-- {"jsonrpc": "2.0", "result": [task_id, ...], "id": 1}
     async fn get_ids(&self, params: &[Value]) -> TaudResult<Value> {
         debug!(target: "tau", "JsonRpc::get_ids() params {:?}", params);
+
         let ws = self.workspace.lock().await.clone();
         let tasks = MonthTasks::load_current_tasks(&self.dataset_path, ws, false)?;
+
         let task_ids: Vec<u32> = tasks.iter().map(|task| task.get_id()).collect();
+
         Ok(json!(task_ids))
     }
 
@@ -162,10 +164,12 @@ impl JsonRpcInterface {
         if params.len() != 2 {
             return Err(TaudError::InvalidData("len of params should be 2".into()))
         }
-        let ws = self.workspace.lock().await.clone();
 
+        let ws = self.workspace.lock().await.clone();
         let task = self.check_params_for_update(&params[0], &params[1], ws)?;
+
         self.notify_queue_sender.send(task).await.map_err(Error::from)?;
+
         Ok(json!(true))
     }
 
@@ -190,7 +194,6 @@ impl JsonRpcInterface {
 
         if states.contains(&state.as_str()) {
             task.set_state(&state);
-            task.set_event("state", &self.nickname, &state);
         }
 
         self.notify_queue_sender.send(task).await.map_err(Error::from)?;
@@ -210,11 +213,11 @@ impl JsonRpcInterface {
         }
 
         let comment_content: String = serde_json::from_value(params[1].clone())?;
-        let ws = self.workspace.lock().await.clone();
 
+        let ws = self.workspace.lock().await.clone();
         let mut task: TaskInfo = self.load_task_by_id(&params[0], ws)?;
+
         task.set_comment(Comment::new(&comment_content, &self.nickname));
-        task.set_event("comment", &self.nickname, &comment_content);
 
         self.notify_queue_sender.send(task).await.map_err(Error::from)?;
 
@@ -231,8 +234,8 @@ impl JsonRpcInterface {
         if params.len() != 1 {
             return Err(TaudError::InvalidData("len of params should be 1".into()))
         }
-        let ws = self.workspace.lock().await.clone();
 
+        let ws = self.workspace.lock().await.clone();
         let task: TaskInfo = self.load_task_by_id(&params[0], ws)?;
 
         Ok(json!(task))
@@ -274,7 +277,7 @@ impl JsonRpcInterface {
         let ws = params[0].as_str().unwrap().to_string();
         let mut s = self.workspace.lock().await;
 
-        if self.configured_ws.contains_key(&ws) {
+        if self.workspaces.contains_key(&ws) {
             *s = ws
         } else {
             warn!("Workspace \"{}\" is not configured", ws);
@@ -290,7 +293,6 @@ impl JsonRpcInterface {
     async fn get_ws(&self, params: &[Value]) -> TaudResult<Value> {
         debug!(target: "tau", "JsonRpc::switch_ws() params {:?}", params);
         let ws = self.workspace.lock().await.clone();
-
         Ok(json!(ws))
     }
 
@@ -309,12 +311,12 @@ impl JsonRpcInterface {
             return Err(TaudError::InvalidData("Invalid path".into()))
         }
 
-        let ws = self.workspace.lock().await.clone();
-        let path = expand_path(params[0].as_str().unwrap())?.join("exported_tasks");
         // mkdir datastore_path if not exists
+        let path = expand_path(params[0].as_str().unwrap())?.join("exported_tasks");
         create_dir_all(path.join("month")).map_err(Error::from)?;
         create_dir_all(path.join("task")).map_err(Error::from)?;
 
+        let ws = self.workspace.lock().await.clone();
         let tasks = MonthTasks::load_current_tasks(&self.dataset_path, ws, true)?;
 
         for task in tasks {
@@ -339,8 +341,8 @@ impl JsonRpcInterface {
             return Err(TaudError::InvalidData("Invalid path".into()))
         }
 
-        let ws = self.workspace.lock().await.clone();
         let path = expand_path(params[0].as_str().unwrap())?.join("exported_tasks");
+        let ws = self.workspace.lock().await.clone();
         let tasks = MonthTasks::load_current_tasks(&path, ws, true)?;
 
         for task in tasks {
@@ -376,7 +378,6 @@ impl JsonRpcInterface {
             let title: String = serde_json::from_value(title)?;
             if !title.is_empty() {
                 task.set_title(&title);
-                task.set_event("title", &self.nickname, &title);
             }
         }
 
@@ -386,7 +387,6 @@ impl JsonRpcInterface {
                 let description: Option<String> = serde_json::from_value(description.clone())?;
                 if let Some(desc) = description {
                     task.set_desc(&desc);
-                    task.set_event("desc", &self.nickname, &desc);
                 }
             }
         }
@@ -397,7 +397,6 @@ impl JsonRpcInterface {
                 let rank: Option<f32> = serde_json::from_value(rank.clone())?;
                 if let Some(rank) = rank {
                     task.set_rank(Some(rank));
-                    task.set_event("rank", &self.nickname, &rank.to_string());
                 }
             }
         }
@@ -407,9 +406,6 @@ impl JsonRpcInterface {
             let due: Option<Option<Timestamp>> = serde_json::from_value(due)?;
             if let Some(d) = due {
                 task.set_due(d);
-                if let Some(d) = d {
-                    task.set_event("due", &self.nickname, &d.0.to_string());
-                }
             }
         }
 
@@ -418,7 +414,6 @@ impl JsonRpcInterface {
             let assign: Vec<String> = serde_json::from_value(assign)?;
             if !assign.is_empty() {
                 task.set_assign(&assign);
-                task.set_event("assign", &self.nickname, &assign.join(", "));
             }
         }
 
@@ -427,7 +422,6 @@ impl JsonRpcInterface {
             let project: Vec<String> = serde_json::from_value(project)?;
             if !project.is_empty() {
                 task.set_project(&project);
-                task.set_event("project", &self.nickname, &project.join(", "));
             }
         }
 
@@ -436,7 +430,6 @@ impl JsonRpcInterface {
             let tags: Vec<String> = serde_json::from_value(tags)?;
             if !tags.is_empty() {
                 task.set_tags(&tags);
-                task.set_event("tags", &self.nickname, &tags.join(", "));
             }
         }
 

+ 92 - 62
bin/tau/taud/src/main.rs

@@ -3,6 +3,7 @@ use std::{
     env,
     fs::{create_dir_all, remove_dir_all},
     io::stdin,
+    path::Path,
 };
 
 use async_executor::Executor;
@@ -41,19 +42,37 @@ use crate::{
     jsonrpc::JsonRpcInterface,
     settings::{Args, CONFIG_FILE, CONFIG_FILE_CONTENTS},
     task_info::TaskInfo,
-    util::{parse_workspaces, Workspace},
 };
 
+fn get_workspaces(settings: &Args) -> Result<FxHashMap<String, SalsaBox>> {
+    let mut workspaces = FxHashMap::default();
+
+    for workspace in settings.workspaces.iter() {
+        let workspace: Vec<&str> = workspace.split(':').collect();
+        let (workspace, secret) = (workspace[0], workspace[1]);
+
+        let bytes: [u8; 32] = bs58::decode(secret)
+            .into_vec()?
+            .try_into()
+            .map_err(|_| Error::ParseFailed("Parse secret key failed"))?;
+
+        let secret = crypto_box::SecretKey::from(bytes);
+        let public = secret.public_key();
+        let salsa_box = crypto_box::SalsaBox::new(&public, &secret);
+        workspaces.insert(workspace.to_string(), salsa_box);
+    }
+
+    Ok(workspaces)
+}
+
 #[derive(Debug, Clone, SerialEncodable, SerialDecodable)]
 pub struct EncryptedTask {
-    workspace: String,
     nonce: Vec<u8>,
     payload: Vec<u8>,
 }
 
 fn encrypt_task(
     task: &TaskInfo,
-    workspace: &String,
     salsa_box: &SalsaBox,
     rng: &mut crypto_box::rand_core::OsRng,
 ) -> TaudResult<EncryptedTask> {
@@ -64,7 +83,7 @@ fn encrypt_task(
     let payload = salsa_box.encrypt(&nonce, payload)?;
 
     let nonce = nonce.to_vec();
-    Ok(EncryptedTask { workspace: workspace.to_string(), nonce, payload })
+    Ok(EncryptedTask { nonce, payload })
 }
 
 fn decrypt_task(encrypt_task: &EncryptedTask, salsa_box: &SalsaBox) -> TaudResult<TaskInfo> {
@@ -79,72 +98,59 @@ fn decrypt_task(encrypt_task: &EncryptedTask, salsa_box: &SalsaBox) -> TaudResul
 }
 
 async fn start_sync_loop(
-    commits_received: Arc<Mutex<Vec<String>>>,
     broadcast_rcv: async_channel::Receiver<TaskInfo>,
     raft_msgs_sender: async_channel::Sender<EncryptedTask>,
     commits_recv: async_channel::Receiver<EncryptedTask>,
     datastore_path: std::path::PathBuf,
-    configured_ws: FxHashMap<String, Workspace>,
+    workspaces: FxHashMap<String, SalsaBox>,
     mut rng: crypto_box::rand_core::OsRng,
 ) -> TaudResult<()> {
     loop {
         select! {
             task = broadcast_rcv.recv().fuse() => {
                 let tk = task.map_err(Error::from)?;
-                if configured_ws.contains_key(&tk.workspace) {
-                    let ws_info = configured_ws.get(&tk.workspace).unwrap();
-                    if let Some(salsa_box) = &ws_info.encryption {
-                        let encrypted_task = encrypt_task(&tk, &tk.workspace, salsa_box, &mut rng)?;
-                        info!(target: "tau", "Send the task: ref: {}", tk.ref_id);
-                        raft_msgs_sender.send(encrypted_task).await.map_err(Error::from)?;
-                    }
+                if workspaces.contains_key(&tk.workspace) {
+                    let salsa_box = workspaces.get(&tk.workspace).unwrap();
+                    let encrypted_task = encrypt_task(&tk, salsa_box, &mut rng)?;
+                    info!(target: "tau", "Send the task: ref: {}", tk.ref_id);
+                    raft_msgs_sender.send(encrypted_task).await.map_err(Error::from)?;
                 }
             }
             task = commits_recv.recv().fuse() => {
-                let recv = task.map_err(Error::from)?;
-                if configured_ws.contains_key(&recv.workspace) {
-                    let ws_info = configured_ws.get(&recv.workspace).unwrap();
-                    if let Some(salsa_box) = &ws_info.encryption {
-                        let task = decrypt_task(&recv, salsa_box);
-                        if let Err(e) = task {
-                            info!("unable to decrypt the task: {}", e);
-                            continue
-                        }
-
-                        let task = task.unwrap();
-                        if !commits_received.lock().await.contains(&task.ref_id) {
-                            commits_received.lock().await.push(task.ref_id.clone());
-                        }
-                        info!(target: "tau", "Save the task: ref: {}", task.ref_id);
-                        task.save(&datastore_path)?;
-                    }
-                }
+                let task = task.map_err(Error::from)?;
+                on_receive_task(&task,&datastore_path, &workspaces)
+                    .await?;
             }
         }
     }
 }
 
+async fn on_receive_task(
+    task: &EncryptedTask,
+    datastore_path: &Path,
+    workspaces: &FxHashMap<String, SalsaBox>,
+) -> TaudResult<()> {
+    for (workspace, salsa_box) in workspaces.iter() {
+        let task = decrypt_task(&task, &salsa_box);
+        if let Err(e) = task {
+            info!("unable to decrypt the task: {}", e);
+            continue
+        }
+
+        let mut task = task.unwrap();
+        info!(target: "tau", "Save the task: ref: {}", task.ref_id);
+        task.workspace = workspace.clone();
+        task.save(&datastore_path)?;
+    }
+    Ok(())
+}
+
 async_daemonize!(realmain);
 async fn realmain(settings: Args, executor: Arc<Executor<'_>>) -> Result<()> {
     let datastore_path = expand_path(&settings.datastore)?;
 
     let nickname =
-        if settings.nickname.is_some() { settings.nickname } else { env::var("USER").ok() };
-
-    if nickname.is_none() {
-        error!("Provide a nickname in config file");
-        return Ok(())
-    }
-
-    let mut rng = crypto_box::rand_core::OsRng;
-
-    if settings.key_gen {
-        info!(target: "tau", "Generating a new secret key");
-        let secret_key = SecretKey::generate(&mut rng);
-        let encoded = bs58::encode(secret_key.as_bytes());
-        println!("Secret key: {}", encoded.into_string());
-        return Ok(())
-    }
+        if settings.nickname.is_some() { settings.nickname.clone() } else { env::var("USER").ok() };
 
     if settings.refresh {
         println!("Removing local data in: {:?} (yes/no)? ", datastore_path);
@@ -164,22 +170,50 @@ async fn realmain(settings: Args, executor: Arc<Executor<'_>>) -> Result<()> {
         return Ok(())
     }
 
+    if nickname.is_none() {
+        error!("Provide a nickname in config file");
+        return Ok(())
+    }
+
     // mkdir datastore_path if not exists
     create_dir_all(datastore_path.clone())?;
     create_dir_all(datastore_path.join("month"))?;
     create_dir_all(datastore_path.join("task"))?;
 
-    // Pick up workspace settings from the TOML configuration
-    let cfg_path = get_config_path(settings.config, CONFIG_FILE)?;
-    let configured_ws = parse_workspaces(&cfg_path)?;
+    let rng = crypto_box::rand_core::OsRng;
+
+    if settings.generate {
+        println!("Generating a new workspace");
 
-    // start at the first configured workspace
-    let workspace = if let Some(key) = configured_ws.keys().next() {
-        Arc::new(Mutex::new(key.to_owned()))
-    } else {
-        error!("Please provide at least one workspace in the config file: {:?}", cfg_path);
+        loop {
+            println!("Name for the new workspace: ");
+            let mut workspace = String::new();
+            stdin().read_line(&mut workspace).ok().expect("Failed to read line");
+            let workspace = workspace.to_lowercase();
+            let workspace = workspace.trim();
+            if workspace.is_empty() && workspace.len() < 3 {
+                error!("Wrong workspace try again");
+                continue
+            }
+            let mut rng = crypto_box::rand_core::OsRng;
+            let secret_key = SecretKey::generate(&mut rng);
+            let encoded = bs58::encode(secret_key.as_bytes());
+
+            println!("workspace: {}:{}", workspace, encoded.into_string());
+            println!("Please add it to the config file.");
+            break
+        }
+
+        return Ok(())
+    }
+
+    let workspaces = get_workspaces(&settings)?;
+
+    if workspaces.is_empty() {
+        error!("Please add at least on workspace to the config file.");
+        println!("Run `$ taud --generate` to generate new workspace.");
         return Ok(())
-    };
+    }
 
     //
     // Raft
@@ -192,8 +226,6 @@ async fn realmain(settings: Args, executor: Arc<Executor<'_>>) -> Result<()> {
     let mut raft = Raft::<EncryptedTask>::new(raft_settings, seen_net_msgs.clone())?;
     let raft_id = raft.id();
 
-    let commits_received: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(vec![]));
-
     let (broadcast_snd, broadcast_rcv) = async_channel::unbounded::<TaskInfo>();
 
     //
@@ -229,8 +261,7 @@ async fn realmain(settings: Args, executor: Arc<Executor<'_>>) -> Result<()> {
         datastore_path.clone(),
         broadcast_snd,
         nickname.unwrap(),
-        workspace,
-        configured_ws.clone(),
+        workspaces.clone(),
         p2p.clone(),
     ));
     executor.spawn(listen_and_serve(settings.rpc_listen.clone(), rpc_interface)).detach();
@@ -250,12 +281,11 @@ async fn realmain(settings: Args, executor: Arc<Executor<'_>>) -> Result<()> {
 
     executor
         .spawn(start_sync_loop(
-            commits_received.clone(),
             broadcast_rcv,
             raft.sender(),
             raft.receiver(),
             datastore_path,
-            configured_ws,
+            workspaces,
             rng,
         ))
         .detach();

+ 5 - 2
bin/tau/taud/src/settings.rs

@@ -27,9 +27,12 @@ pub struct Args {
     /// Increase verbosity
     #[structopt(short, parse(from_occurrences))]
     pub verbose: u8,
-    /// Generate a new secret key
+    /// Generate a new workspace
     #[structopt(long)]
-    pub key_gen: bool,
+    pub generate: bool,
+    /// Secret Key To Encrypt/Decrypt tasks
+    #[structopt(long)]
+    pub workspaces: Vec<String>,
     ///  Clean all the local data in datastore path
     /// (BE CAREFULL) Check the datastore path in the config file before running this
     #[structopt(long)]

+ 30 - 7
bin/tau/taud/src/task_info.rs

@@ -180,11 +180,13 @@ impl TaskInfo {
     pub fn set_title(&mut self, title: &str) {
         debug!(target: "tau", "TaskInfo::set_title()");
         self.title = title.into();
+        self.set_event("title", &title);
     }
 
     pub fn set_desc(&mut self, desc: &str) {
         debug!(target: "tau", "TaskInfo::set_desc()");
         self.desc = desc.into();
+        self.set_event("desc", &desc);
     }
 
     pub fn set_tags(&mut self, tags: &[String]) {
@@ -198,37 +200,57 @@ impl TaskInfo {
                 self.tags.0.retain(|tag| tag != &t);
             }
         }
+        self.set_event("tags", &tags.join(", "));
     }
 
-    pub fn set_assign(&mut self, assign: &[String]) {
+    pub fn set_assign(&mut self, assigns: &[String]) {
         debug!(target: "tau", "TaskInfo::set_assign()");
-        self.assign = TaskAssigns(assign.to_owned());
+        self.assign = TaskAssigns(assigns.to_owned());
+        self.set_event("assign", &assigns.join(", "));
     }
 
-    pub fn set_project(&mut self, project: &[String]) {
+    pub fn set_project(&mut self, projects: &[String]) {
         debug!(target: "tau", "TaskInfo::set_project()");
-        self.project = TaskProjects(project.to_owned());
+        self.project = TaskProjects(projects.to_owned());
+        self.set_event("project", &projects.join(", "));
     }
 
     pub fn set_comment(&mut self, c: Comment) {
         debug!(target: "tau", "TaskInfo::set_comment()");
-        self.comments.0.push(c);
+        self.comments.0.push(c.clone());
+        self.set_event("comment", &c.content);
     }
 
     pub fn set_rank(&mut self, r: Option<f32>) {
         debug!(target: "tau", "TaskInfo::set_rank()");
         self.rank = r;
+        match r {
+            Some(v) => {
+                self.set_event("rank", &v.to_string());
+            }
+            None => {
+                self.set_event("rank", "None");
+            }
+        }
     }
 
     pub fn set_due(&mut self, d: Option<Timestamp>) {
         debug!(target: "tau", "TaskInfo::set_due()");
         self.due = d;
+        match d {
+            Some(v) => {
+                self.set_event("due", &v.to_string());
+            }
+            None => {
+                self.set_event("due", "None");
+            }
+        }
     }
 
-    pub fn set_event(&mut self, action: &str, owner: &str, content: &str) {
+    pub fn set_event(&mut self, action: &str, content: &str) {
         debug!(target: "tau", "TaskInfo::set_event()");
         if !content.is_empty() {
-            self.events.0.push(TaskEvent::new(action.into(), owner.into(), content.into()));
+            self.events.0.push(TaskEvent::new(action.into(), self.owner.clone(), content.into()));
         }
     }
 
@@ -238,6 +260,7 @@ impl TaskInfo {
             return
         }
         self.state = state.to_string();
+        self.set_event("state", &state);
     }
 }
 

+ 1 - 49
bin/tau/taud/src/util.rs

@@ -1,52 +1,3 @@
-use std::path::PathBuf;
-
-use fxhash::FxHashMap;
-use log::info;
-
-use darkfi::Result;
-
-#[derive(Clone)]
-pub struct Workspace {
-    pub encryption: Option<crypto_box::SalsaBox>,
-}
-
-impl Workspace {
-    pub fn new() -> Result<Self> {
-        Ok(Self { encryption: None })
-    }
-}
-
-/// Parse the configuration file for any configured workspaces and return
-/// a map containing said configurations.
-pub fn parse_workspaces(config_file: &PathBuf) -> Result<FxHashMap<String, Workspace>> {
-    let toml_contents = std::fs::read_to_string(config_file)?;
-    let mut ret = FxHashMap::default();
-
-    if let toml::Value::Table(map) = toml::from_str(&toml_contents)? {
-        if map.contains_key("workspace") && map["workspace"].is_table() {
-            for ws in map["workspace"].as_table().unwrap() {
-                info!("Found configuration for workspace {}", ws.0);
-                let mut workspace_info = Workspace::new()?;
-
-                if ws.1.as_table().unwrap().contains_key("secret") {
-                    // Build the NaCl box
-                    let s = ws.1["secret"].as_str().unwrap();
-                    let bytes: [u8; 32] = bs58::decode(s).into_vec()?.try_into().unwrap();
-                    let secret = crypto_box::SecretKey::from(bytes);
-                    let public = secret.public_key();
-                    let msg_box = crypto_box::SalsaBox::new(&public, &secret);
-                    workspace_info.encryption = Some(msg_box);
-                    info!("Instantiated NaCl box for workspace {}", ws.0);
-                }
-
-                ret.insert(ws.0.to_string(), workspace_info);
-            }
-        }
-    };
-
-    Ok(ret)
-}
-
 pub fn find_free_id(task_ids: &[u32]) -> u32 {
     for i in 1.. {
         if !task_ids.contains(&i) {
@@ -60,6 +11,7 @@ pub fn find_free_id(task_ids: &[u32]) -> u32 {
 mod tests {
     use super::*;
 
+    use darkfi::Result;
     #[test]
     fn find_free_id_test() -> Result<()> {
         let mut ids: Vec<u32> = vec![1, 3, 8, 9, 10, 3];

+ 5 - 6
bin/tau/taud_config.toml

@@ -4,9 +4,12 @@
 ## Sets Datastore Path
 #datastore="~/.tau"
 
-## Current display name    
+## Current display name
 #nickname="NICKNAME"
 
+## Workspaces
+# workspaces = ["darkfi:86MGNN31r3VxT4ULMmhQnMtV8pDnod339KwHwHCfabG2"]
+
 ## Raft net settings
 [net]
 ## P2P accept addresses
@@ -21,7 +24,7 @@ outbound_connections=5
 ## Peers to connect to
 #peers = ["tls://127.0.0.1:23331"]
 
-## Seed nodes to connect to 
+## Seed nodes to connect to
 seeds=["tls://tau0.dark.fi:23331", "tls://tau1.dark.fi:23331"]
 
 # Prefered transports for outbound connections
@@ -34,8 +37,4 @@ seeds=["tls://tau0.dark.fi:23331", "tls://tau1.dark.fi:23331"]
 #channel_handshake_seconds=4
 #channel_heartbeat_seconds=10
 
-## Per-workspace settings
-#[workspace."darkfi"]
-## Create with `taud --key-gen`
-#secret = "7CkVuFgwTUpJn5Sv67Q3fyEDpa28yrSeL5Hg2GqQ4jfM"