From d1072f310e5aa3d26db11d1e39b2177fe7c62542 Mon Sep 17 00:00:00 2001 From: liberodark Date: Thu, 28 Nov 2019 10:30:38 +0100 Subject: [PATCH] Update install --- scripts/install | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/install b/scripts/install index 1b0a551..78743bd 100644 --- a/scripts/install +++ b/scripts/install @@ -34,7 +34,7 @@ final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" # Register (book) web path -ynh_webpath_register $app $domain $path_url +ynh_webpath_register "$app" "$domain" $path_url port=$(ynh_find_port 3000) @@ -47,12 +47,12 @@ db_pass=$(ynh_string_random 20) #================================================= ynh_script_progression --message="Storing installation settings..." -ynh_app_setting_set $app domain $domain -ynh_app_setting_set $app path $path_url -ynh_app_setting_set $app is_public $is_public -ynh_app_setting_set $app port $port -ynh_app_setting_set $app db_pass $db_pass -ynh_app_setting_set $app final_path $final_path +ynh_app_setting_set "$app" domain "$domain" +ynh_app_setting_set "$app" path $path_url +ynh_app_setting_set "$app" is_public "$is_public" +ynh_app_setting_set "$app" port "$port" +ynh_app_setting_set "$app" db_pass "$db_pass" +ynh_app_setting_set "$app" final_path "$final_path" #============================================== # INSTALL POSTGRES @@ -72,7 +72,7 @@ ynh_install_nodejs 8 ynh_script_progression --message="Creating a database..." ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pass +ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pass" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -93,25 +93,25 @@ ynh_replace_string "__PATH__" "${path_url:1}" "../conf/config.json.example" ynh_replace_string "__DB_USER__" "$db_user" "../conf/config.json.example" ynh_replace_string "__DB_NAME__" "$db_name" "../conf/config.json.example" ynh_replace_string "__DB_PASS__" "$db_pass" "../conf/config.json.example" -cp ../conf/config.json.example $final_path/config.json +cp ../conf/config.json.example "$final_path"/config.json ynh_store_file_checksum "$final_path/config.json" # DB Config File ynh_replace_string "__DB_USER__" "$db_user" "../conf/.sequelizerc.example" ynh_replace_string "__DB_NAME__" "$db_name" "../conf/.sequelizerc.example" ynh_replace_string "__DB_PASS__" "$db_pass" "../conf/.sequelizerc.example" -cp ../conf/.sequelizerc.example $final_path/.sequelizerc +cp ../conf/.sequelizerc.example "$final_path"/.sequelizerc #============================================== # INSTALL CODIMD #============================================== ynh_script_progression --message="Building application... (this may take some time and resources!)" -pushd $final_path +pushd "$final_path" || exit ./bin/setup yarn run build #node_modules/.bin/sequelize db:migrate -popd +popd || exit #================================================= # NGINX CONFIGURATION @@ -127,8 +127,8 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring system user..." # Create a system user -ynh_system_user_create $app -chown -R $app:$app $final_path +ynh_system_user_create "$app" +chown -R "$app":"$app" "$final_path" #================================================= # SETUP SYSTEMD @@ -141,7 +141,7 @@ ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service" ynh_replace_string "__NODE__" "$nodejs_path" "../conf/systemd.service" ynh_add_systemd_config -yunohost service add $app --description "CodiMD daemon" +yunohost service add "$app" --description "CodiMD daemon" #================================================= # START SYSTEMD SERVICE @@ -149,7 +149,7 @@ yunohost service add $app --description "CodiMD daemon" ynh_script_progression --message="Starting $app..." -ynh_systemd_action --service_name=$app --action="start" +ynh_systemd_action --service_name="$app" --action="start" #================================================= # SETUP SSOWAT @@ -158,7 +158,7 @@ ynh_systemd_action --service_name=$app --action="start" ynh_script_progression --message="Configuring SSOwat..." # If app is public, add url to SSOWat conf as skipped_uris -if [ $is_public -eq 1 ]; then +if [ "$is_public" -eq 1 ]; then # unprotected_uris allows SSO credentials to be passed anyway. ynh_app_setting_set "$app" unprotected_uris "/" fi