AdguardTeam / AdguardTeam/AdGuardHome

patch to improve wiki about configuration file

Aperta
#8,424 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
feature request
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

### The problem

Configuration file is not super clear about a few points

- certain keys require a string literal with duration format
- `cache_optimistic_max_age` is measured since expiration (not since last queried from upstream)

### Proposed solution

Literally this

```
diff --git a/Configuration.md b/Configuration.md
index 552150f..87d7127 100644
--- a/Configuration.md
+++ b/Configuration.md
@@ -636,9 +636,10 @@ Settings are stored in [YAML format](https://en.wikipedia.org/wiki/YAML), possib
Before **v0.108.0-b.5** the TTL for such responses is 60 seconds and since
**v0.108.0-b.5** it's 10 seconds.
- `cache_optimistic_answer_ttl` (**since v0.107.71**) - TTL for answers from
- optimistic cache.
+ optimistic cache. Value must be a string duration.
- `cache_optimistic_max_age` (**since v0.107.71**) - The maximum amount of
- time that expired entries remain in the optimistic cache.
+ time that expired entries remain in the optimistic cache after TTL expiration.
+ Value must be a string duration.
- **Other settings**
- `bogus_nxdomain`: Respond with `NXDOMAIN` instead of any response having
IP addresses matching the ones from this list. **Since v0.108.0** it also
@@ -960,7 +961,34 @@ Removing an entry from settings file will reset it to the default value. Deletin
[rfc6147]: https://datatracker.ietf.org/doc/html/rfc6147
[tls-names]: https://pkg.go.dev/crypto/tls#pkg-constants

+### String duration formats

+Configuration entries such as `cache_optimistic_max_age` require string duration formats.
+
+Standard duration units supported:
+
+- `ns` — nanoseconds
+- `us` or `µs` — microseconds
+- `ms` — milliseconds
+- `s` — seconds
+- `m` — minutes
+- `h` — hours
+
+Examples of acceptable formats:
+
+- `12h` for 12 hours
+- `30s` for 30 seconds
+- `3h` for 3 hours
+- `1h30m` for 1 hour and 30 minutes
+
+```yaml
+cache_optimistic_max_age: '12h' # 12 hours (default)
+cache_optimistic_max_age: '30m' # 30 minutes
+cache_optimistic_max_age: '1h30m' # 1 hour 30 minutes
+cache_optimistic_max_age: '90s' # 90 seconds
+```
+
+Note: The values must be quoted strings in YAML.

## Reset web password
```

### Alternatives considered and additional information

I tried to edit the Wiki directly, but there's no edit button for my GitHub account.

I considered cloning the Wiki repo and submitting a PR, but GitHub doesn't support PRs for the Wiki.

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.