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.hbs and -local-server-panel-ftps.hbs bind the range to localServer.additionalData.activeMinPort / activeMaxPort. additionalData is 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 is auto or active.
  • Validation: pkg/model/m_interface.go requires activeMinPort and activeMaxPort in config for a server interface in active mode (FTP: any partner; FTPS: external partners), with a FIXME: 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 in pkg/integrations/gateway/config.go but 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 (active only, or auto too).
  • 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.
Assignee Loading
Time tracking Loading