diff --git a/issue_template.md b/.github/ISSUE_TEMPLATE.md similarity index 94% rename from issue_template.md rename to .github/ISSUE_TEMPLATE.md index 5df5014..2729a6b 100644 --- a/issue_template.md +++ b/.github/ISSUE_TEMPLATE.md @@ -8,7 +8,7 @@ about: When creating a bug report, please use the following template to provide 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.* + - *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.* --- @@ -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 osticket + 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/README.md b/README.md index a29096b..ac343cf 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,42 @@ + + # 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.svg)](https://install-app.yunohost.org/?app=osticket) -> *This package allows you to install osTicket quickly and simply on a YunoHost server. +*[Lire ce readme en français.](./README_fr.md)* + +> *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. -**Shipped version:** 1.15.2 +Open source support ticket system + +**Shipped version:** 1.15.3.1~ynh1 + +**Demo:** http://www.ostickethacks.com/demo/demo_info.php ## Screenshots -![](screenshot.png) +![](./doc/screenshots/screenshot.png) -## Demo +## Disclaimers / important information -* [Official demo](http://www.ostickethacks.com/demo/demo_info.php) +* Any known limitations, constrains or stuff not working, such as (but not limited to): + * LDAP and HTTP auth are supported through plugins -## Documentation +## Documentation and resources - * Official documentation: https://docs.osticket.com - -## YunoHost specific features - -#### Multi-user support - -LDAP and HTTP auth are supported through plugins - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/osticket.svg)](https://ci-apps.yunohost.org/ci/apps/osticket/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/osticket.svg)](https://ci-apps-arm.yunohost.org/ci/apps/osticket/) - -## Additional information - -* The package include several plugins to be installed and enabled: - - Archiver - - Attachment Inline - - Attachments hosted in Amazon S3 - - Attachments on the filesystem - - Fetch Note - - HTTP Passthru Authentication - - JASIG CAS Authentication - - LDAP Authentication and Lookup - - Mattermost integration - - Mentioner - - Microsoft Teams notifier - - Oauth2 Authentication and Lookup - - Prevent Autoscroll - - Radiobuttons - - Slack notifier - - Ticket Closer - - Ticket Rewriter - -* The package includes many languages available through `Admin Panel > Settings > System - -## Links - - * Report a bug: https://github.com/YunoHost-Apps/osticket_ynh/issues - * App website: https://osticket.com - * Upstream app repository: https://github.com/osTicket/osTicket - * YunoHost website: https://yunohost.org/ - ---- +* Official app website: https://osticket.com +* Official user documentation: https://docs.osticket.com +* Upstream app code repository: https://github.com/osTicket/osTicket +* YunoHost documentation for this app: https://yunohost.org/app_osticket +* Report a bug: https://github.com/YunoHost-Apps/osticket_ynh/issues ## Developer info @@ -76,3 +48,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/osticket_ynh/tree/tes or sudo yunohost app upgrade osticket -u https://github.com/YunoHost-Apps/osticket_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..e4bfa1c --- /dev/null +++ b/README_fr.md @@ -0,0 +1,48 @@ +# osTicket pour YunoHost + +[![Niveau d'intégration](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) +[![Installer osTicket avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=osticket) + +*[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* + +> *Ce package vous permet d'installer osTicket rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* + +## Vue d'ensemble + +Système de ticket de support open source + +**Version incluse :** 1.15.3.1~ynh1 + +**Démo :** http://www.ostickethacks.com/demo/demo_info.php + +## Captures d'écran + +![](./doc/screenshots/screenshot.png) + +## Avertissements / informations importantes + +* Any known limitations, constrains or stuff not working, such as (but not limited to): + * LDAP and HTTP auth are supported through plugins + +## Documentations et ressources + +* Site officiel de l'app : https://osticket.com +* Documentation officielle utilisateur : https://docs.osticket.com +* Dépôt de code officiel de l'app : https://github.com/osTicket/osTicket +* Documentation YunoHost pour cette app : https://yunohost.org/app_osticket +* Signaler un bug : https://github.com/YunoHost-Apps/osticket_ynh/issues + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/osticket_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/osticket_ynh/tree/testing --debug +ou +sudo yunohost app upgrade osticket -u https://github.com/YunoHost-Apps/osticket_ynh/tree/testing --debug +``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/check_process b/check_process index 44ff7c5..420ec16 100644 --- a/check_process +++ b/check_process @@ -1,16 +1,11 @@ -# See here for more information -# https://github.com/YunoHost/package_check#syntax-check_process-file - -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) + domain="domain.tld" + path="/path" + admin="john" language="fr" - is_public=1 (PUBLIC|public=1|private=0) - password="pass" + is_public=1 + password="1Strong-Password" ; Checks pkg_linter=1 setup_sub_dir=1 @@ -27,6 +22,8 @@ #upgrade=1 from_commit=fe0bd01ffa787713e2b36408abe1e44033aacb69 # 1.15.2~ynh1 upgrade=1 from_commit=20349f58ebb98ce87d3a80da18f11a7bafa04985 + # 1.15.2~ynh2 + upgrade=1 from_commit=55e224ea95f384ab8db46941366b0205cd8d3032 backup_restore=1 multi_instance=1 port_already_use=0 @@ -43,3 +40,5 @@ Notification=none name=1.14.3 ; commit=20349f58ebb98ce87d3a80da18f11a7bafa04985 name=1.15.2~ynh1 + ; commit=55e224ea95f384ab8db46941366b0205cd8d3032 + name=1.15.2~ynh2 diff --git a/conf/app.src b/conf/app.src index 534c8b3..9b7a870 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/osTicket/osTicket/releases/download/v1.15.2/osTicket-v1.15.2.zip -SOURCE_SUM=83c435956f3975eefcc001152ce848bf00f26cdc97305e312b7653d6f843a252 +SOURCE_URL=https://github.com/osTicket/osTicket/releases/download/v1.15.3.1/osTicket-v1.15.3.1.zip +SOURCE_SUM=5417aaaa617980ed4e653fcfc1d4330951720841a64a28e8ada922e233a244ce SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/core-plugins.src b/conf/core-plugins.src index 45e1acb..06cd7a7 100644 --- a/conf/core-plugins.src +++ b/conf/core-plugins.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/osTicket/osTicket-plugins/archive/52f7bae08699d9408180d0a67b327e79c095cd37.tar.gz -SOURCE_SUM=468087ea48af6ef1b8372a7542974e1d2f00759c7e3fa87209ce06e7d6c0af70 +SOURCE_URL=https://github.com/osTicket/osTicket-plugins/archive/f00b381190164b237cfb799a4fc4ce6a86eea9f4.tar.gz +SOURCE_SUM=ab2518d70454faad37666f47b41f6bc861c8928b44f574307c1494e9df8ff591 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/plugin-archiver.src b/conf/plugin-archiver.src index d57b13f..26721af 100644 --- a/conf/plugin-archiver.src +++ b/conf/plugin-archiver.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/clonemeagain/osticket-plugin-archiver/archive/6f14d3908e1c92c6d95ac28bdd33b03f6e67c5e5.tar.gz -SOURCE_SUM=9b2cb9bc20a5539a67b51cc7a1299d2b6d8ad3cfa1c9b62947745d4321e09d52 +SOURCE_URL=https://github.com/clonemeagain/osticket-plugin-archiver/archive/df6eab6bb6a65d6aa02215b1becb01238883c62f.tar.gz +SOURCE_SUM=c3fa4416853fe2eb918cd68a6f0965c4b66dd411b79993614a47eea5baa095f2 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/plugin-autocloser.src b/conf/plugin-autocloser.src index 088afb5..90d3fa2 100644 --- a/conf/plugin-autocloser.src +++ b/conf/plugin-autocloser.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/clonemeagain/plugin-autocloser/archive/b5ae451567a3a9a4f79ab19e2781816ea8138cbf.tar.gz -SOURCE_SUM=5ecd1201ef1606222a37b5be2fdf6e4459e0f754e474bf7bc71048ba3c38d279 +SOURCE_URL=https://github.com/clonemeagain/plugin-autocloser/archive/cc986b6a6c687144dca258e42dea6e00eca126df.tar.gz +SOURCE_SUM=ba4dbdddaa340b8cf457cb3b04beb510565c411cca19d67dbab764b562c47b65 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/plugin-mattermost.src b/conf/plugin-mattermost.src index 7dd63be..e97e59b 100644 --- a/conf/plugin-mattermost.src +++ b/conf/plugin-mattermost.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Faust13/osticket-mattermost/archive/ab73d5692fd9877947a513155548c4b581d86f09.tar.gz -SOURCE_SUM=a4cfb94776a5e995f39f084441b00fb3219d3e40989b89a89dc9e2f3f47cd2a5 +SOURCE_URL=https://github.com/pberndro/osticket-mattermost/archive/8ac5224c121e765f22237818da1b8c189a9bd647.tar.gz +SOURCE_SUM=d18e2c796bd96c1016334195e816445d684a10e933f997a789d340eee75c7db7 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/plugin-microsoft-teams.src b/conf/plugin-microsoft-teams.src index 238c55c..0e3159a 100644 --- a/conf/plugin-microsoft-teams.src +++ b/conf/plugin-microsoft-teams.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/ipavlovi/osTicket-Microsoft-Teams-plugin/archive/2cab87a9b1954c3c3d7bfff30671052e7fc69ae2.tar.gz -SOURCE_SUM=48c208064347819580476e7133627c13414cc0307e20d0976f18077c74a28044 +SOURCE_URL=https://github.com/ipavlovi/osTicket-Microsoft-Teams-plugin/archive/dcb66302d6ffc4ee3e016acbd98949b0d69dde01.tar.gz +SOURCE_SUM=8601973c07ca3d18f10333a3458b5b6f48a56c87361be9b3832605db245157e2 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/plugin-slack.src b/conf/plugin-slack.src index 001fd9b..2b740f6 100644 --- a/conf/plugin-slack.src +++ b/conf/plugin-slack.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/clonemeagain/osticket-slack/archive/ca65391b546add6d29e46cd08df6af69c0d9ea58.tar.gz -SOURCE_SUM=c8efddb3f5abbd14abc4982a11c1d4710342eee1330c1925e60375d7787ca090 +SOURCE_URL=https://github.com/clonemeagain/osticket-slack/archive/235436a8fb92168f01fa4d4e55336d203c6eded4.tar.gz +SOURCE_SUM=c97024c86688ba73b38fa4fa4d2329076dd7a912dca5f2aea042d6b095e6ab3e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..c91285e --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,2 @@ +* Any known limitations, constrains or stuff not working, such as (but not limited to): + * LDAP and HTTP auth are supported through plugins diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/screenshot.png b/doc/screenshots/screenshot.png similarity index 100% rename from screenshot.png rename to doc/screenshots/screenshot.png diff --git a/manifest.json b/manifest.json index 7a087e3..d4859a3 100644 --- a/manifest.json +++ b/manifest.json @@ -6,8 +6,15 @@ "en": "Open source support ticket system", "fr": "Système de ticket de support open source" }, - "version": "1.15.2~ynh2", - "url": "https://osticket.com/", + "version": "1.15.3.1~ynh1", + "url": "https://osticket.com", + "upstream": { + "license": "GPL-2.0-or-later", + "website": "https://osticket.com", + "demo": "http://www.ostickethacks.com/demo/demo_info.php", + "userdoc": "https://docs.osticket.com", + "code": "https://github.com/osTicket/osTicket" + }, "license": "GPL-2.0-or-later", "maintainer": { "name": "yalh76" 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/backup b/scripts/backup index c4314ac..89da2d0 100644 --- a/scripts/backup +++ b/scripts/backup @@ -58,7 +58,7 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # SPECIFIC BACKUP #================================================= -# BACKUP A CRON FILE +# BACKUP VARIOUS FILES #================================================= ynh_backup --src_path="/etc/cron.d/$app" diff --git a/scripts/install b/scripts/install index 874883c..f5af1a6 100644 --- a/scripts/install +++ b/scripts/install @@ -68,7 +68,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Configuring system user..." # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # CREATE A MYSQL DATABASE @@ -89,6 +89,7 @@ ynh_app_setting_set --app=$app --key=final_path --value=$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" +ynh_replace_string --match_string="net_ldap2" --replace_string="Net_LDAP2" --target_file="$final_path/include/plugins/build/auth-ldap/plugin.php" ynh_setup_source --dest_dir="$final_path/include/plugins/build/archiver" --source_id="plugin-archiver" ynh_setup_source --dest_dir="$final_path/include/plugins/build/attachment_preview" --source_id="plugin-attachment_preview" ynh_setup_source --dest_dir="$final_path/include/plugins/build/autocloser" --source_id="plugin-autocloser" @@ -134,7 +135,7 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a config file..." +ynh_script_progression --message="Adding a configuration file..." cp -f "../conf/ost-sampleconfig.php" "$final_path/include/ost-config.php" @@ -150,25 +151,25 @@ 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} -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} 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" @@ -206,6 +207,8 @@ ynh_secure_remove --file="$final_path/setup" chmod 400 "$final_path/include/ost-config.php" chown $app:www-data "$final_path/include/ost-config.php" +ynh_store_file_checksum --file="$final_path/include/ost-config.php" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/remove b/scripts/remove index 516968d..5fba8f1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -66,9 +66,9 @@ ynh_remove_fpm_config #================================================= # SPECIFIC REMOVE #================================================= -# REMOVE THE CRON FILE +# REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing the cron file..." +ynh_script_progression --message="Removing various files..." # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index feeee23..39fd74a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -59,7 +59,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # RESTORE THE APP MAIN DIR @@ -75,7 +75,7 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring PHP-FPM configuration..." +ynh_script_progression --message="Restoring the PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" @@ -85,13 +85,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC RESTORATION -#================================================= -# RESTORE THE CRON FILE -#================================================= -ynh_script_progression --message="Restoring the cron file..." - -ynh_restore_file --origin_path="/etc/cron.d/$app" - #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -109,6 +102,13 @@ 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 ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +#================================================= +# RESTORE VARIOUS FILES +#================================================= +ynh_script_progression --message="Restoring various files..." + +ynh_restore_file --origin_path="/etc/cron.d/$app" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 25d21fb..28938ba 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,8 +23,6 @@ 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) -config_file=$final_path/include/ost-config.php - #================================================= # CHECK VERSION #================================================= @@ -32,18 +30,6 @@ ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." - -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -60,13 +46,25 @@ ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # CREATE DEDICATED USER #================================================= ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -80,12 +78,13 @@ then mkdir $tmpdir/plugins rsync -a "$final_path/include/plugins" "$tmpdir/." - rsync -a "$config_file" "$tmpdir/." + rsync -a "$final_path/include/ost-config.php" "$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" +ynh_replace_string --match_string="net_ldap2" --replace_string="Net_LDAP2" --target_file="$final_path/include/plugins/build/auth-ldap/plugin.php" ynh_setup_source --dest_dir="$final_path/include/plugins/build/archiver" --source_id="plugin-archiver" ynh_setup_source --dest_dir="$final_path/include/plugins/build/attachment_preview" --source_id="plugin-attachment_preview" ynh_setup_source --dest_dir="$final_path/include/plugins/build/autocloser" --source_id="plugin-autocloser" @@ -136,7 +135,9 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a config file..." +ynh_script_progression --message="Updating a configuration file..." + +ynh_store_file_checksum --file="$final_path/include/ost-config.php" chmod 400 "$final_path/include/ost-config.php" chown $app:www-data "$final_path/include/ost-config.php" @@ -151,25 +152,25 @@ 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} -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} 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" ynh_secure_remove --file="$final_path/setup" @@ -189,15 +190,6 @@ ynh_script_progression --message="Setting the cron file..." ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" -#================================================= -# STORE 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. -ynh_store_file_checksum --file="$config_file" - #================================================= # GENERIC FINALIZATION #=================================================