Skip to content

Draw.io

Draw.io (diagrams.net) is a free and open-source diagramming application for creating flowcharts, wireframes, network architecture diagrams, and more.

🛠 Installation

Web UI Port: 8080 Webhook Port: 9000

Draw.io runs as a Java web application (WAR) hosted inside Tomcat 10 on Debian.

âš™ Config

Webhook Automation

Automated updates are triggered using webhook listening on port 9000.

homelab/lxc/drawio/hooks.json

[
  {
    "id": "update-app",
    "execute-command": "/root/git/nicholaswilde/homelab/lxc/drawio/update.sh",
    "command-working-directory": "/root/git/nicholaswilde/homelab/lxc/drawio",
    "pass-arguments-to-command": [
      {
        "source": "string",
        "name": "-s"
      }
    ],
    "response-message": "Updating drawio..."
  }
]

Systemd Service (drawio-webhook.service)

[Unit]
Description=Drawio Webhook Listener
After=network.target

[Service]
Type=simple
User=root
Environment=PATH=/home/root/.local/share/pnpm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin:/bin:/root/.local/bin
WorkingDirectory=/root/git/nicholaswilde/homelab/lxc/drawio
ExecStart=/usr/bin/webhook -hooks hooks.json -verbose -port 9000
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

ChangeDetection Automation

ChangeDetection monitors upstream releases via GitHub's Atom feed:

  • Watch URL: https://github.com/jgraph/drawio/releases.atom
  • Notification URL: post://192.168.1.237:9000/hooks/update-app?method=POST&header=Content-Type:application/json

When a new release tag appears, ChangeDetection issues an HTTP POST to the webhook endpoint, triggering update.sh -s to fetch the new WAR file, stop Tomcat, deploy the new release, restart Tomcat, and send a summary email via Mailrise.

Traefik

homelab/pve/traefik/conf.d/drawio.yaml
---
http:
 #region routers 
  routers:
    drawio:
      entryPoints:
        - "websecure"
      rule: "Host(`drawio.l.nicholaswilde.io`)"
      middlewares:
        - default-headers@file
        - https-redirectscheme@file
      tls: {}
      service: drawio
#endregion
#region services
  services:
    drawio:
      loadBalancer:
        servers:
          - url: "http://192.168.1.237:8080"
        passHostHeader: true
#endregion

Task List

task: Available tasks for this project:
* create-template:       Create template from existing .env file
* decrypt:               Decrypt sensitive configuration files using SOPS.
* default:               List all available tasks.
* deps:                  Install dependencies
* enable:                Enable the application's systemd service.
* encrypt:               Encrypt sensitive configuration files using SOPS.
* export:                Export the task list to `task-list.txt`.
* init:                  Initialize the application's environment and configuration files.
* mklinks:               Create symbolic links for configuration files.
* restart:               Restart the application's systemd service.
* start:                 Start the application's systemd service.
* status:                Check the status of the application's systemd service.
* stop:                  Stop the application's systemd service.
* update:                Update the application or its running containers.
* upgrade:               Upgrade the application by pulling the latest changes and updating.
* verify-secrets:        Checks if the decrypted secret matches the local file
* wh:install:            Install and start the systemd webhook service
* wh:logs:               View the webhook service logs
* wh:status:             Check the status of the systemd webhook service
* wh:test:               Test the webhook listener locally

🔗 References