1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00
This commit is contained in:
ericgaspar 2021-02-20 10:01:47 +01:00
parent b6f58ff4bb
commit ddaedeafdd
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 28 additions and 80 deletions

View file

@ -10,7 +10,7 @@
admin="john" (USER)
is_public=1 (PUBLIC|public=1|private=0)
password="pass"
group_name="public"
group_name="public with space"
; Checks
pkg_linter=1
setup_sub_dir=0

View file

@ -73,10 +73,6 @@
"en": "Choose a name for the group you want to create",
"fr": "Choisissez un nom pour le groupe que vous voulez créer"
},
"help": {
"en": "The name will be used as filename (do not use space, dots or / in your name group).",
"fr": "Le nom sera utilisé comme nom de fichier (n'utilisez pas d'espace, de points ou / dans votre groupe de noms)."
},
"default": "public",
"example": "public"
}

View file

@ -173,16 +173,6 @@ ynh_print_ON
coturn_config_path="/etc/$app/coturn.conf"
# 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=__DOMAIN__ --replace_string=$domain --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=__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_print_OFF
# ynh_replace_string --match_string=__TURNSERVER_PWD__ --replace_string=$turnserver_pwd --target_file="$coturn_config_path"
# ynh_print_ON
ynh_add_config --template="../conf/coturn/turnserver.conf" --destination="$coturn_config_path"
# Get public IP and set as external IP for coturn
@ -201,27 +191,12 @@ ynh_store_file_checksum --file="$coturn_config_path"
# MODIFY A CONFIG FILE
#=================================================
# 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=__PASSWORD__ --replace_string=$password --target_file="$final_path/data/passwd"
ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
ynh_store_file_checksum --file="$final_path/data/passwd"
# mv ../conf/groupname.json $final_path/groups/$group_name.json
# ynh_replace_string --match_string=__ADMIN__ --replace_string=$admin --target_file="$final_path/groups/$group_name.json"
# ynh_replace_string --match_string=__PASSWORD__ --replace_string=$password --target_file="$final_path/groups/$group_name.json"
ynh_add_config --template="../conf/groupname.json" --destination="$final_path/groups/$group_name.json"
ynh_store_file_checksum --file="$final_path/groups/$group_name.json"
# cp ../conf/ice-servers.json $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=__APP__ --replace_string=$app --target_file="$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=__ALT_TLS_PORT__ --replace_string=$turnserver_alt_tls_port --target_file="$final_path/data/ice-servers.json"
# ynh_print_OFF
# ynh_replace_string --match_string=__TURNPWD__ --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"
ynh_store_file_checksum --file="$final_path/data/ice-servers.json"

View file

@ -124,42 +124,42 @@ then
chmod 640 /etc/ssl/private/dh2048.pem
fi
#=================================================
# RECONFIGURE THE TURNSERVER
#=================================================
ynh_script_progression --message="Reconfiguring Coturn..." --weight=23
# #=================================================
# # RECONFIGURE THE TURNSERVER
# #=================================================
# ynh_script_progression --message="Reconfiguring Coturn..." --weight=23
# To be sure that at the restoration the IP address in coturn config is the same as the real address we remake the coturn config
# # To be sure that at the restoration the IP address in coturn config is the same as the real address we remake the coturn config
# WARNING : these commands are used in INSTALL, UPGRADE
# For any update do it in all files
# # WARNING : these commands are used in INSTALL, UPGRADE
# # 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=__DOMAIN__ --replace_string=$domain --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=__TURNSERVER_ALT_TLS_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
# # 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=__TURNSERVER_TLS_PORT__ --replace_string=$turnserver_tls_port --target_file="$coturn_config_path"
# # ynh_replace_string --match_string=__TURNSERVER_ALT_TLS_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
#ynh_add_config --template="../settings/conf/coturn/turnserver.conf" --destination="$coturn_config_path"
# #ynh_add_config --template="../settings/conf/coturn/turnserver.conf" --destination="$coturn_config_path"
# 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
public_ip4="$(curl ip.yunohost.org)" || true
public_ip6="$(curl ipv6.yunohost.org)" || true
# # 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
# public_ip4="$(curl ip.yunohost.org)" || true
# public_ip6="$(curl ipv6.yunohost.org)" || true
if ( [[ -n "$public_ip4" ]] && ynh_validate_ip4 --ip_address="$public_ip4" || [[ -n "$public_ip6" ]] && ynh_validate_ip6 --ip_address="$public_ip6" )
then
echo "external-ip=${public_ip4}/${public_ip6}" >> "$coturn_config_path"
fi
# if ( [[ -n "$public_ip4" ]] && ynh_validate_ip4 --ip_address="$public_ip4" || [[ -n "$public_ip6" ]] && ynh_validate_ip6 --ip_address="$public_ip6" )
# then
# echo "external-ip=${public_ip4}/${public_ip6}" >> "$coturn_config_path"
# fi
ynh_store_file_checksum --file="$coturn_config_path"
# ynh_store_file_checksum --file="$coturn_config_path"
#=================================================
# OPEN THE PORT

View file

@ -166,16 +166,6 @@ ynh_script_progression --message="Updating Coturn config..." --weight=1
coturn_config_path="/etc/$app/coturn.conf"
# 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=__DOMAIN__ --replace_string=$domain --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=__TURNSERVER_ALT_TLS_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=__TURNSERVER_PWD__ --replace_string=$turnserver_pwd --target_file="$coturn_config_path"
# ynh_print_ON
ynh_add_config --template="../conf/coturn/turnserver.conf" --destination="$coturn_config_path"
# Get public IP and set as external IP for coturn
@ -205,21 +195,8 @@ chmod +x $final_path/Coturn_config_rotate.sh
# MODIFY A CONFIG FILE
#=================================================
# 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=__PASSWORD__ --replace_string=$password --target_file="$final_path/data/passwd"
ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
# cp ../conf/ice-servers.json $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=__APP__ --replace_string=$app --target_file="$final_path/data/ice-servers.json"
# 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=__TURNSERVER_TLS_ALT_PORT__ --replace_string=$turnserver_alt_tls_port --target_file="$final_path/data/ice-servers.json"
# 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"
#=================================================