diff --git a/README.md b/README.md index fcc4605..ef7188c 100644 --- a/README.md +++ b/README.md @@ -38,10 +38,6 @@ For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post ![pleroma-screenshot1](https://user-images.githubusercontent.com/30271971/52231733-ff136500-28ba-11e9-902a-18f80e627db3.png) -## License - -**LICENSE:** AGPL-3.0 - ## Demo * [List of instances](http://distsn.org/pleroma-instances.html) diff --git a/scripts/backup b/scripts/backup index 5ed5640..3fd2108 100755 --- a/scripts/backup +++ b/scripts/backup @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info "Load settings" +ynh_print_info "Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -38,14 +38,14 @@ cache=$(ynh_app_setting_get "$app" cache) #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_print_info "Backup the app main dir" +ynh_print_info "Backing up the main app directory..." ynh_backup "$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_print_info "Backup nginx configuration" +ynh_print_info "Backing up nginx web server configuration..." ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" @@ -57,14 +57,14 @@ fi #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_print_info "Backup php-fpm configuration" +ynh_print_info "Backing up php-fpm configuration..." -#ynh_backup "/etc/php5/fpm/pool.d/$app.conf" +#ynh_backup "/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= # BACKUP THE POSTGRESQL DATABASE #================================================= -ynh_print_info "Backup the postgresql database" +ynh_print_info "Backing up the PostgreSQL database..." ynh_psql_dump_db "$db_name" > db.sql @@ -73,14 +73,14 @@ ynh_psql_dump_db "$db_name" > db.sql #================================================= # BACKUP LOGROTATE #================================================= -ynh_print_info "Backup logrotate configuration" +ynh_print_info "Backing up logrotate configuration..." ynh_backup "/etc/logrotate.d/$app" #================================================= # BACKUP SYSTEMD #================================================= -ynh_print_info "Backup systemd configuration" +ynh_print_info "Backing up systemd configuration..." ynh_backup "/etc/systemd/system/$app.service" @@ -94,4 +94,4 @@ ynh_backup "/etc/systemd/system/$app.service" # END OF SCRIPT #================================================= -ynh_print_info "Backup script completed. Please wait for YunoHost to create the backup." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 3000aad..8749479 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers #================================================= # RETRIEVE ARGUMENTS #================================================= -ynh_print_info "Retrieve arguments from the manifest" old_domain=$YNH_APP_OLD_DOMAIN old_path=$YNH_APP_OLD_PATH @@ -26,7 +25,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_print_info "Load settings" +ynh_print_info "Loading installation settings..." # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get $app final_path) @@ -38,7 +37,6 @@ final_path=$(ynh_app_setting_get $app final_path) #================================================= # CHECK THE SYNTAX OF THE PATHS #================================================= -ynh_print_info "Check the syntax of the paths" test -n "$old_path" || old_path="/" test -n "$new_path" || new_path="/" @@ -66,7 +64,7 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_print_info "Modify url in nginx configuration" +ynh_print_info "Updating nginx web server configuration..." nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -127,7 +125,7 @@ ynh_store_file_checksum "$final_path/$app/config/prod.secret.exs" #================================================= # RELOAD NGINX #================================================= -ynh_print_info "Reload nginx" +ynh_print_info "Reloading nginx web server..." systemctl reload nginx @@ -135,4 +133,4 @@ systemctl reload nginx # END OF SCRIPT #================================================= -ynh_print_info "Change of url completed" +ynh_print_info "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index 20b8321..24cf001 100755 --- a/scripts/install +++ b/scripts/install @@ -24,7 +24,6 @@ ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -ynh_print_info "Retrieve arguments from the manifest ..." domain=$YNH_APP_ARG_DOMAIN path_url="/" @@ -60,7 +59,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_print_info "Validating arguments ..." +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" @@ -76,7 +75,7 @@ ynh_webpath_register $app $domain $path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_print_info "Store settings from manifest ..." +ynh_print_info "Storing installation settings..." ynh_app_setting_set $app domain $domain ynh_app_setting_set $app path $path_url @@ -137,6 +136,7 @@ ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql pos #================================================= # CREATE A POSTGRESQL DATABASE #================================================= +ynh_print_info "Creating a PostgreSQL database..." ### Use these lines if you need a database for the application. ### `ynh_psql_test_if_first_run` will create a master password and set up global settings. @@ -177,7 +177,7 @@ git clone https://git.pleroma.social/pleroma/pleroma "$final_path/$app" #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info "Configuring nginx ..." +ynh_print_info "Configuring nginx web server..." ### `ynh_add_nginx_config` will use the file conf/nginx.conf @@ -405,7 +405,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_print_info "Reloading nginx ..." +ynh_print_info "Reloading nginx web server..." systemctl reload nginx @@ -419,4 +419,4 @@ ynh_systemd_action --action=start --service_name=$app --log_path=systemd --line_ # END OF SCRIPT #================================================= -ynh_print_info "Installation completed" +ynh_print_info "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index d4a37d0..6b280b1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info "Load settings" +ynh_print_info "Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -32,7 +32,7 @@ cache=$(ynh_app_setting_get "$app" cache) # Remove a service from the admin panel, added by `yunohost service add` if yunohost service status | grep -q $app then - ynh_print_info "Remove $app service" + ynh_print_info "Removing $app service" yunohost service remove $app fi @@ -45,7 +45,7 @@ ynh_systemd_action --action=stop --service_name=$app #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_print_info "Stop and remove the service" +ynh_print_info "Stopping and removing the systemd service" # Remove the dedicated systemd config ynh_remove_systemd_config @@ -53,7 +53,7 @@ ynh_remove_systemd_config #================================================= # REMOVE THE POSTGRESQL DATABASE #================================================= -ynh_print_info "Remove the postgresql database" +ynh_print_info "Removing the PostgreSQL database" ynh_psql_execute_as_root "\connect $db_name SELECT pg_terminate_backend (pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '$db_name';" @@ -64,7 +64,7 @@ ynh_psql_remove_db "$db_name" "$app" #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_print_info "Remove dependencies" +ynh_print_info "Removing dependencies" # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -73,7 +73,7 @@ ynh_secure_remove "/etc/apt/sources.list.d/erlang-solutions.list" #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_print_info "Remove app main directory" +ynh_print_info "Removing app main directory" # Remove the app directory securely ynh_secure_remove "$final_path" @@ -81,7 +81,7 @@ ynh_secure_remove "$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_print_info "Remove nginx configuration" +ynh_print_info "Removing nginx web server configuration" # Remove the dedicated nginx config ynh_remove_nginx_config @@ -90,7 +90,7 @@ ynh_secure_remove "/etc/nginx/conf.d/$app-cache.conf" #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_print_info "Remove php-fpm configuration" +ynh_print_info "Removing php-fpm configuration" # Remove the dedicated php-fpm config #ynh_remove_fpm_config @@ -98,7 +98,7 @@ ynh_print_info "Remove php-fpm configuration" #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_print_info "Remove logrotate configuration" +ynh_print_info "Removing logrotate configuration" # Remove the app-specific logrotate config ynh_remove_logrotate @@ -110,8 +110,8 @@ ynh_print_info "Close ports" if yunohost firewall list | grep -q "\- $port$" then - echo "Close port $port" >&2 - yunohost firewall disallow TCP $port 2>&1 + ynh_print_info "Closing port $port" + ynh_exec_warn_less yunohost firewall disallow TCP $port fi #================================================= @@ -134,7 +134,7 @@ ynh_secure_remove "/var/log/$app/" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_print_info "Remove the dedicated user" +ynh_print_info "Removing the dedicated system user" # Delete a system user ynh_system_user_delete $app @@ -143,4 +143,4 @@ ynh_system_user_delete $app # END OF SCRIPT #================================================= -ynh_print_info "Deletion completed" +ynh_print_info "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 52536cc..f8412bc 100755 --- a/scripts/restore +++ b/scripts/restore @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info "Load settings" +ynh_print_info "Loading settings..." app=$YNH_APP_INSTANCE_NAME @@ -40,6 +40,7 @@ cache=$(ynh_app_setting_get $app cache) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= +ynh_print_info "Validating restoration parameters..." ynh_webpath_available $domain $path_url \ || ynh_die "Path not available: ${domain}${path_url}" @@ -61,14 +62,14 @@ fi #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_print_info "Restore the app main directory" +ynh_print_info "Restoring the app main directory..." ynh_restore_file "$final_path" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_print_info "Recreate the dedicated user" +ynh_print_info "Recreating the dedicated system user..." # Create the dedicated user (if not existing) ynh_system_user_create "$app" "$final_path" @@ -91,7 +92,7 @@ chown -R "$app":"$app" "$final_path" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_print_info "Reinstall dependencies" +ynh_print_info "Reinstalling dependencies..." # Add erlang for Debian Jessie @@ -111,7 +112,7 @@ ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql pos #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -ynh_print_info "Restore the postgresql database" +ynh_print_info "Restoring the PostgreSQL database..." ynh_psql_test_if_first_run ynh_psql_create_user "$app" "$db_pwd" @@ -126,7 +127,7 @@ ynh_psql_execute_file_as_root ./db.sql "$db_name" #================================================= # RESTORE SYSTEMD #================================================= -ynh_print_info "Restore the systemd configuration" +ynh_print_info "Restoring the systemd configuration..." ynh_restore_file "/etc/systemd/system/$app.service" systemctl enable $app.service @@ -155,7 +156,7 @@ ynh_restore_file "/etc/logrotate.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_print_info "Reload nginx and php-fpm" +ynh_print_info "Reloading nginx web server and php-fpm..." #systemctl reload php7.0-fpm systemctl reload nginx @@ -170,4 +171,4 @@ ynh_systemd_action --action=start --service_name=$app --log_path=systemd --line_ # END OF SCRIPT #================================================= -ynh_print_info "Restoration completed" +ynh_print_info "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index a2ef0c2..8d85481 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info "Load settings" +ynh_print_info "Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -47,7 +47,7 @@ fi #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_print_info "Ensure downward compatibility" +ynh_print_info "Ensuring downward compatibility..." # Fix is_public as a boolean value if [ "$is_public" = "Yes" ]; then @@ -73,7 +73,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_print_info "Backup the app before upgrading" +ynh_print_info "Backing up the app before upgrading (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -103,7 +103,7 @@ path_url=$(ynh_normalize_url_path $path_url) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info "Download, check and unpack source" +ynh_print_info "Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src #ynh_setup_source "$final_path/$app" @@ -115,7 +115,7 @@ popd #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info "Reconfigure nginx" +ynh_print_info "Upgrading nginx web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config @@ -136,7 +136,7 @@ fi #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_print_info "Upgrade dependencies" +ynh_print_info "Upgrading dependencies..." # Add erlang for Debian Jessie @@ -156,7 +156,7 @@ ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql pos #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info "Create a dedicated user" +ynh_print_info "Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create "$app" "$final_path" @@ -164,7 +164,7 @@ ynh_system_user_create "$app" "$final_path" #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_print_info "Reconfigure php-fpm" +ynh_print_info "Upgrading php-fpm configuration..." # Create a dedicated php-fpm config #ynh_add_fpm_config @@ -234,7 +234,7 @@ fi #================================================= # SETUP LOGROTATE #================================================= -ynh_print_info "Reconfigure logrotate" +ynh_print_info "Upgrading logrotate configuration..." # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append @@ -242,7 +242,7 @@ ynh_use_logrotate --non-append #================================================= # SETUP SYSTEMD #================================================= -ynh_print_info "Reconfigure systemd" +ynh_print_info "Upgrading systemd configuration..." # Create a dedicated systemd config ynh_add_systemd_config @@ -260,7 +260,7 @@ chown -R "$app":"$app" "$final_path" #================================================= # SETUP SSOWAT #================================================= -ynh_print_info "Reconfigure SSOwat" +ynh_print_info "Upgrading SSOwat configuration..." # Make app public if necessary if [ $is_public -eq 1 ] @@ -272,7 +272,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_print_info "Reload nginx" +ynh_print_info "Reloading nginx web server..." systemctl reload nginx @@ -286,4 +286,4 @@ ynh_systemd_action --action=start --service_name=$app --log_path=systemd --line_ # END OF SCRIPT #================================================= -ynh_print_info "Upgrade completed" +ynh_print_info "Upgrade of $app completed"