diff --git a/README.md b/README.md index eb7fcc7..86cce0d 100644 --- a/README.md +++ b/README.md @@ -319,7 +319,7 @@ __tl;dr__: Always make sure the environment variables for the ports match any ch If you want to change the ports of your Omada Controller to something besides the defaults, there is some unexpected behavior that the controller exhibits. There are two sets of ports: one for HTTP/HTTPS for the controller itself and another for HTTP/HTTPS for the captive portal, typically used for authentication to a guest network. The controller's set of ports, which are set by the `MANAGE_*_PORT` environment variables, can only be modified using the environment variables on the first time the controller is started. If persistent data exists, changing the controller's ports via environment variables will have no effect on the controller itself and can only be modified through the web UI. On the other hand, the portal ports will always be set to whatever has been set in the environment variables, which are set by the `PORTAL_*_PORT` environment variables. -If you absolutely need to have the ports re-read from the environment variables, you can add `web.config.override=true` to the `omada.properties` file inside the container and they'll be read on next startup. +If you absolutely need to have the ports re-read from the environment variables, you can set the `WEB_CONFIG_OVERRIDE` environment variable to `true` and they'll be re-read on next startup. ### Running Rootless @@ -389,6 +389,7 @@ The Helm charts are published to [mbentley/omada-controller-helm](https://hub.do | `TLS_1_11_ENABLED` | `false` | `true`, `false` | Re-enables TLS 1.0 & 1.1 if set to `true` | >= `4.1` | | `TZ` | `Etc/UTC` | _\_ | See [Time Zones](#time-zones) for more detail | >= `3.2` | | `UPGRADE_HTTPS_PORT` | `8043` | `1024`-`65535` | Dedicated HTTPS port for upgrades, separate from the main Controller port | >= `6.1` | +| `WEB_CONFIG_OVERRIDE` | `false` | `true`, `false` | Forces the controller to re-read port configuration from `omada.properties` on startup; see [Using non-default ports](#using-non-default-ports) | >= `5.x` | Documentation on the ports used by the controller can be found in the [TP-Link FAQ](https://support.omadanetworks.com/us/document/13090/). diff --git a/docker-compose.yml b/docker-compose.yml index 4ec645f..f4d6496 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,6 +26,7 @@ services: - PORT_TRANSFER_V2=29815 - PORT_RTTY=29816 - PORT_DEVICE_MONITOR=29817 + - WEB_CONFIG_OVERRIDE=false - SHOW_SERVER_LOGS=true - SHOW_MONGODB_LOGS=false - SSL_CERT_NAME=tls.crt diff --git a/docker-compose_bridge.yml b/docker-compose_bridge.yml index 2864c5d..1c196c6 100644 --- a/docker-compose_bridge.yml +++ b/docker-compose_bridge.yml @@ -34,6 +34,7 @@ services: - PORT_TRANSFER_V2=29815 - PORT_RTTY=29816 - PORT_DEVICE_MONITOR=29817 + - WEB_CONFIG_OVERRIDE=false - SHOW_SERVER_LOGS=true - SHOW_MONGODB_LOGS=false - SSL_CERT_NAME=tls.crt diff --git a/entrypoint-unified.sh b/entrypoint-unified.sh index 3f00628..46f09aa 100755 --- a/entrypoint-unified.sh +++ b/entrypoint-unified.sh @@ -34,6 +34,9 @@ setup_environment() { PORT_DEVICE_MONITOR="${PORT_DEVICE_MONITOR:-29817}" UPGRADE_HTTPS_PORT="${UPGRADE_HTTPS_PORT:-8043}" + # WEB CONFIG OVERRIDE + WEB_CONFIG_OVERRIDE="${WEB_CONFIG_OVERRIDE:-false}" + # EXTERNAL MONGODB MONGO_EXTERNAL="${MONGO_EXTERNAL:-false}" EAP_MONGOD_URI="${EAP_MONGOD_URI:-mongodb://127.0.0.1:27217/omada}" @@ -126,9 +129,9 @@ update_port_configuration() { done } -update_mongodb_properties() { +update_general_properties() { # update stored property values when different of environment defined values (works for any value) - for ELEM in MONGO_EXTERNAL EAP_MONGOD_URI + for ELEM in WEB_CONFIG_OVERRIDE MONGO_EXTERNAL EAP_MONGOD_URI do # convert element to key name KEY="$(echo "${ELEM}" | tr '[:upper:]' '[:lower:]' | tr '_' '.')" @@ -660,7 +663,7 @@ common_setup_and_validation() { setup_directories print_timezone_info update_port_configuration - update_mongodb_properties + update_general_properties fix_permissions import_ssl_certificate enable_tls_1_11 diff --git a/external_mongodb/kubernetes/omada-controller/base/configmap-env.yaml b/external_mongodb/kubernetes/omada-controller/base/configmap-env.yaml index d66148f..dfd0d71 100644 --- a/external_mongodb/kubernetes/omada-controller/base/configmap-env.yaml +++ b/external_mongodb/kubernetes/omada-controller/base/configmap-env.yaml @@ -44,3 +44,5 @@ data: PORT_RTTY: "29816" PORT_DEVICE_MONITOR: "29817" + + WEB_CONFIG_OVERRIDE: "false" diff --git a/helm/omada-controller-helm/Chart.yaml b/helm/omada-controller-helm/Chart.yaml index 0adef4a..dd9ed58 100644 --- a/helm/omada-controller-helm/Chart.yaml +++ b/helm/omada-controller-helm/Chart.yaml @@ -3,5 +3,5 @@ name: omada-controller-helm description: Helm chart for deploying the TP-Link Omada SDN Controller icon: https://static.tp-link.com/assets/images/icon/favicon-omada.ico type: application -version: 1.1.4 +version: 1.1.5 appVersion: "6.1.0.19" diff --git a/helm/omada-controller-helm/README.md b/helm/omada-controller-helm/README.md index 7470171..c92f8b2 100644 --- a/helm/omada-controller-helm/README.md +++ b/helm/omada-controller-helm/README.md @@ -14,6 +14,7 @@ The Helm chart releases do not correspond to the controller version so below is | Controller Version | Chart Version | Change Notes | | ------------------ | ------------- | :------------ | +| `6.1.0.19` | `1.1.5` | Add `webConfigOverride` option to force re-read of port configuration | | `6.1.0.19` | `1.1.4` | Improve secret handling and external MongoDB support | | `6.1.0.19` | `1.1.3` | Adds the ability to configure an initcontainer | | `6.1.0.19` | `1.1.2` | Fix #721; duplicate port in values.yaml | @@ -90,6 +91,7 @@ The following table lists the configurable parameters of the Omada Controller ch | `config.ports.transferV2` | Device transfer port (v2) | `29815` | | `config.ports.rtty` | RTTY connection port | `29816` | | `config.ports.deviceMonitor` | Device monitoring port (Omada 6+) | `29817` | +| `config.webConfigOverride` | Force re-read of port configuration from properties on startup | `false` | | `config.rootless` | Run controller in rootless mode | `true` | | `config.showMongoDBLogs` | Display MongoDB logs (auto-disabled with external MongoDB) | `false` | | `config.showServerLogs` | Display server logs in container output | `true` | @@ -301,7 +303,7 @@ When using a LoadBalancer service, ensure your load balancer supports both TCP a ### To a newer chart version ```bash -helm upgrade omada-controller oci://registry-1.docker.io/mbentley/omada-controller-helm --version 1.1.4 +helm upgrade omada-controller oci://registry-1.docker.io/mbentley/omada-controller-helm --version 1.1.5 ``` ### Upgrading the Application Version diff --git a/helm/omada-controller-helm/templates/statefulset.yaml b/helm/omada-controller-helm/templates/statefulset.yaml index 2ce14fd..63f46c2 100644 --- a/helm/omada-controller-helm/templates/statefulset.yaml +++ b/helm/omada-controller-helm/templates/statefulset.yaml @@ -80,6 +80,8 @@ spec: value: {{ .Values.config.ports.rtty | quote }} - name: PORT_DEVICE_MONITOR value: {{ .Values.config.ports.deviceMonitor | quote }} + - name: WEB_CONFIG_OVERRIDE + value: {{ .Values.config.webConfigOverride | quote }} - name: ROOTLESS value: {{ .Values.config.rootless | quote }} - name: SHOW_SERVER_LOGS diff --git a/helm/omada-controller-helm/values.yaml b/helm/omada-controller-helm/values.yaml index 1752399..821a806 100644 --- a/helm/omada-controller-helm/values.yaml +++ b/helm/omada-controller-helm/values.yaml @@ -67,6 +67,10 @@ config: # Port used for device monitoring (New in Omada 6) deviceMonitor: 29817 + # Forces the controller to re-read port configuration from omada.properties on startup. + # Useful when management ports have been changed via the web UI and need to be overridden. + webConfigOverride: false + # Configures the Omada Controller to run in rootless mode. When this is enabled, the pod # and container security contexts are set to non-root user IDs. rootless: true diff --git a/install.sh b/install.sh index 62db82a..4f223e0 100755 --- a/install.sh +++ b/install.sh @@ -323,6 +323,9 @@ case "${OMADA_MAJOR_VER}" in { \ echo "" ;\ echo "" ;\ + echo "# web config override" ;\ + echo "web.config.override=false" ;\ + echo "" ;\ echo "# external mongodb" ;\ echo "mongo.external=false" ;\ echo "eap.mongod.uri=mongodb://127.0.0.1:27217/omada" ;\ diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 14bd730..2ea80fe 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -64,6 +64,8 @@ spec: value: "29816" - name: PORT_DEVICE_MONITOR value: "29817" + - name: WEB_CONFIG_OVERRIDE + value: "false" - name: SHOW_SERVER_LOGS value: "true" - name: SHOW_MONGODB_LOGS