Sign inSign up

declanisbritton/dashi

By declanisbritton

•Updated over 5 years ago

Config driven application dashboard

Image
0

1.0K

declanisbritton/dashi repository overview

⁠ Dashi ⁠

Dashi is a config driven, application dashboard SPA (Single Page Application) built with a Go API backend and a Flutter frontend, bundled up into a docker container for good measure.

⁠Prerequisites

In order to run this container you'll need docker installed.

⁠Building Dashi

To build Dashi, simply run:

docker build \
  --tag dashi:latest \
  -f packaging/Dockerfile \  
  .

⁠Using Dashi

To run Dashi with a config:

docker run -d \
  -p 8443:8443 \
  -v "${PWD}/config.toml":/config.toml \
  --name dashi \
  dashi:latest 

To run Dashi with a config and Icons

docker run -d \
  -p 8443:8443 \
  -v "${PWD}/images/":/app/frontend/assets/images/ \
  -v "${PWD}/config.toml":/config.toml \
  dashi:latest

⁠Config

Config for Dashi is driven by TOML⁠

Apps are configured as a toml map. If you have apps that you want to only be accessible to certain users, you can assign one or more roles under the access_roles key. If set, only users who have their role set to one of the roles listed will be able to see the app in the dashboard. If you do not set access_roles the app will be viewable to everyone including anonymous users.

[Apps]
 
    [Apps."<APP NAME>"]
    url="<APP URL>"
    tag="<TAG>"
    enable_api=false
    icon="images/<ICON PATH>.png"
    color="#ffffff"
    access_roles=["<ROLE NAME 1>", "<ROLE NAME 2>"]

Global dashboard configuration is described under the Dashboard section. Here you can control overall looks of the dashboard such as background images.

[Dashboard]
background="#D7D9CE"
background_image="images/background.png"

Users can be added to Dashi by adding one or more user entries. The password should be a bcrypt hash of the password. This can be generated through the provided Dashi UI, third party sites, or any other method of generating bcrypt hashes. Adding a role to a user will allow them to see restricted apps which have their role listed.

[[Users]]
name = "myusername"
password = "$2y$12$IeDH28Rgta36lZ.JEhI.qeqky3OTxMM806jhmm4rI91Peg91OLqhi" # mypassword bcrypt'ed
role = "myrole"

[[Users]]
name = "mysecondusername"
role = "differentrole"

There are also some global configuration options. The most important of which for authentication is jwt_key which must be set. jwt_key should be set to a random 32 character string. This can be generated on linux with openssl rand -base64 22. On windows, or for those not comfortable with the command line, we recommend using the Lastpass password generator⁠. Changing this value will log out all currently logged in users.

Below is a full example configuration file with any options not previously discussed commented.

jwt_key = "zTvGErBLHJ0lc3CbxmB7gPU8Vo1ihg=="

# control the bcrypt cost factor used by UI hash generator.
# https://wildlyinaccurate.com/bcrypt-choosing-a-work-factor/
# Defaults to 10.
password_hash_cost = 10

# Time (in minutes) each login should be valid for.
# Defaults to 60.
login_timeout = 60

# Enables debug output in the console. Mostly useful for bug reports and developers.
# Defaults to false.
enable_debug = false

[Apps]

    [Apps."My App Name"]
    url="http://127.0.0.1"
    tag="mytag"
    enable_api=false

    [Apps."My Restricted App Name"]
    url="http://127.0.0.1"
    tag="mytag"
    access_roles=["myrole"]
    enable_api=false

[[Users]]
name = "myusername"
password = "$2y$12$IeDH28Rgta36lZ.JEhI.qeqky3OTxMM806jhmm4rI91Peg91OLqhi" # mypassword bcrypt'ed
role = "myrole"

[[Users]]
name = "mysecondusername"
role = "differentrole"

⁠Adding icons

If you wish to add your own icon into the path inside the container to bind is:

/app/frontend/assets/images/

You can then use the icon option in the toml config with image/<icon file>. mounting with a sub directory would have the same effect such as:

/app/frontend/assets/images/extras

You would reference this in the config like

icon="images/extras/<ICON PATH>.png"

⁠Authors

⁠License

This project uses the following license: MIT⁠ See LICENSE.md for more information.

Tag summary

Content type

Image

Digest

Size

12.6 MB

Last updated

over 5 years ago

docker pull declanisbritton/dashi