Skip to content

Commit

Permalink
better readme and manual
Browse files Browse the repository at this point in the history
  • Loading branch information
azlux committed Aug 30, 2023
1 parent a311059 commit 8e49959
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 29 deletions.
87 changes: 58 additions & 29 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,47 @@ you can use `/etc/nft-dns.conf` as an example for your configuration. All parame

## GLOBAL section
This section modify the program. This section is **optional** and can be removed into custom config from `/etc/nft-dns.d/*` if you don't need customization.
- `[GLOBAL]`
- That is the name of the program section, **do not change it**.

- **`[GLOBAL]`**

That is the name of the program section, **do not change it**.

- `max_ttl` (int)
- Default: `86400`
- Limit the max TTL for each entry, allow to update the entries before the real DNS TTL.

Default: `86400`
Limit the max TTL for each entry, allow to update the entries before the real DNS TTL.

- `min_ttl` (int)
- Default: `300`
- Limit of the min TTL, don't allow a refresh be lower than this value.
- This can be impacting is you have fast DNS change (*e.g. deb.debian.org have a 30s TTL*), so you may want to lower this value.

Default: `300`
Limit of the min TTL, don't allow a refresh be lower than this value.
This can be impacting is you have fast DNS change (*e.g. deb.debian.org have a 30s TTL*), so you may want to lower this value.

- `mode` (str)
- not implemented yet

not implemented yet

- `custom_resolver` (ip)
- Default: not set
- If not set, the system dns server will be used (most of the time, the one into `/etc/resolv.conf`).
- If set, the resolver specified here will be used.

Default: not set
If not set, the system dns server will be used (most of the time, the one into `/etc/resolv.conf`).
If set, the resolver specified here will be used.

- `dry_run` (bool)
- Default: `False`
- No change will be done one the NFTables. Command will only be print. Useful with Verbose tag.

Default: `False`
No change will be done one the NFTables. Command will only be print. Useful with Verbose tag.

- `verbose` (bool)
- Default: `False`
- Active the verbose/debug mode.

Default: `False`
Active the verbose/debug mode.

- `include_config_dir` (str)
- Default (explicit into the package): `/etc/nft-dns.d/`
- If removed, not include will be done.
- This is the path for custom configuration. It's a **Directory**. All `.conf` files inside this folder will be read as part of the configuration.

Default (explicit into the package): `/etc/nft-dns.d/`
If removed, not include will be done.
This is the path for custom configuration. It's a **Directory**. All `.conf` files inside this folder will be read as part of the configuration.

## Other sections
All others sections are your fqdn resolutions configuration.
Expand All @@ -60,21 +76,34 @@ You need at least one section to make this program work. These sections cannot b
**All followings parameters are mandatory**

- `[put-a-name-here]` (str)
- give a name to your section
- non-impacting
- need to be unique

give a name to your section

non-impacting

need to be unique

- `set_name` (str)
- This is the Set Name you want to work with

This is the Set Name you want to work with
- `enable` (bool)
- no Default
- You need to specify if you want to activate this rule with `True` or keep it disabled with `False`

no Default

You need to specify if you want to activate this rule with `True` or keep it disabled with `False`

- `typeof` (str)
- no Default
- Choose between `ipv4` or `ipv6`, cannot be both since nftables set are simple stack.

no Default

Choose between `ipv4` or `ipv6`, cannot be both since nftables set are simple stack.

- `domains` (str)
- no Default
- This is the domain (fqdn) you want to resolve and added to your set.
- Multiple fqdn can be specified, separated with `,`
no Default

This is the domain (fqdn) you want to resolve and added to your set.

Multiple fqdn can be specified, separated with `,`

# BUGS
Report issues at: <https://github.com/azlux/nft-dns/issues>
Expand Down
12 changes: 12 additions & 0 deletions build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ install -Dm 755 "$STARTDIR/nft-dns.py" "$DESTDIR/opt/nft-dns/nft-dns.py"
install -Dm 755 "$STARTDIR/entry.py" "$DESTDIR/opt/nft-dns/entry.py"
install -Dm 644 "$STARTDIR/nft-dns.conf" "$DESTDIR/etc/nft-dns.conf"
install -Dm 644 "$STARTDIR/nft-dns.d/.placeholder" "$DESTDIR/etc/nft-dns.d/.placeholder"
pandoc --standalone --to man "$STARTDIR/MANUAL.md" -o "$STARTDIR/nft-dns.1"
install -D -g 0 -o 0 -m 0644 "$STARTDIR/nft-dns.1" "$DESTDIR/usr/local/man/man1/nft-dns.1"

cat >"$STARTDIR/changelog"<<EOL
package ($new) stable; urgency=medium
Please check the source repo for the full changelog
You can found the link at https://packages.azlux.fr/
-- Azlux <github@azlux.fr> $(date -R)
EOL
install -Dm 644 "$STARTDIR/changelog" "$DESTDIR/usr/share/doc/nft-dns/changelog.Debian"
gzip "$DESTDIR/usr/share/doc/nft-dns/changelog.Debian"


# Build .deb
mkdir "$DESTDIR/DEBIAN" "$OUTDIR"
Expand Down

0 comments on commit 8e49959

Please sign in to comment.