Skip to content

feat(installer): Prompt for the Device Agent port in interactive mode - #739

Open
ppawlowski wants to merge 8 commits into
mainfrom
feat-installer-interactive-port
Open

ppawlowski wants to merge 8 commits into
mainfrom
feat-installer-interactive-port

Conversation

@ppawlowski

@ppawlowski ppawlowski commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request adds a port question to the installer's interactive mode, so a Remote Instance integrator can choose which TCP port the Device Agent binds to without having to know the --port flag up front. The installer asks for the
port straight after the permission check and re-asks until the answer is a free port in the 1025-65535 range. Passing --port still works unchanged and skips the question, reporting only which port will be used.

--port is now a nullable flag value, so an explicit --port 1880 stays distinguishable from an omitted flag, and range validation moved into the flag type - also lets pflag reject a bad value itself and corrects the help
text, previously advertised as 1-65535 while the guard rejected anything below 1025.

When the chosen port is not the default, the installation directory offered by the next question carries it (/opt/flowfuse-device-1881), so agents on different ports are not proposed the same location. It remains a suggestion and any absolute path can be typed instead. Scripted installations driven by --otc stay non-interactive throughout and keep the plain default directory.

Additionally, this pull request:

  • fixes free port check method - now it checks all available network interfaces instead of loopback only
  • adjusts port validation approach
  • reorganizes the utils package

Related Issue(s)

Closes #730

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@Steve-Mcl Steve-Mcl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Local testing good on windows,

Image

@Steve-Mcl

Copy link
Copy Markdown
Contributor

one v minor niggle - the line "The FlowFuse Device Agent will use port 1888." is output after user choice, but there is no equivalent "Install Dir: C:\opt\flowfuse-device-1888" output after the directory choice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installer: Prompt for a port number in the interactive mode

2 participants