You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After specifying privileged ports (22, 80) to soft serve for the SSH and/or HTTP server, when running as the default soft-serve user (as default in soft-serve.service) soft serve will start normally, but will not bind to the specified ports. No errors or warning regarding this are generated of any kind.
I believe this is a bug, because soft serve is unable to fulfill the configuration specified due to privilege issues.
This should result in the program exiting with an error, or at the very least, warning the user with a log message.
Not doing so risks confusion, and is otherwise bad practice.
Ideally, the process of binding to privileged ports with the default systemd units should be documented, or alternatively, soft could start as root to bind to whatever ports it needs, before dropping down to the soft-serve user.
To Reproduce
Debian 12 machine.
Installation (as root):
During this initial run of soft serve, soft binds to port 23231 for SSH.
# Edit config.yaml so SSH binds to :22
vim /srv/soft-serve/config.yaml
# Edit the systemd unit to apply my data path (see below):
systemctl edit soft-serve
systemctl daemon-reload
# Change ownership of data and start soft-serve:
chown -R soft-serve: /srv/soft-serve
systemctl start soft-serve
At this point, soft-serve has started successfully.
However, soft has not bound to ports 22 or 80:
(Checked with ss -nltpu).
There is no mention of anything wrong in the systemd journal, it simply says it's starting the SSH and HTTP server:
Feb 09 14:18:22 git-test soft[1747]: 2025-02-09 14:18:22 server: Starting SSH server addr=:22
Feb 09 14:18:22 git-test soft[1747]: 2025-02-09 14:18:22 server: Starting Git daemon addr=:9418
Feb 09 14:18:22 git-test soft[1747]: 2025-02-09 14:18:22 server: Starting HTTP server addr=:80
I ran sudo -u soft-serve SOFT_SERVE_DATA_PATH=/srv/soft-serve strace -f soft serve, and found this in the strace output, suggesting soft does not have permission to bind, which would make sense for an unprivileged user:
Thank you for the thorough bug report. This is likely due to context not being canceled properly here. It might take us some time to prioritize this one, but if this issue is of your interest, please feel free to send a patch 🙂
Describe the bug
After specifying privileged ports (22, 80) to soft serve for the SSH and/or HTTP server, when running as the default
soft-serve
user (as default insoft-serve.service
)soft serve
will start normally, but will not bind to the specified ports. No errors or warning regarding this are generated of any kind.I believe this is a bug, because soft serve is unable to fulfill the configuration specified due to privilege issues.
This should result in the program exiting with an error, or at the very least, warning the user with a log message.
Not doing so risks confusion, and is otherwise bad practice.
Ideally, the process of binding to privileged ports with the default systemd units should be documented, or alternatively,
soft
could start as root to bind to whatever ports it needs, before dropping down to thesoft-serve
user.To Reproduce
Debian 12 machine.
Installation (as root):
During this initial run of
soft serve
,soft
binds to port23231
for SSH.Systemd edit:
At this point, soft-serve has started successfully.
However,
soft
has not bound to ports22
or80
:(Checked with
ss -nltpu
).There is no mention of anything wrong in the systemd journal, it simply says it's starting the SSH and HTTP server:
I ran
sudo -u soft-serve SOFT_SERVE_DATA_PATH=/srv/soft-serve strace -f soft serve
, and found this in the strace output, suggestingsoft
does not have permission to bind, which would make sense for an unprivileged user:Expected behavior
soft serve
to exit with an error after being unable to bind to the ports specified in the configuration.Workaround
The following workaround will enable binding to privileged ports:
systemctl edit soft-serve
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: