-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Faulty error detection, leads to crash: "[fatal] This is the first launch of AdGuard Home. You must run it as Administrator." #4714
Comments
Related: #4681 |
@yscialom, hello. Unfortunately, we can't reproduce the issue, could you please share some setup details? How exactly do you run the AdGuard Home as non-root user? Do you login to the container as unpriveleged user or use some custom Dockerfile? |
@EugeneOne1 I had to tweak the Dockerfile: https://github.com/yscialom/AdGuardHome/pull/1/files |
(Issue description updated to better explain how to reproduce) |
I have this problem as well, trying to run it inside a Debian LXC container.
I was able to work around this issue by
It's now running happily on port 80/53.
|
Also hitting this issue it seems. Any progress or something I can do to help the issue along? :) |
Issue Details
Context
docker pull adguard/adguardhome:latest
./AdGuardHome -v --version
:Description
Under docker, when running AdGuardHome as a non-root user, AdGuardHome displays the following and exits
Expected Behavior
Under docker, when running AdGuardHome as a non-root user with the NET_BIND_SERVICE capability granted, AdGuardHome starts normally.
How to reproduce
Edit AdGuardHome's Dockerfile (See this draft PR on yscialom/AdGuardHome), build and run with
docker run -e PUID=$(id -un) ...
.Preliminary Analysis
Non-root user can bind processes to ports <1024
This can be checked by running the following commands inside the docker container
Source Code
This error "This is the first launch of AdGuard Home. You must run it as Administrator." can be found in
internal/home/home.go:520
:with
CanBindPrivilegedPorts
defined ininternal/aghnet/net_linux.go:24
:with
unix.PrctlRetInt
being a binding on linux' system call prctl(2) reading:Additional tests are necessary to determine if
unix.PrctlRetInt
is bugged, badly called, or whatever. But one can be convinced that, in this scenario, AdGuardHome should be able to open port 53 and should not exist with an error.Why this issue matters
I discovered this issue while preparing a pull request to allow the docker flavour of AdGuardHome to run as a non-root user. This is indeed beneficial for two reasons:
Additional Information
Result of
./AdGuardHome -v --version
The text was updated successfully, but these errors were encountered: