Compare commits

..

2 Commits

Author SHA1 Message Date
notplants
8501296ea1 working version with yunohost 2025-05-21 18:07:38 -04:00
notplants
1439bb942f working version with binary wrapper 2025-05-21 17:28:55 -04:00
5 changed files with 31 additions and 12 deletions

View File

@ -6,17 +6,17 @@ _Better [Scuttlebutt](https://scuttlebutt.nz) cloud infrastructure as a hardware
## About
This project is a hack that combines PeachCloud with TildeFriends.
This project is a hack that combines PeachCloud with TildFriends.
The original PeachCloud project was paused when most development in the Scuttlebutt ecosystem stopped (*needs reference),
but even after most funding and development had left the ecosystem, a version of the Sbot in C called TildeFriends was finished,
and continues to be maintained, as of May 2025.
The original PeachCloud project was paused when most development in the Scuttlebutt ecosystem stopped (reference),
but even after most funding and development and left the ecosystem, a version of the Sbot in C called TildeFriends was finished,
and continues to be maintained.
This fork of the PeachCloud project makes use of the TildeFriends sbot to make a minimal and functional PeachCloud Scuttlebutt pub,
that can be easily deployed and operated by a non-technical user.
Due to the timing and conditions of the Scuttlebutt ecosystem, and the rise of new protocols,
for this particular hack, the focus was on getting the project working in a minimal form,
for this particular hack, the focus was on getting the project working in a minimal form (aka more hacky),
with less of a focus on long-term sustainability of the project as an ecosystem.
This project serves to provide a working simple-to-use pub for a P2P protocol which is in some ways frozen in amber,

View File

@ -62,6 +62,8 @@ pub fn get_peach_config_defaults() -> HashMap<String, String> {
("TILDE_SBOT_DATADIR", "/home/peach/.local/share/tildefriends/"),
("TILDE_SBOT_SERVICE", "tilde-sbot.service"),
("TILDE_BINARY_PATH", "/home/peach/tildefriends.standalone"),
("TILDE_WRAPPER_PATH", "/home/peach/run-tilde-sbot.sh"),
("TILDE_CONFIG_PATH", "/home/peach/.local/share/tildefriends/tilde-sbot.toml"),
("PEACH_CONFIGDIR", "/var/lib/peachcloud"),
("PEACH_HOMEDIR", "/home/peach"),
("PEACH_WEBDIR", "/usr/share/peach-web"),

View File

@ -270,9 +270,11 @@ pub async fn init_sbot() -> Result<TildeClient, PeachError> {
};
debug!("Initialising an sbot client with configuration parameters");
let database_path = format!("{}/db.sqlite", config_manager::get_config_value("TILDE_SBOT_DATADIR")?);
let sbot_client = TildeClient {
port: sbot_config.ssb_port,
binary_path: config_manager::get_config_value("TILDE_BINARY_PATH")?
tilde_binary_path: config_manager::get_config_value("TILDE_BINARY_PATH")?,
tilde_database_path: database_path,
};
Ok(sbot_client)
}

View File

@ -1,6 +1,17 @@
#!/bin/bash
CONFIG_FILE="/home/notplants/.local/share/tildefriends/sbot-config.toml"
# Exit on error
set -e
# Usage check
if [ "$#" -lt 2 ]; then
echo "Usage: $0 <CONFIG_FILE> <TILDEFRIENDS_PATH>"
exit 1
fi
CONFIG_FILE="$1"
TILDEFRIENDS_PATH="$2"
# Extract network_key (if it exists)
NETWORK_KEY=$(grep -v '^\s*#' "$CONFIG_FILE" | grep -E '^\s*network_key\s*=' | sed -E 's/.*=\s*"?(.*?)"?\s*/\1/')
@ -20,7 +31,7 @@ echo "ARGS: $ARGS"
[ -n "$NETWORK_KEY" ] && echo "NETWORK_KEY: $NETWORK_KEY"
[ -n "$DATABASE_DIRECTORY" ] && echo "DATABASE_DIRECTORY: $DATABASE_DIRECTORY"
CMD="/home/notplants/computer/projects/peachpub/tilde/tildefriends/out/release/tildefriends.standalone run"
CMD="\"$TILDEFRIENDS_PATH\" run"
[ -n "$ARGS" ] && CMD="$CMD -a \"$ARGS\""
[ -n "$NETWORK_KEY" ] && CMD="$CMD -k \"$NETWORK_KEY\""
[ -n "$DATABASE_DIRECTORY" ] && CMD="$CMD -d \"$DATABASE_DIRECTORY/db.sqlite\""
@ -29,4 +40,4 @@ echo "Running command:"
echo "$CMD"
# Execute the command
eval $CMD
eval $CMD

View File

@ -10,7 +10,8 @@ mod error;
pub struct TildeClient {
pub port: String,
pub binary_path: String,
pub tilde_binary_path: String,
pub tilde_database_path: String,
}
pub fn init_sbot() {
println!("++ init sbot!");
@ -19,8 +20,11 @@ pub fn init_sbot() {
impl TildeClient {
pub fn run_tilde_command(&self, args: Vec<&str>) -> Result<String, TildeError> {
let mut command = Command::new(&self.binary_path);
command.args(args);
let mut command = Command::new(&self.tilde_binary_path);
let mut full_args = args.clone();
full_args.push("-d");
full_args.push(self.tilde_database_path.as_str());
command.args(full_args);
let output = command
.output().map_err(|e| TildeError {
message: format!("Command execution failed: {}", e),