Sign inSign up

dokeraj/pihole-gravity-updater

By dokeraj

Updated over 4 years ago

Update gravity on existing Pihole container

Image
0

838

dokeraj/pihole-gravity-updater repository overview

This is a python script that makes scheduled command calls (pihole updateGravity) for updating the gravity (adlists) in a dockerized pihole container.

PREREQUISITES: In order to use this docker script, you need to have a Pihole docker container up and running.

Rationale

Since Pihole mobile apps cannot implement updating the gravity (even if it is manual), there is no easy way of updating the adlists, unless you use a browser and do it yourself. This way, you can ensure that the adlists are always up to date.

Supported Architectures

  • armhf - Raspberry Pi 3 and 4
  • amd64

The tag latest is multi-arch, so you can use it for any architecture.

Usage

  1. Spin up Pihole container, from any image. Have the name of the container handy.

IMPORTANT: you must create the following file named config.yml and place it in a folder, that will be binded to a volume. Otherwise you cannot use this docker image.

config.yml

general_settings:
  ## MANDATORY. Name of your pihole docker container. It most probably should be: pihole
  pihole_container_name: <INSERT YOUR PIHOLE CONTAINER NAME HERE>

## DELETE THE ONE YOU DON'T NEED. This is the schedule when you want the script to run and call the Preview Generator commands
backup_schedule:
  ## DELETE IF NOT NEEDED
  weekly:
    ## available values are MON, TUE, WED, THU, FRI, SAT, SUN.
    day: <INPUT DAY HERE>
    ## Use HH:mm format and wrap the time in quatation marks e.g. "14:28"
    time: <HH:mm>
  ## DELETE IF NOT NEEDED
  daily:
    ## Use HH:mm format and wrap the time in quatation marks e.g. "14:28"
    time: <HH:mm>
  ## DELETE IF NOT NEEDED. This schedule will run the preview generation command, on the specified day on the last week of the current month
  last_day_of_month:
    ## available values are MON, TUE, WED, THU, FRI, SAT, SUN.
    day: <INPUT DAY HERE>
    ## Use HH:mm format and wrap the time in quatation marks e.g. "14:28"
    time: <HH:mm>

The config.yml can also be found here.

Docker create command

docker create \
--name=pihole-gravity-updater \
-d \
-e TZ=Europe/London \
-v /path/to/your/yaml/config/file:/yaml \
-v /var/run/docker.sock:/var/run/docker.sock \
--restart unless-stopped \
dokeraj/pihole-gravity-updater:latest
Creation flags explanation
flagFunction
-e TZ=Europe/LondonMandatory. Set it to your timezone. Note: If not set properly, the scheduled backup/update will not be ran at the specified time!
-v /path/to/your/yaml/config/file:/yamlMandatory. This bind should point to where you have placed your config.yml file, so pihole-gravity-updater can read it on startup.
-v /var/run/docker.sock:/var/run/docker.sockMandatory. This bind should be left as it is - it helps the docker container to get access to docker server environment and monitor for events.

Github project

Source code can be found here: Pihole Gravity Updater

Tag summary

Content type

Image

Digest

Size

21.7 MB

Last updated

over 4 years ago

docker pull dokeraj/pihole-gravity-updater