Skip to content

feat: migrate to sing-box 1.14.2 - #9206

Open
garmr-ulfr wants to merge 4 commits into
mainfrom
sing-box-1.14
Open

garmr-ulfr wants to merge 4 commits into
mainfrom
sing-box-1.14

Conversation

@garmr-ulfr

@garmr-ulfr garmr-ulfr commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Moves the client to sing-box 1.14.2. It pins:

All three pins need to move to tagged or released versions once those PRs merge.

Dependencies

  • Drops the getlantern/sing-tun replace. Its only change, the LinkEndpointFilter.Attach(nil) fix, is upstream in the sing-tun that 1.14 uses (be4ce8d320a5). The arm32 validation doc notes this.
  • gvisor is forced to v0.0.0-20260727.0-sing-box-mod.1, the version 1.14.2 builds against.
  • In stock 1.14, experimental/libbox/native_shell_session.go links the whole sagernet/tailscale client into any build with with_gvisor: about 209 packages in the iOS extension and the Android AAR, against none on main. sing-box-minimal#75 builds that file only with with_tailscale, and with it go list -deps for ./lantern-core/mobile on ios and android shows no sagernet/tailscale packages.

Platform interface

libbox's PlatformInterface drops SystemCertificates and adds methods for the neighbor resolver, the platform shell and SSH used by Tailscale, the bridge outbound, notification cancelling and RegisterMyInterface.

  • Android, iOS and macOS implement the new methods:
    • RegisterMyInterface runs on every openTun, so it's a no-op that never throws.
    • CancelNotification removes what SendNotification posted.
    • The rest report "not supported". sing-box only calls them for features this app doesn't configure.
  • Android removes the systemCertificates override. On Android, sing-box now reads the system root store itself from AndroidCAStore.
  • The unused lantern-core/stub gets the same methods.

TUN DNS

TunOptions.GetDNSServerAddress now returns a list, and GetDNSMode is new. openTun on all three platforms now:

  • adds every DNS server address, so the IPv6 one too when the TUN has an IPv6 address;
  • sets no DNS servers when the DNS mode is disabled.

This matches upstream's own clients.

Testing

  • go build, go vet and go test -race pass with the standard tags. TestBuildAttachmentReadsHEICData fails the same way on main on my machine; it depends on the local MIME database.
  • No Android SDK or Xcode was available here, so the Kotlin and Swift changes were checked against bindings generated with gobind for 1.14: every override's signature matches. CI is the first real compile.

Summary by CodeRabbit

  • Bug Fixes
    • VPN DNS settings now respect whether DNS is enabled and include all configured DNS servers. Android applies DNS settings only when automatic routing is enabled; iOS and macOS skip DNS settings when DNS is disabled or no servers are configured.
    • Notifications can now be canceled by notification type, dismissing the matching notification.
    • Improved DNS handling across Android, iOS, and macOS for more consistent VPN connection behavior.

- bump radiance, and sing-box to the getlantern/sing-box-minimal fork
- drop the sing-tun fork; 1.14's sing-tun has the gVisor fix it carried
- implement the 1.14 platform interface methods on Android, iOS and macOS
- set every TUN DNS server address, and none when DNS mode is disabled
Copilot AI balanced review requested due to automatic review settings October 23, 2026 01:24
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 19523af6-0c6f-40fb-81be-d80c1abc4da2
Commits

Reviewing files that changed from the base of the PR and between ef72816 and 9154da4.

Files ignored due to path filters: 1
  • go.sum is excluded by !**/*.sum
Files selected for processing: 1
  • go.mod

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

This change updates sing-box dependencies and platform callbacks across Android, iOS, macOS, and Go stubs. It adds notification cancellation, removes system-certificate callbacks, and changes TUN DNS setup to handle multiple server addresses and disabled DNS mode.

Changes: Sing-box platform integration

Layer / File(s) Summary
Update sing-box dependencies
go.mod, docs/android-arm32-validation.md
Updates sing-box and related dependency versions, removes the sing-tun replacement, and records that sing-box 1.14 includes the teardown fix upstream.
Implement platform callbacks
android/app/src/main/kotlin/org/getlantern/lantern/{notification/NotificationManager.kt,service/*}, ios/Tunnel/SingBox/ExtensionPlatformInterface.swift, macos/PacketTunnel/SingBox/ExtensionPlatformInterface.swift, lantern-core/stub/stub_interface.go, lantern-core/utils/common_test.go
Adds notification cancellation and platform callback implementations. Unsupported operations return errors or throw exceptions; capability checks return false, and hostname queries return empty strings. Removes system-certificate callbacks and updates the test listener.
Configure TUN DNS servers
android/app/src/main/kotlin/org/getlantern/lantern/service/LanternVpnService.kt, ios/Tunnel/SingBox/ExtensionPlatformInterface.swift, macos/PacketTunnel/SingBox/ExtensionPlatformInterface.swift
TUN setup now uses all available DNS server addresses and omits DNS settings when DNS is disabled or no addresses are available.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Possibly related issues

  • getlantern/engineering#3971: The PR changes Android VPN notification methods, but does not show the component-targeted PendingIntent fix described by the issue.
  • getlantern/grants#1266: The PR changes DNS handling to use all returned addresses and none when DNS is disabled, but does not establish completion of the full remote-configuration activity.

Possibly related PRs

  • getlantern/lantern#8861: The no-VPN service implements PlatformInterfaceWrapper, which this PR updates with callbacks required by sing-box 1.14.2.

Suggested reviewers: jigar-f, myleshorton

Merge Risk: Minimal · up to 9154d

No actionable merge-blocking issue is established by the supplied evidence. Normal checks, including native-platform compilation, should complete before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: migrating the project to sing-box 1.14.2.
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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.

🔵 Needs a closer look

The cross-platform VPN upgrade needs native compilation and device-level DNS, disconnect, and reconnect validation before human approval.

No open issues 🎉

What changed in this PR

Migrates Lantern’s VPN core to sing-box 1.14.2 and adapts the Android, iOS, and macOS integrations to its updated platform interface.

Changes:

  • Updates Go dependency pins and checksums, aligns gVisor, and removes the superseded sing-tun backport.
  • Adds platform callbacks for notification cancellation and unsupported optional features.
  • Updates TUN DNS setup to accept multiple servers and respect disabled DNS mode.
File Description
macos/​PacketTunnel/​SingBox/​ExtensionPlatformInterface.swift Adapts macOS platform callbacks and DNS setup.
lantern-core/​utils/​common_test.go Updates the test listener for the expanded interface.
lantern-core/​stub/​stub_interface.go Aligns the Go stub with the new platform interface.
ios/​Tunnel/​SingBox/​ExtensionPlatformInterface.swift Adapts iOS platform callbacks and DNS setup.
go.sum Updates dependency checksums.
go.mod Pins the upgraded networking dependency stack.
docs/​android-arm32-validation.md Documents why the sing-tun backport is no longer pinned.
android/​app/​src/​main/​kotlin/​org/​getlantern/​lantern/​service/​PlatformInterfaceWrapper.kt Implements callbacks for unsupported optional features.
android/​app/​src/​main/​kotlin/​org/​getlantern/​lantern/​service/​LanternVpnService.kt Updates DNS handling and delegates notification cancellation.
android/​app/​src/​main/​kotlin/​org/​getlantern/​lantern/​notification/​NotificationManager.kt Adds notification cancellation by type ID.

Review effort: Balanced

@jigar-f

jigar-f commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

@garmr-ulfr, let's take our time with this one. It seems like a few changes. If ready, we should run nightly and see if it's working without any issue.

@garmr-ulfr

Copy link
Copy Markdown
Contributor Author

@garmr-ulfr, let's take our time with this one. It seems like a few changes. If ready, we should run nightly and see if it's working without any issue.

@jigar-f, you have no idea! 😄 v1.14.2 has so many changes, updating to it ended up touching 5 repos, including lantern-cloud. Radiance required a design change, which required a small refactor and updates to pretty much every file in the VPN package. We'll definitely need to do plenty of testing, especially on iOS, to make sure the extension doesn't use too much memory.

Copilot AI 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.

🔵 Needs a closer look

The cross-platform networking migration needs successful native builds and device-level DNS and reconnect validation before human approval.

No open issues 🎉

Review effort: Balanced

Copilot AI 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.

🔵 Needs a closer look

The networking-core migration needs successful native builds and cross-platform VPN connection/reconnect validation before human sign-off.

No open issues 🎉

Review effort: Balanced

@jigar-f

jigar-f commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

@garmr-ulfr, let's take our time with this one. It seems like a few changes. If ready, we should run nightly and see if it's working without any issue.

@jigar-f, you have no idea! 😄 v1.14.2 has so many changes, updating to it ended up touching 5 repos, including lantern-cloud. Radiance required a design change, which required a small refactor and updates to pretty much every file in the VPN package. We'll definitely need to do plenty of testing, especially on iOS, to make sure the extension doesn't use too much memory.

Damn, that's a lot. Thanks for doing it. Hope we get a lot out of it.

Copilot AI 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.

🔵 Needs a closer look

The cross-platform networking migration needs successful Android and Apple builds plus VPN connection and reconnect validation before final human approval.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
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.

3 participants