Skip to content
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 a systemd socket unit and adjust AmbientCapabilities= #124

Open
eriksjolund opened this issue Oct 11, 2024 · 2 comments
Open

Add a systemd socket unit and adjust AmbientCapabilities= #124

eriksjolund opened this issue Oct 11, 2024 · 2 comments

Comments

@eriksjolund
Copy link

Now that Caddy supports socket activation adjust the systemd service examples

init/caddy.service
init/caddy-api.service

to make use of a socket unit.

I haven't verified this but I'm speculating that we could remove the line

AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE

CAP_NET_ADMIN was added in

There is a systemd directive ReceiveBuffer that looks useful:

https://www.freedesktop.org/software/systemd/man/latest/systemd.socket.html#ReceiveBuffer=

(I don't know if the systemd directive ReceiveBuffer= would provide enough functionality to justify the removal of CAP_NET_ADMIN)

@francislavoie
Copy link
Member

francislavoie commented Oct 11, 2024

I don't think we can remove any capabilities like that. Socket activation is still an opt-in feature that users have to use in their configs. I don't envision that changing either. If you don't want the capability set, you can set overrides for your systemd config: https://caddyserver.com/docs/running#overrides

@eriksjolund
Copy link
Author

Overriding the systemd config is fine with me.
Should I close this issue?

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

No branches or pull requests

2 participants