From 5ea5611d28a8330a7d9127371d60f28083b0a0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 16 May 2021 07:37:51 +0200 Subject: [PATCH] Testing (#18) * Update install --- .github/ISSUE_TEMPLATE.md | 55 ++++++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++++ README.md | 4 +-- README_fr.md | 4 +-- check_process | 6 ++-- manifest.json | 2 +- pull_request.md | 16 ---------- scripts/install | 14 ++++---- scripts/restore | 4 ++- scripts/upgrade | 15 +++------ 10 files changed, 94 insertions(+), 42 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 pull_request.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..2729a6b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. + +--- + +**How to post a meaningful bug report** +1. *Read this whole template first.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* +--- + +### Describe the bug + +*A clear and concise description of what the bug is.* + +### Context + +- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* +- YunoHost version: x.x.x +- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* + - If yes, please explain: +- Using, or trying to install package version/branch: +- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* + +### Steps to reproduce + +- *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh + sudo yunohost app install the_app + ``` +- *If you used the webadmin, please perform the equivalent command from the CLI first.* +- *If the error occurs in your browser, explain what you did:* + 1. *Go to '...'* + 2. *Click on '...'* + 3. *Scroll down to '...'* + 4. *See error* + +### Expected behavior + +*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* + +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + +*If applicable and useful, add screenshots to help explain your problem.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) diff --git a/README.md b/README.md index 9a1353a..fae8fa0 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ ChtickyNotes is a "simple post-it" application. Its main features are: #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/chtickynotes%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/chtickynotes/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/chtickynotes%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/chtickynotes/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/chtickynotes.svg)](https://ci-apps.yunohost.org/ci/apps/chtickynotes/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/chtickynotes.svg)](https://ci-apps-arm.yunohost.org/ci/apps/chtickynotes/) ## Limitations diff --git a/README_fr.md b/README_fr.md index 5f03ad8..729ed99 100644 --- a/README_fr.md +++ b/README_fr.md @@ -38,8 +38,8 @@ ChtickyNotes est une application "post-it". Ses principales caractéristiques so #### Architectures supportées -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/chtickynotes%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/chtickynotes/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/chtickynotes%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/chtickynotes/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/chtickynotes.svg)](https://ci-apps.yunohost.org/ci/apps/chtickynotes/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/chtickynotes.svg)](https://ci-apps-arm.yunohost.org/ci/apps/chtickynotes/) ## Limitations diff --git a/check_process b/check_process index fc84b56..1d7ff79 100644 --- a/check_process +++ b/check_process @@ -3,9 +3,9 @@ ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + path="/path" + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/manifest.json b/manifest.json index fc84d62..4d44854 100644 --- a/manifest.json +++ b/manifest.json @@ -17,7 +17,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.1.7" + "yunohost": ">= 4.2.4" }, "multi_instance": false, "services": [ diff --git a/pull_request.md b/pull_request.md deleted file mode 100644 index 6c28fc5..0000000 --- a/pull_request.md +++ /dev/null @@ -1,16 +0,0 @@ -## 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. - -## Package_check results ---- -* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/install b/scripts/install index d4c3e04..cd008f7 100644 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=is_public --value=$is_public #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -84,21 +83,24 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config ynh_add_fpm_config --usage=low --footprint=low - #================================================= # SECURE FILES AND DIRECTORIES #================================================= -# Set right permissions for curl install -chown -R $app: $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # SETUP SSOWAT #================================================= ynh_script_progression --message="Configuring permissions..." --weight=1 -# Make app public if necessary or protect it -[ $is_public -eq 0 ] || ynh_permission_update --permission="main" --add="visitors" +# Make app public if necessary +if [ $is_public -eq 1 ] +then + ynh_permission_update --permission="main" --add="visitors" +fi #================================================= # RELOAD NGINX diff --git a/scripts/restore b/scripts/restore index 080f407..e511c60 100644 --- a/scripts/restore +++ b/scripts/restore @@ -65,7 +65,9 @@ ynh_system_user_create --username=$app #================================================= # Restore permissions on app files -chown -R $app: $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 6d0d794..9d067c9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -32,15 +31,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=2 -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/var/www/$app @@ -89,7 +79,10 @@ ynh_add_fpm_config --usage=low --footprint=low #================================================= cp -a ../sources/* $final_path -chown -R $app: $final_path + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION