1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pihole_ynh.git synced 2024-09-03 20:05:58 +02:00

Use the FTL port, do not open it

This commit is contained in:
Kay0u 2021-08-11 17:53:08 +02:00
parent 3f0b4051d6
commit 994419c68e
No known key found for this signature in database
GPG key ID: AE1DCADB6415A156
5 changed files with 8 additions and 14 deletions

View file

@ -2,6 +2,9 @@
; localonly|all
SOCKET_LISTENING=localonly
; On which port should FTL be listening?
FTLPORT=__PORT__
; Display all queries? Set to no to hide query display
; yes|no
QUERY_DISPLAY=yes

View file

@ -70,7 +70,8 @@ then
elif [ "$file" = "pihole-FTL.conf" ]
then
# Get the default file and overwrite the current config
cp /etc/yunohost/apps/$app/conf/pihole-FTL.conf "$config_file"
port=$(ynh_app_setting_get --app=$app --key=port)
ynh_add_config --template="/etc/yunohost/apps/$app/conf/pihole-FTL.conf" --destination="$config_file"
ynh_script_progression --message="Restarting Pi-Hole..." --weight=2

View file

@ -74,10 +74,6 @@ if [ $port -gt 4720 ]
then
ynh_die --message="The ports 4711 to 4720 are already in use. Pi-hole can't work on another port. Please try to free one of these ports."
fi
ynh_script_progression --message="Configuring firewall..." --weight=1
# Open this port
ynh_exec_fully_quiet yunohost firewall allow --no-upnp TCP $port
ynh_app_setting_set --app=$app --key=port --value=$port
# Disable the port 53 for upnp
@ -230,10 +226,8 @@ ynh_exec_warn_less make install )
ynh_secure_remove --file="$FTL_temp_path"
cp "../conf/dns-servers.conf" "$pihole_storage"
cp "../conf/pihole-FTL.conf" "$pihole_storage"
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$pihole_storage/pihole-FTL.conf"
ynh_add_config --template="../conf/pihole-FTL.conf" --destination="$pihole_storage/pihole-FTL.conf"
if [ "$pihole_version" == "Last 3.X" ]
then

View file

@ -109,7 +109,7 @@ ynh_remove_fpm_config
#=================================================
# CLOSE PORTS
#=================================================
ynh_script_progression --message="Closing ports $port et 67..." --weight=13
ynh_script_progression --message="Closing ports $port and 67..." --weight=13
if yunohost firewall list | grep -q "\- $port$"
then

View file

@ -265,11 +265,7 @@ fi
# Overwrite pihole-FTL config file only if it's allowed
if [ $overwrite_ftl -eq 1 ]
then
# Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
ynh_backup_if_checksum_is_different --file="$pihole_storage/pihole-FTL.conf"
cp "../conf/pihole-FTL.conf" "$pihole_storage"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$pihole_storage/pihole-FTL.conf"
ynh_add_config --template="../conf/pihole-FTL.conf" --destination="$pihole_storage/pihole-FTL.conf"
fi
if [ "$pihole_version" == "Last 3.X" ]