FTP/FTPS local servers: the active-mode port range is never saved nor pushed
Context
The active-mode port range of FTP and FTPS local servers is broken across the layers:
-
WebUI:
-local-server-panel-ftp.hbsand-local-server-panel-ftps.hbsbind the range tolocalServer.additionalData.activeMinPort/activeMaxPort.additionalDatais not an attribute of the local-server model: the values are never sent. The fields are shown when the partner is external and client, and the mode isautooractive. -
Validation:
pkg/model/m_interface.gorequiresactiveMinPortandactiveMaxPortinconfigfor a server interface inactivemode (FTP: any partner; FTPS: external partners), with aFIXME: Active port range must be carried by the client configuration. Since the WebUI never sends them, saving such a server from the WebUI should fail on these two mandatory fields (read from the code, not reproduced). The error names (activeMinPort) do not match the field names (ftp-portMin-N), so the WebUI cannot show them next to a field. -
Push:
gateway.FTPActiveMinPort/FTPActiveMaxPort(activeModeMinPort/activeModeMaxPort) are declared inpkg/integrations/gateway/config.gobut never used: the range is never pushed to the Gateway.
Task
- Decide where the active range belongs (server interface as validated today,
or client configuration as the FIXME says) and in which modes (
activeonly, orautotoo). - WebUI: bind the fields to
config.activeMinPort/config.activeMaxPort, shown under the same condition as the validation, with field names matching the API error keys. - Push: send the range to the Gateway under
activeModeMinPort/activeModeMaxPort. - Check the rows stored by earlier versions (the range was never saved through the WebUI).
Acceptance criteria
- An FTP/FTPS server in active mode can be saved from the WebUI with its port range, and a missing range is reported on the field.
- The range is present in the configuration pushed to the Gateway.
- Covered by backend and frontend tests.