From ce07f8bd2c0163a5dca5b9dc80785d4ebd9e7f51 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Mar 2019 00:35:51 +0100 Subject: [PATCH] Apply last example_ynh --- conf/nginx.conf | 9 +++------ manifest.json | 2 +- pull_request_template.md | 23 +++++++++++++++++++++++ scripts/_common.sh | 7 +++++++ scripts/install | 2 +- scripts/restore | 13 +++++++++---- scripts/upgrade | 17 ++++++++++------- 7 files changed, 54 insertions(+), 19 deletions(-) create mode 100644 pull_request_template.md diff --git a/conf/nginx.conf b/conf/nginx.conf index 4a3f39b..7cf6397 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,17 +1,14 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source - alias __FINALPATH__/ ; - # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://127.0.0.1:__PORT__/; - proxy_set_header Host $host; - proxy_buffering off; + proxy_pass http://127.0.0.1:__PORT__/; + proxy_set_header Host $host; + # proxy_buffering off; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/manifest.json b/manifest.json index bc8a7f7..ec088fa 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~ynh5", + "version": "1.0~ynh6", "url": "https://example.com", "license": "Apache-2.0", "maintainer": { diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..14221c0 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,23 @@ +## Problem +- *Description of why you made this PR* + +## Solution +- *And how do you fix that problem* + +## PR Status +- [ ] Code finished. +- [ ] Tested with Package_check. +- [ ] Fix or enhancement tested. +- [ ] Upgrade from last version tested. +- [ ] Can be reviewed and tested. + +## Validation +--- +- [ ] **Code review** +- [ ] **Approval (LGTM)** +*Code review and approval have to be from a member of @YunoHost/apps group* +- **CI succeeded** : +[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/distbin_ynh%20-BRANCH-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/distbin_ynh%20-BRANCH-/) +*Please replace '-BRANCH-' in this link by the name of the branch used.* +*If the PR is from a forked repository. Please provide public results from package_check.* +When the PR is marked as ready to merge, you have to wait for 3 days before really merging it. diff --git a/scripts/_common.sh b/scripts/_common.sh index b905339..035ba43 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,5 +1,12 @@ #!/bin/bash +#================================================= +# COMMON VARIABLES +#================================================= + +# dependencies used by the app +pkg_dependencies="ca-certificates" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 4b0fa5f..bf1b486 100644 --- a/scripts/install +++ b/scripts/install @@ -101,7 +101,7 @@ ynh_print_info "Installing dependencies ..." ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script -ynh_install_app_dependencies ca-certificates +ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs 8 #================================================= diff --git a/scripts/restore b/scripts/restore index c0b5280..e3e21d9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source ../settings/scripts/ynh_systemd_action source /usr/share/yunohost/helpers @@ -73,18 +74,22 @@ ynh_system_user_create "$app" "$final_path" # Restore permissions on app files chown -R "$app":"$app" "$final_path" -mkdir -p /var/log/$app -chown -R $app:$app /var/log/$app - #================================================= # SPECIFIC RESTORATION +#================================================= +# CREATE LOG FOLDER +#================================================= + +mkdir -p "/var/log/$app" +chown -R "$app":"$app" "/var/log/$app" + #================================================= # REINSTALL DEPENDENCIES #================================================= ynh_print_info "Reinstalling dependencies..." # Define and install dependencies -ynh_install_app_dependencies ca-certificates +ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs 8 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a1ee209..a4beb38 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,10 +84,9 @@ ynh_print_info "Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src# #ynh_setup_source "$final_path" -pushd $final_path - git reset --hard - git pull --quiet -popd +git clone --quiet https://github.com/gobengo/distbin "$final_path/upgrade" +cp -a "$final_path/upgrade/." "$final_path/$app/." +rm -r "$final_path/upgrade" #================================================= # NGINX CONFIGURATION @@ -102,7 +101,7 @@ ynh_add_nginx_config #================================================= ynh_print_info "Upgrading dependencies..." -ynh_install_app_dependencies ca-certificates +ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs 8 #================================================= @@ -187,8 +186,12 @@ ynh_add_systemd_config #chown -R root: $final_path chown -R $app:$app $final_path -mkdir -p /var/log/$app -chown -R $app:$app /var/log/$app +#================================================= +# CREATE LOG FOLDER +#================================================= + +mkdir -p "/var/log/$app" +chown -R "$app":"$app" "/var/log/$app" #================================================= # SETUP SSOWAT