From f1d8696ff3c9067104481cbcd517f7967414ff15 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Feb 2019 20:47:00 +0100 Subject: [PATCH 01/19] Fix DB dir instead of using tmp files --- conf/systemd.service | 1 + scripts/install | 6 ++++++ scripts/upgrade | 10 +++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 301d80e..84dacfe 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ Environment="PATH=__NODEJS_PATH__" Environment="PORT=__PORT__" +Environment="DB_DIR=__FINALPATH__/db" WorkingDirectory=__FINALPATH__/ ExecStart=/bin/sh -c '__FINALPATH__/node_modules/.bin/ts-node --project __FINALPATH__/tsconfig.json __FINALPATH__/bin/server.ts >> /var/log/__APP__/__APP__.log 2>&1' diff --git a/scripts/install b/scripts/install index 3bcce28..ae6dcbe 100644 --- a/scripts/install +++ b/scripts/install @@ -174,6 +174,12 @@ ynh_system_user_create "$app" "$final_path" mkdir -p "/var/log/$app" chown -R "$app":"$app" "/var/log/$app" +#================================================= +# CREATE DB FOLDER +#================================================= + +mkdir -p "$final_path/db" + #================================================= # MAKE SETUP #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 0ac8fc0..faa00c8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -119,7 +119,15 @@ ynh_system_user_create "$app" "$final_path" #================================================= # SPECIFIC UPGRADE #================================================= -# ... + +#================================================= +# CREATE DB FOLDER +#================================================= + +mkdir -p "$final_path/db" + +#================================================= +# MAKE INSTALL #================================================= chown -R "$app":"$app" "$final_path" From 12f480dc1e068295c39a5c6626a5be67bd6015d7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Feb 2019 20:52:46 +0100 Subject: [PATCH 02/19] change upgrade --- scripts/upgrade | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index faa00c8..b632330 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -134,9 +134,7 @@ chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs -sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --save -sudo -u $app env PATH=$PATH:$nodejs_path npm install typescript@>=2.0 --save -sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node +sudo -u $app env PATH=$PATH:$nodejs_path npm update sudo -u $app env PATH=$PATH:$nodejs_path npm install sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix popd From 7689f352be33e3926293cb9f7136d99067977ce9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Feb 2019 20:54:59 +0100 Subject: [PATCH 03/19] change git pull --- scripts/upgrade | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index b632330..1570238 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,7 +85,10 @@ path_url=$(ynh_normalize_url_path $path_url) # Download, check integrity, uncompress and patch the source from app.src# #ynh_setup_source "$final_path" -(cd $final_path && git pull) + +pushd $final_path + git pull +popd #================================================= # NGINX CONFIGURATION From 3630061f703fa9f3bdc0d6d3c38a420fa05cbc9e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Feb 2019 21:09:14 +0100 Subject: [PATCH 04/19] update npm to production --- conf/systemd.service | 1 + scripts/install | 8 ++++---- scripts/upgrade | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 84dacfe..8de39bf 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -9,6 +9,7 @@ Group=__APP__ Environment="PATH=__NODEJS_PATH__" Environment="PORT=__PORT__" Environment="DB_DIR=__FINALPATH__/db" +Environment="NODE_ENV=production" WorkingDirectory=__FINALPATH__/ ExecStart=/bin/sh -c '__FINALPATH__/node_modules/.bin/ts-node --project __FINALPATH__/tsconfig.json __FINALPATH__/bin/server.ts >> /var/log/__APP__/__APP__.log 2>&1' diff --git a/scripts/install b/scripts/install index ae6dcbe..8948f43 100644 --- a/scripts/install +++ b/scripts/install @@ -187,10 +187,10 @@ mkdir -p "$final_path/db" chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs -sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --save -sudo -u $app env PATH=$PATH:$nodejs_path npm install typescript@>=2.0 --save -sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node -sudo -u $app env PATH=$PATH:$nodejs_path npm install +sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --production +#sudo -u $app env PATH=$PATH:$nodejs_path npm install typescript@>=2.0 --save +sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node --production +sudo -u $app env PATH=$PATH:$nodejs_path npm install --production sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix popd diff --git a/scripts/upgrade b/scripts/upgrade index 1570238..77dff4f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -137,8 +137,8 @@ chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs -sudo -u $app env PATH=$PATH:$nodejs_path npm update -sudo -u $app env PATH=$PATH:$nodejs_path npm install +sudo -u $app env PATH=$PATH:$nodejs_path npm update --production +sudo -u $app env PATH=$PATH:$nodejs_path npm install --production sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix popd From 257c2bdae3bd1a179e94eeadbe2872444de37c4d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Feb 2019 21:14:16 +0100 Subject: [PATCH 05/19] remove tmp cleanup --- scripts/remove | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/remove b/scripts/remove index a25f56f..c306303 100644 --- a/scripts/remove +++ b/scripts/remove @@ -61,10 +61,6 @@ ynh_remove_nodejs # REMOVE APP MAIN DIR #================================================= -# remove tmp files -sudo -u $app rm -rf /tmp/* -ynh_secure_remove "/var/tmp/*" - # Remove the app directory securely ynh_secure_remove "$final_path" From a8baa331fc4878c7eec1d116bedfb74fb7e87aea Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Feb 2019 21:20:25 +0100 Subject: [PATCH 06/19] cleanup --- scripts/install | 11 +++++------ scripts/upgrade | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index 8948f43..86da27c 100644 --- a/scripts/install +++ b/scripts/install @@ -186,12 +186,11 @@ mkdir -p "$final_path/db" chown -R "$app":"$app" "$final_path" pushd $final_path -ynh_use_nodejs -sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --production -#sudo -u $app env PATH=$PATH:$nodejs_path npm install typescript@>=2.0 --save -sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node --production -sudo -u $app env PATH=$PATH:$nodejs_path npm install --production -sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix + ynh_use_nodejs + sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --production + sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node --production + sudo -u $app env PATH=$PATH:$nodejs_path npm install --production + sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 77dff4f..4f3d7d9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -134,12 +134,11 @@ mkdir -p "$final_path/db" #================================================= chown -R "$app":"$app" "$final_path" - pushd $final_path -ynh_use_nodejs -sudo -u $app env PATH=$PATH:$nodejs_path npm update --production -sudo -u $app env PATH=$PATH:$nodejs_path npm install --production -sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix + ynh_use_nodejs + sudo -u $app env PATH=$PATH:$nodejs_path npm update --production + sudo -u $app env PATH=$PATH:$nodejs_path npm install --production + sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix popd ### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. From 27ea69727d8dd6c116a13807dc1ee0901fe4ab91 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Feb 2019 21:48:12 +0100 Subject: [PATCH 07/19] remove not need file --- conf/package.json | 68 ----------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 conf/package.json diff --git a/conf/package.json b/conf/package.json deleted file mode 100644 index 26deb96..0000000 --- a/conf/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "distbin", - "version": "1.0.0", - "description": "Post bin with distributed social features.", - "main": "src", - "directories": { - "test": "test" - }, - "dependencies": { - "@types/accepts": "^1.3.5", - "@types/dompurify": "0.0.31", - "@types/jsdom": "^11.0.5", - "@types/lodash": "^4.14.85", - "@types/marked": "^0.3.0", - "@types/morgan": "^1.7.35", - "@types/node-uuid": "0.0.28", - "@types/parse-link-header": "^1.0.0", - "@types/winston": "^2.3.7", - "accepts": "^1.3.3", - "dompurify": "^0.8.4", - "hoek": "^4.2.1", - "jsdom": "^9.9.1", - "jsonld": "^0.4.11", - "jsonld-rdfa-parser": "^1.5.1", - "lodash": "^4.17.4", - "marked": "^0.3.19", - "morgan": "^1.9.1", - "node-fetch": "^1.6.3", - "node-uuid": "^1.4.7", - "parse-link-header": "^0.4.1", - "portfinder": "^1.0.13", - "uuid": "^3.1.0", - "winston": "^2.4.0" - }, - "devDependencies": { - "@types/node": "^8.10.19", - "@types/node-fetch": "^2.1.1", - "copyfiles": "^1.2.0", - "eslint": "^3.7.1", - "eslint-config-standard": "^6.2.0", - "eslint-plugin-no-only-tests": "^2.0.0", - "eslint-plugin-promise": "^3.0.0", - "eslint-plugin-standard": "^2.0.1", - "ts-node": "^6.2.0", - "tsc-watch": "^1.0.22", - "tslint": "^5.10.0", - "typescript": "^2.9.2", - "typescript-eslint-parser": "^8.0.1" - }, - "peerDependencies": { - "hoek": "^4.2.1" - }, - "config": { - "port": __PORT__ - }, - "scripts": { - "lint": "tslint -c tslint.json 'src/**/*.ts' 'test/**/*.ts' 'bin/**/*.ts'", - "lint-fix": "tslint --fix -c tslint.json 'src/**/*.ts' 'test/**/*.ts' 'bin/**/*.ts'", - "test": "ts-node test", - "start": "node ./dist/bin/server", - "start-dev": "tsc-watch --onSuccess 'npm start'", - "tsc": "tsc", - "build": "tsc && npm run build.copyfiles", - "build.copyfiles": "copyfiles './src/**/*.json' dist/" - }, - "author": "", - "license": "ISC" -} From c4d75ae09155c77c549a6623f5d29004f146522f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 02:39:17 +0100 Subject: [PATCH 08/19] add --save --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 86da27c..58f63c7 100644 --- a/scripts/install +++ b/scripts/install @@ -187,8 +187,8 @@ mkdir -p "$final_path/db" chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs - sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --production - sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node --production + sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --save --production + sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node --save --production sudo -u $app env PATH=$PATH:$nodejs_path npm install --production sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix popd From f1ad2f1648aa5f5a721de802a991e40002363f0c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 05:28:53 +0100 Subject: [PATCH 09/19] Adding Yarn --- scripts/install | 5 ++++- scripts/remove | 3 ++- scripts/restore | 6 ++++-- scripts/upgrade | 5 ++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 58f63c7..7d84ce7 100644 --- a/scripts/install +++ b/scripts/install @@ -97,10 +97,13 @@ ynh_app_setting_set $app port $port ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script -#ynh_install_app_dependencies deb1 deb2 +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list ynh_install_nodejs 8 +ynh_install_app_dependencies yarn + #================================================= # CREATE A MYSQL DATABASE #================================================= diff --git a/scripts/remove b/scripts/remove index c306303..529f5ef 100644 --- a/scripts/remove +++ b/scripts/remove @@ -46,9 +46,10 @@ ynh_remove_systemd_config #================================================= # Remove metapackage and its dependencies -#ynh_remove_app_dependencies ynh_use_nodejs ynh_remove_nodejs +ynh_remove_app_dependencies +rm -rf "/etc/apt/sources.list.d/yarn.list" #================================================= # REMOVE THE MYSQL DATABASE diff --git a/scripts/restore b/scripts/restore index 9b16496..c12dd0e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -92,11 +92,13 @@ chown -R $app:$app /var/log/$app # REINSTALL DEPENDENCIES #================================================= -# Define and install dependencies -#ynh_install_app_dependencies deb1 deb2 +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list ynh_install_nodejs 8 +ynh_install_app_dependencies yarn + #================================================= # RESTORE SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4f3d7d9..3e795f1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -101,10 +101,13 @@ ynh_add_nginx_config # UPGRADE DEPENDENCIES #================================================= -#ynh_install_app_dependencies deb1 deb2 +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list ynh_install_nodejs 8 +ynh_install_app_dependencies yarn + #================================================= # CREATE DEDICATED USER #================================================= From 41aa41af4a0d60576301effcf619f293c33b92af Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 05:38:41 +0100 Subject: [PATCH 10/19] Adding Yarn --- scripts/install | 7 +++---- scripts/remove | 3 --- scripts/upgrade | 5 ++--- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 7d84ce7..bd2342e 100644 --- a/scripts/install +++ b/scripts/install @@ -190,10 +190,9 @@ mkdir -p "$final_path/db" chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs - sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --save --production - sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node --save --production - sudo -u $app env PATH=$PATH:$nodejs_path npm install --production - sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix + #sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --save --production + sudo -u $app env PATH=$PATH:$nodejs_path yarn install ts-node --save --production + sudo -u $app env PATH=$PATH:$nodejs_path yarn install --production popd #================================================= diff --git a/scripts/remove b/scripts/remove index 529f5ef..0ad888e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -102,9 +102,6 @@ fi # REMOVE THE CRON FILE #================================================= -#npm uninstall -g ts-node -#npm uninstall -g typescript - # Remove a cron file #ynh_secure_remove "/etc/cron.d/$app" diff --git a/scripts/upgrade b/scripts/upgrade index 3e795f1..c8e8a08 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -139,9 +139,8 @@ mkdir -p "$final_path/db" chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs - sudo -u $app env PATH=$PATH:$nodejs_path npm update --production - sudo -u $app env PATH=$PATH:$nodejs_path npm install --production - sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix + sudo -u $app env PATH=$PATH:$nodejs_path yarn update --production + sudo -u $app env PATH=$PATH:$nodejs_path yarn install --production popd ### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. From db1a1fa3973918967a1c3838d77a60ef9058161f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 05:41:36 +0100 Subject: [PATCH 11/19] Fix yarn add --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index bd2342e..23b594a 100644 --- a/scripts/install +++ b/scripts/install @@ -191,7 +191,7 @@ chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs #sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --save --production - sudo -u $app env PATH=$PATH:$nodejs_path yarn install ts-node --save --production + sudo -u $app env PATH=$PATH:$nodejs_path yarn add ts-node --save --production sudo -u $app env PATH=$PATH:$nodejs_path yarn install --production popd From fb2c47df7a1b407167937a64fd4cfce57d0b0890 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 06:09:23 +0100 Subject: [PATCH 12/19] Fix install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 23b594a..e7246c2 100644 --- a/scripts/install +++ b/scripts/install @@ -190,7 +190,7 @@ mkdir -p "$final_path/db" chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs - #sudo -u $app env PATH=$PATH:$nodejs_path npm install hoek@^4.2.1 --save --production + sudo -u $app env PATH=$PATH:$nodejs_path yarn add hoek@^4.2.1 --save --production sudo -u $app env PATH=$PATH:$nodejs_path yarn add ts-node --save --production sudo -u $app env PATH=$PATH:$nodejs_path yarn install --production popd From 6b3702be4c42192fa4d58e2ff137e5cc6f18330a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 06:18:53 +0100 Subject: [PATCH 13/19] removing Yarn --- scripts/install | 12 +++++------- scripts/remove | 1 - scripts/restore | 5 +---- scripts/upgrade | 9 +++------ 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/scripts/install b/scripts/install index e7246c2..57c8d07 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 @@ -97,12 +98,9 @@ ynh_app_setting_set $app port $port ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script -curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list - ynh_install_nodejs 8 -ynh_install_app_dependencies yarn +#ynh_install_app_dependencies #================================================= # CREATE A MYSQL DATABASE @@ -190,9 +188,9 @@ mkdir -p "$final_path/db" chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs - sudo -u $app env PATH=$PATH:$nodejs_path yarn add hoek@^4.2.1 --save --production - sudo -u $app env PATH=$PATH:$nodejs_path yarn add ts-node --save --production - sudo -u $app env PATH=$PATH:$nodejs_path yarn install --production + sudo -u $app env PATH=$PATH:$nodejs_path npm add hoek@^4.2.1 --save --production + sudo -u $app env PATH=$PATH:$nodejs_path npm add ts-node --save --production + sudo -u $app env PATH=$PATH:$nodejs_path npm install --production popd #================================================= diff --git a/scripts/remove b/scripts/remove index 0ad888e..baad67d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -49,7 +49,6 @@ ynh_remove_systemd_config ynh_use_nodejs ynh_remove_nodejs ynh_remove_app_dependencies -rm -rf "/etc/apt/sources.list.d/yarn.list" #================================================= # REMOVE THE MYSQL DATABASE diff --git a/scripts/restore b/scripts/restore index c12dd0e..9f613e6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -92,12 +92,9 @@ chown -R $app:$app /var/log/$app # REINSTALL DEPENDENCIES #================================================= -curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list - ynh_install_nodejs 8 -ynh_install_app_dependencies yarn +#ynh_install_app_dependencies #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index c8e8a08..a262cd4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -101,12 +101,9 @@ ynh_add_nginx_config # UPGRADE DEPENDENCIES #================================================= -curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list - ynh_install_nodejs 8 -ynh_install_app_dependencies yarn +#ynh_install_app_dependencies #================================================= # CREATE DEDICATED USER @@ -139,8 +136,8 @@ mkdir -p "$final_path/db" chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs - sudo -u $app env PATH=$PATH:$nodejs_path yarn update --production - sudo -u $app env PATH=$PATH:$nodejs_path yarn install --production + sudo -u $app env PATH=$PATH:$nodejs_path npm update --production + sudo -u $app env PATH=$PATH:$nodejs_path npm install --production popd ### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. From 9e6a72c8900cea27ea62895faffaededbb9f37a6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 06:23:32 +0100 Subject: [PATCH 14/19] fix ts-node installation --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 57c8d07..74d8721 100644 --- a/scripts/install +++ b/scripts/install @@ -189,7 +189,7 @@ chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs sudo -u $app env PATH=$PATH:$nodejs_path npm add hoek@^4.2.1 --save --production - sudo -u $app env PATH=$PATH:$nodejs_path npm add ts-node --save --production + sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node --save --production sudo -u $app env PATH=$PATH:$nodejs_path npm install --production popd From 78f6ab4ab6b0d268fae87460ae718e6c896a9bd7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 06:27:04 +0100 Subject: [PATCH 15/19] Fix ts-node install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 74d8721..c0e8e0b 100644 --- a/scripts/install +++ b/scripts/install @@ -189,7 +189,7 @@ chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs sudo -u $app env PATH=$PATH:$nodejs_path npm add hoek@^4.2.1 --save --production - sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node --save --production + sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node --production sudo -u $app env PATH=$PATH:$nodejs_path npm install --production popd From 11881920a7dd21f03fa213d7cf17a2026f58685c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 06:30:58 +0100 Subject: [PATCH 16/19] Fix ts-node --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index c0e8e0b..77b768e 100644 --- a/scripts/install +++ b/scripts/install @@ -189,7 +189,7 @@ chown -R "$app":"$app" "$final_path" pushd $final_path ynh_use_nodejs sudo -u $app env PATH=$PATH:$nodejs_path npm add hoek@^4.2.1 --save --production - sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node --production + sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node sudo -u $app env PATH=$PATH:$nodejs_path npm install --production popd From 1d55e528d142726890e1bcd9566e74b4eeba7ec2 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 06:34:25 +0100 Subject: [PATCH 17/19] fix upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index a262cd4..2682a28 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -138,6 +138,7 @@ pushd $final_path ynh_use_nodejs sudo -u $app env PATH=$PATH:$nodejs_path npm update --production sudo -u $app env PATH=$PATH:$nodejs_path npm install --production + sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix popd ### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. From 59a44320b484c8cd2841d7c58da00313917da0c4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 10:17:38 +0100 Subject: [PATCH 18/19] audit fix --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 77b768e..dfdc304 100644 --- a/scripts/install +++ b/scripts/install @@ -191,6 +191,7 @@ pushd $final_path sudo -u $app env PATH=$PATH:$nodejs_path npm add hoek@^4.2.1 --save --production sudo -u $app env PATH=$PATH:$nodejs_path npm install ts-node sudo -u $app env PATH=$PATH:$nodejs_path npm install --production + sudo -u $app env PATH=$PATH:$nodejs_path npm audit fix popd #================================================= From 57671e2b918f4b9bfecb5ee1ac34326dc09b4315 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Feb 2019 11:03:09 +0100 Subject: [PATCH 19/19] upgrade version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 2dad1c0..fa6752d 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Distributed pastebin with ActivityPub.", "fr": "Pastebin distribué utilisant le protocole ActivityPub." }, - "version": "1.0~ynh1", + "version": "1.0~ynh2", "url": "https://example.com", "license": "Apache-2.0", "maintainer": {