2024-11-01 Setting Up Dashy

I did some works on development tooling and website setup, such as OIDC providers, CMS, CRM, etc. It seems a path is forming – to explore the software development landscape, I need to setup necessary tools and the environment to do experiment and to deploy the (partial) works. I then search the web for common setup people general have, which requires more learning and exploration. That's good. I just come back exactly to the point I mentioned in my first post. Anyway, before moving on, I'd like to spend time on setting up "monitoring" tools for the machines and containers I have locally or on the cloud. There are so many alternatives.

Background

Enter software development. For whatever tasks and goals you are going to accomplish, it will be a recurring theme to spending time making decisions about how to approach. This is also the case for the journey I am taking right now.

I am not a very "systematic" or "disciplined" guy, constantly allured by shiny new technologies and tools – I would be rich if I get paid whenever I try something new (I guess many people do this for a living). Still, in the early stage of this journey, I'd like to set up simple rules for myself, even though I know I will ignore from time to time:

  • Do some research, pick something reasonable, and stick with it but without strong commitment – we don't know what will come several months later.
  • Don't pick something that will lock you in or influence critical business or development decisions. Think about the possible exit/migration plan, which should not be an over-haul.
  • Top characteristics to consider: open-source, free, self-hostable, actively maintained, light-weight, easy to install/configure/maintain, no major turn offs
  • Some tools with stronger license are OK if there are just for out-of-box use. Otherwise consider less restrict ones, better implemented with technologies familiar to me, so that I can hack them for potential requirements.

I will not drill too deep into well-known options in order to make the best decision(s), because at this stage where I am going is still not fully known, hence there's no clean set of targets to evaluate against. If I pick something only to find major drawbacks later (due to inefficient researching), I will admit the mistake and find alternatives.

Trying Dashy

The term "monitoring tool" is too general, but the overall objective is to have something monitoring the machines and services I am running, and a way to trouble shooting if something goes wrong. After some investigation, I gather that there are two (overlapping) categories:

  • to monitor systems ranging from high-level machine resource status down to container and process details
  • to aggregate logs from applications/services for central monitoring and analysis

As there are too many choices, I will just pick one specific aspect to get started. I'd like to have a single dashboard showing all server and container status. For this I try Dashy to see if how it goes.

Installation

Search and visit Quick Start. I want to access the interface from pubic, so I look for docker compose installation guide. First, as usual,

mkdir dashy
cd dashy
touch docker-compose.yaml

Edit the file docker-compose.yaml:

networks:
  mynet:
    name: mynet
    external: true

services:
  dashy:
    image: lissy93/dashy
    container_name: dashy
    volumes:
      - ./config.yaml:/app/user-data/conf.yml
    ports:
      - 3102:8080
    environment:
      - NODE_ENV=production
    # Specify your user ID and group ID. You can find this by running `id -u` and `id -g`
      - UID=1000
      - GID=1000
    # Specify restart policy
    restart: unless-stopped
    # Configure healthchecks
    healthcheck:
      test: ['CMD', 'node', '/app/services/healthcheck']
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s

a

To create config.yaml, visit Configuring. I have the initial version below:

pageInfo:
  title: JY Lab
sections:
  - name: Demo
    items:
      - title: GitHub
        description: Source code and documentation on GitHub
        icon: fab fa-github
        url: https://github.com/Lissy93/dashy
      - title: Issues
        description: View currently open issues, or raise a new one
        icon: fas fa-bug
        url: https://github.com/Lissy93/dashy/issues
        id: 1_389_issues
      - title: Demo
        description: A live demo
        icon: far fa-rocket
        url: https://dashy-demo-1.netlify.app
  - name: My Services
    items:
      - title: NPM
        icon: far fa-list
        url: https://...
      - title: This Blog
        icon: far fa-book
        url: https://jyrobin.com

Run the containers:

docker-compose up -d && docker-compose logs -f

Since I'm running it in LAN network, I can access it directly (e.g. http://192.168.x.x:3102). After the compiling is done, I adjust some settings and turn on status indicators (here), and the site looks like:

Remarks

After playing around for a while, I get the look and feel of what the tool does. I can explore more and see its full capabilities, including viewing dynamic content using widgets. But overall using this tool is not critical right now and it takes some time to configure manually, so I may come back to work on it more later.

By the way, I did think about deploying open-source, self-hosted services on clients' side, where I need to give them easier and more usable interfaces in a central place. Dashy can be one approach, but I found another one OliverTin, which seems more flexible yet simpler. I will explore it when needed.