Skip to content
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
974392c
add linux service updates and use radiance daemon
atavism Jan 20, 2026
37d7f3e
run go mod tidy
atavism Jan 20, 2026
ca30ca0
Add copy of radianced for now
atavism Jan 20, 2026
b938914
Add systemd service
atavism Jan 21, 2026
1ef3873
Add new ffi code
atavism Jan 22, 2026
3536da1
Add new ffi code
atavism Jan 22, 2026
0f215d6
update lantern.service
atavism Jan 22, 2026
250fd7f
Update distribute options
atavism Jan 22, 2026
1ffa80a
merge latest
atavism Jan 22, 2026
aa9cdca
Add scripts
atavism Jan 22, 2026
03a0cec
make scripts executable
atavism Jan 22, 2026
9bab074
merge latest
atavism Jan 26, 2026
5c66044
merge latest
atavism Jan 30, 2026
383987e
merge latest
atavism Feb 4, 2026
8080714
Merge remote-tracking branch 'origin/main' into atavism/linux-updates
atavism Feb 4, 2026
5f8b9ef
merge latest
atavism Feb 4, 2026
4682f5c
Merge branch 'main' into atavism/linux-updates
atavism Feb 6, 2026
feb49f5
linux app issue fixes (#8450)
atavism Feb 9, 2026
c1b3185
Merge branch 'main' into atavism/linux-updates
atavism Feb 9, 2026
c67d62b
re-enable trace logging as default (#8458)
garmr-ulfr Feb 10, 2026
d50e625
Merge main into atavism/linux-updates
atavism Feb 17, 2026
d2d8b91
linux: package radiance lanternd (#8476)
atavism Feb 17, 2026
172ee8b
fix build: use published radiance revision
atavism Feb 17, 2026
68f719d
update radiance pin for linux-updates
atavism Feb 17, 2026
18a67ca
Merge branch 'main' into atavism/linux-updates
atavism Feb 18, 2026
14a7ece
Merge branch 'main' into atavism/linux-updates
atavism Feb 18, 2026
1823ef6
Merge branch 'main' into atavism/linux-updates
atavism Feb 18, 2026
93b4bb1
linux: fix daemon packaging with fastforge share layout
atavism Feb 20, 2026
49900fd
remove windows references until new cert is setup (#8480)
jay-418 Feb 18, 2026
8859ed2
Update tray_manager ref
myleshorton Feb 19, 2026
907e80b
Auth fix v4 (#8486)
jigar-f Feb 19, 2026
6691d8e
City Names (#8484)
jigar-f Feb 19, 2026
0ddf555
System tray updates (#8478)
jigar-f Feb 20, 2026
9c88618
Stage env (#8401)
jigar-f Feb 20, 2026
2f559d1
merge latest
atavism Feb 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ LINUX_LIB_ARM64 := $(BIN_DIR)/linux-arm64/$(LANTERN_LIB_NAME).so
LINUX_LIB_BUILD := $(BIN_DIR)/linux/$(LINUX_LIB)
LINUX_INSTALLER_DEB := $(INSTALLER_NAME)$(if $(BUILD_TYPE),-$(BUILD_TYPE)).deb
LINUX_INSTALLER_RPM := $(INSTALLER_NAME)$(if $(BUILD_TYPE),-$(BUILD_TYPE)).rpm
LINUX_SERVICE_NAME := lanternsvc
LINUX_SERVICE_SRC := ./$(LANTERN_CORE)/cmd/lanternsvc
LINUX_SERVICE_BUILD_AMD64 := $(BIN_DIR)/linux-amd64/$(LINUX_SERVICE_NAME)
LINUX_SERVICE_BUILD_ARM64 := $(BIN_DIR)/linux-arm64/$(LINUX_SERVICE_NAME)
LINUX_PKG_ROOT := linux/packaging
LINUX_PKG_USR_LIB_LANTERN := $(LINUX_PKG_ROOT)/usr/lib/lantern
LINUX_PKG_SYSTEMD_DIR := $(LINUX_PKG_ROOT)/usr/lib/systemd/system
LINUX_SYSTEMD_UNIT_SRC := $(LANTERN_CORE)/linux/packaging/systemd/lantern.service
LINUX_SYSTEMD_UNIT_DST := $(LINUX_PKG_SYSTEMD_DIR)/lantern.service

ifeq ($(OS),Windows_NT)
PS := powershell -NoProfile -ExecutionPolicy Bypass -Command
Expand Down Expand Up @@ -256,18 +265,48 @@ linux: linux-amd64
mkdir -p $(BIN_DIR)/linux
cp $(LINUX_LIB_AMD64) $(LINUX_LIB_BUILD)

.PHONY: linux-service-amd64 linux-service-arm64 stage-linux-service

linux-service-amd64: $(GO_SOURCES)
$(call MKDIR_P,$(dir $(LINUX_SERVICE_BUILD_AMD64)))
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 \
go build -v -trimpath -tags "$(TAGS)" \
-ldflags "-w -s $(EXTRA_LDFLAGS)" \
-o $(LINUX_SERVICE_BUILD_AMD64) $(LINUX_SERVICE_SRC)
@echo "Built Linux service: $(LINUX_SERVICE_BUILD_AMD64)"

linux-service-arm64: $(GO_SOURCES)
$(call MKDIR_P,$(dir $(LINUX_SERVICE_BUILD_ARM64)))
GOOS=linux GOARCH=arm64 CGO_ENABLED=1 \
go build -v -trimpath -tags "$(TAGS)" \
-ldflags "-w -s $(EXTRA_LDFLAGS)" \
-o $(LINUX_SERVICE_BUILD_ARM64) $(LINUX_SERVICE_SRC)
@echo "Built Linux service: $(LINUX_SERVICE_BUILD_ARM64)"

stage-linux-service: linux-service-amd64
@echo "Staging systemd unit + service binary $(LINUX_PKG_ROOT)..."
$(call MKDIR_P,$(LINUX_PKG_USR_LIB_LANTERN))
$(call COPY_FILE,$(LINUX_SERVICE_BUILD_AMD64),$(LINUX_PKG_USR_LIB_LANTERN)/$(LINUX_SERVICE_NAME))
$(call MKDIR_P,$(LINUX_PKG_SYSTEMD_DIR))
$(call COPY_FILE,$(LINUX_SYSTEMD_UNIT_SRC),$(LINUX_SYSTEMD_UNIT_DST))

.PHONY: linux-debug
linux-debug:
@echo "Building Flutter app (debug) for Linux..."
flutter build linux --debug

.PHONY: linux-release
linux-release: clean linux pubget gen
.PHONY: linux-release
linux-release: clean linux pubget gen stage-linux-service
@echo "Building Flutter app (release) for Linux..."
flutter build linux --release $(DART_DEFINES)

cp $(LINUX_LIB_BUILD) build/linux/x64/release/bundle
patchelf --set-rpath '$$ORIGIN' build/linux/x64/release/bundle/lantern || true

flutter_distributor package --build-dart-define=BUILD_TYPE=$(BUILD_TYPE) \
--build-dart-define=VERSION=$(VERSION) --platform linux --targets "deb,rpm" --skip-clean

mv $(DIST_OUT)/$(APP_VERSION)/lantern-$(APP_VERSION)-linux.rpm $(LINUX_INSTALLER_RPM)
mv $(DIST_OUT)/$(APP_VERSION)/lantern-$(APP_VERSION)-linux.deb $(LINUX_INSTALLER_DEB)

Expand Down
18 changes: 17 additions & 1 deletion distribute_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,27 @@ releases:
build_args:
dart-define:
APP_ENV: dev
# See full documentation: https://fastforge.dev/makers/exe

- name: windows-exe
package:
platform: windows
target: exe
build_args:
dart-define:
APP_ENV: dev

- name: linux-deb
package:
platform: linux
target: deb
build_args:
dart-define:
APP_ENV: dev

- name: linux-rpm
package:
platform: linux
target: rpm
build_args:
dart-define:
APP_ENV: dev
307 changes: 153 additions & 154 deletions go.mod

Large diffs are not rendered by default.

751 changes: 362 additions & 389 deletions go.sum

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions lantern-core/cmd/lanternsvc/main_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//go:build linux

package main

import (
"flag"
"log"
"log/slog"
"os"
"os/signal"
"syscall"
"time"

"github.com/sagernet/sing-box/experimental/libbox"

"github.com/getlantern/radiance/common"
"github.com/getlantern/radiance/vpn"
)

var (
dataPath = flag.String("data-path", "$HOME/.lantern", "Path to store data")
logPath = flag.String("log-path", "$HOME/.lantern", "Path to store logs")
logLevel = flag.String("log-level", "info", "Logging level (trace, debug, info, warn, error)")
)

func main() {
flag.Parse()

dp := os.ExpandEnv(*dataPath)
lp := os.ExpandEnv(*logPath)

slog.Info("Starting lanternsvc (radiance daemon)", "version", common.Version, "dataPath", dp, "logPath", lp)

platIfceProvider := func() libbox.PlatformInterface { return nil }
ipcServer, err := vpn.InitIPC(dp, lp, *logLevel, platIfceProvider)
if err != nil {
log.Fatalf("Failed to initialize IPC: %v\n", err)
}
defer ipcServer.Close()

// Wait for a signal to gracefully shut down.
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
<-sigCh

slog.Info("Shutting down...")
time.AfterFunc(15*time.Second, func() {
log.Fatal("Failed to shut down in time, forcing exit.")
})

status, _ := vpn.GetStatus()
if status.TunnelOpen {
vpn.Disconnect()
}
}
73 changes: 0 additions & 73 deletions lantern-core/ffi/ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,41 +251,6 @@ func reportIssue(emailC, typeC, descC, deviceC, modelC, logPathC *C.char) *C.cha
return C.CString("ok")
}

// startVPN initializes and starts the VPN server if it is not already running.
//
//export startVPN
func startVPN(_logDir, _dataDir, _locale *C.char) *C.char {
slog.Debug("startVPN called")
sendStatusToPort(Connecting)
if err := vpn_tunnel.StartVPN(nil, &utils.Opts{
DataDir: C.GoString(_dataDir),
Locale: C.GoString(_locale),
}); err != nil {
err = fmt.Errorf("unable to start vpn server: %v", err)
sendStatusToPort(Disconnected)
return C.CString(err.Error())
}
sendStatusToPort(Connected)
slog.Debug("VPN server started successfully")
return C.CString("ok")
}

// stopVPN stops the VPN server if it is running.
//
//export stopVPN
func stopVPN() *C.char {
slog.Debug("stopVPN called")
sendStatusToPort(Disconnecting)
if err := vpn_tunnel.StopVPN(); err != nil {
err = fmt.Errorf("unable to stop vpn server: %v", err)
sendStatusToPort(Connected)
return C.CString(err.Error())
}
sendStatusToPort(Disconnected)
slog.Debug("VPN server stopped successfully")
return C.CString("ok")
}

// getAutoLocation returns the auto location in JSON format.
//
//export getAutoLocation
Expand Down Expand Up @@ -345,29 +310,6 @@ func getAvailableServers() *C.char {
return C.CString(string(c.GetAvailableServers()))
}

// connectToServer sets the private server with the given tag.
// connectToServer connects to a specific VPN server identified by the location type and tag.
// connectToServer will open and start the VPN tunnel if it is not already running.
//
//export connectToServer
func connectToServer(_location, _tag, _logDir, _dataDir, _locale *C.char) *C.char {
tag := C.GoString(_tag)
locationType := C.GoString(_location)

// Valid location types are:
// auto,
// privateServer,
// lanternLocation;
if err := vpn_tunnel.ConnectToServer(locationType, tag, nil, &utils.Opts{
DataDir: C.GoString(_dataDir),
Locale: C.GoString(_locale),
}); err != nil {
return SendError(fmt.Errorf("Error setting private server: %v", err))
}
slog.Debug("Private server set with tag", "tag", tag)
return C.CString("ok")
}

func sendStatusToPort(status VPNStatus) {
slog.Debug("sendStatusToPort called", "status", status)
if statusPort == 0 {
Expand All @@ -383,21 +325,6 @@ func sendStatusToPort(status VPNStatus) {

}

// isVPNConnected checks if the VPN server is running and connected.
//
//export isVPNConnected
func isVPNConnected() C.int {
connected := vpn_tunnel.IsVPNRunning()
slog.Debug("isVPNConnected called, connected:", "connected", connected)
if connected {
sendStatusToPort(Connected)
return 1
} else {
sendStatusToPort(Disconnected)
return 0
}
}

// APIS
// Get user data from the local config
//
Expand Down
Loading
Loading