From a210a14679c422d83c90c0a0dddb2214a44ad0df Mon Sep 17 00:00:00 2001 From: Kayou Date: Thu, 21 Feb 2019 12:35:13 +0100 Subject: [PATCH] Adding ynh_print_info --- scripts/install | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 873ec7e..6ddf10b 100644 --- a/scripts/install +++ b/scripts/install @@ -36,9 +36,8 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= +ynh_print_info "Validating installation parameters..." -### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" @@ -53,6 +52,7 @@ ynh_webpath_register $app $domain $path_url #================================================= # FIND AND OPEN A PORT #================================================= +ynh_print_info "Configuring firewall..." # Find a free port port=$(ynh_find_port 8095) @@ -62,6 +62,7 @@ yunohost firewall allow --no-upnp TCP $port 2>&1 #================================================= # STORE SETTINGS FROM MANIFEST #================================================= +ynh_print_info "Storing installation settings..." ynh_app_setting_set $app domain $domain ynh_app_setting_set $app is_public $is_public @@ -74,6 +75,7 @@ ynh_app_setting_set $app hashed_password $hashed_password #================================================= # INSTALL DEPENDENCIES #================================================= +ynh_print_info "Installing dependencies..." ynh_install_app_dependencies build-essential libssl-dev zlib1g-dev libpng-dev libpq-dev memcached postgresql cpanminus # Install Carton @@ -82,6 +84,7 @@ echo yes | cpanm Carton #================================================= # CREATE A POSTGRESQL DATABASE #================================================= +ynh_print_info "Creating a PostgreSQL database..." # Create postgresql database ynh_psql_test_if_first_run @@ -95,6 +98,7 @@ db_pwd=$(ynh_app_setting_get $app psqlpwd) # Password created in ynh_psql_setup_ #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_print_info "Setting up source files..." ynh_app_setting_set $app final_path $final_path # Download, check integrity, uncompress and patch the source from app.src @@ -103,6 +107,7 @@ ynh_setup_source "$final_path" #================================================= # NGINX CONFIGURATION #================================================= +ynh_print_info "Configuring nginx web server..." # Create a dedicated nginx config ynh_add_nginx_config @@ -110,6 +115,7 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= +ynh_print_info "Configuring system user..." # Create a system user ynh_system_user_create $app @@ -117,6 +123,7 @@ ynh_system_user_create $app #================================================= ## Copy and fix variable into lstu config #================================================= +ynh_print_info "Configuring lstu..." cp ../conf/lstu.conf.template "${final_path}/lstu.conf" ynh_replace_string "__DOMAIN__" "$domain" "${final_path}/lstu.conf" @@ -142,6 +149,7 @@ ynh_store_file_checksum "${final_path}/lstu.conf" #================================================= # SETUP SYSTEMD #================================================= +ynh_print_info "Configuring a systemd service..." # Create a dedicated systemd config ynh_add_systemd_config @@ -149,6 +157,7 @@ ynh_add_systemd_config #================================================= # Install lstu's dependencies via carton #================================================= +ynh_print_info "Installing lstu..." pushd $final_path carton install --deployment --without=sqlite --without=mysql @@ -157,6 +166,7 @@ popd #================================================= # SETUP LOGROTATE #================================================= +ynh_print_info "Configuring log rotation..." # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -170,6 +180,7 @@ yunohost service add $app --log "/var/log/$app.log" --log "/var/www/$app/log/pro #================================================= # SETUP SSOWAT #================================================= +ynh_print_info "Configuring SSOwat..." # Make app public or private ynh_app_setting_set $app unprotected_uris "/" @@ -196,7 +207,14 @@ ynh_systemd_action -n $app -a start -l "Server available at" -p "systemd" #================================================= # RELOAD NGINX #================================================= +ynh_print_info "Reloading nginx web server..." # Reload Nginx systemctl reload nginx yunohost app ssowatconf + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info "Installation of $app completed"