From eb59d1b6baaf9332c474847a3f8652994a8fdd92 Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:09:48 +0100 Subject: [PATCH] Testing (#41) * set relative path to keep option * Auto-update README * Manifest v2 and upgrade to v6.1.0 (#34) * convert to v2 * cleanup and example_ynh * Update * Update * Auto-update README * Update tests.toml --------- Co-authored-by: yunohost-bot * Auto-update README * cleaning * Auto-update README * cleaning * Auto-update README * fix linter * Auto-update README * cleaning * Update backup * Update manifest.toml * Update snipeit.env * Update manifest.toml * Revert "Update manifest.toml" This reverts commit 2ece2825a599591b6d52ed1837ab2e42eeb92c09. * Upgrade to v6.3.0 (#39) * Upgrade to v6.3.0 * Auto-update README * Upgrade to v6.3.1 * Auto-update README * Mail (#37) * Update snipeit.env * Update manifest.toml * Update manifest.toml * fix * Update tests.toml * cleaning * Auto-update README * Update change_url --------- Co-authored-by: yunohost-bot * Auto-update README * fix * add php --------- Co-authored-by: yunohost-bot Co-authored-by: Tagada <36127788+Tagadda@users.noreply.github.com> Co-authored-by: YunoHost Bot Co-authored-by: OniriCorpe --- README.md | 6 +++--- README_fr.md | 4 ++-- conf/extra_php-fpm.conf | 4 ++++ conf/nginx.conf | 2 +- conf/snipeit.env | 8 ++++---- manifest.toml | 10 +++++++--- scripts/_common.sh | 1 + scripts/change_url | 30 ++++++++++++++++++++++++++++++ scripts/install | 5 +---- scripts/remove | 2 -- scripts/upgrade | 5 +---- tests.toml | 3 ++- 12 files changed, 56 insertions(+), 24 deletions(-) create mode 100644 conf/extra_php-fpm.conf create mode 100644 scripts/change_url diff --git a/README.md b/README.md index 7f0a126..492217b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Snipeit is a FOSS project for asset management in IT Operations. Knowing who has which laptop, when it was purchased in order to depreciate it correctly, handling software licenses, etc. -**Shipped version:** 6.3.0~ynh1 +**Shipped version:** 6.3.1~ynh1 **Demo:** https://snipeitapp.com/demo/ @@ -47,4 +47,4 @@ or sudo yunohost app upgrade snipeit -u https://github.com/YunoHost-Apps/snipeit_ynh/tree/testing --debug ``` -**More info regarding app packaging:** +**More info regarding app packaging:** \ No newline at end of file diff --git a/README_fr.md b/README_fr.md index 6f9d8bf..f8827fe 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,5 +1,5 @@ @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Snipeit est un projet FOSS pour la gestion des actifs dans les opérations informatiques. Savoir qui possède quel ordinateur portable, quand il a été acheté pour bien l'amortir, gérer les licences des logiciels, etc. -**Version incluse :** 6.3.0~ynh1 +**Version incluse :** 6.3.1~ynh1 **Démo :** https://snipeitapp.com/demo/ diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf new file mode 100644 index 0000000..700c37c --- /dev/null +++ b/conf/extra_php-fpm.conf @@ -0,0 +1,4 @@ +; Additional php.ini defines, specific to this pool of workers. + +php_admin_value[upload_max_filesize] = 50M +php_admin_value[post_max_size] = 50M diff --git a/conf/nginx.conf b/conf/nginx.conf index 261b7e8..0c727a1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,7 +7,7 @@ location ^~ __PATH__/ { index index.php; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - #client_max_body_size 50M; + client_max_body_size 50M; try_files $uri $uri/ @snipe; location ~ \.php { diff --git a/conf/snipeit.env b/conf/snipeit.env index 3afd353..a0d057d 100644 --- a/conf/snipeit.env +++ b/conf/snipeit.env @@ -48,12 +48,12 @@ DB_SSL_CIPHER=null MAIL_DRIVER=mail MAIL_HOST=127.0.0.1 MAIL_PORT=25 -MAIL_USERNAME= -MAIL_PASSWORD= +MAIL_USERNAME=__APP__ +MAIL_PASSWORD=__MAIL_PWD__ MAIL_ENCRYPTION=null -MAIL_FROM_ADDR=snipeit@__DOMAIN__ +MAIL_FROM_ADDR=__APP__@__DOMAIN__ MAIL_FROM_NAME='Snip-IT' -MAIL_REPLYTO_ADDR=snipeit@__DOMAIN__ +MAIL_REPLYTO_ADDR=__APP__@__DOMAIN__ MAIL_REPLYTO_NAME='Snipe-IT' MAIL_AUTO_EMBED_METHOD='attachment' diff --git a/manifest.toml b/manifest.toml index b2fe01f..c8081f2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Snipe-IT" description.en = "Manage assets for IT operations" description.fr = "Gestionnaire de ressources informatiques" -version = "6.3.0~ynh1" +version = "6.3.1~ynh1" maintainers = [] @@ -23,8 +23,11 @@ fund = "https://snipeitapp.com/donate" yunohost = ">= 11.2" architectures = "all" multi_instance = false + ldap = false + sso = false + disk = "200M" ram.build = "150M" ram.runtime = "50M" @@ -47,11 +50,12 @@ ram.runtime = "50M" [resources] [resources.sources] [resources.sources.main] - url = "https://github.com/snipe/snipe-it/archive/refs/tags/v6.3.0.tar.gz" - sha256 = "a27fcde775d78401b1eefabf68c3842a3640989636fb26238d3a4ed94758a6d9" + url = "https://github.com/snipe/snipe-it/archive/refs/tags/v6.3.1.tar.gz" + sha256 = "7ff56b93cd7609b390e8521dc843841a433dbbce079123fb26bf7519baab8014" autoupdate.strategy = "latest_github_tag" [resources.system_user] + allow_email = true [resources.install_dir] diff --git a/scripts/_common.sh b/scripts/_common.sh index 5bb3d64..930a9ea 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,6 +7,7 @@ # Packages requirements: https://snipe-it.readme.io/docs/requirements YNH_COMPOSER_VERSION=2.5.8 + timezone=$(cat /etc/timezone) #================================================= diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..fa9cbef --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,30 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 + +ynh_change_url_nginx_config + +#================================================= +# SPECIFIC MODIFICATIONS +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_replace_string --match_string="APP_URL=https://$old_domain" --replace_string="APP_URL=https://$new_domain" --target_file=$install_dir/.env + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 2f0efb7..ded25c1 100755 --- a/scripts/install +++ b/scripts/install @@ -25,13 +25,10 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 -# Create a dedicated PHP-FPM config using the conf/php-fpm.conf or conf/extra_php-fpm.conf -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config -# Create a dedicated NGINX config ynh_add_nginx_config -# Install composer ynh_install_composer #================================================= diff --git a/scripts/remove b/scripts/remove index 46ed076..be13778 100755 --- a/scripts/remove +++ b/scripts/remove @@ -14,10 +14,8 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 -# Remove the dedicated NGINX config ynh_remove_nginx_config -# Remove the dedicated PHP-FPM config ynh_remove_fpm_config #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6d65b46..18c0deb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,10 +49,8 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 -# Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config -# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -60,7 +58,6 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Installing Composer..." --weight=15 -# Install composer ynh_install_composer ynh_exec_warn_less ynh_composer_exec --commands="dump-autoload" diff --git a/tests.toml b/tests.toml index f00fcf4..d7e464b 100644 --- a/tests.toml +++ b/tests.toml @@ -2,9 +2,10 @@ test_format = 1.0 [default] - exclude = ["install.subdir", "install.nourl", "change_url"] + exclude = ["install.subdir"] test_upgrade_from.ebf4c0a.name = "Upgrade from 5.3.1~ynh3 (manifest v1)" + test_upgrade_from.ebf4c0a.args.domain="domain.tld" test_upgrade_from.ebf4c0a.args.is_public=1 test_upgrade_from.ebf4c0a.args.language="fr"