-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for listening for an MQTT message to do an “on demand” sync. #517
base: master
Are you sure you want to change the base?
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 have a mgmt pihole where i manage the pihole configs localy (not docker) . (The secondary on primary pihole on docker also works, you simple need to redirect the primary pihole docker fltlog location to a volume in your compose file and use the mapped local ftllog location in the service script). This can be build in i read the FTL logs and compare them so when it's changed after a update or change, it triggers the start of the orbital-sync containers i host there too with the run once config option. Changes to make it usable yourself from in the container from my localy build R&D example: 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.yml
docker-compose.yml dns-pri stack example.
Cheerz 🍺🦝🦝🦝do whatever you want with it. i use my own stuff until you build it better ;) |
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.