Skip to content

Commit

Permalink
move util to dns-addon-repo
Browse files Browse the repository at this point in the history
  • Loading branch information
superstes committed Dec 19, 2024
1 parent 7c9f7aa commit 97d3967
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 165 deletions.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,34 @@ Currently only TCP port-checks are supported.

NFTables documentation: [docs.o-x-l.com](https://docs.o-x-l.com/firewall/nftables.html)

If you use other addons - use the `util.py` from this one. It has some additional functions defined!
----

## Install

* Create directories:

```bash
mkdir -p /var/local/lib/nftables_addons /etc/nftables.d/addons/
```

* Add the script-files:

* [util.py](https://github.com/O-X-L/nftables_addon_dns/blob/latest/lib/util.py)
* [iplist.py](https://github.com/O-X-L/nftables_addon_failover/blob/latest/lib/failover.py)

* Add the config file:

`/etc/nftables.d/addons/failover.json`

* Optional: Create a service user

* Add sudoers privileges
* Allow to read lib-dir
* Allow to write to addons-config-dir

* Add cron or systemd-timer to execute the script on a schedule: `python3 /var/local/lib/nftables_addons/failover.py`

* Test it and verify it's working as expected

----

Expand Down Expand Up @@ -81,7 +108,7 @@ cat /etc/nftables.d/addons/failover.nft

2. The script is executed

`python3 /usr/lib/nftables/failover.py`
`python3 /var/local/lib/nftables_addons/failover.py`

* It will load the configuration
* Run port-checks for all configured variables - use first host that is online
Expand Down
163 changes: 0 additions & 163 deletions lib/util.py

This file was deleted.

0 comments on commit 97d3967

Please sign in to comment.