1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pihole_ynh.git synced 2024-09-03 20:05:58 +02:00
This commit is contained in:
ericgaspar 2021-08-10 09:57:29 +02:00
parent aa9113d02f
commit d2ab7d3ced
5 changed files with 36 additions and 38 deletions

View file

@ -1,8 +1,8 @@
;; Test version last version
; Manifest
domain="domain.tld" (DOMAIN)
path="/path" (PATH)
admin="john" (USER)
domain="domain.tld"
path="/path"
admin="john"
query_logging=1
enable_dhcp=0
pihole_version="Last available"
@ -26,15 +26,15 @@
upgrade=1
backup_restore=1
multi_instance=0
port_already_use=1 (4711)
port_already_use=1
change_url=1
actions=1
config_panel=1
;; Test version 3
; Manifest
domain="domain.tld" (DOMAIN)
path="/path" (PATH)
admin="john" (USER)
domain="domain.tld"
path="/path"
admin="john"
query_logging=1
enable_dhcp=0
pihole_version="Last 3.X"
@ -45,8 +45,6 @@
upgrade=1 from_commit=d79ec131b3038ff4695c3317b5d3ee4eda9c8932
backup_restore=1
actions=1
;;; Levels
Level 5=auto
;;; Options
Email=
Notification=change

View file

@ -8,25 +8,25 @@ name = "PiHole configuration"
name = "Overwriting config files"
[main.overwrite_files.overwrite_setupvars]
ask = "Overwrite the config file setupVars.conf ?"
ask = "Overwrite the config file setupVars.conf?"
type = "boolean"
default = true
help = "If the file is overwritten, a backup will be created."
[main.overwrite_files.overwrite_ftl]
ask = "Overwrite the config file pihole-FTL.conf ?"
ask = "Overwrite the config file pihole-FTL.conf?"
type = "boolean"
default = true
help = "If the file is overwritten, a backup will be created."
[main.overwrite_files.overwrite_nginx]
ask = "Overwrite the nginx config file ?"
ask = "Overwrite the nginx config file?"
type = "boolean"
default = true
help = "If the file is overwritten, a backup will be created."
[main.overwrite_files.overwrite_phpfpm]
ask = "Overwrite the php-fpm config file ?"
ask = "Overwrite the php-fpm config file?"
type = "boolean"
default = true
help = "If the file is overwritten, a backup will be created."
@ -36,7 +36,7 @@ name = "PiHole configuration"
name = "Global configuration"
[main.global_config.email_type]
ask = "Send HTML email to admin ?"
ask = "Send HTML email to admin?"
type = "boolean"
default = true
help = "Allow app scripts to send HTML mails instead of plain text."
@ -46,25 +46,25 @@ name = "PiHole configuration"
name = "PHP-FPM configuration"
[main.php_fpm_config.footprint]
ask = "Memory footprint of the service ?"
ask = "Memory footprint of the service?"
choices = ["low", "medium", "high", "specific"]
default = "low"
help = "low <= 20Mb per pool. medium between 20Mb and 40Mb per pool. high > 40Mb per pool.<br>Use specific to set a value with the following option."
[main.php_fpm_config.free_footprint]
ask = "Memory footprint of the service ?"
ask = "Memory footprint of the service?"
type = "number"
default = "0"
help = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values."
[main.php_fpm_config.usage]
ask = "Expected usage of the service ?"
ask = "Expected usage of the service?"
choices = ["low", "medium", "high"]
default = "low"
help = "low: Personal usage, behind the sso. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.<br>medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.<br>high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding."
[main.php_fpm_config.force_max_children]
ask = "Force the value of pm.max_children ?"
ask = "Force the value of pm.max_children?"
type = "number"
default = "0"
help = "Do not change this value unless you're sure about what you're doing !<br>pm.max_children is automatically defined by this formula: $max_ram / 2 / $footprint<br>You can force that value, and ignore the formula by changing the value here.<br>To reset to the default value, set to 0."

View file

@ -3,8 +3,8 @@
"id": "pihole",
"packaging_format": 1,
"description": {
"en": "Network-wide ad blocking via your own DNS server.",
"fr": "Filtrage publicitaire sur l'ensemble du réseau via votre propre serveur DNS."
"en": "Network-wide ad blocking via your own DNS server",
"fr": "Filtrage publicitaire via votre propre serveur DNS"
},
"version": "5.3.1~ynh1",
"url": "https://pi-hole.net/",
@ -53,8 +53,8 @@
"name": "query_logging",
"type": "boolean",
"ask": {
"en": "Do you want to log queries ?",
"fr": "Voulez-vous enregistrer les requêtes dns ?"
"en": "Do you want to log DNS queries?",
"fr": "Voulez-vous enregistrer les requêtes DNS ?"
},
"help": {
"en": "Keeping this option deactivate will render graphs on the admin page useless. But will respect the privacy of the other users.",
@ -66,11 +66,11 @@
"name": "enable_dhcp",
"type": "boolean",
"ask": {
"en": "Do you want to set Pi-hole as your DHCP server ?",
"fr": "Voulez-vous utiliser Pi-hole an tant que serveur DHCP ?"
"en": "Do you want to set Pi-Hole as your DHCP server?",
"fr": "Voulez-vous utiliser Pi-Hole an tant que serveur DHCP ?"
},
"help": {
"en": "If you want to do that, <a href=https://github.com/YunoHost-Apps/pihole_ynh/blob/master/dhcp.md target=_blank>you really have to read this before</a> !",
"en": "If you want to do that, <a href=https://github.com/YunoHost-Apps/pihole_ynh/blob/master/dhcp.md target=_blank>you really have to read this before</a>!",
"fr": "Si vous voulez faire ça, <a href=https://github.com/YunoHost-Apps/pihole_ynh/blob/master/dhcp.md target=_blank>vous devez vraiment lire cela avant</a> !"
},
"default": false
@ -79,12 +79,12 @@
"name": "pihole_version",
"type": "string",
"ask": {
"en": "Which version of Pi-Hole do you want to install ?",
"en": "Which version of Pi-Hole do you want to install?",
"fr": "Quelle version de Pi-Hole voulez-vous installer ?"
},
"help": {
"en": "The last 3.X version is the last version available with the Debian version of dnsmasq.",
"fr": "The last available version will replace the Debian version of dnsmasq by FTLDNS.<br>See the readme for more information."
"en": "The last 3.X version is the last version available with the Debian version of dnsmasq. The last available version will replace the Debian version of dnsmasq by FTLDNS.<br>See the readme for more information.",
"fr": "La dernière version 3.X est la dernière version disponible avec la version Debian de dnsmasq. La dernière version disponible remplacera la version Debian de dnsmasq par FTLDNS.<br>Voir le readme pour plus d'informations."
},
"choices": ["Last 3.X","Last available"],
"default": "Last 3.X"

View file

@ -38,14 +38,14 @@ pihole_version="$(ynh_app_setting_get --app=$app --key=pihole_version)"
#=================================================
# ACTIVATE MAINTENANCE MODE
#=================================================
ynh_script_progression --message="Activating maintenance mode..." --time --weight=1
ynh_script_progression --message="Activating maintenance mode..." --weight=1
ynh_maintenance_mode_ON
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
@ -53,7 +53,7 @@ ynh_system_user_create --username=$app
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Resetting source files..." --time --weight=1
ynh_script_progression --message="Resetting source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
pihole_local_repo="/etc/.pihole"
@ -78,7 +78,7 @@ chown $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Resetting nginx web server configuration..." --time --weight=1
ynh_script_progression --message="Resetting NGINX web server configuration..." --weight=1
# Create a dedicated nginx config
yunohost app action run $app reset_default_nginx
@ -86,7 +86,7 @@ yunohost app action run $app reset_default_nginx
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Resetting php-fpm configuration..." --time --weight=1
ynh_script_progression --message="Resetting PHP-FPM configuration..." --weight=1
# Create a dedicated php-fpm config
yunohost app action run $app reset_default_phpfpm
@ -94,7 +94,7 @@ yunohost app action run $app reset_default_phpfpm
#=================================================
# RECREATE DIRECTORIES
#=================================================
ynh_script_progression --message="Recreating and populating directories..." --time --weight=1
ynh_script_progression --message="Recreating and populating directories..." --weight=1
pihole_storage="/etc/pihole"
mkdir -p "$pihole_storage"
@ -241,14 +241,14 @@ ynh_systemd_action --action=restart --service_name=pihole-FTL
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# DEACTIVE MAINTENANCE MODE
#=================================================
ynh_script_progression --message="Disabling maintenance mode..." --time --weight=1
ynh_script_progression --message="Disabling maintenance mode..." --weight=1
ynh_maintenance_mode_OFF
@ -256,4 +256,4 @@ ynh_maintenance_mode_OFF
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Execution completed" --time --last
ynh_script_progression --message="Execution completed" --last

View file

@ -72,7 +72,7 @@ then
# Get the default file and overwrite the current config
cp /etc/yunohost/apps/$app/conf/pihole-FTL.conf "$config_file"
ynh_script_progression --message="Restarting PiHole..." --weight=2
ynh_script_progression --message="Restarting Pi-Hole..." --weight=2
# Restart pihole-FTL
ynh_systemd_action --action=restart --service_name=pihole-FTL