geraldwuhoo / adbir

Another Dashboard But In Rust. Mirror of https://gitlab.wuhoo.xyz/jerry/adbir.

Home Page:https://adbir.wuhoo.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adbir

Another Dashboard But In Rust

About

A dashboard inspired by Homer, both in design and configuration.

While I enjoy the configurability and relatively minimalist design of Homer, I dislike its hard dependency on JavaScript to render the page. This is a stripped down rewrite of Homer without any JavaScript.

Configuring

Runtime arguments to configure the program can be provided either with CLI arguments or environment variables.

Usage: adbir [OPTIONS]

Options:
      --out-dir <OUT_DIR>          directory to output generated resources [env: OUT_DIR=] [default: ./out]
      --config-path <CONFIG_PATH>  path to config file [env: CONFIG_PATH=] [default: ./config.yaml]
  -h, --help                       Print help
  -V, --version                    Print version

The config file is inspired by a subset of Homer configuration options.

Root

Field Description Required
title Title of the dashboard Required
subtitle Subtitle of the dashboard displayed underneath title Optional
image URL to image to display at the top of the page (e.g. logo) Optional
services List of service groups Required

.services

Field Description Required
name Name of service group Required
items List of service groups Required

.services.items

Field Description Required
name Name of service Required
subtitle Description of service Required
url URL to the service Required
logo URL to logo of the service Optional

Example

title: Dashboard
subtitle: A list of services
image: logo.webp

services:
  - name: Application group
    items:
      - name: Selfhosted app
        url: https://selfhosted.local
        logo: /icons/svg/files.svg
        subtitle: Cool selfhosted app
      - name: Another selfhosted app
        url: https://otherselfhosted.local
        logo: /icons/svg/another.svg
        subtitle: Another cool selfhosted app
  - name: Another application group
    items:
      - name: Other app
        url: https://otherapp.local
        logo: /icons/svg/other.svg
        subtitle: Another app

Running

Pre-built binary

Download the latest binary from the releases. Then, run:

$ adbir
Started with args: Args { out_dir: "./out", config_path: "./config.yaml" }
Reading from ./config.yaml
Opening output directory file
Rending and writing template to output file
$

This will generate a static index.html in the desired output directory. Upload this file to your desired webserver to serve.

Docker container

The Docker container generates the static files on startup and serves them using a bundled lightweight webserver (darkhttpd). The webserver serves files from /public in the container.

There are two flavors of the Docker container:

  1. Vanilla: adbir:<tag>. This version of the container just contains the webserver and nothing more.
  2. Dashboard Icons: adbir:<tag>-dashboard-icons. This version of the container also bundles dashboard-icons served at /icons in the webserver.

An example docker-compose.yaml.

---
version: '2'

services:
  adbir:
    image: registry.wuhoo.xyz/jerry/adbir:v0.1.2
    environment:
      OUT_DIR: /public
      CONFIG_PATH: /config.yaml
    ports:
      - "8080:8080"
    volumes:
      - ./config.yaml:/config.yaml

Then run:

$ docker-compose up -d
$

Building from source

$ cargo run --release
    Finished release [optimized] target(s) in 0.02s
     Running `target/release/adbir`
Started with args: Args { out_dir: "./out", config_path: "./config.yaml" }
Reading from ./config.yaml
Opening output directory file
Rending and writing template to output file
$

About

Another Dashboard But In Rust. Mirror of https://gitlab.wuhoo.xyz/jerry/adbir.

https://adbir.wuhoo.xyz

License:GNU Affero General Public License v3.0


Languages

Language:HTML 44.3%Language:Rust 22.5%Language:Dockerfile 20.8%Language:Nix 10.9%Language:Shell 1.4%