2025-12-11 18:32:55 -07:00
|
|
|
"""
|
|
|
|
|
Code-defined default configuration for the Controller.
|
|
|
|
|
|
|
|
|
|
Controller starts with these defaults and loads overrides from
|
|
|
|
|
/media/wrolpi/config/controller.yaml after the drive is mounted.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
DEFAULT_CONFIG = {
|
2026-04-07 20:01:49 -06:00
|
|
|
"port": 80,
|
2025-12-11 18:32:55 -07:00
|
|
|
"media_directory": "/media/wrolpi",
|
2026-04-07 20:01:49 -06:00
|
|
|
"hide_cert_banner": False,
|
2025-12-11 18:32:55 -07:00
|
|
|
|
|
|
|
|
"drives": {
|
|
|
|
|
"supported_filesystems": ["ext4", "btrfs", "vfat", "exfat"],
|
|
|
|
|
"auto_mount": True,
|
|
|
|
|
"mounts": [], # Populated from controller.yaml after drive mount
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
"managed_services": [
|
|
|
|
|
# WROLPi services
|
|
|
|
|
{
|
|
|
|
|
"name": "wrolpi-controller",
|
|
|
|
|
"systemd_name": "wrolpi-controller",
|
2026-04-07 20:01:49 -06:00
|
|
|
"port": 80,
|
2026-04-09 15:03:16 -06:00
|
|
|
"viewable": True,
|
2025-12-11 18:32:55 -07:00
|
|
|
"use_https": False,
|
|
|
|
|
"description": "Controller API (FastAPI)",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "wrolpi-api",
|
|
|
|
|
"systemd_name": "wrolpi-api",
|
|
|
|
|
"port": 8081,
|
|
|
|
|
"viewable": True,
|
|
|
|
|
"use_https": False,
|
|
|
|
|
"description": "Python API (Sanic)",
|
|
|
|
|
},
|
2025-12-18 17:51:18 -07:00
|
|
|
{
|
|
|
|
|
"name": "wrolpi-api-dev",
|
|
|
|
|
"systemd_name": "wrolpi-api-dev",
|
|
|
|
|
"port": 8081,
|
|
|
|
|
"viewable": True,
|
|
|
|
|
"use_https": False,
|
|
|
|
|
"description": "Python API (Development)",
|
controller: group services into Core vs Optional & Maintenance
The Controller listed every wrolpi-* service in one flat table, which was
confusing for new users who couldn't tell always-on infrastructure from
one-off/dev/maintenance units.
Services are now split into two groups computed once in the backend and
exposed as `service.group`:
* Core Services - persistent services enabled at boot (api, app, caddy,
kiwix, ...), the normal running system.
* Optional & Maintenance - one-off/dev/maintenance tasks (bootstrap, repair,
upgrade, *-dev, discovered wrolpi-*), plus persistent
services the user has disabled at boot (e.g. Samba with
no shares configured).
Rule: core iff kind == "persistent" and enabled; otherwise optional. Group
membership only changes when the user toggles Boot, never on start/stop or
polling, so rows stay put. Within each group, failed/stopped services sort
first so problems stay visible.
Feature parity across all three render paths: the React ControllerPage, the
server-side Jinja template, and the client-side poll refresh. Docker
containers have no group field and fall back to a single ungrouped list.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 19:41:17 -06:00
|
|
|
"kind": "task",
|
2025-12-18 17:51:18 -07:00
|
|
|
"show_only_when_running": True,
|
|
|
|
|
},
|
2025-12-11 18:32:55 -07:00
|
|
|
{
|
|
|
|
|
"name": "wrolpi-app",
|
|
|
|
|
"systemd_name": "wrolpi-app",
|
|
|
|
|
"port": 3000,
|
|
|
|
|
"viewable": False,
|
|
|
|
|
"use_https": False,
|
|
|
|
|
"description": "React frontend",
|
|
|
|
|
},
|
2025-12-18 18:01:45 -07:00
|
|
|
{
|
|
|
|
|
"name": "wrolpi-app-dev",
|
|
|
|
|
"systemd_name": "wrolpi-app-dev",
|
|
|
|
|
"port": 3000,
|
|
|
|
|
"viewable": False,
|
|
|
|
|
"use_https": False,
|
|
|
|
|
"description": "React frontend (Development)",
|
controller: group services into Core vs Optional & Maintenance
The Controller listed every wrolpi-* service in one flat table, which was
confusing for new users who couldn't tell always-on infrastructure from
one-off/dev/maintenance units.
Services are now split into two groups computed once in the backend and
exposed as `service.group`:
* Core Services - persistent services enabled at boot (api, app, caddy,
kiwix, ...), the normal running system.
* Optional & Maintenance - one-off/dev/maintenance tasks (bootstrap, repair,
upgrade, *-dev, discovered wrolpi-*), plus persistent
services the user has disabled at boot (e.g. Samba with
no shares configured).
Rule: core iff kind == "persistent" and enabled; otherwise optional. Group
membership only changes when the user toggles Boot, never on start/stop or
polling, so rows stay put. Within each group, failed/stopped services sort
first so problems stay visible.
Feature parity across all three render paths: the React ControllerPage, the
server-side Jinja template, and the client-side poll refresh. Docker
containers have no group field and fall back to a single ungrouped list.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 19:41:17 -06:00
|
|
|
"kind": "task",
|
2025-12-18 18:01:45 -07:00
|
|
|
"show_only_when_running": True,
|
|
|
|
|
},
|
2025-12-11 18:32:55 -07:00
|
|
|
{
|
|
|
|
|
"name": "wrolpi-help",
|
|
|
|
|
"systemd_name": "wrolpi-help",
|
|
|
|
|
"port": 8086,
|
|
|
|
|
"viewable": True,
|
|
|
|
|
"use_https": True,
|
|
|
|
|
"description": "Help documentation",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "wrolpi-kiwix",
|
|
|
|
|
"systemd_name": "wrolpi-kiwix",
|
|
|
|
|
"port": 8085,
|
|
|
|
|
"viewable": True,
|
|
|
|
|
"use_https": True,
|
|
|
|
|
"description": "Kiwix/Zim server",
|
|
|
|
|
},
|
|
|
|
|
# System services
|
|
|
|
|
{
|
Replace nginx with Caddy for TLS termination and reverse proxying.
- Replace nginx with Caddy as the web server for both Docker and native
(RPi/Debian) deployments. Caddy handles HTTPS termination, reverse
proxying to all services (API, React app, Controller, Kiwix, Help, Map),
and serves the media/download file browsers.
- Generate a Root CA and signed leaf certificates for HTTPS. The Root CA
uses Name Constraints to restrict signing to local addresses only
(.local, localhost, and RFC 1918 private IP ranges), mitigating MITM
risk if the CA key is compromised.
- Add an HTTP landing page that guides users through one-time CA
certificate installation on iOS, Android, macOS, Windows, Linux, and
Firefox, with auto-redirect when the cert is already trusted.
- Add trailing-slash redirects for /controller, /docs, /media, and
/download so bare paths don't fall through to the React catch-all.
- Add a Root CA download link on the Settings page under Configs.
- Update help.sh diagnostics for IPv6 listener detection and HTTP/2
status codes.
- Remove all nginx config files and the https_proxy Docker container.
- Bump wrolpi-help submodule with certificate documentation.
2026-03-07 12:08:27 -07:00
|
|
|
"name": "caddy",
|
|
|
|
|
"systemd_name": "caddy",
|
2026-04-07 20:01:49 -06:00
|
|
|
"port": 443,
|
2025-12-11 18:32:55 -07:00
|
|
|
"viewable": True,
|
2026-04-07 20:01:49 -06:00
|
|
|
"use_https": True,
|
|
|
|
|
"description": "Web proxy (HTTPS)",
|
2025-12-11 18:32:55 -07:00
|
|
|
},
|
2026-03-28 16:28:47 -06:00
|
|
|
# Samba file sharing services
|
|
|
|
|
{
|
|
|
|
|
"name": "smbd",
|
|
|
|
|
"systemd_name": "smbd",
|
|
|
|
|
"port": 445,
|
|
|
|
|
"viewable": False,
|
|
|
|
|
"use_https": False,
|
|
|
|
|
"description": "Samba file sharing",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "nmbd",
|
|
|
|
|
"systemd_name": "nmbd",
|
|
|
|
|
"port": 137,
|
|
|
|
|
"viewable": False,
|
|
|
|
|
"use_https": False,
|
|
|
|
|
"description": "Samba NetBIOS name service",
|
|
|
|
|
},
|
2025-12-11 18:32:55 -07:00
|
|
|
# Upgrade service - only shown when running
|
|
|
|
|
{
|
|
|
|
|
"name": "wrolpi-upgrade",
|
|
|
|
|
"systemd_name": "wrolpi-upgrade",
|
|
|
|
|
"port": None,
|
|
|
|
|
"viewable": False,
|
|
|
|
|
"use_https": False,
|
|
|
|
|
"description": "WROLPi upgrade process",
|
controller: group services into Core vs Optional & Maintenance
The Controller listed every wrolpi-* service in one flat table, which was
confusing for new users who couldn't tell always-on infrastructure from
one-off/dev/maintenance units.
Services are now split into two groups computed once in the backend and
exposed as `service.group`:
* Core Services - persistent services enabled at boot (api, app, caddy,
kiwix, ...), the normal running system.
* Optional & Maintenance - one-off/dev/maintenance tasks (bootstrap, repair,
upgrade, *-dev, discovered wrolpi-*), plus persistent
services the user has disabled at boot (e.g. Samba with
no shares configured).
Rule: core iff kind == "persistent" and enabled; otherwise optional. Group
membership only changes when the user toggles Boot, never on start/stop or
polling, so rows stay put. Within each group, failed/stopped services sort
first so problems stay visible.
Feature parity across all three render paths: the React ControllerPage, the
server-side Jinja template, and the client-side poll refresh. Docker
containers have no group field and fall back to a single ungrouped list.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 19:41:17 -06:00
|
|
|
"kind": "task",
|
2025-12-11 18:32:55 -07:00
|
|
|
"show_only_when_running": True,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
"hotspot": {
|
|
|
|
|
"device": "wlan0",
|
|
|
|
|
"ssid": "WROLPi",
|
|
|
|
|
"password": "wrolpi hotspot",
|
2026-07-28 19:52:39 -06:00
|
|
|
"protocol": "wpa2", # wpa2 (wpa-psk) or wpa3 (sae); see get_device_hotspot_protocols
|
2025-12-11 18:32:55 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
"throttle": {
|
|
|
|
|
"default_governor": "ondemand",
|
|
|
|
|
},
|
2026-03-28 16:28:47 -06:00
|
|
|
|
|
|
|
|
"samba": {
|
|
|
|
|
"shares": [],
|
|
|
|
|
# Each share: {"name": str, "path": str, "read_only": bool, "comment": str}
|
|
|
|
|
},
|
2025-12-11 18:32:55 -07:00
|
|
|
}
|