Migrating Controller from port 8087 to 80 so that it is more discoverable. Reformatting Controller dashboard to make header at the top. Reformatting navigation bar to handle the new links which prevented Admin from being visible in some screens.

This commit is contained in:
Roland 2026-04-07 20:01:49 -06:00 • committed by lrnselfreliance
parent c316a178f9
commit e0324ce0fc
33 changed files with 302 additions and 407 deletions

View file

@ -20,17 +20,17 @@ Browse to https://localhost:8443
## Services
| Service | Port(s) | Description |
|----------------|--------------------------------------|-----------------------------|
| **web** | 8080 (HTTP), 8443 (HTTPS), 8084-8086 | Caddy reverse proxy |
| **api** | 8081 | Sanic API server |
| **app** | (via web) | React frontend |
| **controller** | 8087 | System management (FastAPI) |
| **db** | 5432 | PostgreSQL 12 |
| **archive** | 8083 | SingleFile/Readability |
| **zim** | (via web:8085) | Kiwix |
| **help** | (via web:8086) | MkDocs documentation |
| **map** | (via web:8084) | OpenStreetMap tile server |
| Service | Port(s) | Description |
|----------------|--------------------------|-----------------------------|
| **web** | 8443 (HTTPS), 8084-8086 | Caddy reverse proxy |
| **api** | 8081 | Sanic API server |
| **app** | (via web) | React frontend |
| **controller** | 8080 | System management (FastAPI) |
| **db** | 5432 | PostgreSQL 12 |
| **archive** | 8083 | SingleFile/Readability |
| **zim** | (via web:8085) | Kiwix |
| **help** | (via web:8086) | MkDocs documentation |
| **map** | (via web:8084) | OpenStreetMap tile server |
## TLS Certificates
@ -43,12 +43,13 @@ to pick up hostname and IP changes.
1. On first start, the `web` container generates a root CA at `/opt/media/config/ssl/`.
2. A leaf cert signed by the root CA is created at `/etc/ssl/caddy/` inside the container.
3. Caddy serves HTTPS on ports 443, 8084, 8085, and 8086 using the leaf cert.
4. Port 80 serves an HTTP landing page where users can download the root CA.
4. The Controller serves on port 80 with a certificate trust banner when needed.
### Trusting the certificate
1. Browse to `http://<host-ip>:8080` to see the landing page with download link and
platform-specific trust instructions.
1. Browse to `http://<host-ip>` to see the Controller. If the HTTPS certificate is not
yet trusted, a banner will appear with the download link and platform-specific
trust instructions.
2. Download and install the root CA on your device.
3. All HTTPS ports will work without browser warnings.
@ -94,7 +95,7 @@ docker compose up -d --build web
```
All devices will need to re-download and re-trust the new CA from
`http://<host-ip>:8080/ca.crt`.
`http://<host-ip>/ca.crt`.
## Volumes
@ -116,7 +117,6 @@ docker volume create --name=openstreetmap-rendered-tiles
| `MEDIA_DIRECTORY` | `/opt/media` | Media directory inside containers |
| `EXTRA_SANS` | (empty) | Additional SANs for the TLS leaf certificate |
| `WEB_HOST` | `0.0.0.0` | Host bind address for the web service |
| `WEB_PORT` | `8080` | HTTP port |
| `WEB_HTTPS_PORT` | `8443` | HTTPS port |
| `REACT_APP_API` | `0.0.0.0:8081` | API bind address |
| `UID` | `1000` | User ID for api/app containers |

View file

@ -23,8 +23,8 @@ ENV DOCKERIZED=true
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8087/api/health || exit 1
CMD curl -f http://localhost:80/api/health || exit 1
EXPOSE 8087
EXPOSE 80
CMD ["uvicorn", "controller.main:app", "--host", "0.0.0.0", "--port", "8087"]
CMD ["python", "-m", "controller.serve"]

@ -1 +1 @@
Subproject commit 5e9a4306585ea8e8099f7efd8411def97230a49f
Subproject commit 2c75fbb559f6c52aa294fe185e08358d55eab998

View file

@ -5,23 +5,6 @@
auto_https disable_redirects
}
:80 {
handle / {
root * /var/www
rewrite * /landing.html
file_server
}
handle /ca.crt {
root * /opt/media/config/ssl
header Content-Type "application/x-x509-ca-cert"
header Content-Disposition "attachment; filename=\"wrolpi-ca.crt\""
file_server
}
handle {
redir https://{host}:8443{uri} permanent
}
}
:443 {
tls /etc/ssl/caddy/cert.crt /etc/ssl/caddy/cert.key
@ -55,7 +38,7 @@
# Controller - system management API and UI.
handle_path /controller/* {
reverse_proxy controller:8087
reverse_proxy controller:80
}
handle /controller {
redir * /controller/ 301
@ -115,7 +98,7 @@
}
handle_errors 502 503 504 {
redir * "http://{host}:8087/?fallback=true" 302
redir * "http://{host}:8080/?fallback=true" 302
}
}

View file

@ -6,7 +6,6 @@ RUN apk add --no-cache openssl bash
COPY docker/web/Caddyfile /etc/caddy/Caddyfile
COPY docker/web/entrypoint.sh /entrypoint.sh
COPY scripts/generate_certificates.sh /opt/wrolpi/scripts/generate_certificates.sh
COPY etc/raspberrypios/landing.html /var/www/landing.html
RUN chmod +x /entrypoint.sh /opt/wrolpi/scripts/generate_certificates.sh