Added support for listening for an MQTT message to do an “on demand” sync.#517
Added support for listening for an MQTT message to do an “on demand” sync.#517davidabacon wants to merge 6 commits intomattwebbio:masterfrom
Conversation
well i simple did this to make a trigged sync between multiple shared piholes as a service to make it work myself easy. This is based on my R&D work on it:to start, KEEP it SIMPLE!!!Perhaps build it in orbital-sync with a config setting that enables this build in trigger service that runs the triggersync service when using in a stack with a mgmt primary pihole (using internally shared log volume with a pihole container as shown in my dns-mgmt orbital pihole docker-compose.yml example below) I'm able to compare the mgmt pilhole ftl.log read from a shared docker volume and use it to trigger the update of others if FTL.log changes. As FTL.log always changes when settings are changed on my mgt pihole. R&D setup: One mgmt pihole in docker and the pihole-update.service localy on the docker host checking mgmt pihole docker mapped logfile volume location for the logfile directly. And another secondary pihole in docker that gets updated. This trigger logfile check i use could be build in orbital-sync containr as well The obvious stuff, log file locations, docker container names, or custom start command for example to use ssh and docker start to run orbital triggered sync on a other docker host for example. Or fetch the porbital-sync container output and print it to the servicee log as well for example. How to maybe integrate it in de orbital-sync containerCreate a service config file (debian/ubuntu):pihole-update.service filecontent to save Create the Pi-Hole Update Trigger script used in the service.Create a folder /etc/pupdate and the check-pihole.sh service-script/etc/pupdate/check-pihole.sh filecontent to save Register the Pi-Hole trigger service in the container to make it work! (debian/ubuntu).Enable service Propossed pihole orbital-sync mgmt stack exampledocker-compose.ymldocker-compose.yml dns-pri stack example.Cheerz 🍺🦝🦝🦝do whatever you want with it. i use my own stuff until you build it better ;) Maybe just discard all above and seek contact and integration with the pi-hole docker project offficially and integrate orbital-sync triggering via reading out changes from the Pihole API for example.Maybe update orbital-sync to orbital-mgmt, make what you currently have into a combined solution so eterprises can use pihole docker containers HA disposable and manageble when combinted with orbital-mgmt for the mgmt service. The pi-hole API has features for rebooting and system mgmt already. Simple integrate them, maybe build a simple mgmt webui from the pihole ui. where to add piholes, manage triggers, configs cental. Or just integrate pihole and the orbital idea all togheter. Make them bloodey usable and efficient Pi-Holes remotly managable and usable. 😍 As for a really big part you already did. |
OBJECTIVE
My changes are minor - just added a subroutine to listen for MQTT message (only if MQT_BROKER_URL is defined). Upon receipt of the message, a sync is fired.
Hopefully this could be of use to the wider community.