From 3493e5adb9d0505478ec77d9b8de591745c6dbef Mon Sep 17 00:00:00 2001 From: notplants Date: Thu, 26 May 2022 23:17:20 +0200 Subject: [PATCH 1/2] Change sbot.rs to use configurable go-sbot service name --- peach-web/src/utils/sbot.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index 8a8b34c..c0953e6 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -3,7 +3,6 @@ use std::{ error::Error, fs, fs::File, - io, io::prelude::*, path::Path, process::{Command, Output}, @@ -23,12 +22,13 @@ use crate::{error::PeachWebError, utils::sbot}; // SBOT HELPER FUNCTIONS /// Executes a systemctl command for the go-sbot.service process. -pub fn systemctl_sbot_cmd(cmd: &str) -> io::Result { - Command::new("sudo") +pub fn systemctl_sbot_cmd(cmd: &str) -> Result { + let output = Command::new("sudo") .arg("systemctl") .arg(cmd) - .arg("go-sbot.service") - .output() + .arg(get_config_value("GO_SBOT_SERVICE")?) + .output()?; + Ok(output) } /// Executes a systemctl stop command followed by start command. From 16e6d42f87539f96692729ea915371ab9f501877 Mon Sep 17 00:00:00 2001 From: notplants Date: Thu, 26 May 2022 23:19:31 +0200 Subject: [PATCH 2/2] Cargo clippy --- Cargo.lock | 2 +- peach-web/src/utils/sbot.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index b7aa8f0..4963ead 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1111,7 +1111,7 @@ dependencies = [ [[package]] name = "golgi" version = "0.1.1" -source = "git+https://git.coopcloud.tech/golgi-ssb/golgi#77dd75bcd4649b7487069a61e2a8069b49f60a1d" +source = "git+https://git.coopcloud.tech/golgi-ssb/golgi.git#77dd75bcd4649b7487069a61e2a8069b49f60a1d" dependencies = [ "async-std", "async-stream 0.3.3", diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index c0953e6..1a71489 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -13,6 +13,7 @@ use dirs; use futures::stream::TryStreamExt; use golgi::{api::friends::RelationshipQuery, blobs, messages::SsbMessageValue, Sbot}; use log::debug; +use peach_lib::config_manager::get_config_value; use peach_lib::sbot::SbotConfig; use rouille::input::post::BufferedFile; use temporary::Directory;