1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/plume_ynh.git synced 2024-09-03 20:15:54 +02:00

Security:Close port

This commit is contained in:
anmol 2018-11-19 19:30:58 +05:30
parent ec9aed16ee
commit 7868979543
3 changed files with 18 additions and 6 deletions

View file

@ -89,8 +89,6 @@ ynh_app_setting_set $app random_key $random_key
# Find a free port
port=$(ynh_find_port 8095)
# Open this port
yunohost firewall allow --no-upnp TCP $port 2>&1
ynh_app_setting_set $app port $port
#=================================================

View file

@ -70,8 +70,15 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file "$final_path"
# open port
yunohost firewall allow --no-upnp TCP $port 2>&1
#=================================================
# CLOSE A PORT
#=================================================
if yunohost firewall list | grep -q "\- $port$"
then
echo "Close port $port" >&2
yunohost firewall disallow TCP $port 2>&1
fi
#=================================================
# RESTORE THE PostgreSQL DATABASE

View file

@ -66,8 +66,15 @@ systemctl stop "$app"
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path $path_url)
# Open this port
yunohost firewall allow --no-upnp TCP $port 2>&1
#=================================================
# CLOSE A PORT
#=================================================
if yunohost firewall list | grep -q "\- $port$"
then
echo "Close port $port" >&2
yunohost firewall disallow TCP $port 2>&1
fi
#=================================================
# CREATE DEDICATED USER