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:
parent
ec9aed16ee
commit
7868979543
3 changed files with 18 additions and 6 deletions
|
@ -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
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue