mirror of
https://github.com/YunoHost-Apps/galene_ynh.git
synced 2024-09-03 18:36:31 +02:00
Simplify config
This commit is contained in:
parent
ff303c960e
commit
08664bd85c
5 changed files with 61 additions and 51 deletions
|
@ -1,10 +1,10 @@
|
||||||
lt-cred-mech
|
lt-cred-mech
|
||||||
use-auth-secret
|
use-auth-secret
|
||||||
static-auth-secret=__TURNPWD__
|
static-auth-secret=__TURNSERVER_PWD__
|
||||||
realm=__DOMAIN__
|
realm=__DOMAIN__
|
||||||
|
|
||||||
tls-listening-port=__TLS_PORT__
|
tls-listening-port=__TURNSERVER_TLS_PORT__
|
||||||
alt-tls-listening-port=__TLS_ALT_PORT__
|
alt-tls-listening-port=__TURNSERVER_TLS_ALT_PORT__
|
||||||
min-port=49153
|
min-port=49153
|
||||||
max-port=49193
|
max-port=49193
|
||||||
cli-port=__CLI_PORT__
|
cli-port=__CLI_PORT__
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"urls": [
|
"urls": [
|
||||||
"turn:__DOMAIN__:__TLS_PORT__",
|
"turn:__DOMAIN__:__TURNSERVER_TLS_PORT__",
|
||||||
"turn:__DOMAIN__:__TLS_ALT_PORT__",
|
"turn:__DOMAIN__:__TURNSERVER_TLS_ALT_PORT__",
|
||||||
"turn:__DOMAIN__:__TLS_PORT__?transport=tcp",
|
"turn:__DOMAIN__:__TURNSERVER_TLS_PORT__?transport=tcp",
|
||||||
"turn:__DOMAIN__:__TLS_ALT_PORT__?transport=tcp",
|
"turn:__DOMAIN__:__TURNSERVER_TLS_ALT_PORT__?transport=tcp",
|
||||||
"turn:__DOMAIN__:__TLS_PORT__?transport=udp",
|
"turn:__DOMAIN__:__TURNSERVER_TLS_PORT__?transport=udp",
|
||||||
"turn:__DOMAIN__:__TLS_ALT_PORT__?transport=udp"
|
"turn:__DOMAIN__:__TURNSERVER_TLS_ALT_PORT__?transport=udp"
|
||||||
],
|
],
|
||||||
"username": "__APP__",
|
"username": "__APP__",
|
||||||
"credential": "__TURNPWD__",
|
"credential": "__TURNSERVER_PWD__",
|
||||||
"credentialType": "hmac-sha1"
|
"credentialType": "hmac-sha1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -171,17 +171,19 @@ 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
|
||||||
|
|
||||||
coturn_config_path="/etc/$app/coturn.conf"
|
# coturn_config_path="/etc/$app/coturn.conf"
|
||||||
|
|
||||||
cp ../conf/coturn/turnserver.conf "$coturn_config_path"
|
# cp ../conf/coturn/turnserver.conf "$coturn_config_path"
|
||||||
ynh_replace_string --match_string=__APP__ --replace_string=$app --target_file="$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=__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=__TURNSERVER_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=__TURNSERVER_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_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=__TURNSERVER_PWD__ --replace_string=$turnserver_pwd --target_file="$coturn_config_path"
|
||||||
ynh_print_ON
|
# ynh_print_ON
|
||||||
|
|
||||||
|
ynh_add_config --template="../conf/coturn/turnserver.conf" --destination="/etc/$app/coturn.conf"
|
||||||
|
|
||||||
# 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
|
||||||
|
|
|
@ -140,18 +140,20 @@ ynh_print_ON
|
||||||
# WARNING : these commands are used in INSTALL, UPGRADE
|
# WARNING : these commands are used in INSTALL, UPGRADE
|
||||||
# For any update do it in all files
|
# For any update do it in all files
|
||||||
|
|
||||||
coturn_config_path="/etc/$app/coturn.conf"
|
# coturn_config_path="/etc/$app/coturn.conf"
|
||||||
|
|
||||||
cp ../settings/conf/coturn/turnserver.conf "$coturn_config_path"
|
# cp ../settings/conf/coturn/turnserver.conf "$coturn_config_path"
|
||||||
|
|
||||||
ynh_replace_string --match_string=__APP__ --replace_string=$app --target_file="$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=__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_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
|
||||||
|
|
||||||
|
ynh_add_config --template="../settings/conf/coturn/turnserver.conf" --destination="/etc/$app/coturn.conf"
|
||||||
|
|
||||||
# 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
|
||||||
|
|
|
@ -164,17 +164,19 @@ ynh_script_progression --message="Updating Coturn config..." --weight=1
|
||||||
# WARNING : theses command are used in INSTALL, UPGRADE
|
# WARNING : theses command are used in INSTALL, UPGRADE
|
||||||
# For any update do it in all files
|
# For any update do it in all files
|
||||||
|
|
||||||
coturn_config_path="/etc/$app/coturn.conf"
|
# coturn_config_path="/etc/$app/coturn.conf"
|
||||||
|
|
||||||
cp ../conf/coturn/turnserver.conf $coturn_config_path
|
# cp ../conf/coturn/turnserver.conf $coturn_config_path
|
||||||
ynh_replace_string --match_string=__APP__ --replace_string=$app --target_file="$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=__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=__TURNSERVER_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=__TURNSERVER_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_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=__TURNSERVER_PWD__ --replace_string=$turnserver_pwd --target_file="$coturn_config_path"
|
||||||
ynh_print_ON
|
# ynh_print_ON
|
||||||
|
|
||||||
|
ynh_add_config --template="../conf/coturn/turnserver.conf" --destination="/etc/$app/coturn.conf"
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -203,18 +205,22 @@ chmod +x $final_path/Coturn_config_rotate.sh
|
||||||
# MODIFY A CONFIG FILE
|
# MODIFY A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
cp ../conf/passwd $final_path/data/passwd
|
# cp ../conf/passwd $final_path/data/passwd
|
||||||
ynh_replace_string --match_string=__ADMIN__ --replace_string=$admin --target_file="$final_path/data/passwd"
|
# ynh_replace_string --match_string=__ADMIN__ --replace_string=$admin --target_file="$final_path/data/passwd"
|
||||||
ynh_replace_string --match_string=__PASSWORD__ --replace_string=$password --target_file="$final_path/data/passwd"
|
# ynh_replace_string --match_string=__PASSWORD__ --replace_string=$password --target_file="$final_path/data/passwd"
|
||||||
|
|
||||||
cp ../conf/ice-servers.json $final_path/data/ice-servers.json
|
ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
|
||||||
ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file="$final_path/data/ice-servers.json"
|
|
||||||
ynh_replace_string --match_string=__APP__ --replace_string=$app --target_file="$final_path/data/ice-servers.json"
|
# cp ../conf/ice-servers.json $final_path/data/ice-servers.json
|
||||||
ynh_replace_string --match_string=__TLS_PORT__ --replace_string=$turnserver_tls_port --target_file="$final_path/data/ice-servers.json"
|
# ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file="$final_path/data/ice-servers.json"
|
||||||
ynh_replace_string --match_string=__TLS_ALT_PORT__ --replace_string=$turnserver_alt_tls_port --target_file="$final_path/data/ice-servers.json"
|
# ynh_replace_string --match_string=__APP__ --replace_string=$app --target_file="$final_path/data/ice-servers.json"
|
||||||
ynh_print_OFF
|
# ynh_replace_string --match_string=__TURNSERVER_TLS_PORT__ --replace_string=$turnserver_tls_port --target_file="$final_path/data/ice-servers.json"
|
||||||
ynh_replace_string --match_string=__TURNPWD__ --replace_string=$turnserver_pwd --target_file="$final_path/data/ice-servers.json"
|
# ynh_replace_string --match_string=__TURNSERVER_TLS_ALT_PORT__ --replace_string=$turnserver_alt_tls_port --target_file="$final_path/data/ice-servers.json"
|
||||||
ynh_print_ON
|
# ynh_print_OFF
|
||||||
|
# ynh_replace_string --match_string=__TURNSERVER_PWD__ --replace_string=$turnserver_pwd --target_file="$final_path/data/ice-servers.json"
|
||||||
|
# ynh_print_ON
|
||||||
|
|
||||||
|
ynh_add_config --template="../conf/ice-servers.json" --destination="$final_path/data/ice-servers.json"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
|
Loading…
Add table
Reference in a new issue