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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/3076
Author: @rinseaid
Created: 5/14/2026
Status: ❌ Closed
Base:
dev← Head:fix/v1-target-fallback-http-mode📝 Commits (1)
4270519Fix 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 whensemver.satisfies()returns false for the Newt's reported versionsemver.satisfies()returns false for any non-semver string (e.g., custom build tags like"dev","patched","nightly")convertSubnetProxyTargetsV2ToV1()stripshttpTargetsand only preservesrewriteTo, which is empty/undefined for HTTP-mode resourcesThe fix adds a
semver.valid()guard so the V1 fallback only triggers for versions that are valid semver AND below1.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()andupdateTargets()are updated.Test plan
"dev") and verify HTTP-mode resources are reachable1.10.2still receives V1 targets (backwards compat preserved)1.10.3+ receives V2 targets (existing behavior unchanged)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.