peach-workspace/peach-web
notplants 8b0b872d21 Reponse to CR 2022-06-15 12:36:44 +02:00
..
debian Fix conflict 2022-04-18 16:45:28 -04:00
docs First workspace commit 2021-08-06 13:58:40 -04:00
src Change sbot.rs to use configurable go-sbot service name 2022-05-26 23:17:20 +02:00
static remove ellipsis label class width 2022-03-25 08:43:32 +02:00
.gitignore update git ignore and remove outdated code 2022-03-24 09:19:39 +02:00
.travis.yml First workspace commit 2021-08-06 13:58:40 -04:00
Cargo.toml Reponse to CR 2022-06-15 12:36:44 +02:00
README.md update readme 2022-03-24 09:43:31 +02:00

README.md

peach-web

Generic badge

Web Interface for PeachCloud

peach-web provides a web interface for the PeachCloud device.

The web interface is primarily designed as a means of managing a Scuttlebutt pub. As such, it exposes the following features:

  • Create a Scuttlebutt profile
  • Follow, unfollow, block and unblock peers
  • Generate pub invite codes
  • Configure the sbot (hops, log directory, LAN discovery etc.)
  • Send private messages
  • Stop, start and restart the sbot

Additional features are focused on administration of the device itself. This includes networking functionality and device statistics.

The peach-web stack currently consists of Rouille (Rust web framework), Maud (Rust template engine), HTML and CSS. Scuttlebutt functionality is provided by golgi.

Note: This is a work-in-progress.

Setup

Clone the peach-workspace repo:

git clone https://git.coopcloud.tech/PeachCloud/peach-workspace

Move into the repo and compile:

cd peach-workspace/peach-web cargo build --release

Run the binary:

../target/release/peach-web

Environment

Configuration Mode

The web application can be run with a minimal set of routes and functionality (PeachPub - a simple sbot manager) or with the full-suite of capabilities, including network management and access to device statistics (PeachCloud). The mode is enabled by default (as defined in Rocket.toml) but can be overwritten using the STANDALONE_MODE environment variable: true or false. If the variable is unset or the value is incorrectly set, the application defaults to standalone mode.

Authentication

Authentication is enabled by default when running the application. It can be disabled by setting the DISABLE_AUTH environment variable to true:

export DISABLE_AUTH=true

Logging

Logging is made available with env_logger:

export RUST_LOG=info

Other logging levels include debug, warn and error.

Debian Packaging

A systemd service file and Debian maintainer scripts are included in the debian directory, allowing peach-web to be easily bundled as a Debian package (.deb). The cargo-deb crate can be used to achieve this.

Install cargo-deb:

cargo install cargo-deb

Move into the repo:

cd peach-web

Build the package:

cargo deb

The output will be written to target/debian/peach-web_0.3.0_arm64.deb (or similar).

Install the package as follows:

sudo dpkg -i target/debian/peach-web_0.3.0_arm64.deb

The service will be automatically enabled and started.

Uninstall the service:

sudo apt-get remove peach-web

Remove configuration files (not removed with apt-get remove):

sudo apt-get purge peach-web

Configuration

Configuration variables are stored in /var/lib/peachcloud/config.yml. Peach-web also updates this file when changes are made to configurations via the web interface. peach-web has no database, so all configurations are stored in this file.

Dynamic DNS Configuration

Most users will want to use the default PeachCloud dynamic dns server. If the config dyn_use_custom_server=false, then default values will be used. If the config dyn_use_custom_server=true, then a value must also be set for dyn_dns_server_address (e.g. "http://peachdynserver.commoninternet.net"). This value is the URL of the instance of peach-dyndns-server that requests will be sent to for domain registration. Using a custom value can here can be useful for testing.

Design

peach-web has been designed with simplicity and resource minimalism in mind. Both the dependencies used by the project, as well as the code itself, reflect these design priorities. The Rouille micro-web-framework and Maud templating engine have been used to present a web interface for interacting with the device. HTML is rendered server-side and request handlers call peach- libraries and serve HTML and assets. The optimised binary for peach-web can be compiled on a RPi 3 B+ in approximately 30 minutes.

Licensing

AGPL-3.0