Merge pull request #18 from YunoHost-Apps/2.0.0-beta.33

2.0.0 beta.33
This commit is contained in:
yalh76 2019-02-12 06:28:42 +01:00 committed by GitHub
commit 96a4de5a03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 26 deletions

View File

@ -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

View File

@ -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

View File

@ -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": {

View File

@ -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
#=================================================

View File

@ -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

View File

@ -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

View File

@ -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
#=================================================