Skip to content

Comments

Linux damon #8483

Open
garmr-ulfr wants to merge 40 commits intomainfrom
garmr/linux-daemon
Open

Linux damon #8483
garmr-ulfr wants to merge 40 commits intomainfrom
garmr/linux-daemon

Conversation

@garmr-ulfr
Copy link
Contributor

@garmr-ulfr garmr-ulfr commented Feb 19, 2026

This pull request introduces a comprehensive overhaul of the Linux packaging and installation process, focusing on systemd service integration, improved build automation, and enhanced developer documentation. The changes migrate packaging to use nfpm, add robust service management scripts for DEB, RPM, and Arch Linux, and update the app to handle Linux-specific behaviors more gracefully.

Key changes include:

Linux Packaging and Service Integration

  • Migrated Linux packaging to use nfpm, supporting DEB, RPM, and Arch Linux formats, and added a unified nfpm.yaml configuration with appropriate dependencies, file layout, and post-install/remove scripts for systemd service management. [1] [2]
  • Added systemd unit handling: systemd service files, postinstall/preremove/postremove scripts for DEB (linux/packaging/deb/scripts/*) and Arch (linux/packaging/arch/*.sh), and Makefile rules to build, stage, and package the lanternd daemon and its unit. [1] [2] [3] [4] [5] [6] [7]

Build Automation and Verification

  • Updated the Makefile to automate building the lanternd service for both amd64 and arm64, stage systemd unit files, and verify package contents in CI. Also ensures nfpm is installed as a build dependency. [1] [2] [3]
  • Added a desktop entry (lantern.desktop) and application icon installation for better desktop integration. [1] [2]

App and Core Logic Improvements (Linux-specific)

  • Updated the app to handle system tray and window management more robustly on Linux, including correct quitting behavior and tray icon selection. [1] [2] [3] [4]
  • Improved core logic to skip IPC server initialization and shutdown on Linux, and added debug logging for settings path. [1] [2] [3]

Developer Documentation

  • Added clear Linux build, install, and troubleshooting instructions to README-dev.md, including systemd usage and uninstall steps.

Miscellaneous

  • Minor fixes and cleanups in packaging metadata and project files, such as categories, keywords, and provisioning profile specifiers. [1] [2] [3]

These updates collectively modernize and streamline the Linux packaging, installation, and service management experience for both developers and end-users.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces systemd-based daemon support for running Lantern on Linux, establishing a two-process architecture where a privileged lanternd system service handles VPN operations while the Flutter app runs as a regular user and communicates via IPC. The changes include comprehensive packaging updates for Debian/RPM distributions, build system enhancements, and application-level modifications to support the new architecture.

Changes:

  • Added lanternd systemd service with security hardening and Linux packaging infrastructure (deb/rpm with install/uninstall scripts)
  • Updated build system (Makefile, distribute_options.yaml) to build and stage the service binary and systemd unit files
  • Refactored window management to separate "close to tray" from "quit", and updated Linux-specific UI behavior (tray icons, IPC handling)

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
linux/packaging/systemd/lantern.service New systemd unit file with security hardening directives and network capabilities
linux/packaging/deb/scripts/postinst Post-installation script to create lantern group, add users, and enable service
linux/packaging/deb/scripts/prerm Pre-removal script to stop the service before package removal
linux/packaging/deb/scripts/postrm Post-removal script to disable service and reload systemd
linux/packaging/deb/make_config.yaml Updated packaging configuration with install/uninstall scripts (contains errors)
scripts/ci/verify_linux_package.sh New CI verification script to validate package contents and configuration
Makefile Added targets to build lanternd service binary and stage systemd artifacts
.github/workflows/build-linux.yml Integrated package verification into Linux build workflow
distribute_options.yaml Added Linux deb and rpm build targets
lib/features/window/window_wrapper.dart Updated to call new closeToTray() method for proper window management
lib/features/window/provider/window_notifier.dart Refactored close() to closeToTray() and added quit() for process termination
lib/features/system_tray/provider/system_tray_notifier.dart Updated quit action to use new quit() method and added Linux tray icon paths
lantern-core/vpn_tunnel/vpn_tunnel.go Skip IPC initialization on Linux (handled by daemon)
lantern-core/core.go Added debug logging for Linux IPC settings path
go.mod, go.sum Updated radiance dependency to newer version
README-dev.md Added comprehensive Linux daemon build, install, and troubleshooting instructions
macos/Runner.xcodeproj/project.pbxproj Changed provisioning profile for Debug configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@garmr-ulfr
Copy link
Contributor Author

Actually, the daemon isn't being packaged in..converting to draft.

@garmr-ulfr garmr-ulfr marked this pull request as draft February 19, 2026 19:29
@garmr-ulfr garmr-ulfr marked this pull request as ready for review February 23, 2026 17:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

MACOSX_DEPLOYMENT_TARGET = 15.0;
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "Macos Development Profile";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = runner;
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provisioning profile specifier has been changed from "Macos Development Profile" to just runner (without proper quoting). This appears unrelated to the Linux daemon changes in this PR. Additionally, this creates an inconsistency - the Debug configuration now uses "runner" (line 1186) while the Release configuration still uses "Macos Development Profile" (line 1220). This change should either be reverted or applied consistently to both configurations with proper explanation.

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +35

- 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
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linux-deb and linux-rpm entries added to distribute_options.yaml will not be used because the Linux build process has switched to using nfpm (see Makefile lines 314-319) instead of flutter_distributor. flutter_distributor is still used for macOS and Windows builds, but not for Linux. These Linux entries should be removed to avoid confusion.

Suggested change
- 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

Copilot uses AI. Check for mistakes.
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.

2 participants