Compare commits
14 Commits
v1.1.1
..
79fdbc4687
| Author | SHA1 | Date | |
|---|---|---|---|
| 79fdbc4687 | |||
| 5fabd035c2 | |||
| 3e7cc11e08 | |||
| 58f7fb11a3 | |||
| 3f62661ed7 | |||
| b271c15267 | |||
| 3a3d46119a | |||
| 0b16218ce9 | |||
| 248c33ed80 | |||
| 933fa8f257 | |||
| 883ef20ced | |||
| ed4397b21b | |||
| da188ea290 | |||
| 42a50037ab |
@@ -3,7 +3,6 @@ __pycache__
|
|||||||
*.pyc
|
*.pyc
|
||||||
*.pyo
|
*.pyo
|
||||||
config.json
|
config.json
|
||||||
data/
|
|
||||||
screenshots/
|
screenshots/
|
||||||
.claude/
|
.claude/
|
||||||
CLAUDE.md
|
CLAUDE.md
|
||||||
|
|||||||
+2
-6
@@ -23,9 +23,5 @@ __pycache__/
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
# Local config — contains the admin password hash and session secret.
|
# Local config (uncomment if you want to ignore local changes)
|
||||||
# Fresh installs start from config.json.example (see CONFIG.md).
|
# config.json
|
||||||
config.json
|
|
||||||
|
|
||||||
# Docker config volume (holds the live config.json with secrets)
|
|
||||||
data/
|
|
||||||
|
|||||||
@@ -18,14 +18,6 @@ python3 server.py
|
|||||||
|
|
||||||
Access at http://localhost:{web_port} (configured in config.json)
|
Access at http://localhost:{web_port} (configured in config.json)
|
||||||
|
|
||||||
### Deployment / fielding notes
|
|
||||||
|
|
||||||
- **Config path** is overridable via the `ADSBIT_CONFIG` env var (defaults to `config.json` beside `server.py`). Docker uses `/app/data/config.json` on a mounted volume.
|
|
||||||
- **`/health`** (no auth) returns status/version/receiver/flight counts — used by the Docker `HEALTHCHECK` and any external monitoring.
|
|
||||||
- **`VERSION`** constant in `server.py` is the single source of truth; surfaced at startup, via `GET /api/config`, and in the admin header. Bump it for releases.
|
|
||||||
- **Auto-scan** (`scan_for_receivers`) skips subnets larger than `MIN_SCAN_PREFIX` (/20) so a docker `/16` doesn't stall startup; the manual scan endpoint enforces the same limit.
|
|
||||||
- **`docker-entrypoint.sh`** seeds `config.json` from `config.json.example` on first run, so a fresh `docker compose up` needs no manual steps. SIGTERM/SIGINT shut down cleanly (no traceback).
|
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
### Components
|
### Components
|
||||||
@@ -56,15 +48,11 @@ Access at http://localhost:{web_port} (configured in config.json)
|
|||||||
- **admin/** - Admin panel (login + tabbed settings UI)
|
- **admin/** - Admin panel (login + tabbed settings UI)
|
||||||
- Theme management: rename display names, upload per-direction background PNGs, create new themes
|
- Theme management: rename display names, upload per-direction background PNGs, create new themes
|
||||||
- Display names stored in `config.json` `theme_names` map (folder name -> display name)
|
- Display names stored in `config.json` `theme_names` map (folder name -> display name)
|
||||||
- Receivers tab: live per-receiver health (via `GET /api/admin/receiver-status` and `POST /api/admin/test-receivers`), a select → SAVE & APPLY → auto-test flow, selectable scan results, and a per-interface scan selector
|
|
||||||
- Version (from `server.py` `VERSION`) is surfaced via public `GET /api/config` and shown in the admin header
|
|
||||||
- **pixel-editor.js** - In-app Canvas2D pixel editor (Sprites tab "EDIT" button)
|
- **pixel-editor.js** - In-app Canvas2D pixel editor (Sprites tab "EDIT" button)
|
||||||
- Edits sprites at native 500x333; tools: pencil, eraser, color picker, fill bucket, pan, line, rectangle, ellipse (outline/filled), rectangular select
|
- Edits sprites at native 500x333; tools: pencil, eraser, color picker, fill bucket, pan
|
||||||
- Select & move: marquee + floating layer, drag/arrow-nudge, Ctrl+C/X/V clipboard, Delete, Enter/Esc commit
|
- Zoom/pan, undo/redo (snapshot-per-stroke), grid overlay, retro palette + native color input
|
||||||
- Zoom/pan, undo/redo (snapshot-per-stroke), grid overlay, brush size & opacity, retro + custom (localStorage) + recent palettes, adjustable reference-image overlay
|
|
||||||
- Exports a 500x333 PNG via `srcCanvas.toBlob` and POSTs to the existing `/api/admin/sprites/{type}` upload endpoint (no new server route)
|
- Exports a 500x333 PNG via `srcCanvas.toBlob` and POSTs to the existing `/api/admin/sprites/{type}` upload endpoint (no new server route)
|
||||||
- Keyboard: B/E/I/F/L/R/O/M tools, Space=pan, +/-/0 zoom, Ctrl+Z/Y undo/redo, Ctrl+C/X/V, arrows nudge, G grid, Esc close
|
- Keyboard: B/E/I/F tools, Space=pan, +/-/0 zoom, Ctrl+Z/Y undo/redo, G grid, Esc close
|
||||||
- **Asset cache-busting:** `admin.html` references `admin.css`/`admin.js`/`pixel-editor.js` with a `?v=YYYYMMDD[x]` query — bump it whenever those files change so browsers reload them
|
|
||||||
|
|
||||||
- **setup/** - First-run setup wizard (multi-step configuration)
|
- **setup/** - First-run setup wizard (multi-step configuration)
|
||||||
|
|
||||||
|
|||||||
+2
-9
@@ -13,16 +13,9 @@ RUN pip install --no-cache-dir -r requirements.txt && \
|
|||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN chmod +x /app/docker-entrypoint.sh
|
|
||||||
|
|
||||||
EXPOSE 2001
|
EXPOSE 2001
|
||||||
|
|
||||||
# Persist config on a mounted volume by default (see docker-compose.yml).
|
ENV PYTHONUNBUFFERED=1
|
||||||
ENV PYTHONUNBUFFERED=1 \
|
|
||||||
ADSBIT_CONFIG=/app/data/config.json
|
|
||||||
|
|
||||||
# Liveness probe against the unauthenticated /health endpoint.
|
CMD ["python3", "server.py"]
|
||||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
|
||||||
CMD python3 -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:2001/health',timeout=4).status==200 else 1)" || exit 1
|
|
||||||
|
|
||||||
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
|
||||||
|
|||||||
@@ -7,16 +7,14 @@ A retro SNES-style side-view flight tracker that displays ADS-B aircraft data wi
|
|||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Real-time aircraft tracking via ADS-B receivers
|
- Real-time aircraft tracking via ADS-B receivers
|
||||||
- Custom pixel art sprites for 9 aircraft types (small prop, regional jet, narrow body, wide body, heavy, helicopter, balloon, glider, UAV)
|
- Custom pixel art sprites for 6 aircraft types (small prop, regional jet, narrow body, wide body, heavy, helicopter)
|
||||||
- Animated sun and moon with accurate astronomical positions
|
- Animated sun and moon with accurate astronomical positions
|
||||||
- Dynamic sky colors based on time of day
|
- Dynamic sky colors based on time of day
|
||||||
- Weather visualization with cloud sprites
|
- Weather visualization with cloud sprites
|
||||||
- Directional view (N/E/S/W) with themed backgrounds
|
- Directional view (N/E/S/W) with themed backgrounds
|
||||||
- Auto-discovery of ADS-B receivers on your network, with per-interface scanning
|
- Auto-discovery of ADS-B receivers on your network
|
||||||
- Canvas-based 10 FPS retro rendering
|
- Canvas-based 10 FPS retro rendering
|
||||||
- Admin panel with password authentication
|
- Admin panel with password authentication
|
||||||
- **In-app pixel editor** — draw and edit sprites in the browser (pencil, shapes, fill, select & move, reference overlay, custom palettes)
|
|
||||||
- **Receiver health dashboard** — live per-receiver status (receiving / no data / unreachable), connection testing, and select → save → apply flow
|
|
||||||
- First-run setup wizard
|
- First-run setup wizard
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
@@ -44,16 +42,14 @@ On first run, visit http://localhost:2001 and the setup wizard will guide you th
|
|||||||
### First Run
|
### First Run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build and start — no config step needed
|
# Create a config file (the setup wizard runs if you skip this)
|
||||||
|
cp config.json.example config.json
|
||||||
|
|
||||||
|
# Build and start
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
A config file is created automatically in `data/` on first run, then the
|
The web UI is available at http://localhost:2001.
|
||||||
browser **setup wizard** walks you through receiver, location, and password
|
|
||||||
setup. The web UI is available at http://localhost:2001.
|
|
||||||
|
|
||||||
A `/health` endpoint (used by the container healthcheck) reports status,
|
|
||||||
version, and receiver/flight counts: `curl http://localhost:2001/health`.
|
|
||||||
|
|
||||||
### Useful Commands
|
### Useful Commands
|
||||||
|
|
||||||
@@ -84,11 +80,11 @@ The following paths are bind-mounted from the repo directory and persist across
|
|||||||
|
|
||||||
| Path | Contents |
|
| Path | Contents |
|
||||||
|------|----------|
|
|------|----------|
|
||||||
| `data/` | Server configuration and credentials (`config.json`, auto-seeded) |
|
| `config.json` | Server configuration and credentials |
|
||||||
| `images/` | Aircraft and UI sprites (including uploads) |
|
| `images/` | Aircraft and UI sprites (including uploads) |
|
||||||
| `backgrounds/` | Theme background images (including custom themes) |
|
| `backgrounds/` | Theme background images (including custom themes) |
|
||||||
|
|
||||||
Host networking (`network_mode: host`) is used so the server can auto-scan your LAN for ADS-B receivers. Auto-scan skips oversized subnets (larger than /20, e.g. a Docker bridge `172.17.0.0/16`); if your receiver lives on such a network, set it explicitly via the admin Receivers tab.
|
Host networking (`network_mode: host`) is used so the server can auto-scan your LAN for ADS-B receivers.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@@ -106,8 +102,8 @@ ADS-Bit uses a first-run setup wizard to configure your installation. You can al
|
|||||||
"receiver_port": 30003,
|
"receiver_port": 30003,
|
||||||
"location": {
|
"location": {
|
||||||
"name": "My Location",
|
"name": "My Location",
|
||||||
"lat": 0.0,
|
"lat": 36.2788,
|
||||||
"lon": 0.0
|
"lon": -115.2283
|
||||||
},
|
},
|
||||||
"web_port": 2001,
|
"web_port": 2001,
|
||||||
"theme": "desert"
|
"theme": "desert"
|
||||||
|
|||||||
@@ -169,15 +169,6 @@ textarea {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-version {
|
|
||||||
font-family: 'Courier New', monospace;
|
|
||||||
font-size: 11px;
|
|
||||||
color: #54fc54;
|
|
||||||
text-shadow: none;
|
|
||||||
margin-left: 6px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-actions {
|
.header-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|||||||
+4
-4
@@ -7,7 +7,7 @@
|
|||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="/admin/admin.css?v=20260609d">
|
<link rel="stylesheet" href="/admin/admin.css?v=20260609c">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- Login Screen -->
|
<!-- Login Screen -->
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<!-- Admin Panel -->
|
<!-- Admin Panel -->
|
||||||
<div id="admin-panel" class="hidden">
|
<div id="admin-panel" class="hidden">
|
||||||
<header class="admin-header">
|
<header class="admin-header">
|
||||||
<h1 class="retro-title">ADS-Bit Admin <span id="admin-version" class="admin-version"></span></h1>
|
<h1 class="retro-title">ADS-Bit Admin</h1>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<a href="/" class="btn btn-small">VIEWER</a>
|
<a href="/" class="btn btn-small">VIEWER</a>
|
||||||
<button id="logout-btn" class="btn btn-small btn-danger">LOGOUT</button>
|
<button id="logout-btn" class="btn btn-small btn-danger">LOGOUT</button>
|
||||||
@@ -297,7 +297,7 @@
|
|||||||
<div id="toast" class="toast hidden"></div>
|
<div id="toast" class="toast hidden"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/admin/pixel-editor.js?v=20260609d"></script>
|
<script src="/admin/pixel-editor.js?v=20260609c"></script>
|
||||||
<script src="/admin/admin.js?v=20260609d"></script>
|
<script src="/admin/admin.js?v=20260609c"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -28,22 +28,10 @@
|
|||||||
loadConfig();
|
loadConfig();
|
||||||
loadThemes();
|
loadThemes();
|
||||||
loadNetworkInfo();
|
loadNetworkInfo();
|
||||||
loadVersion();
|
|
||||||
refreshStatus();
|
refreshStatus();
|
||||||
statusInterval = setInterval(refreshStatus, 5000);
|
statusInterval = setInterval(refreshStatus, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadVersion() {
|
|
||||||
try {
|
|
||||||
const res = await fetch('/api/config');
|
|
||||||
if (!res.ok) return;
|
|
||||||
const data = await res.json();
|
|
||||||
if (data.version) {
|
|
||||||
document.getElementById('admin-version').textContent = 'v' + data.version;
|
|
||||||
}
|
|
||||||
} catch (e) { /* ignore */ }
|
|
||||||
}
|
|
||||||
|
|
||||||
document.getElementById('login-form').addEventListener('submit', async (e) => {
|
document.getElementById('login-form').addEventListener('submit', async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const pw = document.getElementById('login-password').value;
|
const pw = document.getElementById('login-password').value;
|
||||||
|
|||||||
+2
-4
@@ -6,11 +6,9 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- PYTHONUNBUFFERED=1
|
- PYTHONUNBUFFERED=1
|
||||||
- ADSBIT_CONFIG=/app/data/config.json
|
|
||||||
volumes:
|
volumes:
|
||||||
# Config persists here; auto-seeded from config.json.example on first run
|
# Persist config (copy config.json.example to config.json before first run)
|
||||||
# (a directory mount, so a fresh `docker compose up` just works).
|
- ./config.json:/app/config.json
|
||||||
- ./data:/app/data
|
|
||||||
# Persist custom sprite uploads
|
# Persist custom sprite uploads
|
||||||
- ./images:/app/images
|
- ./images:/app/images
|
||||||
# Persist custom theme backgrounds
|
# Persist custom theme backgrounds
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Seed a config file on first run so `docker compose up` works on a fresh
|
|
||||||
# clone with no manual steps. The config lives on a mounted data volume so it
|
|
||||||
# persists across container rebuilds.
|
|
||||||
set -e
|
|
||||||
|
|
||||||
: "${ADSBIT_CONFIG:=/app/config.json}"
|
|
||||||
CONFIG_DIR=$(dirname "$ADSBIT_CONFIG")
|
|
||||||
mkdir -p "$CONFIG_DIR"
|
|
||||||
|
|
||||||
if [ ! -f "$ADSBIT_CONFIG" ]; then
|
|
||||||
echo "[entrypoint] No config at $ADSBIT_CONFIG — seeding from config.json.example"
|
|
||||||
cp /app/config.json.example "$ADSBIT_CONFIG"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec python3 server.py
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 264 KiB |
@@ -17,16 +17,8 @@ from aiohttp import web, ClientSession, ClientTimeout
|
|||||||
import netifaces
|
import netifaces
|
||||||
import bcrypt
|
import bcrypt
|
||||||
|
|
||||||
VERSION = "1.1.1"
|
|
||||||
|
|
||||||
WEB_DIR = Path(__file__).parent
|
WEB_DIR = Path(__file__).parent
|
||||||
# Config path is overridable (handy for containers persisting config on a
|
CONFIG_FILE = WEB_DIR / "config.json"
|
||||||
# named volume); defaults to config.json next to this script for bare-metal.
|
|
||||||
CONFIG_FILE = Path(os.environ.get("ADSBIT_CONFIG") or (WEB_DIR / "config.json"))
|
|
||||||
|
|
||||||
# Smallest subnet prefix (largest network) we'll auto-scan: /20 = 4094 hosts.
|
|
||||||
# Anything bigger (e.g. a docker /16) is skipped to keep scans fast and safe.
|
|
||||||
MIN_SCAN_PREFIX = 20
|
|
||||||
|
|
||||||
# Track server start time
|
# Track server start time
|
||||||
SERVER_START_TIME = time.time()
|
SERVER_START_TIME = time.time()
|
||||||
@@ -420,15 +412,6 @@ async def scan_for_receivers():
|
|||||||
if ip and netmask and not ip.startswith('127.'):
|
if ip and netmask and not ip.startswith('127.'):
|
||||||
try:
|
try:
|
||||||
network = ipaddress.IPv4Network(f"{ip}/{netmask}", strict=False)
|
network = ipaddress.IPv4Network(f"{ip}/{netmask}", strict=False)
|
||||||
# Skip subnets too large to scan quickly (e.g. a docker
|
|
||||||
# bridge /16 = 65k hosts). Without this, AUTO discovery
|
|
||||||
# hammers the network and stalls startup on any host with
|
|
||||||
# Docker or a large/16. Use MANUAL or a custom subnet for
|
|
||||||
# receivers that live on such networks.
|
|
||||||
if network.prefixlen < MIN_SCAN_PREFIX:
|
|
||||||
print(f"Skipping {network} on {iface}: too large "
|
|
||||||
f"({network.num_addresses} hosts) for auto-scan")
|
|
||||||
continue
|
|
||||||
found.extend(await _scan_subnet(network, port))
|
found.extend(await _scan_subnet(network, port))
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
print(f"Invalid network {ip}/{netmask}: {e}")
|
print(f"Invalid network {ip}/{netmask}: {e}")
|
||||||
@@ -566,7 +549,6 @@ async def handle_receiver_location(request):
|
|||||||
async def handle_config(request):
|
async def handle_config(request):
|
||||||
"""Return client-relevant configuration (public, no secrets)."""
|
"""Return client-relevant configuration (public, no secrets)."""
|
||||||
return web.json_response({
|
return web.json_response({
|
||||||
"version": VERSION,
|
|
||||||
"theme": config.get("theme", "desert"),
|
"theme": config.get("theme", "desert"),
|
||||||
"location": config["location"],
|
"location": config["location"],
|
||||||
"receivers": receivers,
|
"receivers": receivers,
|
||||||
@@ -999,10 +981,9 @@ async def handle_admin_scan_receivers(request):
|
|||||||
return web.json_response(
|
return web.json_response(
|
||||||
{"error": f"Invalid subnet: {subnet}"}, status=400)
|
{"error": f"Invalid subnet: {subnet}"}, status=400)
|
||||||
|
|
||||||
if network.prefixlen < MIN_SCAN_PREFIX:
|
if network.prefixlen < 20:
|
||||||
return web.json_response(
|
return web.json_response(
|
||||||
{"error": f"Subnet too large (max /{MIN_SCAN_PREFIX} = "
|
{"error": "Subnet too large (max /20 = 4096 hosts)"}, status=400)
|
||||||
f"{2 ** (32 - MIN_SCAN_PREFIX) - 2} hosts)"}, status=400)
|
|
||||||
|
|
||||||
port = config['receiver_port']
|
port = config['receiver_port']
|
||||||
found = await _scan_subnet(network, port)
|
found = await _scan_subnet(network, port)
|
||||||
@@ -1188,17 +1169,6 @@ async def handle_http(request):
|
|||||||
return web.Response(status=404, text="Not Found")
|
return web.Response(status=404, text="Not Found")
|
||||||
|
|
||||||
|
|
||||||
async def handle_health(request):
|
|
||||||
"""GET /health - liveness/readiness probe (no auth, no secrets)."""
|
|
||||||
return web.json_response({
|
|
||||||
"status": "ok",
|
|
||||||
"version": VERSION,
|
|
||||||
"receivers": len(receivers),
|
|
||||||
"flights": len(flights),
|
|
||||||
"uptime_seconds": int(time.time() - SERVER_START_TIME),
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Application setup
|
# Application setup
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -1211,7 +1181,6 @@ async def start_http_server():
|
|||||||
app.router.add_get('/ws', websocket_handler)
|
app.router.add_get('/ws', websocket_handler)
|
||||||
|
|
||||||
# Public API
|
# Public API
|
||||||
app.router.add_get('/health', handle_health)
|
|
||||||
app.router.add_get('/api/receiver-location', handle_receiver_location)
|
app.router.add_get('/api/receiver-location', handle_receiver_location)
|
||||||
app.router.add_get('/api/config', handle_config)
|
app.router.add_get('/api/config', handle_config)
|
||||||
|
|
||||||
@@ -1262,7 +1231,7 @@ async def main():
|
|||||||
"""Main entry point"""
|
"""Main entry point"""
|
||||||
global receivers, receiver_tasks
|
global receivers, receiver_tasks
|
||||||
|
|
||||||
print(f"ADS-Bit Server v{VERSION} Starting...")
|
print("ADS-Bit Server Starting...")
|
||||||
|
|
||||||
load_config()
|
load_config()
|
||||||
|
|
||||||
@@ -1310,11 +1279,4 @@ async def main():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Make SIGTERM (docker stop, systemctl stop) raise KeyboardInterrupt like
|
|
||||||
# SIGINT does, so shutdown is clean and quiet instead of a stack trace.
|
|
||||||
import signal
|
|
||||||
signal.signal(signal.SIGTERM, signal.default_int_handler)
|
|
||||||
try:
|
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
except (KeyboardInterrupt, SystemExit):
|
|
||||||
print("ADS-Bit server shutting down.")
|
|
||||||
|
|||||||
Reference in New Issue
Block a user