mirror of
https://github.com/YunoHost-Apps/galene_ynh.git
synced 2024-09-03 18:36:31 +02:00
Open port 8443
This commit is contained in:
parent
9df2425e08
commit
99dcd31023
6 changed files with 20 additions and 13 deletions
|
@ -8,7 +8,7 @@ Type=simple
|
||||||
WorkingDirectory=__FINALPATH__/
|
WorkingDirectory=__FINALPATH__/
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
ExecStart=__FINALPATH__/galene
|
ExecStart=__FINALPATH__/galene -http __PORT__ -turn auto
|
||||||
LimitNOFILE=65536
|
LimitNOFILE=65536
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -106,14 +106,14 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --time --weight=3
|
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
|
|
@ -86,9 +86,8 @@ port=$(ynh_find_port --port=8443)
|
||||||
turnserver_tls_port=$(ynh_find_port --port=5349)
|
turnserver_tls_port=$(ynh_find_port --port=5349)
|
||||||
turnserver_alt_tls_port=$(ynh_find_port --port=$((turnserver_tls_port+1)))
|
turnserver_alt_tls_port=$(ynh_find_port --port=$((turnserver_tls_port+1)))
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=port --value=$port
|
|
||||||
|
|
||||||
# Open the port
|
# Open the port
|
||||||
|
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
||||||
ynh_exec_warn_less yunohost firewall allow Both $turnserver_tls_port
|
ynh_exec_warn_less yunohost firewall allow Both $turnserver_tls_port
|
||||||
ynh_exec_warn_less yunohost firewall allow Both $turnserver_alt_tls_port
|
ynh_exec_warn_less yunohost firewall allow Both $turnserver_alt_tls_port
|
||||||
|
|
||||||
|
@ -155,6 +154,7 @@ adduser turnserver ssl-cert
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
||||||
|
|
||||||
|
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/systemd.service"
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ setfacl -R -m user:turnserver:rwX /var/log/$app
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
|
||||||
|
|
||||||
yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log" --needs_exposed_ports $port
|
||||||
yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_tls_port
|
yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_tls_port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -87,6 +87,12 @@ ynh_remove_logrotate
|
||||||
# CLOSE A PORT
|
# CLOSE A PORT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
if yunohost firewall list | grep -q "\- $port$"
|
||||||
|
then
|
||||||
|
ynh_script_progression --message="Closing port $port..." --weight=1
|
||||||
|
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
||||||
|
fi
|
||||||
|
|
||||||
if yunohost firewall list | grep -q "\- $turnserver_tls_port$"
|
if yunohost firewall list | grep -q "\- $turnserver_tls_port$"
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Closing port $turnserver_tls_port..." --weight=1
|
ynh_script_progression --message="Closing port $turnserver_tls_port..." --weight=1
|
||||||
|
|
|
@ -31,6 +31,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
group_name=$(ynh_app_setting_get --app=$app --key=group_name)
|
group_name=$(ynh_app_setting_get --app=$app --key=group_name)
|
||||||
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
turnserver_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_tls_port)
|
turnserver_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_tls_port)
|
||||||
turnserver_alt_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_alt_tls_port)
|
turnserver_alt_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_alt_tls_port)
|
||||||
ynh_print_OFF
|
ynh_print_OFF
|
||||||
|
@ -98,7 +99,7 @@ systemctl enable coturn-$app.service --quiet
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
|
||||||
|
|
||||||
yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log" --needs_exposed_ports $port
|
||||||
yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_tls_port
|
yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_tls_port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -107,7 +108,6 @@ yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log"
|
||||||
yunohost service add coturn-$app --needs_exposed_ports $turnserver_tls_port
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A DH FILE
|
# CREATE A DH FILE
|
||||||
|
@ -143,7 +143,6 @@ fi
|
||||||
# ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file="$coturn_config_path"
|
# ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file="$coturn_config_path"
|
||||||
# ynh_replace_string --match_string=__TLS_PORT__ --replace_string=$turnserver_tls_port --target_file="$coturn_config_path"
|
# ynh_replace_string --match_string=__TLS_PORT__ --replace_string=$turnserver_tls_port --target_file="$coturn_config_path"
|
||||||
# ynh_replace_string --match_string=__TLS_ALT_PORT__ --replace_string=$turnserver_alt_tls_port --target_file="$coturn_config_path"
|
# ynh_replace_string --match_string=__TLS_ALT_PORT__ --replace_string=$turnserver_alt_tls_port --target_file="$coturn_config_path"
|
||||||
# ynh_replace_string --match_string=__CLI_PORT__ --replace_string=$cli_port --target_file="$coturn_config_path"
|
|
||||||
# ynh_print_OFF
|
# ynh_print_OFF
|
||||||
# ynh_replace_string --match_string=__TURNPWD__ --replace_string=$turnserver_pwd --target_file="$coturn_config_path"
|
# ynh_replace_string --match_string=__TURNPWD__ --replace_string=$turnserver_pwd --target_file="$coturn_config_path"
|
||||||
# ynh_print_ON
|
# ynh_print_ON
|
||||||
|
@ -165,6 +164,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Ouvre le port dans le firewall
|
# Ouvre le port dans le firewall
|
||||||
|
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
||||||
ynh_exec_warn_less yunohost firewall allow Both $turnserver_tls_port
|
ynh_exec_warn_less yunohost firewall allow Both $turnserver_tls_port
|
||||||
ynh_exec_warn_less yunohost firewall allow Both $turnserver_alt_tls_port
|
ynh_exec_warn_less yunohost firewall allow Both $turnserver_alt_tls_port
|
||||||
|
|
||||||
|
|
|
@ -231,6 +231,7 @@ adduser turnserver ssl-cert
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
|
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
|
||||||
|
|
||||||
|
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/systemd.service"
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
|
@ -264,7 +265,7 @@ ynh_use_logrotate --non-append
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
|
||||||
|
|
||||||
yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log" --needs_exposed_ports $port
|
||||||
yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_tls_port
|
yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_tls_port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue