From 659cde42fdeedccd1aca7eb54597e74f54a63a45 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Fri, 23 Feb 2018 17:38:31 +0100 Subject: [PATCH] Update to 3.3 --- README.md | 3 ++- README_fr.md | 3 ++- conf/FTL.src | 9 +++++++++ conf/admin_dashboard.src | 4 ++-- conf/app.src | 4 ++-- conf/pihole-FTL.conf | 31 +++++++++++++++++++++++++++++++ manifest.json | 2 +- scripts/_variables | 2 +- scripts/install | 14 ++++++++++++-- scripts/upgrade | 17 +++++++++++++++-- 10 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 conf/FTL.src create mode 100644 conf/pihole-FTL.conf diff --git a/README.md b/README.md index 56f66cc..28c9363 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview Network-wide ad blocking via your own Linux hardware -**Shipped version:** 3.1.4 +**Shipped version:** 3.3 ## Screenshots @@ -40,6 +40,7 @@ Use the admin panel of your Pi-hole to configure this app. ## Limitations * Activate DHCP with Pi-hole need a manuel configuration of your router. +* Pi-Hole-FTL can't be upgrade above the version 2.13.2, because of the usage of an option of dnsmasq not yet available on Jessie. ## Additionnal informations diff --git a/README_fr.md b/README_fr.md index 1754ee1..49683c4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/inst ## Résumé Blocage des publicités sur l'ensemble du réseau via votre propre matériel Linux -**Version embarquée:** 3.1.4 +**Version embarquée:** 3.3 ## Captures d'écran @@ -40,6 +40,7 @@ Utiliser le panneau d'administration de votre Pi-hole pour configurer cette appl ## Limitations * Activer DHCP avec Pi-hole nécessite une configuration manuelle de votre routeur. +* Pi-Hole-FTL ne peut pas être mis à jour au-delà de la version 2.13.2, à cause de l'utilisation d'une option de dnsmasq non encore disponible sur Jessie. ## Informations additionnelles diff --git a/conf/FTL.src b/conf/FTL.src new file mode 100644 index 0000000..31d1e65 --- /dev/null +++ b/conf/FTL.src @@ -0,0 +1,9 @@ +SOURCE_URL=https://github.com/pi-hole/FTL/archive/v2.13.2.tar.gz +SOURCE_SUM=07383d2b3de1ef31526b090603e783b3 +SOURCE_SUM_PRG=md5sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= + +# Be carrefull, the version 3.0 isn't compatible with the version of dnsmasq available on Jessie. +# So, we need to stay stick on the version 2.13.2. diff --git a/conf/admin_dashboard.src b/conf/admin_dashboard.src index eb73e7a..410936c 100644 --- a/conf/admin_dashboard.src +++ b/conf/admin_dashboard.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/pi-hole/AdminLTE/archive/v3.1.tar.gz -SOURCE_SUM=2c0bf61ec96bdb85edeb9fd2cc2f330b +SOURCE_URL=https://github.com/pi-hole/AdminLTE/archive/v3.3.tar.gz +SOURCE_SUM=23368537fa576480e45f625b5e1a7cd7 SOURCE_SUM_PRG=md5sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/app.src b/conf/app.src index 242d278..bc029e6 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/pi-hole/pi-hole/archive/v3.1.4.tar.gz -SOURCE_SUM=e231722332116b7ffab316d5c66a828e +SOURCE_URL=https://github.com/pi-hole/pi-hole/archive/v3.3.tar.gz +SOURCE_SUM=6d4eb0905cf5eb03f16cd8080a66c6f4 SOURCE_SUM_PRG=md5sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/pihole-FTL.conf b/conf/pihole-FTL.conf new file mode 100644 index 0000000..b9b8dca --- /dev/null +++ b/conf/pihole-FTL.conf @@ -0,0 +1,31 @@ +# Listen only for local socket connections or permit all connections +# localonly|all +SOCKET_LISTENING=localonly + +# Display all queries? Set to no to hide query display +# yes|no +QUERY_DISPLAY=yes + +# Allow FTL to analyze AAAA queries from pihole.log? +# yes|no +AAAA_QUERY_ANALYSIS=yes + +# How long should queries be stored in the database? Setting this to 0 disables the database altogether +MAXDBDAYS=365 + +# Should FTL try to resolve IPv6 addresses to host names? +# yes|no +RESOLVE_IPV6=yes + +# Should FTL try to resolve IPv4 addresses to host names? +# yes|no +RESOLVE_IPV4=yes + +# How often do we store queries in FTL's database [minutes]? +DBINTERVAL=1.0 + +# Specify path and filename of FTL's SQLite long-term database. Setting this to DBFILE= disables the database altogether +DBFILE=/etc/pihole/pihole-FTL.db + +# Up to how many hours of queries should be imported from the database and logs? Maximum is 744 (31 days) +MAXLOGAGE=24.0 diff --git a/manifest.json b/manifest.json index 402e8d9..287f3b8 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Network-wide ad blocking via your own DNS server.", "fr": "Filtrage publicitaire sur l'ensemble du réseau via votre propre serveur DNS." }, - "version": "3.1.4~ynh2", + "version": "3.3~ynh1", "url": "https://pi-hole.net/", "license": "EUPL-1.2", "maintainer": { diff --git a/scripts/_variables b/scripts/_variables index a6ba261..53fbf75 100644 --- a/scripts/_variables +++ b/scripts/_variables @@ -1,4 +1,4 @@ #!/bin/bash # Dependencies -app_depencencies="dhcpcd5" +app_depencencies="dhcpcd5 sqlite php5-sqlite idn2" diff --git a/scripts/install b/scripts/install index f208bac..c1a68eb 100644 --- a/scripts/install +++ b/scripts/install @@ -166,11 +166,18 @@ sed -i "/# su #/d;" "$pihole_storage/logrotate" # INSTALLATION OF PIHOLE-FTL #================================================= -git clone https://github.com/pi-hole/FTL +# Get the source of Pi-Hole-FTL +FTL_temp_path=$(mktemp -d) +ynh_setup_source "$FTL_temp_path" FTL + # Plutôt que télécharger le binaire C, on le compile nous-même. -( cd FTL +( cd "$FTL_temp_path" ynh_exec_warn_less make ynh_exec_warn_less make install ) +ynh_secure_remove "$FTL_temp_path" + +cp "../conf/pihole-FTL.conf" "$pihole_storage" + cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL chmod +x /etc/init.d/pihole-FTL ynh_exec_warn_less systemctl enable pihole-FTL @@ -218,6 +225,9 @@ else ynh_replace_string "^log-queries" "#log-queries" $pihole_dnsmasq_config fi +# Fix a too recent option for our dnsmasq version. +ynh_replace_string "log-queries=extra" "log-queries" $pihole_dnsmasq_config + ynh_store_file_checksum "$pihole_dnsmasq_config" # Enregistre la somme de contrôle du fichier de config # Pour éviter un conflit entre les config de dnsmasq, il faut commenter cache-size dans la config par défaut. diff --git a/scripts/upgrade b/scripts/upgrade index 01dc427..701df49 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,6 +8,8 @@ source _common.sh source /usr/share/yunohost/helpers +# Load common variables for all scripts. +source _variables #================================================= # LOAD SETTINGS @@ -49,6 +51,12 @@ path_url=$(ynh_normalize_url_path $path_url) # Vérifie et corrige la syntaxe du #================================================= # STANDARD UPGRADE STEPS +#================================================= +# INSTALL DEPENDENCIES +#================================================= + +ynh_install_app_dependencies $app_depencencies + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -123,11 +131,16 @@ sed -i "/# su #/d;" "$pihole_storage/logrotate" systemctl stop pihole-FTL -git clone https://github.com/pi-hole/FTL +# Get the source of Pi-Hole-FTL +FTL_temp_path=$(mktemp -d) +ynh_setup_source "$FTL_temp_path" FTL + # Plutôt que télécharger le binaire C, on le compile nous-même. -( cd FTL +( cd "$FTL_temp_path" ynh_exec_warn_less make ynh_exec_warn_less make install ) +ynh_secure_remove "$FTL_temp_path" + cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL chmod +x /etc/init.d/pihole-FTL ynh_exec_warn_less systemctl enable pihole-FTL