Skip to content

Commit eb146ec

Browse files
authored
Merge branch 'main' into jay/releases
2 parents 7e5d046 + bd4049f commit eb146ec

File tree

6 files changed

+49
-32
lines changed

6 files changed

+49
-32
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
github.com/Microsoft/go-winio v0.6.2
2323
github.com/alecthomas/assert/v2 v2.3.0
2424
github.com/getlantern/lantern-server-provisioner v0.0.0-20251031121934-8ea031fccfa9
25-
github.com/getlantern/radiance v0.0.0-20260205161423-b16c3dd810bb
25+
github.com/getlantern/radiance v0.0.0-20260206172532-634227877790
2626
github.com/sagernet/sing-box v1.12.13
2727
golang.org/x/mobile v0.0.0-20250711185624-d5bb5ecc55c0
2828
golang.org/x/sys v0.40.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ github.com/getlantern/osversion v0.0.0-20240418205916-2e84a4a4e175 h1:JWH5BB2o0e
245245
github.com/getlantern/osversion v0.0.0-20240418205916-2e84a4a4e175/go.mod h1:h3S9LBmmzN/xM+lwYZHE4abzTtCTtidKtG+nxZcCZX0=
246246
github.com/getlantern/pluriconfig v0.0.0-20251126214241-8cc8bc561535 h1:rtDmW8YLAuT8r51ApR5z0d8/qjhHu3TW+divQ2C98Ac=
247247
github.com/getlantern/pluriconfig v0.0.0-20251126214241-8cc8bc561535/go.mod h1:WKJEdjMOD4IuTRYwjQHjT4bmqDl5J82RShMLxPAvi0Q=
248-
github.com/getlantern/radiance v0.0.0-20260205161423-b16c3dd810bb h1:vMDnMcCtlBp6z8xBq9luCntcqyaFGDCsozCrP52fSMI=
249-
github.com/getlantern/radiance v0.0.0-20260205161423-b16c3dd810bb/go.mod h1:/fmFw5h92yNfM2uNqNiBUnec81BadiVjnwJhNOQHpyE=
248+
github.com/getlantern/radiance v0.0.0-20260206172532-634227877790 h1:4oHVkHyEI6EULtJGWVQLB8vUtiUADBZlf1QBsTfjr74=
249+
github.com/getlantern/radiance v0.0.0-20260206172532-634227877790/go.mod h1:/fmFw5h92yNfM2uNqNiBUnec81BadiVjnwJhNOQHpyE=
250250
github.com/getlantern/sing v0.7.18-lantern h1:QKGgIUA3LwmKYP/7JlQTRkxj9jnP4cX2Q/B+nd8XEjo=
251251
github.com/getlantern/sing v0.7.18-lantern/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
252252
github.com/getlantern/sing-box-minimal v1.12.19-lantern h1:Tntq+Udsvyv6A/mjxfSoZ8NhvhXRSX6i/CICKGPFhAY=

lantern-core/mobile/mobile.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ func StopVPN() error {
174174
return nil
175175
}
176176

177+
func CloseIPC() error {
178+
return vpn_tunnel.CloseIPC()
179+
}
180+
177181
// ConnectToServer connects to a server using the provided location type and tag.
178182
// It works with private servers and lantern location servers.
179183
func ConnectToServer(locationType, tag string, platIfce utils.PlatformInterface, options *utils.Opts) error {

lantern-core/vpn_tunnel/vpn_tunnel.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ package vpn_tunnel
22

33
import (
44
"fmt"
5+
"sync/atomic"
56

67
"log/slog"
78

89
"github.com/getlantern/radiance/servers"
910
"github.com/getlantern/radiance/vpn"
11+
"github.com/getlantern/radiance/vpn/ipc"
1012
"github.com/getlantern/radiance/vpn/rvpn"
1113

1214
"github.com/getlantern/lantern/lantern-core/utils"
@@ -20,6 +22,8 @@ const (
2022
InternalTagLantern InternalTag = InternalTag(servers.SGLantern)
2123
)
2224

25+
var ipcServer atomic.Pointer[ipc.Server]
26+
2327
// StartVPN will start the VPN tunnel using the provided platform interface.
2428
// It passes the empty string so it will connect to best server available.
2529
func StartVPN(platform rvpn.PlatformInterface, opts *utils.Opts) error {
@@ -80,11 +84,23 @@ func GetSelectedServer() string {
8084
return status.SelectedServer
8185
}
8286

87+
func CloseIPC() error {
88+
if svr := ipcServer.Swap(nil); svr != nil {
89+
return svr.Close()
90+
}
91+
return nil
92+
}
93+
8394
func initIPC(opts *utils.Opts, platIfce rvpn.PlatformInterface) error {
95+
if ipcServer.Load() != nil {
96+
return nil
97+
}
8498
slog.Debug("Initializing IPC", "dataDir", opts.DataDir, "logDir", opts.LogDir, "logLevel", opts.LogLevel)
85-
if _, err := vpn.InitIPC(opts.DataDir, opts.LogDir, opts.LogLevel, platIfce); err != nil {
99+
svr, err := vpn.InitIPC(opts.DataDir, opts.LogDir, opts.LogLevel, platIfce)
100+
if err != nil {
86101
return err
87102
}
103+
ipcServer.Store(svr)
88104
return nil
89105
}
90106

macos/PacketTunnel/SingBox/ExtensionProvider.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,12 @@ public class ExtensionProvider: NEPacketTunnelProvider {
101101
appLogger.log("error while stopping tunnel \(error?.localizedDescription ?? "")")
102102
return
103103
}
104+
MobileCloseIPC(&error)
105+
if error != nil {
106+
appLogger.log("error closing IPC \(error?.localizedDescription ?? "")")
107+
}
104108
appLogger.log("(lantern-tunnel) tunnel closed")
105109
platformInterface.reset()
106-
#if os(macOS)
107-
// HACK: There is a bug in the NetworkExtension code so it doesn't reliably teardown
108-
// and terminate the extension process on return -- causing the tunnel to remain in
109-
// memory or stuck in an inconsistent state.
110-
// see https://github.com/WireGuard/wireguard-apple/blob/master/Sources/WireGuardNetworkExtension/PacketTunnelProvider.swift#L83-L88
111-
exit(0)
112-
#endif
113110
}
114111

115112
private func stopService() {

macos/Podfile.lock

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -135,32 +135,32 @@ EXTERNAL SOURCES:
135135
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
136136

137137
SPEC CHECKSUMS:
138-
app_links: c3185399a5cabc2e610ee5ad52fb7269b84ff869
139-
auto_updater_macos: 3e3462c418fe4e731917eacd8d28eef7af84086d
140-
desktop_webview_window: d4365e71bcd4e1aa0c14cf0377aa24db0c16a7e2
141-
device_info_plus: 1b14eed9bf95428983aed283a8d51cce3d8c4215
142-
flutter_inappwebview_macos: bdf207b8f4ebd58e86ae06cd96b147de99a67c9b
143-
flutter_local_notifications: 4ccab5b7a22835214a6672e3f9c5e8ae207dab36
144-
flutter_timezone: b3bc0c587d8780d395651284a1ff46eb1e5753ac
138+
app_links: 05a6ec2341985eb05e9f97dc63f5837c39895c3f
139+
auto_updater_macos: 3a42f1a06be6981f1a18be37e6e7bf86aa732118
140+
desktop_webview_window: 7e37af677d6d19294cb433d9b1d878ef78dffa4d
141+
device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76
142+
flutter_inappwebview_macos: c2d68649f9f8f1831bfcd98d73fd6256366d9d1d
143+
flutter_local_notifications: 4bf37a31afde695b56091b4ae3e4d9c7a7e6cda0
144+
flutter_timezone: d272288c69082ad571630e0d17140b3d6b93dc0c
145145
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
146-
in_app_purchase_storekit: a1ce04056e23eecc666b086040239da7619cd783
147-
mobile_scanner: 77265f3dc8d580810e91849d4a0811a90467ed5e
146+
in_app_purchase_storekit: d1a48cb0f8b29dbf5f85f782f5dd79b21b90a5e6
147+
mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
148148
ObjectBox: a60820ec1c903702350585d8cc99c1268c99e688
149-
objectbox_flutter_libs: fdba3af52a244037417fe170952a3dd819fee1af
150-
objective_c: e5f8194456e8fc943e034d1af00510a1bc29c067
149+
objectbox_flutter_libs: 013bbc27a57c5120e1408c0b33386c78cd0b5847
150+
objective_c: ec13431e45ba099cb734eb2829a5c1cd37986cba
151151
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
152-
package_info_plus: 12f1c5c2cfe8727ca46cbd0b26677728972d9a5b
153-
path_provider_foundation: 0b743cbb62d8e47eab856f09262bb8c1ddcfe6ba
154-
screen_retriever_macos: 776e0fa5d42c6163d2bf772d22478df4b302b161
152+
package_info_plus: f0052d280d17aa382b932f399edf32507174e870
153+
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
154+
screen_retriever_macos: 452e51764a9e1cdb74b3c541238795849f21557f
155155
Sentry: b53951377b78e21a734f5dc8318e333dbfc682d7
156-
sentry_flutter: f074f75557daea0e1dd9607381a05cc0e3e456fe
157-
share_plus: 1fa619de8392a4398bfaf176d441853922614e89
158-
shared_preferences_foundation: 5086985c1d43c5ba4d5e69a4e8083a389e2909e6
156+
sentry_flutter: 4c33648b7e83310aa1fdb1b10c5491027d9643f0
157+
share_plus: 510bf0af1a42cd602274b4629920c9649c52f4cc
158+
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
159159
Sparkle: a346a4341537c625955751ed3ae4b340b68551fa
160-
store_checker: 387169de0dffe57b6370d54cc027e9f95051b57f
161-
tray_manager: 9064e219c56d75c476e46b9a21182087930baf90
162-
url_launcher_macos: 175a54c831f4375a6cf895875f716ee5af3888ce
163-
window_manager: e25faf20d88283a0d46e7b1a759d07261ca27575
160+
store_checker: 0b5120a0f0a0f36af7b4be01a049e6006151dc16
161+
tray_manager: a104b5c81b578d83f3c3d0f40a997c8b10810166
162+
url_launcher_macos: f87a979182d112f911de6820aefddaf56ee9fbfd
163+
window_manager: b729e31d38fb04905235df9ea896128991cad99e
164164

165165
PODFILE CHECKSUM: b1a5a5e815560a377d8b3e64b4f3f97e2bd372ba
166166

0 commit comments

Comments
 (0)