🚧 Update certificate management
This commit is contained in:
@@ -12,6 +12,7 @@ from dataclasses import dataclass, field
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.config import get_settings
|
||||
from app.models import BrokerSettings, Certificate, ListenerConfig
|
||||
|
||||
_BOOL = {True: "true", False: "false"}
|
||||
@@ -121,6 +122,20 @@ def generate_config(db: Session) -> GenerationResult:
|
||||
lines.append("")
|
||||
|
||||
if enabled:
|
||||
# Compose publishes only a fixed set of broker ports to the host
|
||||
# (spec section 5). Listeners on other ports are reachable ONLY
|
||||
# inside the Docker network — surface that before an operator
|
||||
# wonders why no external device can connect.
|
||||
published = get_settings().published_port_set
|
||||
for listener in enabled:
|
||||
if listener.port not in published:
|
||||
warnings.append(
|
||||
f"listener '{listener.name}' (port {listener.port}) is not "
|
||||
"published to the host by compose.yaml — it is reachable "
|
||||
"only inside the Docker network. Map the port in "
|
||||
"compose.yaml (or use a published port like 8883) to "
|
||||
"make it reachable for external devices."
|
||||
)
|
||||
lines.append("# --- Listeners ---")
|
||||
for listener in enabled:
|
||||
block = _listener_block(listener, db, warnings)
|
||||
|
||||
Reference in New Issue
Block a user