mirror of
https://github.com/AlexanderWilhelmsenBerg/network-discovery.git
synced 2026-11-15 23:31:06 +01:00
No description
- Python 77.3%
- HTML 14.3%
- CSS 7.3%
- Shell 1.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| app | ||
| deploy/systemd | ||
| scripts | ||
| CODE_REVIEW.md | ||
| README.md | ||
| requirements.txt | ||
Homelab Control Service
A modular FastAPI-based service designed to run as a Linux service on your opstools host.
Phase 1 goals
- Discover network devices from UniFi and OPNsense
- Show a discovery table in the web UI
- Track first seen, last seen, and connection duration
- Move selected devices into a Homelab inventory table
- Keep the code structured so you can later add:
- VLAN management
- Traefik routes
- Uptime Kuma entries
- DNS overrides
- Static IP planning
- Container inventory from Proxmox / host SSH
Design principles
- Modular: each domain has its own model, service, and router
- Linux service first: includes a
systemdunit file - Single config source: one
.envfile for secrets and endpoints - Separation of concerns:
models/= database tablesservices/= business logic and sync jobsrouters/= web/API endpointstemplates/= UI pages
- Extensible DB: separate tables for discovery, homelab assets, VLANs, routes, checks
Planned modules
Implemented now
- Discovery
- Homelab inventory shell
- Dashboard navigation
- Move-to-homelab workflow
- Linux service deployment files
Planned next
- VLAN assignment logic
- Static IP planning / reservation state
- DNS overrides
- Uptime Kuma integration
- Traefik route generation
- Proxmox container sync over SSH
Run locally
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn app.main:app --host 0.0.0.0 --port 8100
Linux service deployment
- Copy the project to
/mnt/config/opstools/discovery-tool/ - Create a venv in that folder
- Copy
.env.exampleto.envand fill it in - Install the systemd unit from
deploy/systemd/discovery-tool.service - Adjust paths if needed
- Enable and start:
sudo cp deploy/systemd/discovery-tool.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now discovery-tool.service
sudo systemctl status discovery-tool.service
Database layout
The database is intentionally split by function.
discovered_devicesdevice_observationshomelab_devicesvlansdns_overridestraefik_routesuptime_kuma_checks
Only discovery and homelab workflows are wired up in this version.