From 09fa7c4d083bf54a0b972b2bc6d9a4b0f76c0237 Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 5 Jan 2022 06:46:20 +0100 Subject: [PATCH 1/6] Add workaround to fix setting of capabilities --- docker-compose-template.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose-template.yml b/docker-compose-template.yml index 6621a53..d2e6cf8 100644 --- a/docker-compose-template.yml +++ b/docker-compose-template.yml @@ -24,6 +24,7 @@ services: - 443:443/tcp environment: DNSMASQ_LISTENING: all + DNSMASQ_USER: root TZ: ${TIMEZONE} WEBPASSWORD: ${WEBPASSWORD} VIRTUAL_HOST: ${DOMAIN_NAME} From ec4eb0ac40e80b9001595656d6fe3806e9810b21 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 25 Sep 2022 10:17:00 +0200 Subject: [PATCH 2/6] Fix detection of current version --- syno_pihole.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/syno_pihole.sh b/syno_pihole.sh index 518e507..953af11 100644 --- a/syno_pihole.sh +++ b/syno_pihole.sh @@ -4,8 +4,8 @@ # Title : syno_pihole.sh # Description : Install or Update Pi-Hole as Docker Container on a Synology NAS with a Static IP Address # Author : Mark Dumay -# Date : November 26th, 2021 -# Version : 1.2.1 +# Date : September 25th, 2022 +# Version : 1.2.2 # Usage : sudo ./syno_pihole.sh [OPTIONS] command # Repository : https://github.com/markdumay/synology-pihole.git # License : MIT - https://github.com/markdumay/synology-pihole/blob/master/LICENSE @@ -719,7 +719,8 @@ detect_host_versions() { #====================================================================================================================== # Defines the current and target version of Pi-hole. Exits if the installed version is already the latest version -# available, unless in force mode. The PIHOLE_TAG of the Docker container contains the version information. +# available, unless in force mode. The PIHOLE_TAG or PIHOLE_DOCKER_TAG of the Docker container contains the version +# information. # See https://github.com/pi-hole/docker-pi-hole/releases/tag/2021.09 for more details about the version management. #====================================================================================================================== # Globals: @@ -732,8 +733,8 @@ detect_host_versions() { define_pihole_versions() { print_status "Detecting current and available Pi-hole versions" - # Detect current Docker Pi-hole version (PIHOLE_TAG should comply with 'year.month[.revision]') - pihole_version=$(docker inspect "${param_pihole_hostname}" | grep PIHOLE_TAG | grep -Eo "[0-9]+.[0-9]+(.[0-9]+)?") + # Detect current Docker Pi-hole version (PIHOLE_TAG or PIHOLE_DOCKER_TAG should comply with 'year.month[.revision]') + pihole_version=$(docker inspect "${param_pihole_hostname}" | grep "PIHOLE[A-Z_]*TAG" | grep -Eo "[0-9]+.[0-9]+(.[0-9]+)?") is_valid_version "${pihole_version}" || pihole_version='' log "Current Pi-hole: ${pihole_version:-Unavailable}" From 11d357f4f5068d76d0774dcb4476bbcbe55ce98b Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 25 Sep 2022 10:17:46 +0200 Subject: [PATCH 3/6] Bump default version --- syno_pihole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syno_pihole.sh b/syno_pihole.sh index 953af11..ff76dea 100644 --- a/syno_pihole.sh +++ b/syno_pihole.sh @@ -22,7 +22,7 @@ BOLD='\033[1m' #Bold color DSM_SUPPORTED_VERSION=6 SYNO_DOCKER_SERV_NAME6=pkgctl-Docker SYNO_DOCKER_SERV_NAME7=Docker -DEFAULT_PIHOLE_VERSION='2021.09' +DEFAULT_PIHOLE_VERSION='2022.09.4' COMPOSE_FILE='docker-compose.yml' TEMPLATE_FILE='docker-compose-template.yml' GITHUB_API_PIHOLE='https://api.github.com/repos/pi-hole/docker-pi-hole/releases/latest' From 6c0fe1c48dfa9342dfb18c41e840144721ca4087 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 25 Sep 2022 10:28:23 +0200 Subject: [PATCH 4/6] Limit detection of Docker tag to one result only --- syno_pihole.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/syno_pihole.sh b/syno_pihole.sh index ff76dea..4ecb76b 100644 --- a/syno_pihole.sh +++ b/syno_pihole.sh @@ -734,7 +734,8 @@ define_pihole_versions() { print_status "Detecting current and available Pi-hole versions" # Detect current Docker Pi-hole version (PIHOLE_TAG or PIHOLE_DOCKER_TAG should comply with 'year.month[.revision]') - pihole_version=$(docker inspect "${param_pihole_hostname}" | grep "PIHOLE[A-Z_]*TAG" | grep -Eo "[0-9]+.[0-9]+(.[0-9]+)?") + pihole_version=$(docker inspect -f '{{range $index, $value := .Config.Env}}{{println $value}}{{end}}' \ + "${param_pihole_hostname}" | grep "PIHOLE[A-Z_]*TAG" | grep -Eo "[0-9]+.[0-9]+(.[0-9]+)?") is_valid_version "${pihole_version}" || pihole_version='' log "Current Pi-hole: ${pihole_version:-Unavailable}" From 45ed67cab4ab0088782dc68e326f48c5e1709d89 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 25 Sep 2022 10:35:36 +0200 Subject: [PATCH 5/6] Fix linting errors --- docker-compose-template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose-template.yml b/docker-compose-template.yml index d2e6cf8..c7b2502 100644 --- a/docker-compose-template.yml +++ b/docker-compose-template.yml @@ -11,7 +11,7 @@ networks: - subnet: ${SUBNET} gateway: ${GATEWAY} ip_range: ${IP_RANGE} - + services: pihole: container_name: ${PIHOLE_HOSTNAME} @@ -44,6 +44,6 @@ services: mac_address: ${MAC_ADDRESS} hostname: ${PIHOLE_HOSTNAME} domainname: ${DOMAIN_NAME} - dns: + dns: - 127.0.0.1 - ${DNS1} \ No newline at end of file From 3218cc7f0bc0c3a08c114004b5785d151051a6b0 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 25 Sep 2022 10:44:22 +0200 Subject: [PATCH 6/6] Fix version update --- syno_pihole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syno_pihole.sh b/syno_pihole.sh index 4ecb76b..6103db6 100644 --- a/syno_pihole.sh +++ b/syno_pihole.sh @@ -5,7 +5,7 @@ # Description : Install or Update Pi-Hole as Docker Container on a Synology NAS with a Static IP Address # Author : Mark Dumay # Date : September 25th, 2022 -# Version : 1.2.2 +# Version : 1.2.3 # Usage : sudo ./syno_pihole.sh [OPTIONS] command # Repository : https://github.com/markdumay/synology-pihole.git # License : MIT - https://github.com/markdumay/synology-pihole/blob/master/LICENSE