Skip to content

Fix: VPN Providers Mishandled in Unattended Installation - #2026

Merged
billz merged 8 commits into
RaspAP:masterfrom
climberomes:bugfix/VPN-Providers-NonInteractiveMode
Dec 23, 2025
Merged

Fix: VPN Providers Mishandled in Unattended Installation#2026
billz merged 8 commits into
RaspAP:masterfrom
climberomes:bugfix/VPN-Providers-NonInteractiveMode

Conversation

@climberomes

@climberomes climberomes commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

Bug Overview

Fixes #2027


Summary

When using the RaspAP CLI in non-interactive mode (--yes), the --providers option is ignored for VPN providers with IDs > 1.

Example: 3-NordVPN is not installed automatically as expected.

Observed behavior:

  • image

Minor UI Fix

Added echo -e for newlines to prevent overlapping CLI output:

Before:

  • image

After:

  • image

Fix

  • Add a dedicated else if block for VPN providers using pv_option.
  • Iterate dynamically over the known VPN provider list to ensure scalability.
  • Maintain the existing structure to avoid breaking other features.
  • Include echo -e to prevent overlapping lines in the CLI output.

Verification

Tested unattended installation for NordVPN.

  • image
  • image

Verification Part2

Test No Flag

  • image

Test --provider 0

  • image

Test --provider 1

  • image

Test --provider 3

  • image

Test --provider 5

  • image

@climberomes

climberomes commented Dec 12, 2025

Copy link
Copy Markdown
Contributor Author

Opened this PR before reading the contributions/raising an issue. Sorry for that!

@climberomes climberomes changed the title Minor Bug Fix: VPN Providers Mishandled in Unattended Installation Fix: VPN Providers Mishandled in Unattended Installation Dec 12, 2025
@billz

billz commented Dec 12, 2025

Copy link
Copy Markdown
Member

@climberomes no worries! PRs are always welcome with or without issues :)

@billz

billz commented Dec 13, 2025

Copy link
Copy Markdown
Member

Nice work. This resolves the issue and correctly sets provider ID during unattended installs. One thing I observed is that when running with --yes but without --provider, the installer shows an error instead of skipping:

[✗ error] Invalid VPN provider ID 0 - (Skipped)

Other features (OpenVPN, WireGuard) report 'skipped' when set to 0. Ideally, VPN provider should behave the same way. This could be done by checking for 0 first:

elif [ "$opt" == "pv_option" ]; then
      local value=${!opt}
      # Skip silently if not requested (value is 0)
      if [ "$value" == 0 ]; then
          echo "(Skipped)"
      else
          # Iterate over the VPN provider options
          ...

This isn't a critical error (the installer is able to continue) but would be cleaner and consistent with other features.

@climberomes

climberomes commented Dec 13, 2025

Copy link
Copy Markdown
Contributor Author

Nice work. This resolves the issue and correctly sets provider ID during unattended installs. One thing I observed is that when running with --yes but without --provider, the installer shows an error instead of skipping:

[✗ error] Invalid VPN provider ID 0 - (Skipped)

Other features (OpenVPN, WireGuard) report 'skipped' when set to 0. Ideally, VPN provider should behave the same way. This could be done by checking for 0 first:

elif [ "$opt" == "pv_option" ]; then
      local value=${!opt}
      # Skip silently if not requested (value is 0)
      if [ "$value" == 0 ]; then
          echo "(Skipped)"
      else
          # Iterate over the VPN provider options
          ...

This isn't a critical error (the installer is able to continue) but would be cleaner and consistent with other features.

Great call out. Correct it should skip on 0, not error. Darn edge cases! Commit is in and I can test this once I get a chance.

@climberomes

climberomes commented Dec 21, 2025

Copy link
Copy Markdown
Contributor Author

Got a chance to test the changes after the PR review.

In my recent test through a Docker build, i observed that somehow when --provider is not included as an input flag, pv_option value is still unset (null) and not 0 even with the initialization of pv_option=0. Weirdly enough this was not an issue when --provider is passed in... Given the comment in #2026 (comment) it seems like this portion should work. Maybe this is just an environment issue on my end, however this is an easy thing to account for.

Commit 1d2a223 updates this in the event this is a real issue and not an environment issue.

Test verification was performed. Linked in the description. Can provide logs if needed. but pictures should avoid downloading files.

Comment thread installers/common.sh Outdated
$function
fi
elif [ "$opt" == "pv_option" ]; then
# pv_option has multiple options and is not a normal binary flag [enabled(1)/disabled(0)].

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would you mind removing this and the additional comments below? They appear to be AI generated. Thanks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@billz

billz commented Dec 23, 2025

Copy link
Copy Markdown
Member

good to merge. @climberomes many thanks for the PR!

@billz
billz merged commit e7d18d3 into RaspAP:master Dec 23, 2025
3 checks passed
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.

[Bug]: VPN Providers Mishandled in Unattended Installation

2 participants