diff --git a/scripts/backup b/scripts/backup index ca54841..36941d4 100644 --- a/scripts/backup +++ b/scripts/backup @@ -50,4 +50,3 @@ ynh_backup "/etc/systemd/system/$app.service" #================================================= mongodump --db "$app" -o "./dump" - diff --git a/scripts/install b/scripts/install index c32d01b..e59fa1b 100755 --- a/scripts/install +++ b/scripts/install @@ -14,13 +14,14 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= + # Exit if an error occurs during the execution of the script ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= + domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC @@ -96,6 +97,7 @@ ynh_system_user_create $app "$final_path" #================================================= # SPECIFIC SETUP #================================================= + # Install wekan dependencies ynh_print_info "Installing npm dependencies ..." chown -R $app $final_path @@ -112,6 +114,7 @@ systemctl restart mongodb #================================================= # SETUP SYSTEMD #================================================= + # Create a dedicated systemd config ynh_print_info "Adding wekan systemd service ..." ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service" @@ -127,6 +130,7 @@ ynh_add_systemd_config #================================================= # SECURE FILES AND DIRECTORIES #================================================= + ynh_print_info "Fixing permissions ..." # Set strong right permissions to app files chown -R $app: "$final_path" @@ -136,6 +140,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 #================================================= # ADD SERVICE IN ADMIN PANEL #================================================= + yunohost service add mongodb --log "/var/log/mongodb/mongodb.log" yunohost service add $app diff --git a/scripts/remove b/scripts/remove index 4abca71..9870274 100755 --- a/scripts/remove +++ b/scripts/remove @@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= + readonly app=$YNH_APP_INSTANCE_NAME readonly domain=$(ynh_app_setting_get "$app" domain) readonly final_path=$(ynh_app_setting_get "$app" final_path) @@ -42,6 +43,7 @@ ynh_remove_systemd_config #================================================= # REMOVE DB #================================================= + mongo $app --eval "db.dropDatabase()" #================================================= @@ -103,5 +105,3 @@ ynh_secure_remove "/var/log/$app/" # Delete a system user ynh_system_user_delete $app - - diff --git a/scripts/restore b/scripts/restore index 218d4f0..7d08e74 100644 --- a/scripts/restore +++ b/scripts/restore @@ -80,6 +80,7 @@ ynh_install_app_dependencies "mongodb mongodb-server" #================================================= # RESTORE DB #================================================= + # Start mogodb systemctl enable mongodb systemctl start mongodb @@ -99,6 +100,7 @@ popd #================================================= # SECURE FILES AND DIRECTORIES #================================================= + # Set strong right permissions to app files chown -R $app: "$final_path" chmod -R 640 "$final_path" @@ -114,6 +116,7 @@ systemctl enable $app.service #================================================= # ADVERTISE SERVICE IN ADMIN PANEL #================================================= + yunohost service add mongodb --log "/var/log/mongodb/mongodb.log" yunohost service add $app diff --git a/scripts/upgrade b/scripts/upgrade index 1633736..a2396b3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,6 +26,7 @@ port=$(ynh_app_setting_get $app port) #================================================= # Check version #================================================= + abort_if_up_to_date # previous function is what defines 'version', more precisely the 'previous version' previous_version="${version}" @@ -90,7 +91,6 @@ if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then ynh_add_systemd_config fi - #================================================= # STANDARD UPGRADE STEPS #=================================================