update readme and service
This commit is contained in:
parent
e0ba9a86af
commit
269876c51c
24
README.md
24
README.md
|
@ -1,9 +1,29 @@
|
|||
# pihole-opnsense-sync
|
||||
|
||||
_Sync custom DNS entries in Pi-hole to OPNsense Unbound._
|
||||
|
||||
## Install
|
||||
|
||||
1. Install pip requirements:
|
||||
```shell
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Then get your API auth details.
|
||||
2. Create your secrets file at `/etc/secrets/pihole-opnsense-sync` with your API details:
|
||||
```bash
|
||||
OPNSENSE_API_KEY='...'
|
||||
OPNSENSE_API_SECRET='...'
|
||||
```
|
||||
3. Set the permissions on this file:
|
||||
```shell
|
||||
sudo chown root:root /etc/secrets/pihole-opnsense-sync
|
||||
sudo chmod 600 /etc/secrets/pihole-opnsense-sync
|
||||
```
|
||||
4. Copy the systemd service file:
|
||||
```shell
|
||||
sudo cp pihole-opnsense-sync.service /etc/systemd/system/pihole-opnsense-sync.service
|
||||
```
|
||||
5. Enable and start the service:
|
||||
```shell
|
||||
sudo systemctl enable --now pihole-opnsense-sync
|
||||
sudo systemctl status pihole-opnsense-sync
|
||||
```
|
|
@ -4,7 +4,8 @@ Description=Sync Pi-hole local DNS to OPNsense Unbound
|
|||
[Service]
|
||||
User=pihole
|
||||
Group=pihole
|
||||
ExecStart=/opt/icinga2-checks/Other/auto-acknowledge-apt.sh --api https://localhost:5665 --fail --user icingaweb2 --password XXXXX
|
||||
EnvironmentFile=/etc/secrets/pihole-opnsense-sync
|
||||
ExecStart=/opt/pihole-opnsense-sync/venv/bin/python /opt/pihole-opnsense-sync/syncer.py --opnsense https://192.168.1.1 --api-key ${OPNSENSE_API_KEY} --api-secret ${OPNSENSE_API_SECRET}
|
||||
SyslogIdentifier=pihole-opnsense-sync
|
||||
Restart=always
|
||||
|
||||
|
|
Loading…
Reference in New Issue