-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for service reload and sync service file #2102
Conversation
WalkthroughThe changes introduce enhancements to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SystemD
participant Headscale
User->>SystemD: Sends reload signal (HUP)
SystemD->>Headscale: Executes ExecReload command
Headscale-->>SystemD: Reloads configuration
SystemD-->>User: Acknowledges reload completion
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- docs/packaging/headscale.systemd.service (1 hunks)
- docs/running-headscale-linux-manual.md (1 hunks)
Additional comments not posted (16)
docs/packaging/headscale.systemd.service (1)
12-12
: LGTM!The
ExecReload
directive is correctly implemented and aligns with the PR objective of enabling the reloading of Access Control Lists (ACLs) via the commandsystemctl reload headscale
.Sending the HUP signal to the main process is a common pattern for reloading the configuration of a service without needing to stop and restart it entirely. The command uses the correct signal (HUP) and the correct variable ($MAINPID) to identify the main process.
docs/running-headscale-linux-manual.md (15)
123-123
: Approved: The updated service description clarifies headscale's role.The change from "headscale controller" to "headscale coordination server for Tailscale" provides a more accurate description of headscale's purpose.
124-124
: Approved: The newX-Restart-Triggers
directive improves service management.The addition of the
X-Restart-Triggers
directive, pointing to the configuration file, enhances the service's restart behaviour based on configuration changes. This is a useful feature for managing the headscale service.
131-131
: Approved: The newExecReload
directive enables graceful service reloads.The addition of the
ExecReload
directive, using thekill
command to send theHUP
signal to the main process, allows for graceful reloading of the headscale service. This is a valuable feature for managing the service without requiring a full restart.
138-138
: Verify the addition ofCAP_CHOWN
toAmbientCapabilities
.The
AmbientCapabilities
directive has been updated to includeCAP_CHOWN
, indicating that the service can now change file ownership. Please verify that this capability is necessary for the service's operation and does not introduce any unintended security risks.
139-139
: Approved: The newCapabilityBoundingSet
directive enhances security.The addition of the
CapabilityBoundingSet
directive, specifyingCAP_NET_BIND_SERVICE
andCAP_CHOWN
, limits the service's capabilities to only those required. This helps to reduce the potential attack surface and enhance the service's security posture.
140-140
: Approved: The newLockPersonality
directive enhances security.The addition of the
LockPersonality
directive, set totrue
, prevents the service from changing its personality (execution domain). This is a security enhancement that restricts the service's ability to switch between different execution domains, reducing the risk of privilege escalation.
141-141
: Approved: The newNoNewPrivileges
directive enhances security.The addition of the
NoNewPrivileges
directive, set totrue
, prevents the service and its child processes from gaining new privileges throughexecve()
. This is a security enhancement that limits the service's ability to escalate its privileges, reducing the risk of unauthorized access or exploitation.
142-142
: Approved: The newPrivateDevices
directive enhances security.The addition of the
PrivateDevices
directive, set totrue
, creates a private/dev
mount for the service and only adds API pseudo devices. This is a security enhancement that prevents the service from accessing physical devices, reducing the risk of unauthorized access or exploitation.
143-143
: Approved: The newPrivateMounts
directive enhances security.The addition of the
PrivateMounts
directive, set totrue
, creates a private mount namespace for the service, preventing it from accessing system mount points. This is a security enhancement that isolates the service's mount namespace, reducing the risk of unauthorized access or exploitation.
144-144
: Approved: The newPrivateTmp
directive enhances security.The addition of the
PrivateTmp
directive, set totrue
, mounts a private/tmp
directory for the service, preventing it from accessing the system's temporary files. This is a security enhancement that isolates the service's temporary files, reducing the risk of unauthorized access or exploitation.
145-145
: Approved: The newProcSubset
directive enhances security.The addition of the
ProcSubset
directive, set topid
, mounts a subset of/proc
that only contains thepid
directories for the service. This is a security enhancement that limits the service's access to process information, reducing the risk of unauthorized access or exploitation.
146-146
: Approved: The newProtectClock
directive enhances security.The addition of the
ProtectClock
directive, set totrue
, makes the service unable to change the system clock. This is a security enhancement that prevents the service from tampering with the system time, ensuring the integrity of time-based operations.
147-147
: Approved: The newProtectControlGroups
directive enhances security.The addition of the
ProtectControlGroups
directive, set totrue
, makes the service unable to modify the control group file system. This is a security enhancement that prevents the service from tampering with the system's resource control and allocation mechanisms, ensuring the stability and integrity of the system.
148-148
: Approved: The newProtectHome
directive enhances security.The addition of the
ProtectHome
directive, set totrue
, makes the service unable to access home directories of users. This is a security enhancement that prevents the service from accessing potentially sensitive user data, reducing the risk of unauthorized access or data breaches.
149-149
: Approved: The newProtectHostname
directive enhances security.The addition of the
ProtectHostname
directive, set totrue
, makes the service unable to change the system hostname. This is a security enhancement that prevents the service from tampering with the system's identity, ensuring the stability and integrity of the system.
Alternatively, the |
Yes, linking it sounds way better than attempting to keep them in sync. |
* Copy the systemd.service file to the manual linux docs and adjust the path to the headscale binary to match with the previous documentation blocks. Unfortunately, there seems to be no easy way to include a file in mkdocs. * Remove a redundant "deprecation" block. The beginning of the documentation already states that. * Add `ExecReload` to the systemd.service file. Fixes: juanfont#2016
9248f3c
to
9337907
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (4)
- docs/packaging/headscale.systemd.service (1 hunks)
- docs/running-headscale-linux-manual.md (4 hunks)
- docs/running-headscale-linux.md (1 hunks)
- integration/dns_test.go (1 hunks)
Files skipped from review due to trivial changes (3)
- docs/running-headscale-linux-manual.md
- docs/running-headscale-linux.md
- integration/dns_test.go
Additional comments not posted (1)
docs/packaging/headscale.systemd.service (1)
12-12
: Approve the addition of theExecReload
directive.The
ExecReload
directive is correctly implemented using/usr/bin/kill -HUP $MAINPID
. This allows the service to reload its configuration dynamically, aligning with the objectives of PR and issue #2016.Please ensure that the Headscale application is designed to handle the HUP signal appropriately, as this is crucial for the directive to function as intended.
Thank you, this is very helpful! |
ExecReload
to the systemd.service file.Fixes #2016
Summary by CodeRabbit
New Features
ExecReload
directive for graceful configuration reloads.Documentation
headscale
on Linux, encouraging the use of pre-packaged service files.