AdguardTeam / AdguardTeam/AdGuardHome

Install files to executable directory instead of working directory

Đang mở
#3,286 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement P3: Medium
Ngôn ngữ chính
TypeScript
Star
36.9k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Have a question or an idea? Please search it [on our forum](https://github.com/AdguardTeam/AdGuardHome/discussions) to make sure it was not yet asked. If you cannot find what you had in mind, please [submit it here](https://github.com/AdguardTeam/AdGuardHome/discussions/new).

### Prerequisites

Please answer the following questions for yourself before submitting an issue. **YOU MAY DELETE THE PREREQUISITES SECTION.**

- [x] I am running the latest version
- [x] I checked the documentation and found no answer
- [x] I checked to make sure that this issue has not already been filed

### Problem Description
The updater currently installs files to the working directory: https://github.com/AdguardTeam/AdGuardHome/blob/master/internal/updater/updater.go#L249-L274
By default the working directory matches the executable directory, but using the `-w, --work-dir` option changes this, so that files are tried to be installed to the wrong directory.

### Proposed Solution
Instead of deriving the target directory from the working directory, the updater could use the location of the running AdGuard Home executable itself, so that the working directory can be changed without breaking the updater.

### Alternatives Considered
I'm not sure whether there is already some kind of bin dir implemented that can be used, or otherwise if there is a different way to change the location of config and data without breaking the updater. But it doesn't seem intended to me that `-w, --work-dir` inherently breaks it.

### Additional Information
We use the `-w, --work-dir` option in our implementation to separate the static binary and install files from variable user data and config, but the updater then fails.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.