CanAutoUpdate should not decide by util.HaveAdminRights #2072

Closed
opened 2026-03-04 01:44:56 -05:00 by deekerman · 7 comments
Owner

Originally created by @ihipop on GitHub (Oct 28, 2020).

Originally assigned to: @EugeneOne1 on GitHub.

github.com/AdguardTeam/AdGuardHome@d1e55c31af/home/control_update.go (L101-L114)

if we run AdGuardHome by systemd like this

[Unit]
Description=Adguard Home
Requires=network.target
After=network.target

[Service]
Type=simple
####ExecStartPre=-/sbin/setcap cap_net_bind_service=+ep /config/ihipop/AdGuardHome/AdGuardHome
AmbientCapabilities=CAP_NET_BIND_SERVICE
ExecStart=/config/ihipop/AdGuardHome/AdGuardHome
Restart=always
RestartSec=2s
User=dnsmasq
PermissionsStartOnly=true
LimitNOFILE=infinity

[Install]
WantedBy=multi-user.target

The CAP_NET_BIND_SERVICE capability is grant by systemd and not exists in filesystem
AmbientCapabilities doc https://www.freedesktop.org/software/systemd/man/systemd.exec.html#AmbientCapabilities=
It's safe to upgrade then

Originally created by @ihipop on GitHub (Oct 28, 2020). Originally assigned to: @EugeneOne1 on GitHub. https://github.com/AdguardTeam/AdGuardHome/blob/d1e55c31af13a7fd88516d1e498747ee2aa69209/home/control_update.go#L101-L114 if we run AdGuardHome by systemd like this ``` [Unit] Description=Adguard Home Requires=network.target After=network.target [Service] Type=simple ####ExecStartPre=-/sbin/setcap cap_net_bind_service=+ep /config/ihipop/AdGuardHome/AdGuardHome AmbientCapabilities=CAP_NET_BIND_SERVICE ExecStart=/config/ihipop/AdGuardHome/AdGuardHome Restart=always RestartSec=2s User=dnsmasq PermissionsStartOnly=true LimitNOFILE=infinity [Install] WantedBy=multi-user.target ``` The `CAP_NET_BIND_SERVICE` capability is grant by systemd and not exists in filesystem `AmbientCapabilities` doc https://www.freedesktop.org/software/systemd/man/systemd.exec.html#AmbientCapabilities= It's safe to upgrade then
deekerman 2026-03-04 01:44:56 -05:00
Author
Owner

@ihipop commented on GitHub (Oct 28, 2020):

#1193 github.com/AdguardTeam/AdGuardHome@7ff743ab32
#1944

@ihipop commented on GitHub (Oct 28, 2020): #1193 https://github.com/AdguardTeam/AdGuardHome/commit/7ff743ab32292ec50b7bc4a2530b00b59e117018 #1944
Author
Owner

@ihipop commented on GitHub (Oct 28, 2020):

IMO,the simple way is to have a auto update policy option, let the administrator to decide whether it’s safe or not to auto upgrade
The administrator is responsible for the failure of auto update
To interactive with systemd is not a good idea because it’s tooo heavy behavior and bundle to much to platform code
Let‘s keep it simple 。

@ihipop commented on GitHub (Oct 28, 2020): IMO,the simple way is to have a `auto update policy` option, let the administrator to decide whether it’s safe or not to auto upgrade The administrator is responsible for the failure of auto update To interactive with systemd is not a good idea because it’s tooo heavy behavior and bundle to much to platform code Let‘s keep it simple 。
Author
Owner

@ihipop commented on GitHub (Oct 30, 2020):

Suggestions:

  • deprecated no-check-update option
  • add new update-policy option

New policy:

  • auto:
    auto update if possible, with a new version and execute file is located and writable on file system ,ignore the Capabilities stuff
  • manual: (default)
    same as auto but will not update self until administrator click it on admin panel
  • disable:
    same as the old no-check-update, will not perform any update check so will no self-update
@ihipop commented on GitHub (Oct 30, 2020): Suggestions: - deprecated `no-check-update` option - add new `update-policy` option New policy: - `auto`: auto update if possible, with a new version and execute file is located and writable on file system ,**ignore the Capabilities stuff** - `manual`: (default) same as `auto` but will not update self until administrator click it on admin panel - `disable`: same as the old `no-check-update`, will not perform any update check so will no self-update
Author
Owner

@EugeneOne1 commented on GitHub (Nov 30, 2020):

This should be fixed as of snapshot 641db73. Could you please check if our solution fixes the issue for you?

@EugeneOne1 commented on GitHub (Nov 30, 2020): This should be fixed as of snapshot [`641db73`](https://github.com/AdguardTeam/AdGuardHome/commit/641db73a86a6d9d047f47c403bca70af320f23e9). Could you please check if our solution fixes the issue for you?
Author
Owner

@ihipop commented on GitHub (Nov 30, 2020):

This should be fixed as of snapshot 641db73. Could you please check if our solution fixes the issue for you?

I take a glance at the code ,Nice and clean fix than what I've suggested !!!
I will take a try and close my issue if it works fine

@ihipop commented on GitHub (Nov 30, 2020): > This should be fixed as of snapshot [`641db73`](https://github.com/AdguardTeam/AdGuardHome/commit/641db73a86a6d9d047f47c403bca70af320f23e9). Could you please check if our solution fixes the issue for you? I take a glance at the code ,Nice and clean fix than what I've suggested !!! I will take a try and close my issue if it works fine
Author
Owner

@ainar-g commented on GitHub (Dec 7, 2020):

@ihipop, hi, any news? Can we close the issue for now?

@ainar-g commented on GitHub (Dec 7, 2020): <p>@ihipop,&#xA0;hi, any news?&#x2003;Can we close the&#xA0;issue for&#xA0;now?</p>
Author
Owner

@ainar-g commented on GitHub (Dec 10, 2020):

I'll close this issue for now. Please feel free to reopen with more details if you think it should be reopened.

@ainar-g commented on GitHub (Dec 10, 2020): <p>I'll&#xA0;close this issue for now.&#x2003;Please feel free to reopen with more details if you think it should be&#xA0;reopened.</p>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AdGuardHome#2072
No description provided.