diff --git a/README.md b/README.md index ec4c303..223f82b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ AdGuard Home is a network-wide software for blocking ads & tracking. After you s It operates as a DNS server that re-routes tracking domains to a "black hole", thus preventing your devices from connecting to those servers. It's based on software we use for our public AdGuard DNS servers -- both share a lot of common code. -**Shipped version:** 0.107.27~ynh1 +**Shipped version:** 0.107.40~ynh1 ## Screenshots @@ -33,7 +33,6 @@ It operates as a DNS server that re-routes tracking domains to a "black hole", t * Official user documentation: * Official admin documentation: * Upstream app code repository: -* YunoHost documentation for this app: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 87f01e1..0b281cb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -21,7 +21,7 @@ AdGuard Home est un logiciel à l'échelle du réseau pour bloquer les publicit Il fonctionne comme un serveur DNS qui redirige les domaines de pistage vers un "trou noir", empêchant ainsi vos appareils de se connecter à ces serveurs. Il est basé sur un logiciel que nous utilisons pour nos serveurs DNS publics AdGuard - les deux partagent beaucoup de code commun. -**Version incluse :** 0.107.27~ynh1 +**Version incluse :** 0.107.40~ynh1 ## Captures d’écran @@ -33,7 +33,6 @@ Il fonctionne comme un serveur DNS qui redirige les domaines de pistage vers un * Documentation officielle utilisateur : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : * Signaler un bug : ## Informations pour les développeurs diff --git a/conf/AdGuardHome.yaml b/conf/AdGuardHome.yaml index 588e664..a37ec83 100644 --- a/conf/AdGuardHome.yaml +++ b/conf/AdGuardHome.yaml @@ -118,11 +118,12 @@ dhcp: ra_slaac_only: false ra_allow_slaac: false clients: [] -log_compress: false -log_localtime: false -log_max_backups: 0 -log_max_size: 100 -log_max_age: 3 -log_file: "" +log: + compress: false + localtime: false + max_backups: 0 + max_size: 100 + max_age: 3 + file: "" verbose: false schema_version: 10 \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf index 6ee6940..f083888 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,6 +9,7 @@ location __PATH__/ { proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; + proxy_set_header X-Remote-User $remote_user; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -19,7 +20,7 @@ location __PATH__/ { } location /dns-query { - proxy_set_header Host $http_host; + proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect off; proxy_buffering on; diff --git a/config_panel.toml b/config_panel.toml index f2aee75..c8db66c 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -4,9 +4,6 @@ version = "1.0" name = "AdguardHome configuration" services = ["__APP__"] - [main.options] - name = "Enable some features" - [main.options.dns_over_https] ask = "Enable DNS-over-HTTPS" type = "boolean" diff --git a/scripts/install b/scripts/install index 35ab3dc..08fc4c1 100644 --- a/scripts/install +++ b/scripts/install @@ -19,17 +19,17 @@ then dns_over_https="true" # DNS over TLS adguard_DoT_port=853 - ynh_app_setting_set --app=$app --key=adguard_DoT_port --value=$adguard_DoT_port + ynh_app_setting_set --app="$app" --key=adguard_DoT_port --value=$adguard_DoT_port ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $adguard_DoT_port ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $adguard_DoT_port # DNS over QUIC adguard_DoQ_port=784 - ynh_app_setting_set --app=$app --key=adguard_DoQ_port --value=$adguard_DoQ_port + ynh_app_setting_set --app="$app" --key=adguard_DoQ_port --value=$adguard_DoQ_port ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $adguard_DoQ_port else dns_over_https="false" fi -ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https +ynh_app_setting_set --app="$app" --key=dns_over_https --value=$dns_over_https #================================================= # CREATE DEDICATED USER @@ -93,25 +93,25 @@ ipv4_route_output=$(echo "$(ip -4 route get 1.2.3.4 2> /dev/null)" | head -n1 | ipv6_route_output=$(echo "$(ip -6 route get ::1.2.3.4 2> /dev/null)" | head -n1) ipv4_addr="" -for i in $(seq "$(echo $ipv4_route_output | wc -w)" -1 1); do - ip=$(echo $ipv4_route_output | awk "{print \$$i}") - if ynh_validate_ip4 --ip_address=$ip; then +for i in $(seq "$(echo "$ipv4_route_output" | wc -w)" -1 1); do + ip=$(echo "$ipv4_route_output" | awk "{print \$$i}") + if ynh_validate_ip4 --ip_address="$ip"; then ipv4_addr="- $ip" break fi done ipv6_addr="" -for i in $(seq "$(echo $ipv6_route_output | wc -w)" -1 1); do - ip=$(echo $ipv6_route_output | awk "{print \$$i}") - if ynh_validate_ip6 --ip_address=$ip; then +for i in $(seq "$(echo "$ipv6_route_output" | wc -w)" -1 1); do + ip=$(echo "$ipv6_route_output" | awk "{print \$$i}") + if ynh_validate_ip6 --ip_address="$ip"; then ipv6_addr="- $ip" break fi done password=$(python3 -c "import bcrypt; print(bcrypt.hashpw(b\"$password\", bcrypt.gensalt(rounds=10)).decode())") -ynh_app_setting_set --app=$app --key=password --value=$password +ynh_app_setting_set --app="$app" --key=password --value="$password" # Main config File ynh_add_config --template="../conf/AdGuardHome.yaml" --destination="$install_dir/AdGuardHome.yaml" @@ -135,7 +135,7 @@ yunohost service add $app --description="Ads & trackers blocking DNS server" --n ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service -ynh_systemd_action --service_name=$app --action="restart" --log_path=systemd +ynh_systemd_action --service_name="$app" --action="restart" --log_path=systemd #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 57324bf..e21957a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,10 +16,10 @@ source /usr/share/yunohost/helpers #================================================= # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null +if ynh_exec_warn_less yunohost service status "$app" >/dev/null then ynh_script_progression --message="Removing $app service integration..." --weight=1 - yunohost service remove $app + yunohost service remove "$app" fi # Remove the dedicated systemd config diff --git a/scripts/restore b/scripts/restore index 60a2b03..6070641 100644 --- a/scripts/restore +++ b/scripts/restore @@ -36,7 +36,7 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet yunohost service add $app --description="Ads & trackers blocking DNS server" --needs_exposed_ports $port_adguard @@ -45,7 +45,7 @@ yunohost service add $app --description="Ads & trackers blocking DNS server" --n #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="restart" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 79c845d..a7dde02 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" +ynh_systemd_action --service_name="$app" --action="stop" #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -32,7 +32,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 if [ -n "$dns_over_https" ] && [ "$dns_over_https" == "1" ]; then dns_over_https="true" - ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https + ynh_app_setting_set --app="$app" --key=dns_over_https --value=$dns_over_https # DNS over TLS adguard_DoT_port=853 ynh_app_setting_set --app=$app --key=adguard_DoT_port --value=$adguard_DoT_port @@ -40,12 +40,12 @@ then ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $adguard_DoT_port # DNS over QUIC adguard_DoQ_port=784 - ynh_app_setting_set --app=$app --key=adguard_DoQ_port --value=$adguard_DoQ_port + ynh_app_setting_set --app="$app" --key=adguard_DoQ_port --value=$adguard_DoQ_port ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $adguard_DoQ_port elif [ -z "$dns_over_https" ] || [ "$dns_over_https" == "0" ]; then dns_over_https="false" - ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https + ynh_app_setting_set --app="$app" --key=dns_over_https --value=$dns_over_https fi #================================================= @@ -110,18 +110,18 @@ ipv4_route_output=$(echo "$(ip -4 route get 1.2.3.4 2> /dev/null)" | head -n1) ipv6_route_output=$(echo "$(ip -6 route get ::1.2.3.4 2> /dev/null)" | head -n1) ipv4_addr="" -for i in $(seq "$(echo $ipv4_route_output | wc -w)" -1 1); do - ip=$(echo $ipv4_route_output | awk "{print \$$i}") - if ynh_validate_ip4 --ip_address=$ip; then +for i in $(seq "$(echo "$ipv4_route_output" | wc -w)" -1 1); do + ip=$(echo "$ipv4_route_output" | awk "{print \$$i}") + if ynh_validate_ip4 --ip_address="$ip"; then ipv4_addr="$ip" break fi done ipv6_addr="" -for i in $(seq "$(echo $ipv6_route_output | wc -w)" -1 1); do - ip=$(echo $ipv6_route_output | awk "{print \$$i}") - if ynh_validate_ip6 --ip_address=$ip; then +for i in $(seq "$(echo "$ipv6_route_output" | wc -w)" -1 1); do + ip=$(echo "$ipv6_route_output" | awk "{print \$$i}") + if ynh_validate_ip6 --ip_address="$ip"; then ipv6_addr="$ip" break fi @@ -159,7 +159,7 @@ chown -R $app:$app "$install_dir/AdGuardHome.yaml" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="restart" --log_path="systemd" #================================================= # END OF SCRIPT