mirror of
https://github.com/YunoHost-Apps/synapse_ynh.git
synced 2024-09-03 20:26:38 +02:00
Fix undefined var
This commit is contained in:
parent
b1cebf78f1
commit
4cd097e916
1 changed files with 28 additions and 28 deletions
|
@ -23,7 +23,7 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Migrate from settings 'special_domain' to 'domain' and 'special_path' to 'path'
|
# Migrate from settings 'special_domain' to 'domain' and 'special_path' to 'path'
|
||||||
if [ -z $domain ]; then
|
if [ -z "${domain:-}" ]; then
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=special_domain)
|
domain=$(ynh_app_setting_get --app=$app --key=special_domain)
|
||||||
path=$(ynh_app_setting_get --app=$app --key=special_path)
|
path=$(ynh_app_setting_get --app=$app --key=special_path)
|
||||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||||
|
@ -34,19 +34,19 @@ if [ -z $domain ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Define $server_name if not already defined
|
# Define $server_name if not already defined
|
||||||
if [ -z $server_name ]; then
|
if [ -z "${server_name:-}" ]; then
|
||||||
server_name=$domain
|
server_name=$domain
|
||||||
ynh_app_setting_set --app=$app --key=server_name --value=$domain
|
ynh_app_setting_set --app=$app --key=server_name --value=$domain
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Define $jitsi_server if not already defined
|
# Define $jitsi_server if not already defined
|
||||||
if [ -z $jitsi_server ]; then
|
if [ -z "${jitsi_server:-}" ]; then
|
||||||
jitsi_server='jitsi.riot.im'
|
jitsi_server='jitsi.riot.im'
|
||||||
ynh_app_setting_set --app=$app --key=jitsi_server --value=$jitsi_server
|
ynh_app_setting_set --app=$app --key=jitsi_server --value=$jitsi_server
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Define $e2e_enabled_by_default if not already defined
|
# Define $e2e_enabled_by_default if not already defined
|
||||||
if [ -z $e2e_enabled_by_default ] ; then
|
if [ -z "${e2e_enabled_by_default:-}" ] ; then
|
||||||
e2e_enabled_by_default="invite"
|
e2e_enabled_by_default="invite"
|
||||||
ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default
|
ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default
|
||||||
fi
|
fi
|
||||||
|
@ -61,7 +61,7 @@ if [ "$e2e_enabled_by_default" = "false" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default
|
ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $report_stats ]; then
|
if [ -z "${report_stats:-}" ]; then
|
||||||
report_stats="false"
|
report_stats="false"
|
||||||
ynh_app_setting_set --app=$app --key=report_stats --value=$report_stats
|
ynh_app_setting_set --app=$app --key=report_stats --value=$report_stats
|
||||||
fi
|
fi
|
||||||
|
@ -72,7 +72,7 @@ web_client_location=$element_ynh_url
|
||||||
client_base_url=$element_ynh_url
|
client_base_url=$element_ynh_url
|
||||||
invite_client_location=$element_ynh_url
|
invite_client_location=$element_ynh_url
|
||||||
|
|
||||||
if [ -z "$web_client_location" ]
|
if [ -z "${web_client_location:-}" ]
|
||||||
then
|
then
|
||||||
element_instance="element"
|
element_instance="element"
|
||||||
if yunohost --output-as plain app list | grep -q "^$element_instance"'$'; then
|
if yunohost --output-as plain app list | grep -q "^$element_instance"'$'; then
|
||||||
|
@ -88,101 +88,101 @@ then
|
||||||
ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location
|
ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$allow_public_rooms_without_auth" ]
|
if [ -z "${allow_public_rooms_without_auth:-}" ]
|
||||||
then
|
then
|
||||||
allow_public_rooms_without_auth=${allow_public_rooms:-false}
|
allow_public_rooms_without_auth=${allow_public_rooms:-false}
|
||||||
ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth
|
ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth
|
||||||
fi
|
fi
|
||||||
if [ -z "$allow_public_rooms_over_federation" ]
|
if [ -z "${allow_public_rooms_over_federation:-}" ]
|
||||||
then
|
then
|
||||||
allow_public_rooms_over_federation=${allow_public_rooms:-false}
|
allow_public_rooms_over_federation=${allow_public_rooms:-false}
|
||||||
ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation
|
ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation
|
||||||
fi
|
fi
|
||||||
if [ -z "$max_upload_size" ]
|
if [ -z "${max_upload_size:-}" ]
|
||||||
then
|
then
|
||||||
max_upload_size="100M"
|
max_upload_size="100M"
|
||||||
ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size
|
ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size
|
||||||
fi
|
fi
|
||||||
if [ -z "$disable_msisdn_registration" ]
|
if [ -z "${disable_msisdn_registration:-}" ]
|
||||||
then
|
then
|
||||||
disable_msisdn_registration="true"
|
disable_msisdn_registration="true"
|
||||||
ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration
|
ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration
|
||||||
fi
|
fi
|
||||||
if [ -z "$registrations_require_3pid" ]
|
if [ -z "${registrations_require_3pid:-}" ]
|
||||||
then
|
then
|
||||||
registrations_require_3pid=email
|
registrations_require_3pid=email
|
||||||
ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid
|
ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid
|
||||||
fi
|
fi
|
||||||
if [ -z "$allowed_local_3pids_email" ]
|
if [ -z "${allowed_local_3pids_email:-}" ]
|
||||||
then
|
then
|
||||||
allowed_local_3pids_email=''
|
allowed_local_3pids_email=''
|
||||||
ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value=$allowed_local_3pids_email
|
ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value=$allowed_local_3pids_email
|
||||||
fi
|
fi
|
||||||
if [ -z "$allowed_local_3pids_msisdn" ]
|
if [ -z "${allowed_local_3pids_msisdn:-}" ]
|
||||||
then
|
then
|
||||||
allowed_local_3pids_msisdn=''
|
allowed_local_3pids_msisdn=''
|
||||||
ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value=$allowed_local_3pids_msisdn
|
ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value=$allowed_local_3pids_msisdn
|
||||||
fi
|
fi
|
||||||
if [ -z "$account_threepid_delegates_msisdn" ]
|
if [ -z "${account_threepid_delegates_msisdn:-}" ]
|
||||||
then
|
then
|
||||||
account_threepid_delegates_msisdn=""
|
account_threepid_delegates_msisdn=""
|
||||||
ynh_app_setting_set --app=$app --key=account_threepid_delegates_msisdn --value=$account_threepid_delegates_msisdn
|
ynh_app_setting_set --app=$app --key=account_threepid_delegates_msisdn --value=$account_threepid_delegates_msisdn
|
||||||
fi
|
fi
|
||||||
if [ -z "$allow_guest_access" ]
|
if [ -z "${allow_guest_access:-}" ]
|
||||||
then
|
then
|
||||||
allow_guest_access="false"
|
allow_guest_access="false"
|
||||||
ynh_app_setting_set --app=$app --key=allow_guest_access --value=$allow_guest_access
|
ynh_app_setting_set --app=$app --key=allow_guest_access --value=$allow_guest_access
|
||||||
fi
|
fi
|
||||||
if [ -z "$default_identity_server" ]
|
if [ -z "${default_identity_server:-}" ]
|
||||||
then
|
then
|
||||||
default_identity_server="https://matrix.org"
|
default_identity_server="https://matrix.org"
|
||||||
ynh_app_setting_set --app=$app --key=default_identity_server --value=$default_identity_server
|
ynh_app_setting_set --app=$app --key=default_identity_server --value=$default_identity_server
|
||||||
fi
|
fi
|
||||||
if [ -z "$auto_join_rooms" ]
|
if [ -z "${auto_join_rooms:-}" ]
|
||||||
then
|
then
|
||||||
auto_join_rooms="#auto_join_room:""$server_name"
|
auto_join_rooms="#auto_join_room:""$server_name"
|
||||||
ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms
|
ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms
|
||||||
fi
|
fi
|
||||||
if [ -z "$autocreate_auto_join_rooms" ]
|
if [ -z "${autocreate_auto_join_rooms:-}" ]
|
||||||
then
|
then
|
||||||
autocreate_auto_join_rooms="false"
|
autocreate_auto_join_rooms="false"
|
||||||
ynh_app_setting_set --app=$app --key=autocreate_auto_join_rooms --value=$autocreate_auto_join_rooms
|
ynh_app_setting_set --app=$app --key=autocreate_auto_join_rooms --value=$autocreate_auto_join_rooms
|
||||||
fi
|
fi
|
||||||
if [ -z "$auto_join_rooms_for_guests" ]
|
if [ -z "${auto_join_rooms_for_guests:-}" ]
|
||||||
then
|
then
|
||||||
auto_join_rooms_for_guests="true"
|
auto_join_rooms_for_guests="true"
|
||||||
ynh_app_setting_set --app=$app --key=auto_join_rooms_for_guests --value=$auto_join_rooms_for_guests
|
ynh_app_setting_set --app=$app --key=auto_join_rooms_for_guests --value=$auto_join_rooms_for_guests
|
||||||
fi
|
fi
|
||||||
if [ -z "$enable_notifs" ]
|
if [ -z "${enable_notifs:-}" ]
|
||||||
then
|
then
|
||||||
enable_notifs="true"
|
enable_notifs="true"
|
||||||
ynh_app_setting_set --app=$app --key=enable_notifs --value=$enable_notifs
|
ynh_app_setting_set --app=$app --key=enable_notifs --value=$enable_notifs
|
||||||
fi
|
fi
|
||||||
if [ -z "$notif_for_new_users" ]
|
if [ -z "${notif_for_new_users:-}" ]
|
||||||
then
|
then
|
||||||
notif_for_new_users="true"
|
notif_for_new_users="true"
|
||||||
ynh_app_setting_set --app=$app --key=notif_for_new_users --value=$notif_for_new_users
|
ynh_app_setting_set --app=$app --key=notif_for_new_users --value=$notif_for_new_users
|
||||||
fi
|
fi
|
||||||
if [ -z "$enable_group_creation" ]
|
if [ -z "${enable_group_creation:-}" ]
|
||||||
then
|
then
|
||||||
enable_group_creation="true"
|
enable_group_creation="true"
|
||||||
ynh_app_setting_set --app=$app --key=enable_group_creation --value=$enable_group_creation
|
ynh_app_setting_set --app=$app --key=enable_group_creation --value=$enable_group_creation
|
||||||
fi
|
fi
|
||||||
if [ -z "$enable_3pid_lookup" ]
|
if [ -z "${enable_3pid_lookup:-}" ]
|
||||||
then
|
then
|
||||||
enable_3pid_lookup=false
|
enable_3pid_lookup=false
|
||||||
ynh_app_setting_set --app=$app --key=enable_3pid_lookup --value=$enable_3pid_lookup
|
ynh_app_setting_set --app=$app --key=enable_3pid_lookup --value=$enable_3pid_lookup
|
||||||
fi
|
fi
|
||||||
if [ -z "$turn_allow_guests" ]
|
if [ -z "${turn_allow_guests:-}" ]
|
||||||
then
|
then
|
||||||
turn_allow_guests=false
|
turn_allow_guests=false
|
||||||
ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests
|
ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -z "$enable_registration" ]
|
if [ -z "${enable_registration:-}" ]
|
||||||
then
|
then
|
||||||
if [ -z $is_free_registration ]; then
|
if [ -z "${is_free_registration:-}" ]; then
|
||||||
is_free_registration=$(ynh_app_setting_get --app=$app --key=is_""public)
|
is_free_registration=$(ynh_app_setting_get --app=$app --key=is_""public)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ then
|
||||||
ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled
|
ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$push_include_content" ]
|
if [ -z "${push_include_content:-}" ]
|
||||||
then
|
then
|
||||||
push_include_content="true"
|
push_include_content="true"
|
||||||
ynh_app_setting_set --app=$app --key=push_include_content --value=$push_include_content
|
ynh_app_setting_set --app=$app --key=push_include_content --value=$push_include_content
|
||||||
|
@ -360,7 +360,7 @@ fi
|
||||||
# MIGRATION 1 : GENERATE SYNAPSE SECRET
|
# MIGRATION 1 : GENERATE SYNAPSE SECRET
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ -z "$registration_shared_secret" ] || [ "$form_secret" == "form_secret: " ]
|
if [ -z "${registration_shared_secret:-}" ] || [ "$form_secret" == "form_secret: " ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Generating synapse secret..." --weight=1
|
ynh_script_progression --message="Generating synapse secret..." --weight=1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue