Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/toastxc/kuma-rs

A simple and easy library for interacting with Uptime Kuma
https://github.com/toastxc/kuma-rs

high-availability rust rust-lang uptime uptime-kuma uptime-monitor

Last synced: 18 days ago
JSON representation

A simple and easy library for interacting with Uptime Kuma

Awesome Lists containing this project

README

        

## A library for UptimeKuma, at last
If you use both Rust and Kuma you may have noticed that there practically are no libraries for it, until now

## Purpose
I made this program as part of a project integrate LEDs with Kuma

## Usage
There is no binary of CLI yet but you can use the library, all you need is a few dependencies, a Kuma instance and an .env file
### dotenv
```dotenv
# the key will look something like this
# do NOT include a ':' at the start, it is not needed
# don't share your key with anyone
KEY="EXAMPLEKEY"
# the URI should NOT include HTTP/HTTPS
# HTTP support is not currently included
URI="kuma.instance/metrics"
```
### main.rs
```rust
#[tokio::main]
async fn main() {
let _ = dotenv();
let data = Kuma::new(env::var("URI").unwrap(), env::var("KEY").unwrap())
.get()
.await
.unwrap();
}
```

## GUI


Demo image 1
Demo image 2

### Installing
```bash
git clone https://github.com/toastxc/kuma-rs.git
cd kuma-rs/
rustup update
cargo b -r --example gui
cp ./target/release/examples/gui ./target/release/
sudo flatpak-builder --install --force-clean build-dir xyz.toastxc.Kuma.yaml
```
### Running
```bash
cargo r --example gui
```

## Library
### Installing
```bash
cargo add kuma-rs
```