From 537eda073d6b87a9c2b45d76670491f03e4b73cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 15 May 2021 08:28:00 +0200 Subject: [PATCH] Testing (#29) * Simplify config * Set requirementsto 4.2.4 --- .../ISSUE_TEMPLATE.md | 10 ++++---- .github/PULL_REQUEST_TEMPLATE.md | 16 +++++++++++++ check_process | 8 +++---- doc/DISCLAIMER.md | 12 ++++++++++ manifest.json | 2 +- pull_request_template.md | 16 ------------- scripts/_common.sh | 2 ++ scripts/install | 24 ++++++------------- scripts/restore | 5 ++-- scripts/upgrade | 13 ++++------ 10 files changed, 54 insertions(+), 54 deletions(-) rename issue_template.md => .github/ISSUE_TEMPLATE.md (85%) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 doc/DISCLAIMER.md delete mode 100644 pull_request_template.md diff --git a/issue_template.md b/.github/ISSUE_TEMPLATE.md similarity index 85% rename from issue_template.md rename to .github/ISSUE_TEMPLATE.md index c5be5d0..2729a6b 100644 --- a/issue_template.md +++ b/.github/ISSUE_TEMPLATE.md @@ -6,11 +6,11 @@ about: When creating a bug report, please use the following template to provide **How to post a meaningful bug report** 1. *Read this whole template first.* -2. *Make sure you are on the right place:* - - *If you were performing an action on Movim from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* +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.* - - *In doubt, ask here and we will figure it out together.* -3. *Delete these italic comments as you write over them below, and remove this guide.* + - *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 @@ -31,7 +31,7 @@ about: When creating a bug report, please use the following template to provide - *If you performed a command from the CLI, the command itself is enough. For example:* ```sh - sudo yunohost app install movim + 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:* 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/check_process b/check_process index 10490ea..48e476b 100644 --- a/check_process +++ b/check_process @@ -3,10 +3,10 @@ ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + path="/path" + admin="john" + is_public=1 password="phrasedepasse" language="fr" port=9537 (PORT) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..aded581 --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,12 @@ +* Any known limitations, constrains or stuff not working, such as (but not limited to): + * requiring a full dedicated domain ? + * architectures not supported ? + * not-working single-sign on or LDAP integration ? + * the app requires an important amount of RAM / disk / .. to install or to work properly + * etc... + +* Other infos that people should be aware of, such as: + * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) + * how to configure / administrate the application if it ain't obvious + * upgrade process / specificities / things to be aware of ? + * security considerations ? diff --git a/manifest.json b/manifest.json index fb7fb09..1e88f64 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.1.7" + "yunohost": ">= 4.2.4" }, "multi_instance": false, "services": [ diff --git a/pull_request_template.md b/pull_request_template.md deleted file mode 100644 index 6c28fc5..0000000 --- a/pull_request_template.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/_common.sh b/scripts/_common.sh index 5617785..986295d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,6 +9,8 @@ pkg_dependencies="postgresql postgresql-contrib apt-transport-https" YNH_PHP_VERSION="7.3" +YNH_COMPOSER_VERSION="2.0.13" + extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-xml" #================================================= diff --git a/scripts/install b/scripts/install index 2c1c9e7..800974c 100644 --- a/scripts/install +++ b/scripts/install @@ -132,32 +132,22 @@ ynh_store_file_checksum --file="$final_path/config/db.inc.php" #================================================= ynh_script_progression --message="Configuring Composer..." --weight=1 -pushd $final_path - export COMPOSER_HOME=$final_path - ynh_exec_warn_less curl -sS https://getcomposer.org/installer | php${phpversion} -- --version="1.10.16" --install-dir="$final_path" \ - && php${phpversion} composer.phar install --no-interaction --quiet -popd +ynh_install_composer #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=12 -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service - ynh_add_systemd_config #================================================= -# Set-up database and configuration +# SET-UP DATABASE AND CONFIGURATION #================================================= -ynh_script_progression --message="Configuring database..." --weight=1 - -cache_dir="/home/$app" +ynh_script_progression --message="Configuring Movim..." --weight=1 # Create cachedir folder +cache_dir="/home/yunohost.app/$app" mkdir -p $cache_dir chown -R $app $cache_dir @@ -172,9 +162,9 @@ popd # SET PERMISSIONS #================================================= -chown -R $app:www-data $final_path -chown -R $app $final_path/src/Movim/ -chmod u+rwx $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/restore b/scripts/restore index 9effe72..a560845 100644 --- a/scripts/restore +++ b/scripts/restore @@ -73,8 +73,9 @@ ynh_system_user_create --username=$app #================================================= # Restore permissions on app files -chown -R $app:www-data $final_path -chown -R $app $final_path/src/Movim/ +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 44d4183..b7f748c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -128,9 +128,9 @@ ynh_add_fpm_config --package="$extra_php_dependencies" # SET PERMISSIONS #================================================= -chown -R $app:www-data $final_path -chown -R $app $final_path/src/Movim/Bootstrap.php -chmod u+rwx $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # INTEGRATE SERVICE IN YUNOHOST @@ -145,7 +145,7 @@ yunohost service add $app --description="Responsive web-based XMPP client" --log ynh_script_progression --message="Installing Composer..." --weight=1 pushd "$final_path" - ynh_exec_warn_less curl -sS https://getcomposer.org/installer | php$phpversion -- --version="1.10.16" --install-dir="$final_path" \ + ynh_exec_warn_less ynh_install_composer \ && php$phpversion composer.phar config --global discard-changes true --quiet \ && php$phpversion composer.phar update --no-interaction --quiet \ && php$phpversion composer.phar movim:migrate --quiet @@ -156,11 +156,6 @@ popd #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --weight=5 -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service - ynh_add_systemd_config #=================================================