AdguardTeam / AdguardTeam/AdGuardHome

Script to automate update for non-root AGH service

Aperta
#5,525 0 commenti 1 reazione 1 assegnatario Rivendicata da @ainar-g Vedi su GitHub
documentation
Lingua principale
TypeScript
Stelle
36.9k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Prerequisites

- [X] I have checked the [Wiki](https://github.com/AdguardTeam/AdGuardHome/wiki) and [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions) and found no answer

- [X] I have searched other issues and found no duplicates

- [X] I want to request a feature or enhancement and not ask a question

### Description

#### What problem are you trying to solve?

For security, I run AdGuardHome as a non-root service using systemctl and the adguard user. I use `AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW` to enable AGH to bind to privileged ports.

Unfortunately this means AGH will not autoupdate from the web-gui, as it sees that the binary is not owned by root.

#### Proposed solution

I have created an [update script](https://github.com/eccgecko/AdGuardHome/blob/master/scripts/AdGuardHomeUpdate_linux_arm64.sh) for my 64-bit raspberry pi to automate the process of manually downloading and installing the new binary. My script downloads both the tarball and checksum.txt into /tmp/ and performs a checksum, before backing up the config file and data directory into the user's $HOME directory, then copying the new binary into /opt/AdGuardHome/ and restarting the AdGuardHome.service using systemctl.

#### Alternatives considered

#### Additional information

The script is my first attempt, hence I did not feel ready to make a PR. It works on my system, but probably requires looking over by more advanced eyes than mine.

As it is currently written, it does not perform an architecture check, and thus only works on linux_arm64 machines. If your system is different you will need to edit the `TARBALL="AdGuardHome_linux_arm64.tar.gz"` line to match your system.

It would be great if someone could add in an arch check and edit it to download the relevant arch automatically.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.