mirror of
https://github.com/YunoHost-Apps/webmin_ynh.git
synced 2024-09-03 20:36:08 +02:00
SECURITY:Close port
This commit is contained in:
parent
33490f3d6b
commit
589f730a32
3 changed files with 10 additions and 11 deletions
|
@ -70,7 +70,6 @@ ynh_app_setting_set $app admin $admin
|
||||||
# Find a free port
|
# Find a free port
|
||||||
port=$(ynh_find_port 10000)
|
port=$(ynh_find_port 10000)
|
||||||
# Open this port
|
# Open this port
|
||||||
yunohost firewall allow --no-upnp TCP $port 2>&1
|
|
||||||
ynh_app_setting_set $app port $port
|
ynh_app_setting_set $app port $port
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,16 +46,6 @@ ynh_webpath_available $domain $path_url \
|
||||||
|
|
||||||
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
# FIND AND OPEN A PORT
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
### Use these lines if you have to open a port for the application
|
|
||||||
### `ynh_find_port` will find the first available port starting from the given port.
|
|
||||||
### If you're not using these lines:
|
|
||||||
### - Remove the section "CLOSE A PORT" in the remove script
|
|
||||||
|
|
||||||
yunohost firewall allow --no-upnp TCP $port 2>&1
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -70,6 +70,16 @@ ynh_backup_if_checksum_is_different "/etc/webmin/miniserv.conf"
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
# Recalculate and store the checksum of the file for the next upgrade.
|
||||||
ynh_store_file_checksum "/etc/webmin/miniserv.conf"
|
ynh_store_file_checksum "/etc/webmin/miniserv.conf"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CLOSE A PORT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
if yunohost firewall list | grep -q "\- $port$"
|
||||||
|
then
|
||||||
|
echo "Close port $port" >&2
|
||||||
|
yunohost firewall disallow TCP $port 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue