Skip to content

rootless panel installation - #23

Merged
et-nik merged 7 commits into
mainfrom
rootless-panel
Aug 6, 2026
Merged

rootless panel installation#23
et-nik merged 7 commits into
mainfrom
rootless-panel

Conversation

@et-nik

@et-nik et-nik commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added rootless, user-scoped panel installation on Linux.
    • Added automatic or explicit system/user scope selection.
    • Added scope-aware lifecycle commands, updates, password changes, and uninstallation.
    • Added user-scoped systemd service management and setup guidance.
    • Added documentation covering requirements, paths, PATH configuration, and limitations.
  • Bug Fixes

    • Improved handling of scoped configuration, binaries, ports, databases, services, and logs.
    • Prevented unsupported user-scope operations, including database-server installation and HTTP-01 certificates.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds Linux system and user installation scopes. It introduces scoped paths, user-systemd support, scope-aware panel and daemon lifecycle commands, rootless installation rules, scoped updates and uninstallation, and documentation.

Changes

Rootless installation and scoped operations

Layer / File(s) Summary
Scope, paths, and systemd infrastructure
pkg/gameap/*, pkg/systemd/*, pkg/panel/options*, pkg/panel/preflight*, pkg/panel/templates_unix.go, pkg/panel/start_linux.go, pkg/panel/stop_linux.go, pkg/panel/restart_linux.go, pkg/daemon/*_unix.go
Adds scope validation, scoped panel paths, user-systemd command handling, unit rendering, user-manager checks, and shared daemon and panel service operations.
Scope-aware panel installation
pkg/panel/install*, internal/actions/panel/install/*, internal/pkg/panel/*
Adds user and system installation defaults, scoped binaries and configuration, database restrictions, port defaults, dependency handling, service startup, persisted scope state, and installation tests.
Scoped lifecycle, update, and ACME commands
internal/actions/panel/{start,stop,restart,status,update,uninstall,letsencrypt,changepassword}/*, internal/app/app.go
Adds scope flags and passes resolved paths or scope options through lifecycle, update, uninstallation, password, and ACME operations.
Daemon scope handling and runtime fallbacks
internal/actions/daemon/install/daemon_install.go, internal/app/app.go
Uses shared daemon scope resolution, skips package-manager update checks for user scope, and adds fallback log-directory selection.
Rootless installation documentation
README.md
Documents user-scoped installation requirements, paths, systemd behavior, PATH handling, and limitations.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • gameap/gameapctl#24: Both PRs modify panel installation and systemd startup code, including panel_install_v4.go and daemon service handling.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 24.66% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the pull request's main change: rootless panel installation.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 30702561603

Coverage increased (+0.7%) to 14.011%

Details

  • Coverage increased (+0.7%) from the base build.
  • Patch coverage: 738 uncovered changes across 34 files (158 of 896 lines covered, 17.63%).
  • 23 coverage regressions across 13 files.

Uncovered Changes

Top 10 Files by Coverage Impact Changed Covered %
internal/actions/panel/install/panel_install_v4.go 208 24 11.54%
pkg/systemd/systemd_unix.go 87 24 27.59%
internal/app/app.go 53 0 0.0%
pkg/panel/start_linux.go 41 0 0.0%
internal/actions/panel/uninstall/uninstall_linux.go 39 0 0.0%
internal/actions/panel/uninstall/uninstall.go 30 0 0.0%
internal/pkg/panel/install.go 29 0 0.0%
internal/actions/panel/update/panel_update_v4.go 26 0 0.0%
internal/actions/panel/install/askv4.go 24 0 0.0%
pkg/panel/install.go 42 19 45.24%
Total (34 files) 896 158 17.63%

Coverage Regressions

23 previously-covered lines in 13 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
internal/actions/panel/uninstall/uninstall_linux.go 9 0.0%
internal/actions/panel/install/panel_install_v4.go 3 3.55%
internal/actions/panel/letsencrypt/disable.go 1 0.0%
internal/actions/panel/letsencrypt/setup.go 1 4.8%
internal/actions/panel/restart/restart.go 1 0.0%
internal/actions/panel/start/start.go 1 0.0%
internal/actions/panel/stop/stop.go 1 0.0%
internal/actions/panel/uninstall/uninstall.go 1 0.0%
internal/app/app.go 1 0.0%
pkg/panel/install.go 1 28.08%

Coverage Stats

Coverage Status
Relevant Lines: 14310
Covered Lines: 2005
Line Coverage: 14.01%
Coverage Strength: 10.15 hits per line

💛 - Coveralls

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 11

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/actions/panel/changepassword/changepassword.go`:
- Around line 56-61: Update Handle around panelpkg.ResolveScope to return the
ResolveScope error immediately instead of proceeding with an empty
opts.ConfigPath; preserve assigning paths.ConfigFilePath on success, then call
ChangePassword only after scope resolution succeeds.

In `@internal/actions/panel/install/checkers_v4.go`:
- Around line 191-199: In the user-scope SELinux branch of the checker, replace
the log-only warning call with the file’s existing user-facing output mechanism,
fmt.Println, while preserving the warning text and early return from the check.

In `@internal/actions/panel/install/panel_install_v4.go`:
- Around line 644-700: Fix the certificate setup flow around updateCACommand so
the ca-certificates installation and trust-store refresh branch can execute when
the certificate bundle is missing, rather than checking availability of a
command already selected as available. Check the certificate bundle itself or
restructure the command-selection logic so the missing-command/package-install
path is reachable, while preserving the existing distro-specific refresh
commands and installer rerun behavior.

In `@internal/actions/panel/status/status.go`:
- Around line 15-18: Update the ResolveScope handling in the status action to
add an error branch that logs the returned error when scope resolution fails,
while preserving the existing installation-scope log on success.

In `@internal/actions/panel/uninstall/uninstall_linux.go`:
- Around line 54-58: Update uninstallDaemon to return nil when neither
paths.DaemonFilePath exists nor the gameap-daemon command is available, matching
uninstallGameAP’s missing-installation behavior. Preserve normal daemon removal
for installed binaries and allow stopAndUninstallDaemon to continue into the
remaining Handle cleanup blocks.

In `@internal/app/app.go`:
- Around line 611-631: Update logDirCandidates and the related initLogFile
candidate-selection flow so tempLogDir is not called while constructing the
candidate list; defer creating the temporary directory until all system and
user-state candidates have failed, preserving the existing preference order and
fallback behavior.
- Around line 598-609: Update the os.OpenFile call in openLogFile to use a
restrictive file mode such as 0644 or 0640 instead of 0666, ensuring only the
owner (and optionally the owning group) can write to the log file while
preserving the existing open flags and error handling.

In `@README.md`:
- Line 53: Update the existing-database configuration documentation in the
README table to list --database-name and --database-username alongside the host
and password requirements, and mention --database-port for non-default ports.
- Around line 28-29: The README claim that the installer enables lingering is
inaccurate. Update the lingering documentation to state that users must run sudo
loginctl enable-linger $USER when lingering is disabled, matching the
installer’s lingerEnabled check and printed guidance.
- Line 52: Update the low-port limitation statement in the README table to say
ports below 1024 are normally unavailable, and document that they can be used
when an administrator lowers net.ipv4.ip_unprivileged_port_start.
- Line 54: Update the system-packages documentation in the README to distinguish
panel requirements from daemon installation prerequisites. Explicitly state that
user-scope daemon installation requires preinstalled curl, gpg, tmux, and
docker, and that SteamCMD may additionally require 32-bit libraries.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3d5853e6-764c-4757-9a01-4113e0b27334

📥 Commits

Reviewing files that changed from the base of the PR and between 3063f65 and 77573c3.

📒 Files selected for processing (60)
  • README.md
  • internal/actions/daemon/install/daemon_install.go
  • internal/actions/panel/changepassword/changepassword.go
  • internal/actions/panel/install/askv4.go
  • internal/actions/panel/install/checkers_v4.go
  • internal/actions/panel/install/panel_install_v4.go
  • internal/actions/panel/install/scope_v4_test.go
  • internal/actions/panel/letsencrypt/disable.go
  • internal/actions/panel/letsencrypt/setup.go
  • internal/actions/panel/restart/restart.go
  • internal/actions/panel/start/start.go
  • internal/actions/panel/status/status.go
  • internal/actions/panel/stop/stop.go
  • internal/actions/panel/uninstall/uninstall.go
  • internal/actions/panel/uninstall/uninstall_darwin.go
  • internal/actions/panel/uninstall/uninstall_linux.go
  • internal/actions/panel/uninstall/uninstall_windows.go
  • internal/actions/panel/update/panel_update.go
  • internal/actions/panel/update/panel_update_v4.go
  • internal/app/app.go
  • internal/pkg/gameapctl/panel_install_state.go
  • internal/pkg/panel/commands.go
  • internal/pkg/panel/install.go
  • internal/pkg/panel/scope.go
  • internal/pkg/panel/scope_test.go
  • pkg/daemon/daemon_restart_unix.go
  • pkg/daemon/daemon_start_unix.go
  • pkg/daemon/daemon_start_unix_test.go
  • pkg/daemon/daemon_stop_unix.go
  • pkg/daemon/linger_unix.go
  • pkg/daemon/options.go
  • pkg/gameap/daemon_paths.go
  • pkg/gameap/panel_paths.go
  • pkg/gameap/panel_paths_unix.go
  • pkg/gameap/panel_paths_unix_test.go
  • pkg/gameap/panel_paths_windows.go
  • pkg/gameap/scope.go
  • pkg/gameap/scope_test.go
  • pkg/panel/defaults_linux.go
  • pkg/panel/install.go
  • pkg/panel/install_linux.go
  • pkg/panel/install_unix_test.go
  • pkg/panel/options.go
  • pkg/panel/options_unsupported.go
  • pkg/panel/preflight_linux.go
  • pkg/panel/preflight_other.go
  • pkg/panel/restart_darwin.go
  • pkg/panel/restart_linux.go
  • pkg/panel/restart_windows.go
  • pkg/panel/start_darwin.go
  • pkg/panel/start_linux.go
  • pkg/panel/start_windows.go
  • pkg/panel/stop_darwin.go
  • pkg/panel/stop_linux.go
  • pkg/panel/stop_windows.go
  • pkg/panel/templates_linux.go
  • pkg/panel/templates_unix.go
  • pkg/panel/templates_unix_test.go
  • pkg/systemd/systemd_unix.go
  • pkg/systemd/systemd_unix_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • gameap/gameap.github.io (manual)
💤 Files with no reviewable changes (4)
  • pkg/panel/templates_linux.go
  • pkg/daemon/daemon_start_unix_test.go
  • pkg/gameap/daemon_paths.go
  • pkg/daemon/linger_unix.go

Comment thread internal/actions/panel/changepassword/changepassword.go Outdated
Comment thread internal/actions/panel/install/checkers_v4.go
Comment thread internal/actions/panel/install/panel_install_v4.go Outdated
Comment thread internal/actions/panel/status/status.go Outdated
Comment thread internal/actions/panel/uninstall/uninstall_linux.go
Comment thread internal/app/app.go Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 54-58: Update the README limitation describing Let's Encrypt
challenges to specify that http-01 is unavailable only with --scope=user, while
system scope may use it when port 80 is publicly reachable; retain the existing
recommendation to use --challenge=dns-01 for user scope.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1d964f2d-6b5d-4f67-ae2d-edcdb267fc05

📥 Commits

Reviewing files that changed from the base of the PR and between 77573c3 and 93d0c52.

📒 Files selected for processing (7)
  • README.md
  • internal/actions/panel/changepassword/changepassword.go
  • internal/actions/panel/install/checkers_v4.go
  • internal/actions/panel/install/panel_install_v4.go
  • internal/actions/panel/status/status.go
  • internal/actions/panel/uninstall/uninstall_linux.go
  • internal/app/app.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • gameap/gameap.github.io (manual)
🚧 Files skipped from review as they are similar to previous changes (6)
  • internal/actions/panel/status/status.go
  • internal/actions/panel/install/checkers_v4.go
  • internal/actions/panel/uninstall/uninstall_linux.go
  • internal/app/app.go
  • internal/actions/panel/install/panel_install_v4.go
  • internal/actions/panel/changepassword/changepassword.go

Comment thread README.md Outdated
@coderabbitai coderabbitai Bot mentioned this pull request Aug 6, 2026
et-nik added 3 commits August 6, 2026 17:05
# Conflicts:
#	internal/actions/panel/install/panel_install_v4.go
#	pkg/daemon/daemon_start_unix.go
#	pkg/panel/install_linux.go
#	pkg/panel/templates_linux.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/panel/templates_unix_test.go (1)

70-104: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject system network targets in the user-scope unit test.

systemdUserUnitTemplate still emits Wants=network-online.target and After=network.target network-online.target. Add both target names to the forbidden list.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/panel/templates_unix_test.go` around lines 70 - 104, Update
TestRenderSystemdUnit_User’s forbidden directives list to also reject
“Wants=network-online.target” and “After=network.target network-online.target”,
ensuring the user-scope unit test catches system network targets emitted by
systemdUserUnitTemplate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@pkg/panel/templates_unix_test.go`:
- Around line 70-104: Update TestRenderSystemdUnit_User’s forbidden directives
list to also reject “Wants=network-online.target” and “After=network.target
network-online.target”, ensuring the user-scope unit test catches system network
targets emitted by systemdUserUnitTemplate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b8dbbbb-c808-4faa-8996-d2fa244d5af9

📥 Commits

Reviewing files that changed from the base of the PR and between e172c71 and 17f3b0b.

📒 Files selected for processing (6)
  • internal/actions/panel/install/panel_install_v4.go
  • pkg/panel/install_linux.go
  • pkg/panel/install_linux_test.go
  • pkg/panel/templates_unix.go
  • pkg/panel/templates_unix_test.go
  • pkg/systemd/systemd_unix.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • gameap/gameap.github.io (manual)
🚧 Files skipped from review as they are similar to previous changes (4)
  • pkg/panel/templates_unix.go
  • pkg/panel/install_linux.go
  • pkg/systemd/systemd_unix.go
  • internal/actions/panel/install/panel_install_v4.go

@et-nik
et-nik merged commit c7d032a into main Aug 6, 2026
1 check passed
@et-nik
et-nik deleted the rootless-panel branch August 6, 2026 21:42
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