HUB
Sign inSign up
labtown logo

techbygiusi/labtown

By techbygiusi

•Updated about 11 hours ago

Homelab dashboard in a minimalist city-builder style – Proxmox, Beszel, Uptime Kuma, UniFi

Image
0

4.2K

techbygiusi/labtown repository overview

⁠LabTown

Your homelab as a small, living city – a self-hosted browser start page in a minimalist city-builder style. Proxmox clusters are factories, services are houses, switches are roundabouts, your reverse proxy is the city gate, and network traffic drives through the streets as cars. All graphics are original, flat SVG/canvas shapes.

⁠Features

  • City map generated from your objects and network topology: WAN highway → city gate → gateway roundabout → switch roundabouts → districts. Deterministic per installation (seed, "re-roll" for a new landscape), grows with new objects, optional classic grid.
  • Organic landscape: soft cluster zones hugging their buildings, a meandering river with sandy banks and boats, optional lakes, gentle hills and meadows, natural tree groups. Clusters can be dragged across the river – the zone splits, buildings move to the banks and bridges appear.
  • 2.5D buildings with roof types (hall roofs for hosts, gable/hip roofs, flat roofs with AC units and solar), stable per-building variants, lit windows at night and shadows that follow the sun.
  • Smooth layout editor: buildings lift when grabbed, follow with inertia and land with a spring; live preview of roads and zones computed in a Web Worker; invalid spots turn red and spring back.
  • Display settings: detail level (low/medium/high), landscape on/off, ambient life (swaying trees, water, boats, birds, cloud shadows, fireflies), nature density.
  • Factories = Proxmox clusters, hosts as buildings with chimney smoke by CPU load; offline hosts collapse, and are rebuilt when they come back.
  • Switches as roundabouts (small / medium / large, cascaded, LACP uplinks as multi-lane roads). With UniFi: per-port traffic and link speed, port down = road works, PoE = lightning bolt, switch offline = barricades and a traffic jam, graphical port overview – gateways/routers get the same port overview.
  • Pangolin as the city gate: one lane per site with a barrier (closed when offline), resources mapped to service houses with a domain flag and a lock for protected resources.
  • Traffic: cars ∝ throughput, speed ∝ utilization, latency = traffic jam; dashed centre lines run in the direction of traffic and turn yellow/red by link utilization.
  • Day & night from the real sun position (lamps, windows, reflections on the water), optional weather overlay.
  • Detail panels for every building, roundabout, gate and road with live values and 1 h / 24 h / 7 d history – including a detailed Ceph section for Proxmox clusters.
  • Search with bookmarks: web search in a new tab, internal bookmarks as suggestions (Tab to accept), managed in the admin area and filled automatically from your objects' link URLs.
  • Integrations: Proxmox VE (multiple clusters), Proxmox Backup Server, Uptime Kuma, Beszel, UniFi, Pangolin – all queried by the backend, credentials stored AES-256-GCM encrypted, never sent to the browser.
  • Backups of the configuration to a local folder and/or an SMB share – without mounts, privileged mode or extra capabilities; optional AES-256 encryption, retention, schedule, one-click restore.
  • Admin area with a sidebar that uses the whole screen: master-detail editing on wide screens, a sticky save bar, day/night styling that follows the map, and a burger menu on small screens.
  • Branding: own name, logo and favicon (including a status favicon).
  • English UI. Starts empty; an optional demo city with simulated live data is one click away.

⁠Quick start

docker run -d --name labtown --restart unless-stopped \
  -p 8080:8080 -v labtown-data:/data -e TZ=Europe/Berlin \
  techbygiusi/labtown:latest

Open http://<host>:8080/admin from your local network and add your integrations, or click Objects → Create demo city to try it out with simulated data (a fresh instance starts empty, demo mode off). There is no login by default – the admin area is restricted to private networks (see below).

⁠docker-compose.yml
services:
  labtown:
    image: techbygiusi/labtown:latest
    container_name: labtown
    restart: unless-stopped   # also needed for one-click restore of backups
    ports:
      - "8080:8080"
    volumes:
      - labtown-data:/data
    environment:
      TZ: "Europe/Berlin"
      # AUTH_MODE: "oidc"                         # optional login via Pocket ID
      # ADMIN_ALLOWED_NETS: "192.168.1.0/24"      # who may use /admin
      # ADMIN_URL: "https://labtown.example.com"  # unlock /admin via your reverse proxy
      # BASE_URL: "https://home.example.com"
      # TRUST_PROXY: "loopback, linklocal, uniquelocal"
      # LABTOWN_SECRET_KEY: "<long random string>"
volumes:
  labtown-data:

⁠Configuration

Everything (integrations, objects, display, login, backups) is configured in the web UI. Environment variables are optional:

VariableDefaultMeaning
AUTH_MODEsetting, else nonenone: admin without login, IP allowlist only. oidc: additional login via Pocket ID. When set, the mode can't be changed in the UI.
ADMIN_ALLOWED_NETSprivate networksComma-separated CIDRs/IPs allowed to use /admin. Default 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, ::1/128, fc00::/7, fe80::/10.
ADMIN_URL–e.g. https://labtown.example.com: requests arriving through your reverse proxy on this host may use /admin from anywhere. Can also be set under Admin → Login. Protect it at the proxy (SSO) or enable Pocket ID.
TRUST_PROXYloopback, linklocal, uniquelocalProxies whose X-Forwarded-For is trusted (Express syntax).
BASE_URL–Public URL, e.g. https://home.example.com or with a path https://example.com/labtown.
LABTOWN_SECRET_KEY–Key for encrypting stored credentials. Without it, /data/secret.key is created on first start – back it up.
TZUTCTime zone (clock, schedules).
PORT / DATA_DIR8080 / /dataPort inside the container, data directory.
  • Volume: /data (SQLite database, key file, uploads, local backups).
  • Port: 8080 (HTTP). Put it behind your reverse proxy for TLS.
  • Runs as user node (UID 1000). For bind mounts: chown -R 1000:1000 ./data.
  • Health check built in: GET /api/health (returns the version).

⁠Integrations

Add them under Admin → Integrations (or in the setup wizard at /setup). Every integration has on/off, URL, credentials, Test connection, a polling interval and Don't verify TLS for self-signed certificates. All access is read-only; credentials are stored encrypted and never leave the server. Afterwards, import objects (clusters, nodes, monitors, switches with topology, the Pangolin gate) or link existing ones with live previews and ✨ auto-suggestions in the object editor.

⁠Proxmox VE (one integration per cluster)
  1. Create a read-only user and token on any node (shell as root):
    pveum user add labtown@pve --comment "LabTown Dashboard"
    pveum aclmod / -user labtown@pve -role PVEAuditor
    pveum user token add labtown@pve dashboard --privsep 0
    
    The output shows full-tokenid (e.g. labtown@pve!dashboard) and value – the secret, shown only once.
  2. Web UI alternative: Datacenter → Permissions → Users → Add (labtown, realm pve), then API Tokens → Add (user labtown@pve, ID dashboard). Either untick Privilege Separation or give the token itself the role PVEAuditor on path / under Permissions → Add → API Token Permission.
  3. In LabTown: URL https://<pve-host>:8006, Token ID labtown@pve!dashboard, Secret; tick Don't verify TLS if Proxmox uses its self-signed certificate.
⁠Proxmox Backup Server
  1. On the PBS (shell as root):
    proxmox-backup-manager user create labtown@pbs
    proxmox-backup-manager user generate-token labtown@pbs dashboard
    proxmox-backup-manager acl update / Audit --auth-id labtown@pbs
    proxmox-backup-manager acl update / Audit --auth-id 'labtown@pbs!dashboard'
    
    Copy the secret from the output (shown only once). Both lines are needed: for API tokens PBS uses the intersection of the user's and the token's permissions – without the user line the connection works but no datastores show up.
  2. In LabTown: URL https://<pbs-host>:8007, Token ID labtown@pbs!dashboard, Secret, usually Don't verify TLS.
⁠Uptime Kuma – two options
  • Status page (no login needed): In Kuma create a status page (Status Pages → New Status Page), add the monitors you want to see. In LabTown choose mode Status page and enter the slug – the last part of https://<kuma>/status/<slug>. Includes 24 h uptime.
  • /metrics with API key: In Kuma Settings → API Keys → Generate, copy the key. In LabTown choose mode /metrics and paste the key. With Kuma 1.x the monitor names act as IDs (renaming a monitor = re-link it).
⁠Beszel
  1. In the Beszel hub create a dedicated user for LabTown (e.g. [email protected] with a password). LabTown signs in through the PocketBase API (users, falling back to _superusers) and renews the token itself.
  2. In LabTown: hub URL (e.g. http://beszel:8090), e-mail and password. Alternatively paste a PocketBase token.
  3. Container values appear once Beszel collects Docker statistics on that system.
⁠UniFi (UDM Pro, UCG, UDR, Cloud Key Gen2+ with Network 9.x)
  1. In UniFi Network: Settings → Control Plane → Integrations → Create API Key, give it a name, copy the key.
  2. In LabTown: URL of the console/gateway (e.g. https://192.168.1.1), API key, usually Don't verify TLS. Site is optional (default: first site). Gateway MAC only if the gateway isn't detected automatically.
  3. Switches, ports, PoE and uplinks are detected automatically; import them under Objects → Import from integration → UniFi, then accept the topology suggestions (which device hangs on which switch).
  4. Note: per-client and per-port rates come from UniFi's classic endpoints (stat/sta, stat/device). Many controllers don't accept the API key there – the connection test then says so; WAN, devices, port status and speed still work.
⁠Pangolin (self-hosted reverse proxy)
  1. Enable the Integration API in Pangolin's config/config.yml and restart Pangolin:
    flags:
      enable_integration_api: true
    # optional, default port 3003:
    # server:
    #   integration_port: 3003
    
    The API is then reachable at http://<pangolin-host>:3003/v1 (or through your proxy, e.g. https://api.example.com/v1; Swagger docs at …/v1/docs).
  2. Create an API key: Organization → API Keys → Create API Key, grant read access to sites, resources and targets, copy the key (shown only once). Root keys (Server Admin → API Keys) work too.
  3. In LabTown: URL of the Integration API, API key, and – for organization keys – the organization ID (empty = first organization). LabTown only reads GET /orgs, /org/{orgId}/sites, /org/{orgId}/resources and /resource/{id}/targets.
  4. Resources are matched to service houses by target IP (the house's URL or its UniFi client IP), otherwise by name; you can also pick them explicitly in the house editor.
⁠Backups to an SMB share (Synology, TrueNAS, Unraid, Windows …)
  1. On the NAS create a user (e.g. labtown) and a share (e.g. backup); the user needs read and write access. Enable SMB2 or better SMB3 (Synology: Control Panel → File Services → SMB → Advanced → Max. protocol SMB3).
  2. In LabTown Admin → Backup: tick SMB share, share //nas.local/backup (or //192.168.1.20/backup), subfolder labtown, user and password (domain only if needed), SMB version SMB3, Force encryption if the NAS supports it.
  3. Test connection (it writes, reads and deletes a test file), choose a schedule and retention, Save, then Back up now – the file appears locally and on the NAS under backup/labtown/.
⁠Login with Pocket ID (optional)
  1. In Pocket ID: OIDC Clients → Add OIDC Client (e.g. "LabTown"), callback URL https://<your-labtown-address>/api/auth/callback (the Login page in LabTown shows the exact URL), enable PKCE. Optionally restrict it to a group such as labtown-admins.
  2. In LabTown Admin → Login: issuer URL, client ID and secret (and the group, if used), Test connection, then select Pocket ID (OIDC) and save – you are redirected to sign in.
  3. Locked out? docker exec labtown labtown-cli auth reset removes OIDC again (see CLI).

⁠Access & login

  • IP allowlist (always on): /admin and the admin API only answer clients from ADMIN_ALLOWED_NETS – or requests forwarded by a proxy in those networks for the configured admin URL (ADMIN_URL or Admin → Login). A spoofed Host header sent straight to the container is not enough.
  • CSRF protection (always on) and encrypted secrets.
  • Optional OIDC login via Pocket ID (PKCE, optional group check) – set up under Login or with AUTH_MODE=oidc.
  • Behind a reverse proxy, make sure it sets X-Forwarded-For so LabTown sees the real client IP.

⁠Backups

Local (/data/backups) and/or SMB at the same time (setup see above) – no volume mount, no privileged container. Each backup is verified (size, checksum, read-back on SMB), old ones are removed by count or age, schedules daily/weekly/cron, optional password encryption (AES-256). Restore with preview; LabTown restarts and applies it (needs restart: unless-stopped).

⁠CLI

docker exec labtown labtown-cli auth show            # login mode, allowed networks, OIDC (secret masked)
docker exec labtown labtown-cli auth reset           # remove OIDC, back to "none" (only when OIDC is active)
docker exec labtown labtown-cli recovery-link --base-url http://192.168.1.10:8080
docker exec labtown labtown-cli backup now
docker exec labtown labtown-cli backup list
docker exec labtown labtown-cli backup restore <file> [--location smb] [--password …] --yes

⁠Versioning

0.1.1, 0.1.2 … 0.1.199, then 0.2.0 … 0.2.199, then 0.3.0 and so on. Tags: <version> (e.g. 0.1.1), <major.minor> (e.g. 0.1, always the newest patch) and latest. Images for linux/amd64 and linux/arm64.

⁠Changelog

0.2.0 – New admin area: sidebar instead of tabs (collapsible, burger menu below 900 px, status hints), pages use the full screen width (1/2/3 columns, equal-height cards), docked object and integration editors on wide screens, Branding as its own page, sticky save bar with Discard, illustrated empty states.

0.1.28 – Admin area: toggle switches instead of checkboxes, action buttons consistently on the right.

0.1.27 – Search suggestions and internal panel links also work via the admin URL behind a reverse proxy (e.g. Pangolin); manifest loaded with cookies (no CORS errors behind a login proxy).

0.1.26 – Bookmark suggestions only from object link URLs and your own entries (Pangolin domains removed); no "/" hint in the search bar.

0.1.25 – Bookmarks admin page with uniform field and button styling; Save at the bottom right.

0.1.24 – Detailed Ceph section (health with warnings, OSDs, monitors, managers, PGs, I/O, capacity, pools); search opens in a new tab with bookmark suggestions in a glass list (Tab to accept); bookmarks manageable in the admin area, objects with URLs and Pangolin resources added automatically.

0.1.23 – Host chimneys are slim round stacks again, still standing on the hall roof.

0.1.22 – Slim square brick chimneys standing on the hall roofs of Proxmox hosts (no more floating grey cylinders); smoke rises from the chimney mouth.

0.1.21 – Gateway/router port overview like on switches (WAN port in blue, linked devices), uplink/WAN throughput shown from the network's point of view, chimneys drawn as connected stacks, no more hover flicker on buildings, roundabouts and the city gate.

0.1.20 – No more notches or wedges in zone outlines (contour tracing + morphological closing), car parks follow the cluster's overall RAM utilisation (several car parks filled together), uplink ports shown in plain blue.

0.1.19 – Organic city: soft cluster zones (SDF hull, animated when dragging), river with varying width and sandy banks, optional lakes/hills/meadows, 2.5D buildings with roof types and sun shadows, warning beacon and offline barrier tape, parked cars per running VM/LXC, smooth drag & drop (lift, inertia, spring, Web-Worker preview, red invalid spots), clusters can be split across the river with bridges, new detail level and landscape settings.

0.1.18 – Natural forest edge (no rectangle), labels keep their distance to buildings when zooming in, straight short links (no S-wave at the gateway), curvier town streets.

0.1.17 – Winter look (snow cover, snow caps, icy water; ?snow=1 preview), fewer standard cars when there is real traffic and a car cap per roundabout, fixed street lamps at bridges.

0.1.16 – More compact small towns (main street ends at the last side street, no empty blocks), dead-end roundabouts removed, sites keep off the river, no trees in the water.

0.1.15 – Larger sites become small towns: main street with side streets, trees between the buildings, roundabout at the end. Site title inside the outline, outage barriers on the driveway, dropdown arrow back at the right edge.

0.1.14 – Organic district streets with small roundabouts in larger districts. Traffic scales with real data (also at a few kbit/s, at least one car per reachable building), no more overlapping cars, jams resolve. Dropdown arrow spacing, muted chips in dark mode, panel tables scroll with a slim themed scrollbar.

0.1.13 – New Home Assistant integration (power/energy sensors per object, sums per site). Detail panel: one combined overview from the most precise reachable source, no duplicates. Admin area dark at night. Panel tables without horizontal scrolling.

0.1.12 – Smooth junction and roundabout corners (no more small bumps at the curve ends).

0.1.11 – Far fewer traffic jams at roundabouts, roof windows on moving cars, more space next to the port status dots.

0.1.10 – Traffic passes through Pangolin/gateway stations, roundabout jams resolve, rounded headlights beneath the cars. More parking lots spread through districts, with parked cars by RAM usage. Access roads leave towards the switch. Cleaner junctions, regular windows, fixed river in the editor, better editor hit areas, readable clock at night.

0.1.9 – Fix: with a toll station or barrier on the map, roundabout rings, junctions and bridges went missing in 0.1.8. The ground layer is now drawn robustly.

0.1.8 – Checkpoints without a round plaza (cars turn smoothly at the station), status dot beside the station, new bridge look with slim curved stone parapets, building details stay inside their outline.

0.1.7 – Road markings stand still and never run into roundabouts. A gateway or Pangolin with only one connection is a checkpoint instead of a roundabout (gateway = toll station, Pangolin = road barrier). Bridges keep the normal road.

0.1.6 – Pangolin can be picked as upstream and moves in between automatically (gateway → Pangolin → factory or gateway → switch → Pangolin → factory). Cuter bridges; boats and river current glide smoothly and pass under bridges. Gear icon for settings, frosted-glass background behind open dialogs, one consistent close button everywhere (top right, centred X), icon field removed from the object editor, status dot on gateways, PBS: clear message when the token can't see any datastores (grant Audit to the user as well).

0.1.5 – Flexible topology: gateways, switches and gates get a multi-select "Connected here" (e.g. a gateway directly to several factory sites or buildings). Pangolin can sit before the gateway (city gate at the edge) or between a gateway/switch and selected factory sites or buildings, as its own node on the map. Compact dialogs on large screens, single dropdown arrow, tidier detail panel header.

0.1.4 – Fixed map rendering (road markings, cars and trees could vanish while zooming/panning). Pangolin 1.26: correct pagination (page/pageSize, no limit), clear errors per HTTP status and a step-by-step connection test. Custom scrollbars and dropdowns that follow the time of day, English file picker, search clear button, search engine presets with automatic URL correction (e.g. google.com/%s), search hidden while editing the layout.

0.1.3 – Switch roundabouts show 4 / 5 / 6 status lights (small / medium / large) instead of one dot per port; the number lit is the share of active ports (e.g. 2 of 4 = 50 %). The dots never overlap.

0.1.2 – Admin URL: unlock /admin from outside via your reverse proxy (ADMIN_URL or Admin → Login). River current is animated and never drawn over bridges; selected roads blend smoothly into roundabouts. UI fully in English. New instances start empty with demo mode off (single "No objects yet" hint on the map; "Create demo city" turns demo mode on). Fixed the empty-state link being swallowed by the map, clouds piling up in one spot. Removed the admin preview tab and the extra underline on the active tab.

0.1.1 – First public release. City map with organic layout and rounded road geometry, switches as roundabouts (UniFi ports, PoE, LACP, topology import), Pangolin city gate, Proxmox / PBS / Uptime Kuma / Beszel / UniFi / Pangolin integrations, detail panels with history, day & night, weather, branding, backups to SMB, optional Pocket ID login, smooth loading without jumps, compact header with centred search, animations throughout.

Tag summary

Content type

Image

Digest

sha256:bb88802eb…

Size

79 MB

Last updated

about 11 hours ago

docker pull techbygiusi/labtown