AdguardTeam / AdguardTeam/AdGuardHome

Add option to enable auto-upgrade on Linux/Unix despite CAP_NET_BIND_SERVICE capability

オープン
#1,944 コメント 5 件 リアクション 2 件 担当者 0 名 GitHub で見る
feature request help wanted
主要言語
TypeScript
スター
36.9k
フォーク
2.5k
PR マージ指標
30日以内にマージされた PR はありません

説明

### Problem Description

The if statement linked below rightly describes the issue with setting `CAP_NET_BIND_SERVICE` on binary _files_ in Linux but doesn't account for setting this option using _systemd's_ `AmbientCapabilities` directive instead, which doesn't require setting the capability on the binary itself.

https://github.com/AdguardTeam/AdGuardHome/blob/b4aa79151315035f0e839d9a710fe4051595acb5/home/control_update.go#L101-L111

### Proposed Solution

Modify the if statement logic to allow users to override the behavior, perhaps with a command line flag like `--allow-auto-update`? When combined with the AmbientCapabilities systemd directive, this would allow users to auto upgrade the binary even when running AdGuardHome without root permissions.

**Systemd Service File Example**
```ini
AmbientCapabilities=CAP_NET_BIND_SERVICE
```

### Alternatives Considered

Script the upgrade myself or fork the code, but a native solution would be much easier and a benefit for other Linux users. Thanks for the great application!

### Additional Information

- [func getVersionResp][1]
- [systemd.exec AmbientCapabilities][2]

[1]: https://github.com/AdguardTeam/AdGuardHome/blob/b4aa79151315035f0e839d9a710fe4051595acb5/home/control_update.go#L87-L117
[2]: https://www.freedesktop.org/software/systemd/man/systemd.exec.html#AmbientCapabilities=

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。