Skip to content

Configuration

Judah Paul edited this page Jul 16, 2026 · 11 revisions

The app reads its configuration from environment variables. A single template at the repo root, .env.example, holds both these application variables and the Docker Compose host-port and service variables; the compose file passes the application half into the app container, defaulting each so a missing .env is fine.

Variable Default Purpose
DATABASE_PATH ./src/data.db Path to the SQLite database file. The schema is created on first boot, so the path only needs to be writable. In the production image this is /app/src/data.db, inside the data volume.
OPENAIP_API_KEY unset OpenAIP key for worldwide airspace overlays and no-fly-zone safety checks. Server-side only. When unset, /api/airspace falls back to the FAA's keyless public layers (US coverage); see Mission Planning.
VITE_ALTITUDE_ANGEL_API_KEY unset Key for the Altitude Angel airspace endpoint.
MAPTILER_KEY unset MapTiler key for the rich dark and labeled hybrid-satellite basemaps. Also settable in Integrations. Without one the map uses keyless tile sources.
AI_API_KEY unset Key for the AI PID tuning assistant. Also settable in Integrations.
AI_BASE_URL https://api.openai.com/v1 Base URL of the OpenAI-compatible endpoint the AI assistant calls (a LiteLLM proxy or a local Ollama works).
AI_MODEL gpt-4o-mini Model the AI assistant requests.
MAVLINK_SIGNING_KEY unset Passphrase for MAVLink 2 signing. Also settable in Integrations. When set, the link signs outbound and verifies inbound messages.
SMTP_HOST, SMTP_PORT, SMTP_SECURE, SMTP_USER, SMTP_PASS, MAIL_FROM port 587 SMTP for password-reset and alert email; see Email. Also settable in Integrations.
MSP_SERIAL_PATH, MSP_BAUD unset, 115200 Serial device of a Betaflight or INAV flight controller; see MSP flight controller link.
MSP_TCP_HOST, MSP_TCP_PORT unset MSP flight controller over TCP instead of serial (a SITL or a serial-over-TCP bridge).
FC_BOOTLOADER_PATH /dev/ttyACM0 Serial device the Firmware tab flashes ArduPilot and PX4 over.
MAVLINK_TCP_HOST, MAVLINK_TCP_PORT sitl, 5760 Development MAVLink TCP endpoint. A blank host disables the MAVLink link, which the MSP-only dev profiles use.
FLIGHT_LOG_PATH ./flight-logs Directory for recorded flight logs. In the production image this is /app/src/flight-logs, inside the data volume.
WEBRTC_SOURCE, WEBRTC_RUNONDEMAND rpiCamera Live-feed video source for the camera bridge; see Camera source.
MEDIAMTX_API_URL host gateway :9997 MediaMTX control API the app patches when the camera source is changed in Integrations.
NODE_ENV set by compose production uses the serial link at /dev/ttyACM0; development uses the SITL TCP link.

An empty value means unset: it falls through to the Integrations setting or the default rather than overriding them.

Airspace data

The server route /api/airspace supplies both the map overlay and the pre-flight airspace checks. It reads two providers:

  • OpenAIP (worldwide) when OPENAIP_API_KEY is set. Create a free account at openaip.net, generate an API key, and set the variable. The key is read only on the server, so it never reaches the browser.
  • FAA public airspace layers (US) as a keyless fallback when the key is unset or OpenAIP returns nothing. No account or key is required.

See Mission Planning for how the zones drive the overlay and the pre-flight checks.

Map tiles

The 2D map picks its basemap per view from settings resolved by /api/map-config. A MapTiler API key (Integrations, or MAPTILER_KEY) selects MapTiler's rich dark basemap and a labeled hybrid satellite; without a key the map falls back to OpenStreetMap, CARTO Dark Matter, and Google hybrid. Each mode (light, dark, satellite) accepts a custom XYZ tile URL override, chosen from a preset dropdown of free sources or typed in. The map swaps between the light and dark basemap when the theme toggles, and satellite is the default view.

MSP flight controller link

A Betaflight or INAV flight controller speaks the MultiWii Serial Protocol (MSP). The link opens over serial (MSP_SERIAL_PATH, at MSP_BAUD) or over TCP (MSP_TCP_HOST and MSP_TCP_PORT, for a SITL build or a serial-over-TCP bridge); with neither set, the flight-controller panel shows as not configured. The development-betaflight and development-inav compose profiles point the TCP pair at the bundled SITL. The Firmware tab flashes ArduPilot and PX4 over FC_BOOTLOADER_PATH, which defaults to the MAVLink autopilot's own serial port. See Firmware for the link behavior, board autodetect, and flashing.

Camera source

The live feed serves one WebRTC stream through MediaMTX, and WEBRTC_SOURCE picks what feeds it at boot: rpiCamera (the CSI camera), an rtsp:// (or RTMP/SRT) URL for an IP camera or a flight controller camera that advertises RTSP, or publisher for a USB/V4L2 capture device with the publish command in WEBRTC_RUNONDEMAND. The camera panel in Integrations changes the source at runtime by patching the MediaMTX control API at MEDIAMTX_API_URL. The root .env.example carries a worked example for each source.

Email (SMTP)

Password-reset links and telemetry alerts send over SMTP through your own mail server, configured in Integrations or through SMTP_HOST, SMTP_PORT, SMTP_SECURE, SMTP_USER, SMTP_PASS, and MAIL_FROM. The Integrations values take precedence over the environment. The port defaults to 587 (STARTTLS); set SMTP_SECURE=true for implicit TLS on port 465. MAIL_FROM defaults to the SMTP user. Email stays off until a host, user, and password are set.

Lost-operator failsafe

When the vehicle is armed and no operator has been connected for the window set in Integrations, the station commands the recovery itself: return to launch for a copter, rover, or sub, and the synthesized autoland approach for a fixed wing, picked clear of airspace, obstacles, buildings, and terrain where map data allows. The window is in minutes and 0 turns the failsafe off; it starts when the last connected page closes and resets the moment one reconnects. The manual-control streams carry their own deadman separate from this window and release the craft to the flight controller's failsafe within seconds of the operator going quiet.

MAVLink signing

MAVLink 2 signing authenticates the vehicle link with a shared passphrase, set in Integrations (or MAVLINK_SIGNING_KEY). The passphrase is hashed to a 32-byte key with SHA-256, the same derivation QGroundControl and Mission Planner use, so the identical passphrase configured on the autopilot authenticates the link. Every outbound message is signed with a strictly increasing timestamp, and inbound signed messages are verified: one that fails is dropped and never counts as link traffic, so a wrong key surfaces as a down link. Strict mode (a toggle in Integrations) additionally drops unsigned inbound messages, which enforces signing once the autopilot is configured for it.

Signing is authentication and integrity, not encryption. Telemetry still travels in cleartext, so pair it with a transport tunnel (VPN or TLS) for confidentiality. Set the same passphrase on the autopilot through its own MAVLink signing setup. This matters most when the link is reachable over the public internet, as it is on a public-IP cellular SIM (see Build).

AI PID tuning assistant

The vehicle parameters page can ask an OpenAI-compatible chat endpoint to review the PID gains. Configure the endpoint in Integrations (or AI_API_KEY, AI_BASE_URL, AI_MODEL): OpenAI, a LiteLLM proxy, or a local Ollama all speak the same wire format. The AI PID Tune button sends the current rate and attitude gains plus the latest vibration and attitude telemetry to /api/ai/pid-tune, which returns gain suggestions that apply one at a time or all at once. Without a key the endpoint returns a clear message and makes no request.

Clone this wiki locally