diff --git a/peach-web/Cargo.toml b/peach-web/Cargo.toml index 94a7160..239588f 100644 --- a/peach-web/Cargo.toml +++ b/peach-web/Cargo.toml @@ -39,6 +39,7 @@ chrono = "0.4" dirs = "4.0" env_logger = "0.8" futures = "0.3" +#golgi = { git = "https://git.coopcloud.tech/golgi-ssb/golgi.git", branch = "dev" } golgi = { git = "https://git.coopcloud.tech/golgi-ssb/golgi.git" } lazy_static = "1.4" log = "0.4" diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index 1a71489..64c8bed 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -11,6 +11,7 @@ use std::{ use async_std::task; use dirs; use futures::stream::TryStreamExt; +use golgi::sbot::Keystore; use golgi::{api::friends::RelationshipQuery, blobs, messages::SsbMessageValue, Sbot}; use log::debug; use peach_lib::config_manager::get_config_value; @@ -67,13 +68,14 @@ pub async fn init_sbot_with_config( ) -> Result { debug!("Initialising an sbot client with configuration parameters"); // initialise sbot connection with ip:port and shscap from config file + let key_path = format!("{}/secret", get_config_value("GO_SBOT_DATADIR")?); let sbot_client = match sbot_config { // TODO: panics if we pass `Some(conf.shscap)` as second arg Some(conf) => { let ip_port = conf.lis.clone(); - Sbot::init(Some(ip_port), None).await? + Sbot::init(Keystore::CustomGoSbot(key_path), Some(ip_port), None).await? } - None => Sbot::init(None, None).await?, + None => Sbot::init(Keystore::CustomGoSbot(key_path), None, None).await?, }; Ok(sbot_client)