diff --git a/README.md b/README.md index 0f3ed7b..3b82f94 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ An open source, modern and powerful wiki app built on Node.js, Git and Markdown **Wiki.js is still under development, all features not already implemented.** -**Shipped version:** 2.0.0-beta.13 +**Shipped version:** 2.0.0-beta.33 ## Screenshots diff --git a/conf/app.src b/conf/app.src index e4dd89f..844e9b8 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=url of app's source -SOURCE_SUM=sha256 checksum +SOURCE_URL=https://github.com/Requarks/wiki/archive/2.0.0-beta.33.tar.gz +SOURCE_SUM=66115e8ae174083eaaec83d1c7f6e026fa97ee53d664e6f1505ebe22b0dfe7f2 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 935bdfb..13a5d7d 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "An open source, modern and powerful wiki app built on Node.js, Git and Markdown.", "fr": "Un wiki moderne et open source propulsé Node.js, Git et Markdown." }, - "version": "2.0.0-beta.13~ynh1", + "version": "2.0.0-beta.33~ynh1", "url": "https://wiki.js.org/", "license": "AGPL-3.0-or-later", "maintainer": { diff --git a/scripts/install b/scripts/install index 1e6070c..1e7594e 100644 --- a/scripts/install +++ b/scripts/install @@ -16,6 +16,7 @@ source /usr/share/yunohost/helpers ynh_clean_setup () { ### Remove this function if there's nothing to clean before calling the remove script. + read -p "Press any key..." ynh_clean_check_starting } # Exit if an error occurs during the execution of the script @@ -106,14 +107,13 @@ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/source ynh_install_nodejs 10 -ynh_install_app_dependencies redis-server postgresql postgresql-contrib yarn +ynh_install_app_dependencies yarn redis-server postgresql postgresql-contrib build-essential #================================================= # CREATE A POSTGRESQL DATABASE #================================================= ynh_print_info "Creating a postgresql database ..." - ### Use these lines if you need a database for the application. ### `ynh_mysql_setup_db` will create a database, an associated user and a ramdom password. ### The password will be stored as 'mysqlpwd' into the app settings, @@ -141,12 +141,7 @@ 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 -#ynh_setup_source "$final_path" -git clone https://github.com/Requarks/wiki "$final_path" - -pushd $final_path - git checkout "tags/2.0.0-beta.13" --quiet -popd +ynh_setup_source "$final_path" #================================================= # NGINX CONFIGURATION @@ -194,6 +189,13 @@ ynh_print_info "Configuring php-fpm ..." mkdir -p "/var/log/$app" chown -R "$app":"$app" "/var/log/$app" +#================================================= +# PATCH fs.readdirAsync error +#================================================= + +ynh_replace_string "fs.readdirAsync" "fs.readdirSync" "$final_path/server/db/migrator-source.js" +ynh_replace_string "fs.readdirAsync" "fs.readdirSync" "$final_path/server/jobs/purge-uploads.js" + #================================================= # MAKE SETUP #================================================= @@ -202,8 +204,11 @@ chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs - sudo -u $app env PATH=$PATH:$nodejs_path yarn install - sudo -u $app env PATH=$PATH:$nodejs_path npm run build + sudo -u $app env PATH=$PATH yarn cache clean + sudo -u $app env PATH=$PATH yarn --frozen-lockfile --non-interactive + sudo -u $app env PATH=$PATH yarn build + ynh_secure_remove $final_path/node_modules + sudo -u $app env PATH=$PATH yarn --production --frozen-lockfile --non-interactive popd #================================================= diff --git a/scripts/remove b/scripts/remove index 4756cc8..0838765 100644 --- a/scripts/remove +++ b/scripts/remove @@ -50,6 +50,7 @@ ynh_print_info "Remove the postgresql database" # Remove a database if it exists, along with the associated user ynh_psql_remove_db "$db_name" "$db_name" +ynh_psql_drop_user "$db_name" #================================================= # REMOVE DEPENDENCIES diff --git a/scripts/restore b/scripts/restore index bb1add6..680d05a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -93,7 +93,7 @@ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/source ynh_install_nodejs 10 -ynh_install_app_dependencies redis-server postgresql postgresql-contrib yarn +ynh_install_app_dependencies yarn redis-server postgresql postgresql-contrib build-essential #================================================= # RESTORE THE POSTGRESQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index f61089d..aa11327 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,12 +89,7 @@ path_url=$(ynh_normalize_url_path $path_url) ynh_print_info "Download, check and unpack source" # Download, check integrity, uncompress and patch the source from app.src -#ynh_setup_source "$final_path" - -pushd $final_path - git fetch origin - git checkout "tags/2.0.0-beta.13" --quiet -popd +ynh_setup_source "$final_path" #================================================= # NGINX CONFIGURATION @@ -114,7 +109,7 @@ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/source ynh_install_nodejs 10 -ynh_install_app_dependencies redis-server postgresql postgresql-contrib yarn +ynh_install_app_dependencies yarn redis-server postgresql postgresql-contrib build-essential #================================================= # CREATE DEDICATED USER @@ -135,18 +130,27 @@ ynh_print_info "Reconfigure php-fpm" #================================================= # SPECIFIC UPGRADE #================================================= -# SETUP +# PATCH fs.readdirAsync error +#================================================= + +ynh_replace_string "fs.readdirAsync" "fs.readdirSync" "$final_path/server/db/migrator-source.js" +ynh_replace_string "fs.readdirAsync" "fs.readdirSync" "$final_path/server/jobs/purge-uploads.js" + +#================================================= +# MAKE SETUP #================================================= chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs - sudo -u $app env PATH=$PATH:$nodejs_path yarn install - sudo -u $app env PATH=$PATH:$nodejs_path npm run build + sudo -u $app env PATH=$PATH yarn cache clean + sudo -u $app env PATH=$PATH yarn --frozen-lockfile --non-interactive + sudo -u $app env PATH=$PATH yarn build + ynh_secure_remove $final_path/node_modules + sudo -u $app env PATH=$PATH yarn --production --frozen-lockfile --non-interactive popd - #================================================= # MODIFY A CONFIG FILE #=================================================