[PR #3076] [CLOSED] Fix V1 target fallback for non-semver Newt versions #18330

Closed
opened 2026-05-18 18:30:27 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/pangolin/pull/3076
Author: @rinseaid
Created: 5/14/2026
Status: Closed

Base: devHead: fix/v1-target-fallback-http-mode


📝 Commits (1)

  • 4270519 Fix V1 target fallback for non-semver Newt versions

📊 Changes

1 file changed (+27 additions, -25 deletions)

View changed files

📝 server/routers/client/targets.ts (+27 -25)

📄 Description

Summary

  • convertTargetsIfNessicary() falls back to V1 targets when semver.satisfies() returns false for the Newt's reported version
  • semver.satisfies() returns false for any non-semver string (e.g., custom build tags like "dev", "patched", "nightly")
  • V1 conversion via convertSubnetProxyTargetsV2ToV1() strips httpTargets and only preserves rewriteTo, which is empty/undefined for HTTP-mode resources
  • This makes all HTTP-mode private resources unreachable: Newt's TCP handler falls through to raw DNAT with an empty destination, causing connection timeouts

The fix adds a semver.valid() guard so the V1 fallback only triggers for versions that are valid semver AND below 1.10.3. Non-semver version strings are treated as V2-capable, since genuinely old Newt versions always reported real semver versions.

Both call sites in convertTargetsIfNessicary() and updateTargets() are updated.

Test plan

  • Deploy Newt with a non-semver version string (e.g., "dev") and verify HTTP-mode resources are reachable
  • Verify Newt with version 1.10.2 still receives V1 targets (backwards compat preserved)
  • Verify Newt with version 1.10.3+ receives V2 targets (existing behavior unchanged)
  • Verify Newt with no version set receives V2 targets (existing behavior unchanged)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fosrl/pangolin/pull/3076 **Author:** [@rinseaid](https://github.com/rinseaid) **Created:** 5/14/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/v1-target-fallback-http-mode` --- ### 📝 Commits (1) - [`4270519`](https://github.com/fosrl/pangolin/commit/42705194fcba94168b6792ccdcf761fd8ecee03b) Fix V1 target fallback for non-semver Newt versions ### 📊 Changes **1 file changed** (+27 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `server/routers/client/targets.ts` (+27 -25) </details> ### 📄 Description ## Summary - `convertTargetsIfNessicary()` falls back to V1 targets when `semver.satisfies()` returns false for the Newt's reported version - `semver.satisfies()` returns false for **any non-semver string** (e.g., custom build tags like `"dev"`, `"patched"`, `"nightly"`) - V1 conversion via `convertSubnetProxyTargetsV2ToV1()` strips `httpTargets` and only preserves `rewriteTo`, which is empty/undefined for HTTP-mode resources - This makes all HTTP-mode private resources unreachable: Newt's TCP handler falls through to raw DNAT with an empty destination, causing connection timeouts The fix adds a `semver.valid()` guard so the V1 fallback only triggers for versions that are valid semver AND below `1.10.3`. Non-semver version strings are treated as V2-capable, since genuinely old Newt versions always reported real semver versions. Both call sites in `convertTargetsIfNessicary()` and `updateTargets()` are updated. ## Test plan - [ ] Deploy Newt with a non-semver version string (e.g., `"dev"`) and verify HTTP-mode resources are reachable - [ ] Verify Newt with version `1.10.2` still receives V1 targets (backwards compat preserved) - [ ] Verify Newt with version `1.10.3`+ receives V2 targets (existing behavior unchanged) - [ ] Verify Newt with no version set receives V2 targets (existing behavior unchanged) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-18 18:30:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#18330