AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
25.37k stars 1.82k forks source link

Allow reading passwords from files #7202

Open giorgiga opened 2 months ago

giorgiga commented 2 months ago

Prerequisites

The problem

Integration with declarative configuration and secret management systems is complicated because passwords are in the same file as the rest of the configuration.

Proposed solution

It would be nice to be able to specify passwords via files:

users:
  - name: some_user
    password_file: /run/secrets/user2-addguard-bcrypt-password.txt

Something similar should also be allowed for the http_proxy password.

Alternatives considered and additional information

Note that, while in some way similar to what proposed in #6647, this requires no special syntax.

Any chance a PR implementing this would be accepted?

ppfeufer commented 2 months ago

Wouldn't it make more sense to make this a proper credentials file in this case? Something like:

users:
  - credentials_file: /run/secrets/addguard-credentials.txt

And either make it look like:

user: foobar
password: barfoo_hashed

Or, if we want to support multiple users:

user_1:password_hash
user_2:password_hash
user_3:password_hash

Just as an idea …

giorgiga commented 2 months ago

@ppfeufer IMHO some sort of user database would indeed be nice (as would some kind of external authentication) and I'll also admit that the way config is mixed with users in the same file strikes me as a bit weird, but... can't we have that and also this? I mean, they can be two separate and independent features.