1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/coturn_ynh.git synced 2024-09-03 18:16:32 +02:00

Cleaning up

This commit is contained in:
ericgaspar 2021-04-19 10:57:43 +02:00
parent 188b315afd
commit d85d9331f3
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 12 additions and 34 deletions

View file

@ -27,7 +27,7 @@
# TLS version 1.0, 1.1 and 1.2. # TLS version 1.0, 1.1 and 1.2.
# For secure UDP connections, Coturn supports DTLS version 1. # For secure UDP connections, Coturn supports DTLS version 1.
# #
tls-listening-port=__TLS_PORT__ tls-listening-port=__TURNSERVER_TLS_PORT__
# Alternative listening port for UDP and TCP listeners; # Alternative listening port for UDP and TCP listeners;
# default (or zero) value means "listening port plus one". # default (or zero) value means "listening port plus one".
@ -43,7 +43,7 @@ tls-listening-port=__TLS_PORT__
# Alternative listening port for TLS and DTLS protocols. # Alternative listening port for TLS and DTLS protocols.
# Default (or zero) value means "TLS listening port plus one". # Default (or zero) value means "TLS listening port plus one".
# #
alt-tls-listening-port=__TLS_ALT_PORT__ alt-tls-listening-port=__TURNSERVER_ALT_TLS_PORT__
# Some network setups will require using a TCP reverse proxy in front # Some network setups will require using a TCP reverse proxy in front
# of the STUN server. If the proxy port option is set a single listener # of the STUN server. If the proxy port option is set a single listener
@ -241,7 +241,7 @@ max-port=65535
# in the user database (if present). The database-stored value can be changed on-the-fly # in the user database (if present). The database-stored value can be changed on-the-fly
# by a separate program, so this is why that mode is considered 'dynamic'. # by a separate program, so this is why that mode is considered 'dynamic'.
# #
static-auth-secret=__TURNPWD__ static-auth-secret=__TURNSERVER_PWD__
# Server name used for # Server name used for
# the oAuth authentication purposes. # the oAuth authentication purposes.
@ -297,7 +297,7 @@ userdb=/var/lib/turn/turndb
# http://www.postgresql.org/docs/9.2/static/libpq-connect.html#LIBPQ-CONNSTRING # http://www.postgresql.org/docs/9.2/static/libpq-connect.html#LIBPQ-CONNSTRING
# for 9.x and newer connection string formats. # for 9.x and newer connection string formats.
# #
#psql-userdb="host=<host> dbname=__DB_NAME__ user=__DB_USER__ password=__DB_PASSWORD__ connect_timeout=30" #psql-userdb="host=<host> dbname=<database-name> user=<database-user> password=<database-user-password> connect_timeout=30"
# MySQL database connection string in the case that you are using MySQL # MySQL database connection string in the case that you are using MySQL
# as the user database. # as the user database.

View file

@ -33,7 +33,7 @@ app=$YNH_APP_INSTANCE_NAME
ynh_script_progression --message="Storing installation settings..." --weight=4 ynh_script_progression --message="Storing installation settings..." --weight=4
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=no_sso --value true ynh_app_setting_set --app=$app --key=no_sso --value=true
#================================================= #=================================================
# CREATE A DH FILE # CREATE A DH FILE
@ -113,18 +113,9 @@ turnserver_pwd=$(ynh_string_random --length=30)
ynh_app_setting_set --app=$app --key=turnserver_pwd --value=$turnserver_pwd ynh_app_setting_set --app=$app --key=turnserver_pwd --value=$turnserver_pwd
ynh_print_ON ynh_print_ON
mv /etc/turnserver.conf /etc/turnserver.conf.orig
coturn_config_path="/etc/turnserver.conf" coturn_config_path="/etc/turnserver.conf"
cp ../conf/turnserver.conf "$coturn_config_path"
ynh_replace_string --match_string=__APP__ --replace_string=$app --target_file="$coturn_config_path" ynh_add_config --template="/etc/turnserver.conf" --destination="$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_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_replace_string --match_string=__TURNPWD__ --replace_string=$turnserver_pwd --target_file="$coturn_config_path"
ynh_print_ON
# Get public IP and set as external IP for coturn # Get public IP and set as external IP for coturn
# note: '|| true' is used to ignore the errors if we can't get the public ipv4 or ipv6 # note: '|| true' is used to ignore the errors if we can't get the public ipv4 or ipv6
@ -154,8 +145,7 @@ chmod +x $data_path/Coturn_config_rotate.sh
# SET COTURN CRON # SET COTURN CRON
#================================================= #=================================================
cp -f ../conf/cron_coturn /etc/cron.d/$app ynh_add_config --template="../conf/cron_coturn" --destination="/etc/cron.d/$app"
ynh_replace_string --match_string="__DATA_PATH__" --replace_string=$data_path --target_file=/etc/cron.d/$app
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
@ -181,7 +171,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="Coturn TURN server" --log="/var/log/$app/$app.log" --needs_exposed_ports $turnserver_tls_port yunohost service add $app --description="Coturn TURN server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$turnserver_tls_port"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE

View file

@ -89,18 +89,7 @@ ynh_script_progression --message="Configuring Coturn..." --weight=2
coturn_config_path="/etc/turnserver.conf" coturn_config_path="/etc/turnserver.conf"
ynh_backup_if_checksum_is_different --file="$coturn_config_path" ynh_add_config --template="/etc/turnserver.conf" --destination="$coturn_config_path"
cp ../conf/turnserver.conf "$coturn_config_path"
ynh_replace_string --match_string=__APP__ --replace_string=$app --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_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_replace_string --match_string=__TURNPWD__ --replace_string=$turnserver_pwd --target_file="$coturn_config_path"
ynh_print_ON
# Get public IP and set as external IP for coturn # Get public IP and set as external IP for coturn
# note: '|| true' is used to ignore the errors if we can't get the public ipv4 or ipv6 # note: '|| true' is used to ignore the errors if we can't get the public ipv4 or ipv6
@ -130,8 +119,7 @@ chmod +x $data_path/Coturn_config_rotate.sh
# SET COTURN CRON # SET COTURN CRON
#================================================= #=================================================
cp -f ../conf/cron_coturn /etc/cron.d/$app ynh_add_config --template="../conf/cron_coturn" --destination="/etc/cron.d/$app"
ynh_replace_string --match_string="__DATA_PATH__" --replace_string=$data_path --target_file=/etc/cron.d/$app
#================================================= #=================================================
# MIGRATION 3 : USE STANDARD ACCESS FOR CERTIFCATE # MIGRATION 3 : USE STANDARD ACCESS FOR CERTIFCATE
@ -169,7 +157,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="Coturn TURN server" --log="/var/log/$app/$app.log" --needs_exposed_ports $turnserver_tls_port yunohost service add $app --description="Coturn TURN server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$turnserver_tls_port"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE