From b5101b7e1cca7bd7d87d6051c4059f2e5bf5c61b Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 5 Jul 2020 17:20:00 +0200 Subject: [PATCH 01/10] [fix] set COMPOSER_HOME before building plugins --- scripts/install | 3 +++ scripts/upgrade | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index a37e8de..888a4be 100644 --- a/scripts/install +++ b/scripts/install @@ -139,6 +139,9 @@ admin_mail=$(ynh_user_get_info $admin 'mail') #================================================= ynh_print_info --message="Building plugins..." +mkdir -p "$final_path/include/plugins/build/.config/composer" +export COMPOSER_HOME="$final_path/include/plugins/build/.config/composer" + pushd "$final_path/include/plugins/build" php make.php hydrate php -dphar.readonly=0 make.php build auth-cas diff --git a/scripts/upgrade b/scripts/upgrade index c48c528..8e39797 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -82,14 +82,14 @@ ynh_abort_if_errors if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_print_info --message="Upgrading source files..." - + tmpdir="$(mktemp -d)" mkdir $tmpdir/plugins rsync -a "$final_path/include/plugins" "$tmpdir/." rsync -a "$config_file" "$tmpdir/." ynh_secure_remove --file="$final_path" - + # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path/include/plugins/build" --source_id="core-plugins" @@ -150,6 +150,8 @@ ynh_print_info --message="Building plugins..." if [ "$upgrade_type" == "UPGRADE_APP" ] then + mkdir -p "$final_path/include/plugins/build/.config/composer" + export COMPOSER_HOME="$final_path/include/plugins/build/.config/composer" pushd "$final_path/include/plugins/build" php make.php hydrate php -dphar.readonly=0 make.php build auth-cas From 383a68cb9e98786365c03d68fb2a816111b0500a Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 7 Jul 2020 22:46:48 +0200 Subject: [PATCH 02/10] [enh] no need to export COMPOSER_HOME --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 888a4be..fdc3b5d 100644 --- a/scripts/install +++ b/scripts/install @@ -140,7 +140,7 @@ admin_mail=$(ynh_user_get_info $admin 'mail') ynh_print_info --message="Building plugins..." mkdir -p "$final_path/include/plugins/build/.config/composer" -export COMPOSER_HOME="$final_path/include/plugins/build/.config/composer" +COMPOSER_HOME="$final_path/include/plugins/build/.config/composer" pushd "$final_path/include/plugins/build" php make.php hydrate diff --git a/scripts/upgrade b/scripts/upgrade index 8e39797..74dc963 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -151,7 +151,7 @@ ynh_print_info --message="Building plugins..." if [ "$upgrade_type" == "UPGRADE_APP" ] then mkdir -p "$final_path/include/plugins/build/.config/composer" - export COMPOSER_HOME="$final_path/include/plugins/build/.config/composer" + COMPOSER_HOME="$final_path/include/plugins/build/.config/composer" pushd "$final_path/include/plugins/build" php make.php hydrate php -dphar.readonly=0 make.php build auth-cas From df3eb818c0a11dff589239bf4eebfdbdf0c60d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 11 Sep 2020 22:52:21 +0200 Subject: [PATCH 03/10] Update manifest.json - *ynhexample -> osTicket* --- manifest.json | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index 80d9966..b48da65 100644 --- a/manifest.json +++ b/manifest.json @@ -27,8 +27,8 @@ "name": "domain", "type": "domain", "ask": { - "en": "Choose a domain name for ynhexample", - "fr": "Choisissez un nom de domaine pour ynhexample" + "en": "Choose a domain name for osTicket", + "fr": "Choisissez un nom de domaine pour osTicket" }, "example": "example.com" }, @@ -36,8 +36,8 @@ "name": "path", "type": "path", "ask": { - "en": "Choose a path for ynhexample", - "fr": "Choisissez un chemin pour ynhexample" + "en": "Choose a path for osTicket", + "fr": "Choisissez un chemin pour osTicket" }, "example": "/osticket", "default": "/osticket" @@ -77,10 +77,6 @@ "en": "Set the administrator password", "fr": "Définissez le mot de passe administrateur" }, - "help": { - "en": "Use the help field to add an information for the admin about this question.", - "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." - }, "example": "Choose a password" } ] From eb25d98bb70a63c79b66d081e62569d3efd6660d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 11 Sep 2020 23:04:43 +0200 Subject: [PATCH 04/10] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - *Add badges* - *Mention the availability of many languages ​​within the app Admin Panel settings and remove the Prévert list* --- README.md | 69 ++++--------------------------------------------------- 1 file changed, 4 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index 0f31911..f1e51de 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # osTicket for YunoHost -[![Integration level](https://dash.yunohost.org/integration/osticket.svg)](https://dash.yunohost.org/appci/app/osticket) +[![Integration level](https://dash.yunohost.org/integration/osticket.svg)](https://dash.yunohost.org/appci/app/osticket) ![](https://ci-apps.yunohost.org/ci/badges/osticket.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/osticket.maintain.svg) [![Install osTicket with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=osticket) > *This package allow you to install osTicket quickly and simply on a YunoHost server. @@ -55,68 +55,8 @@ LDAP and HTTP auth are supported through plugins - Ticket Closer - Ticket Rewriter -* The package include several languages: - - Albanian (shqip) - - Arabic - Egypt (مصر) - - Arabic - Saudi Arabia (المملكة العربية السعودية) - - Azerbaijani (azərbaycanca) - - Basque (euskara) - - Bengali (বাংলা) - - Bosnian (bosanski) - - Bulgarian (български) - - Catalan (Català) - - Chinese (China) (中文 (中国)) - - Chinese (Taiwan) (中文(台灣) - - Croatian (hrvatski) - - Czech (čeština) - - Danish (dansk) - - Dutch (Nederlands) - - English (Great Britain) - - English (US) - - Estonian (eesti) - - Finnish (suomi) - - French (français) - - Galician (galego) - - Georgian (ქართული) - - German (Deutsch) - - Greek (Ελληνικά) - - Hebrew (עברית) - - Hindi (हिन्दी) - - Hungarian (magyar) - - Icelandic (íslenska) - - Indonesian - - Italian (italiano) - - Japanese (日本語) - - Khmer (ខ្មែរ) - - Korean (한국어) - - Latvian (latviešu) - - Lithuanian (lietuvių) - - Macedonian (македонски) - - Malay (Melayu) - - Mongolian (монгол) - - Norwegian (norsk) - - Persian (فارسی) - - Polish (polski) - - Portuguese (Português) - - Portuguese, Brazil (Português — BR) - - Romanian (română) - - Russian (русский язык) - - Serbian (Cyrillic) - - Serbian (Serbia) (српски (Србија)) - - Slovak (slovenčina) - - Slovenian (slovenščina) - - Spanish (Argentina) - - Spanish (español) - - Spanish - Mexico (Méjico) - - Swahili (Kiswahili) - - Swedish (svenska) - - Thai (ไทย) - - Turkish (Türkçe) - - Ukrainian (українська) - - Urdu (India) (اردو (بھارت - - Urdu (Pakistan) اردو (پاکستان) - - Vietnamese (Tiếng Việt) - +* The package includes many languages available through `Admin Panel > Settings > System + ## Links * Report a bug: https://github.com/YunoHost-Apps/osticket_ynh/issues @@ -126,8 +66,7 @@ LDAP and HTTP auth are supported through plugins --- -Developers info ----------------- +## Developers info Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/osticket_ynh/tree/testing). From 8a53b62fb99bf80a32f0df4a02eaa078a234e179 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 17 Feb 2021 10:11:58 +0100 Subject: [PATCH 05/10] apply example_ynh --- README.md | 14 ++--- check_process | 5 -- conf/app.src | 1 + conf/core-plugins.src | 4 +- conf/nginx.conf | 2 +- conf/php-fpm.conf | 2 +- issue_template.md | 37 +++++++++----- manifest.json | 2 +- pull_request_template.md | 4 +- scripts/_common.sh | 6 ++- scripts/backup | 4 +- scripts/change_url | 11 ++-- scripts/install | 97 +++++++++++++++++------------------ scripts/remove | 18 +++---- scripts/restore | 34 ++++++------ scripts/upgrade | 108 +++++++++++++++------------------------ 16 files changed, 165 insertions(+), 184 deletions(-) diff --git a/README.md b/README.md index 4f5c327..19a67d7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # osTicket for YunoHost [![Integration level](https://dash.yunohost.org/integration/osticket.svg)](https://dash.yunohost.org/appci/app/osticket) ![](https://ci-apps.yunohost.org/ci/badges/osticket.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/osticket.maintain.svg) -[![Install osTicket with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=osticket) +[![Install osTicket with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=osticket) -> *This package allow you to install osTicket quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +> *This package allows you to install osTicket quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview osTicket is a widely-used open source support ticket system. It seamlessly integrates inquiries created via email, phone and web-based forms into a simple easy-to-use multi-user web interface. Manage, organize and archive all your support requests and responses in one place while providing your customers with accountability and responsiveness they deserve. @@ -25,13 +25,13 @@ osTicket is a widely-used open source support ticket system. It seamlessly integ ## YunoHost specific features -#### Multi-users support +#### Multi-user support LDAP and HTTP auth are supported through plugins #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/osticket%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/osticket/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/osticket%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/osticket/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/osticket%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/osticket/) ## Additional information @@ -66,9 +66,9 @@ LDAP and HTTP auth are supported through plugins --- -## Developers info +## Developer info -Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/osticket_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/osticket_ynh/tree/testing). To try the testing branch, please proceed like that. ``` diff --git a/check_process b/check_process index 7caa43a..6f5c02f 100644 --- a/check_process +++ b/check_process @@ -25,13 +25,8 @@ upgrade=1 from_commit=cadb10e497d938e0e684e43ac870a3807b4b60d9 backup_restore=1 multi_instance=1 - # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. - # incorrect_path=1 port_already_use=0 change_url=1 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email= Notification=none diff --git a/conf/app.src b/conf/app.src index b336e4d..520d02a 100644 --- a/conf/app.src +++ b/conf/app.src @@ -4,3 +4,4 @@ SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/conf/core-plugins.src b/conf/core-plugins.src index 313e9e5..45e1acb 100644 --- a/conf/core-plugins.src +++ b/conf/core-plugins.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/osTicket/osTicket-plugins/archive/14f4778904fd2aba707497e9a45dcecbb2129c9a.tar.gz -SOURCE_SUM=7bde26e1e08ffa9f7225b73744991594841eb4e9dd8b3e172975628cb00d9bd1 +SOURCE_URL=https://github.com/osTicket/osTicket-plugins/archive/52f7bae08699d9408180d0a67b327e79c095cd37.tar.gz +SOURCE_SUM=468087ea48af6ef1b8372a7542974e1d2f00759c7e3fa87209ce06e7d6c0af70 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 901ac24..556b622 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -17,7 +17,7 @@ location __PATH__/ { try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index ab5dca9..ab1a471 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -33,7 +33,7 @@ group = __USER__ ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) diff --git a/issue_template.md b/issue_template.md index 9f271c6..5df5014 100644 --- a/issue_template.md +++ b/issue_template.md @@ -1,32 +1,34 @@ --- name: Bug report -about: Create a report to help us debug, it would be nice to fill the template as much as you can to help us, help you and help us all. +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 osticket itself. Refer to its documentation or repository for help.* - - *If you have a doubt, post here, we will figure it out together.* + - *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 osTicket 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** +### Describe the bug + *A clear and concise description of what the bug is.* -**Versions** +### 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* +- 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`* -**To Reproduce** -*Steps to reproduce the behavior.* +### Steps to reproduce + - *If you performed a command from the CLI, the command itself is enough. For example:* ```sh sudo yunohost app install osticket @@ -34,13 +36,20 @@ about: Create a report to help us debug, it would be nice to fill the template a - *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 '....'* + 2. *Click on '...'* + 3. *Scroll down to '...'* 4. *See error* -**Expected behavior** +### 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** -*After a failed command, YunoHost makes the log available to you, but also to others, thanks to `yunohost log display [log name] --share`. The actual command, with the correct log name, is displayed at the end of the failed attempt in the CLI. Execute it and copy here the share link it outputs.* +### 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/manifest.json b/manifest.json index c349269..ccea0b6 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,7 @@ "name": "yalh76" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 4.1.3" }, "multi_instance": true, "services": [ diff --git a/pull_request_template.md b/pull_request_template.md index 4475716..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/osticket_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/osticket_ynh%20PR-NUM-%20(USERNAME)/) +* 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 c1ae9c8..4070ba8 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,11 @@ #================================================= # dependencies used by the app -pkg_dependencies="php-gd php-gettext php-imap php-json php-mbstring php-xml php-zip php-intl php-apcu php-curl" +pkg_dependencies="curl" + +YNH_PHP_VERSION="7.3" + +extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-gettext php-imap php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-curl" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 7170751..73cf595 100644 --- a/scripts/backup +++ b/scripts/backup @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= -ynh_print_info --message="Managing script failure..." ynh_clean_setup () { true @@ -31,6 +30,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -53,7 +53,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # SPECIFIC BACKUP diff --git a/scripts/change_url b/scripts/change_url index 0856ea5..a190724 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -12,7 +12,6 @@ source /usr/share/yunohost/helpers #================================================= # RETRIEVE ARGUMENTS #================================================= -ynh_print_info --message="Retrieve arguments from the manifest" old_domain=$YNH_APP_OLD_DOMAIN old_path=$YNH_APP_OLD_PATH @@ -25,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -38,7 +37,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_print_info --message="Backing up the app before changing its url (may take a while)..." +ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -73,7 +72,7 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_print_info --message="Updating nginx web server configuration..." +ynh_script_progression --message="Updating nginx web server configuration..." nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -110,7 +109,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading nginx web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -118,4 +117,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Change of URL completed for $app" +ynh_script_progression --message="Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index a37e8de..2033e7d 100644 --- a/scripts/install +++ b/scripts/install @@ -12,7 +12,6 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= -ynh_print_info --message="Managing script failure..." ynh_clean_setup () { true @@ -23,7 +22,6 @@ ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -ynh_print_info --message="Retrieving arguments from the manifest..." domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH @@ -37,7 +35,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_print_info --message="Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -48,12 +46,11 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_print_info --message="Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." 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=admin --value=$admin -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=language --value=$language #================================================= @@ -61,14 +58,14 @@ ynh_app_setting_set --app=$app --key=language --value=$language #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_print_info --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_print_info --message="Creating a MySQL database..." +ynh_script_progression --message="Creating a MySQL database..." db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name @@ -78,7 +75,7 @@ ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info --message="Setting up source files..." +ynh_script_progression --message="Setting up source files..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src @@ -99,7 +96,7 @@ ynh_setup_source --dest_dir="$final_path/include/plugins/build/preventautoscroll #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring nginx web server..." # Create a dedicated nginx config ynh_add_nginx_config @@ -107,7 +104,7 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info --message="Configuring system user..." +ynh_script_progression --message="Configuring system user..." # Create a system user ynh_system_user_create --username=$app --home_dir=$final_path @@ -115,17 +112,18 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Configuring php-fpm..." +ynh_script_progression --message="Configuring php-fpm..." # Create a dedicated php-fpm config -ynh_add_fpm_config +ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP #================================================= # PREPARE INSTALL #================================================= -ynh_print_info --message="Preparing install..." +ynh_script_progression --message="Preparing install..." config_file=$final_path/include/ost-config.php cp -f ../conf/ost-sampleconfig.php "$config_file" @@ -137,27 +135,27 @@ admin_mail=$(ynh_user_get_info $admin 'mail') #================================================= # BUILD PLUGINS #================================================= -ynh_print_info --message="Building plugins..." +ynh_script_progression --message="Building plugins..." pushd "$final_path/include/plugins/build" - php make.php hydrate - php -dphar.readonly=0 make.php build auth-cas - php -dphar.readonly=0 make.php build auth-ldap - php -dphar.readonly=0 make.php build auth-oauth - php -dphar.readonly=0 make.php build auth-passthru - php -dphar.readonly=0 make.php build storage-fs - php -dphar.readonly=0 make.php build storage-s3 - php -dphar.readonly=0 make.php build archiver - php -dphar.readonly=0 make.php build attachment_preview - php -dphar.readonly=0 make.php build autocloser - php -dphar.readonly=0 make.php build fetch-note - php -dphar.readonly=0 make.php build field-radiobuttons - php -dphar.readonly=0 make.php build fwd-rewriter - php -dphar.readonly=0 make.php build mattermost - php -dphar.readonly=0 make.php build mentioner - php -dphar.readonly=0 make.php build microsoft-teams - php -dphar.readonly=0 make.php build slack - php -dphar.readonly=0 make.php build preventautoscroll + php${phpversion} make.php hydrate + php${phpversion} -dphar.readonly=0 make.php build auth-cas + php${phpversion} -dphar.readonly=0 make.php build auth-ldap + php${phpversion} -dphar.readonly=0 make.php build auth-oauth + php${phpversion} -dphar.readonly=0 make.php build auth-passthru + php${phpversion} -dphar.readonly=0 make.php build storage-fs + php${phpversion} -dphar.readonly=0 make.php build storage-s3 + php${phpversion} -dphar.readonly=0 make.php build archiver + php${phpversion} -dphar.readonly=0 make.php build attachment_preview + php${phpversion} -dphar.readonly=0 make.php build autocloser + php${phpversion} -dphar.readonly=0 make.php build fetch-note + php${phpversion} -dphar.readonly=0 make.php build field-radiobuttons + php${phpversion} -dphar.readonly=0 make.php build fwd-rewriter + php${phpversion} -dphar.readonly=0 make.php build mattermost + php${phpversion} -dphar.readonly=0 make.php build mentioner + php${phpversion} -dphar.readonly=0 make.php build microsoft-teams + php${phpversion} -dphar.readonly=0 make.php build slack + php${phpversion} -dphar.readonly=0 make.php build preventautoscroll cp *.phar $final_path/include/plugins/. popd ynh_secure_remove --file="$final_path/include/plugins/build" @@ -165,21 +163,22 @@ ynh_secure_remove --file="$final_path/include/plugins/build" #================================================= # INSTALL LANGUAGE #================================================= -ynh_print_info --message="Installing language..." +ynh_script_progression --message="Installing language..." rsync -a "../conf/i18n" "$final_path/include/." #================================================= # SETUP APPLICATION WITH CURL #================================================= -ynh_print_info --message="Setuping application with CURL..." +ynh_script_progression --message="Setuping application with CURL..." # Set right permissions for curl install chown -R $app: $final_path # Set the app as temporarily public for curl call -ynh_print_info --message="Configuring SSOwat..." -ynh_app_setting_set --app=$app --key=skipped_uris --value="/" +ynh_script_progression --message="Configuring SSOwat..." +# Making the app public for curl +ynh_permission_update --permission="main" --add="visitors" # Reload SSOwat config yunohost app ssowatconf @@ -187,19 +186,16 @@ yunohost app ssowatconf ynh_systemd_action --service_name=nginx --action=reload # Installation with curl -ynh_print_info --message="Finalizing installation..." +ynh_script_progression --message="Finalizing installation..." ynh_local_curl "/setup/install.php" "s=install" "name=$app" "email=$app@$domain" "lang_id=$language" "fname=$admin_fname" "lname=$admin_lname" "admin_email=$admin_mail" "username=$admin" "passwd=$password" "passwd2=$password" "prefix=ost_" "dbhost=localhost" "dbname=$db_name" "dbuser=$db_user" "dbpass=$db_pwd" # Remove the public access -if [ $is_public -eq 0 ] -then - ynh_app_setting_delete --app=$app --key=skipped_uris -fi +ynh_permission_update --permission="main" --remove="visitors" #================================================= # FINALIZE INSTALL #================================================= -ynh_print_info --message="Finalizing install..." +ynh_script_progression --message="Finalizing install..." # Removing setup folder ynh_secure_remove --file="$final_path/setup" @@ -210,7 +206,7 @@ chmod 0644 $config_file #================================================= # SET THE CRON FILE #================================================= -ynh_print_info --message="Setting the cron file..." +ynh_script_progression --message="Setting the cron file..." cp ../conf/cron /etc/cron.d/$app @@ -219,7 +215,7 @@ ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= -ynh_print_info --message="Storing the config file checksum..." +ynh_script_progression --message="Storing the config file checksum..." # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$config_file" @@ -229,7 +225,7 @@ ynh_store_file_checksum --file="$config_file" #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_print_info --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." # Set permissions to app files chown -R $app: $final_path @@ -237,19 +233,20 @@ chown -R $app: $final_path #================================================= # SETUP SSOWAT #================================================= -ynh_print_info --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." # Make app public if necessary if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading nginx web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -257,4 +254,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Installation of $app completed" +ynh_script_progression --message="Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index edb4a04..4b9eb04 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -26,7 +26,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_print_info --message="Removing the MySQL database..." +ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name @@ -34,7 +34,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_print_info --message="Removing dependencies..." +ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -42,7 +42,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_print_info --message="Removing app main directory..." +ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -50,7 +50,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing nginx web server configuration..." # Remove the dedicated nginx config ynh_remove_nginx_config @@ -58,7 +58,7 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Removing php-fpm configuration..." +ynh_script_progression --message="Removing php-fpm configuration..." # Remove the dedicated php-fpm config ynh_remove_fpm_config @@ -68,7 +68,7 @@ ynh_remove_fpm_config #================================================= # REMOVE THE CRON FILE #================================================= -ynh_print_info --message="Removing the cron file..." +ynh_script_progression --message="Removing the cron file..." # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" @@ -78,7 +78,7 @@ ynh_secure_remove --file="/etc/cron.d/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_print_info --message="Removing the dedicated system user..." +ynh_script_progression --message="Removing the dedicated system user..." # Delete a system user ynh_system_user_delete --username=$app @@ -87,4 +87,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_print_info --message="Removal of $app completed" +ynh_script_progression --message="Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index cecd22d..3148bd6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= -ynh_print_info --message="Managing script failure..." ynh_clean_setup () { true @@ -24,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading settings..." +ynh_script_progression --message="Loading settings..." app=$YNH_APP_INSTANCE_NAME @@ -33,11 +32,12 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_print_info --message="Validating restoration parameters..." +ynh_script_progression --message="Validating restoration parameters..." ynh_webpath_available --domain=$domain --path_url=$path_url \ || ynh_die --message="Path not available: ${domain}${path_url}" @@ -49,21 +49,21 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Restoring the nginx configuration..." +ynh_script_progression --message="Restoring the nginx configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_print_info --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_print_info --message="Recreating the dedicated system user..." +ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) ynh_system_user_create --username=$app @@ -71,7 +71,7 @@ ynh_system_user_create --username=$app #================================================= # RESTORE USER RIGHTS #================================================= -ynh_print_info --message="Restoring user rights..." +ynh_script_progression --message="Restoring user rights..." # Restore permissions on app files chown -R $app: $final_path @@ -79,16 +79,20 @@ chown -R $app: $final_path #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Restoring PHP-FPM configuration..." +ynh_script_progression --message="Restoring PHP-FPM configuration..." -ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Create a dedicated php-fpm config +ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_print_info --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -96,7 +100,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_print_info --message="Restoring the MySQL database..." +ynh_script_progression --message="Restoring the MySQL database..." db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd @@ -105,7 +109,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= # RESTORE THE CRON FILE #================================================= -ynh_print_info --message="Restoring the cron file..." +ynh_script_progression --message="Restoring the cron file..." ynh_restore_file --origin_path="/etc/cron.d/$app" @@ -114,13 +118,13 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_print_info --message="Reloading nginx web server and php-fpm..." +ynh_script_progression --message="Reloading nginx web server and php-fpm..." -ynh_systemd_action --service_name=php7.0-fpm --action=reload +ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Restoration completed for $app" +ynh_script_progression --message="Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index c48c528..e4c3740 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,14 +12,13 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) @@ -29,40 +28,26 @@ config_file=$final_path/include/ost-config.php #================================================= # CHECK VERSION #================================================= -ynh_print_info --message="Checking version..." +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_print_info --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." -# 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 +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all -# If db_name doesn't exist, create it -if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name -fi - -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path + ynh_app_setting_delete --app=$app --key=is_public fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_print_info --message="Backing up the app before upgrading (may take a while)..." +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -81,7 +66,7 @@ ynh_abort_if_errors if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_print_info --message="Upgrading source files..." + ynh_script_progression --message="Upgrading source files..." tmpdir="$(mktemp -d)" @@ -113,7 +98,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading nginx web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config @@ -121,14 +106,14 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_print_info --message="Upgrading dependencies..." +ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username=$app @@ -136,39 +121,40 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Upgrading php-fpm configuration..." +ynh_script_progression --message="Upgrading php-fpm configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config +ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC UPGRADE #================================================= # BUILD PLUGINS #================================================= -ynh_print_info --message="Building plugins..." +ynh_script_progression --message="Building plugins..." if [ "$upgrade_type" == "UPGRADE_APP" ] then pushd "$final_path/include/plugins/build" - php make.php hydrate - php -dphar.readonly=0 make.php build auth-cas - php -dphar.readonly=0 make.php build auth-ldap - php -dphar.readonly=0 make.php build auth-oauth - php -dphar.readonly=0 make.php build auth-passthru - php -dphar.readonly=0 make.php build storage-fs - php -dphar.readonly=0 make.php build storage-s3 - php -dphar.readonly=0 make.php build archiver - php -dphar.readonly=0 make.php build attachment_preview - php -dphar.readonly=0 make.php build autocloser - php -dphar.readonly=0 make.php build fetch-note - php -dphar.readonly=0 make.php build field-radiobuttons - php -dphar.readonly=0 make.php build fwd-rewriter - php -dphar.readonly=0 make.php build mattermost - php -dphar.readonly=0 make.php build mentioner - php -dphar.readonly=0 make.php build microsoft-teams - php -dphar.readonly=0 make.php build slack - php -dphar.readonly=0 make.php build preventautoscroll + php${phpversion} make.php hydrate + php${phpversion} -dphar.readonly=0 make.php build auth-cas + php${phpversion} -dphar.readonly=0 make.php build auth-ldap + php${phpversion} -dphar.readonly=0 make.php build auth-oauth + php${phpversion} -dphar.readonly=0 make.php build auth-passthru + php${phpversion} -dphar.readonly=0 make.php build storage-fs + php${phpversion} -dphar.readonly=0 make.php build storage-s3 + php${phpversion} -dphar.readonly=0 make.php build archiver + php${phpversion} -dphar.readonly=0 make.php build attachment_preview + php${phpversion} -dphar.readonly=0 make.php build autocloser + php${phpversion} -dphar.readonly=0 make.php build fetch-note + php${phpversion} -dphar.readonly=0 make.php build field-radiobuttons + php${phpversion} -dphar.readonly=0 make.php build fwd-rewriter + php${phpversion} -dphar.readonly=0 make.php build mattermost + php${phpversion} -dphar.readonly=0 make.php build mentioner + php${phpversion} -dphar.readonly=0 make.php build microsoft-teams + php${phpversion} -dphar.readonly=0 make.php build slack + php${phpversion} -dphar.readonly=0 make.php build preventautoscroll cp -f *.phar $final_path/include/plugins/. popd ynh_secure_remove --file="$final_path/include/plugins/build" @@ -177,14 +163,14 @@ fi #================================================= # UPGRADE LANGUAGE #================================================= -ynh_print_info --message="UPGRADING language..." +ynh_script_progression --message="UPGRADING language..." rsync -a "../conf/i18n" "$final_path/include/." #================================================= # FINALIZE UPGRADE #================================================= -ynh_print_info --message="Finalizing install..." +ynh_script_progression --message="Finalizing install..." if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -198,7 +184,7 @@ fi #================================================= # SET THE CRON FILE #================================================= -ynh_print_info --message="Setting the cron file..." +ynh_script_progression --message="Setting the cron file..." cp -f ../conf/cron /etc/cron.d/$app @@ -207,7 +193,7 @@ ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= -ynh_print_info --message="Storing the config file checksum..." +ynh_script_progression --message="Storing the config file checksum..." ynh_backup_if_checksum_is_different --file="$config_file" # Recalculate and store the checksum of the file for the next upgrade. @@ -218,27 +204,15 @@ ynh_store_file_checksum --file="$config_file" #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_print_info --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." # Set permissions on app files chown -R $app: $final_path -#================================================= -# SETUP SSOWAT -#================================================= -ynh_print_info --message="Upgrading SSOwat configuration..." - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi - #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading nginx web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -246,4 +220,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed" From 422ccd1c28231fb98b49371a56dee1fd87545552 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 18 Feb 2021 09:56:46 +0100 Subject: [PATCH 06/10] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 4070ba8..dd969ed 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ pkg_dependencies="curl" YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-gettext php-imap php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-curl" +extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-curl" #================================================= # PERSONAL HELPERS From d5cc37f149b1faf23a7f70287c550ba039153aad Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 21 Feb 2021 21:39:53 +0100 Subject: [PATCH 07/10] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index dd969ed..5d59d5d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ pkg_dependencies="curl" YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-curl" +extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-curl" #================================================= # PERSONAL HELPERS From ad2bf9aff02b3a6bd3f7fa806bb3007623c7bb54 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 4 Mar 2021 22:59:28 +0100 Subject: [PATCH 08/10] Disable core-plugins --- check_process | 4 ++++ manifest.json | 4 ++-- scripts/install | 6 ++---- scripts/upgrade | 6 ++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/check_process b/check_process index 6f5c02f..af36d43 100644 --- a/check_process +++ b/check_process @@ -23,6 +23,8 @@ upgrade=1 from_commit=81e4075468d035b12ad70936d016d45d0f124720 # 1.14.2 upgrade=1 from_commit=cadb10e497d938e0e684e43ac870a3807b4b60d9 + # 1.14.3 + upgrade=1 from_commit=fe0bd01ffa787713e2b36408abe1e44033aacb69 backup_restore=1 multi_instance=1 port_already_use=0 @@ -35,3 +37,5 @@ Notification=none name=1.14.1 ; commit=cadb10e497d938e0e684e43ac870a3807b4b60d9 name=1.14.2 + ; commit=fe0bd01ffa787713e2b36408abe1e44033aacb69 + name=1.14.3 diff --git a/manifest.json b/manifest.json index ccea0b6..afe0a64 100644 --- a/manifest.json +++ b/manifest.json @@ -13,12 +13,12 @@ "name": "yalh76" }, "requirements": { - "yunohost": ">= 4.1.3" + "yunohost": ">= 4.1.7.3" }, "multi_instance": true, "services": [ "nginx", - "php7.0-fpm", + "php7.3-fpm", "mysql" ], "arguments": { diff --git a/scripts/install b/scripts/install index 1b59500..00cd724 100644 --- a/scripts/install +++ b/scripts/install @@ -141,7 +141,7 @@ mkdir -p "$final_path/include/plugins/build/.config/composer" COMPOSER_HOME="$final_path/include/plugins/build/.config/composer" pushd "$final_path/include/plugins/build" - php${phpversion} make.php hydrate + #php${phpversion} make.php hydrate php${phpversion} -dphar.readonly=0 make.php build auth-cas php${phpversion} -dphar.readonly=0 make.php build auth-ldap php${phpversion} -dphar.readonly=0 make.php build auth-oauth @@ -211,9 +211,7 @@ chmod 0644 $config_file #================================================= ynh_script_progression --message="Setting the cron file..." -cp ../conf/cron /etc/cron.d/$app - -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" #================================================= # STORE THE CONFIG FILE CHECKSUM diff --git a/scripts/upgrade b/scripts/upgrade index f3d3462..c218dbb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -139,7 +139,7 @@ then mkdir -p "$final_path/include/plugins/build/.config/composer" COMPOSER_HOME="$final_path/include/plugins/build/.config/composer" pushd "$final_path/include/plugins/build" - php${phpversion} make.php hydrate + #php${phpversion} make.php hydrate php${phpversion} -dphar.readonly=0 make.php build auth-cas php${phpversion} -dphar.readonly=0 make.php build auth-ldap php${phpversion} -dphar.readonly=0 make.php build auth-oauth @@ -188,9 +188,7 @@ fi #================================================= ynh_script_progression --message="Setting the cron file..." -cp -f ../conf/cron /etc/cron.d/$app - -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" #================================================= # STORE THE CONFIG FILE CHECKSUM From 07013081a6e63a31e79eccdd5d44822a518227e0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 5 Mar 2021 09:33:58 +0100 Subject: [PATCH 09/10] Disable all plugins --- scripts/install | 36 ++++++++++++++++++------------------ scripts/upgrade | 36 ++++++++++++++++++------------------ 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/scripts/install b/scripts/install index 00cd724..1d9eaf0 100644 --- a/scripts/install +++ b/scripts/install @@ -142,24 +142,24 @@ COMPOSER_HOME="$final_path/include/plugins/build/.config/composer" pushd "$final_path/include/plugins/build" #php${phpversion} make.php hydrate - php${phpversion} -dphar.readonly=0 make.php build auth-cas - php${phpversion} -dphar.readonly=0 make.php build auth-ldap - php${phpversion} -dphar.readonly=0 make.php build auth-oauth - php${phpversion} -dphar.readonly=0 make.php build auth-passthru - php${phpversion} -dphar.readonly=0 make.php build storage-fs - php${phpversion} -dphar.readonly=0 make.php build storage-s3 - php${phpversion} -dphar.readonly=0 make.php build archiver - php${phpversion} -dphar.readonly=0 make.php build attachment_preview - php${phpversion} -dphar.readonly=0 make.php build autocloser - php${phpversion} -dphar.readonly=0 make.php build fetch-note - php${phpversion} -dphar.readonly=0 make.php build field-radiobuttons - php${phpversion} -dphar.readonly=0 make.php build fwd-rewriter - php${phpversion} -dphar.readonly=0 make.php build mattermost - php${phpversion} -dphar.readonly=0 make.php build mentioner - php${phpversion} -dphar.readonly=0 make.php build microsoft-teams - php${phpversion} -dphar.readonly=0 make.php build slack - php${phpversion} -dphar.readonly=0 make.php build preventautoscroll - cp *.phar $final_path/include/plugins/. + #php${phpversion} -dphar.readonly=0 make.php build auth-cas + #php${phpversion} -dphar.readonly=0 make.php build auth-ldap + #php${phpversion} -dphar.readonly=0 make.php build auth-oauth + #php${phpversion} -dphar.readonly=0 make.php build auth-passthru + #php${phpversion} -dphar.readonly=0 make.php build storage-fs + #php${phpversion} -dphar.readonly=0 make.php build storage-s3 + #php${phpversion} -dphar.readonly=0 make.php build archiver + #php${phpversion} -dphar.readonly=0 make.php build attachment_preview + #php${phpversion} -dphar.readonly=0 make.php build autocloser + #php${phpversion} -dphar.readonly=0 make.php build fetch-note + #php${phpversion} -dphar.readonly=0 make.php build field-radiobuttons + #php${phpversion} -dphar.readonly=0 make.php build fwd-rewriter + #php${phpversion} -dphar.readonly=0 make.php build mattermost + #php${phpversion} -dphar.readonly=0 make.php build mentioner + #php${phpversion} -dphar.readonly=0 make.php build microsoft-teams + #php${phpversion} -dphar.readonly=0 make.php build slack + #php${phpversion} -dphar.readonly=0 make.php build preventautoscroll + #cp *.phar $final_path/include/plugins/. popd ynh_secure_remove --file="$final_path/include/plugins/build" diff --git a/scripts/upgrade b/scripts/upgrade index c218dbb..fc6739c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -140,24 +140,24 @@ then COMPOSER_HOME="$final_path/include/plugins/build/.config/composer" pushd "$final_path/include/plugins/build" #php${phpversion} make.php hydrate - php${phpversion} -dphar.readonly=0 make.php build auth-cas - php${phpversion} -dphar.readonly=0 make.php build auth-ldap - php${phpversion} -dphar.readonly=0 make.php build auth-oauth - php${phpversion} -dphar.readonly=0 make.php build auth-passthru - php${phpversion} -dphar.readonly=0 make.php build storage-fs - php${phpversion} -dphar.readonly=0 make.php build storage-s3 - php${phpversion} -dphar.readonly=0 make.php build archiver - php${phpversion} -dphar.readonly=0 make.php build attachment_preview - php${phpversion} -dphar.readonly=0 make.php build autocloser - php${phpversion} -dphar.readonly=0 make.php build fetch-note - php${phpversion} -dphar.readonly=0 make.php build field-radiobuttons - php${phpversion} -dphar.readonly=0 make.php build fwd-rewriter - php${phpversion} -dphar.readonly=0 make.php build mattermost - php${phpversion} -dphar.readonly=0 make.php build mentioner - php${phpversion} -dphar.readonly=0 make.php build microsoft-teams - php${phpversion} -dphar.readonly=0 make.php build slack - php${phpversion} -dphar.readonly=0 make.php build preventautoscroll - cp -f *.phar $final_path/include/plugins/. + #php${phpversion} -dphar.readonly=0 make.php build auth-cas + #php${phpversion} -dphar.readonly=0 make.php build auth-ldap + #php${phpversion} -dphar.readonly=0 make.php build auth-oauth + #php${phpversion} -dphar.readonly=0 make.php build auth-passthru + #php${phpversion} -dphar.readonly=0 make.php build storage-fs + #php${phpversion} -dphar.readonly=0 make.php build storage-s3 + #php${phpversion} -dphar.readonly=0 make.php build archiver + #php${phpversion} -dphar.readonly=0 make.php build attachment_preview + #php${phpversion} -dphar.readonly=0 make.php build autocloser + #php${phpversion} -dphar.readonly=0 make.php build fetch-note + #php${phpversion} -dphar.readonly=0 make.php build field-radiobuttons + #php${phpversion} -dphar.readonly=0 make.php build fwd-rewriter + #php${phpversion} -dphar.readonly=0 make.php build mattermost + #php${phpversion} -dphar.readonly=0 make.php build mentioner + #php${phpversion} -dphar.readonly=0 make.php build microsoft-teams + #php${phpversion} -dphar.readonly=0 make.php build slack + #php${phpversion} -dphar.readonly=0 make.php build preventautoscroll + #cp -f *.phar $final_path/include/plugins/. popd ynh_secure_remove --file="$final_path/include/plugins/build" fi From 20349f58ebb98ce87d3a80da18f11a7bafa04985 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 5 Mar 2021 20:40:36 +0100 Subject: [PATCH 10/10] Upgrade to 1.15.2 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 19a67d7..ec285c9 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview osTicket is a widely-used open source support ticket system. It seamlessly integrates inquiries created via email, phone and web-based forms into a simple easy-to-use multi-user web interface. Manage, organize and archive all your support requests and responses in one place while providing your customers with accountability and responsiveness they deserve. -**Shipped version:** 1.14.3 +**Shipped version:** 1.15.2 ## Screenshots diff --git a/conf/app.src b/conf/app.src index 520d02a..534c8b3 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/osTicket/osTicket/releases/download/v1.14.3/osTicket-v1.14.3.zip -SOURCE_SUM=1b118825680a5ed2c25bfa642e809b9f20d2d4c959e452a8473b4357fbe7b345 +SOURCE_URL=https://github.com/osTicket/osTicket/releases/download/v1.15.2/osTicket-v1.15.2.zip +SOURCE_SUM=83c435956f3975eefcc001152ce848bf00f26cdc97305e312b7653d6f843a252 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index afe0a64..ebc3481 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Open source support ticket system", "fr": "Système de ticket de support open source" }, - "version": "1.14.3~ynh1", + "version": "1.15.2~ynh1", "url": "https://osticket.com/", "license": "GPL-2.0-or-later", "maintainer": {