From 7461b1d0f1f0da643e348da3d7ac76c51fd7c576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 19 Nov 2021 15:05:33 +0100 Subject: [PATCH 01/10] Testing (#26) * Add redis (#25) --- README.md | 2 +- README_fr.md | 2 +- conf/.env | 6 +++--- conf/nginx.conf | 5 ----- manifest.json | 2 +- scripts/_common.sh | 40 +++++++++++++++++++++++++++++++++++++++- scripts/install | 29 +++++++++++++++++------------ scripts/remove | 8 ++++++++ scripts/restore | 27 +++++++++++---------------- scripts/upgrade | 18 +++++++++--------- 10 files changed, 90 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 0d16df9..69a80b2 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Manage assets for IT operations -**Shipped version:** 5.3.1~ynh1 +**Shipped version:** 5.3.1~ynh2 **Demo:** https://snipeitapp.com/demo/ diff --git a/README_fr.md b/README_fr.md index a1a56d4..72f482c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Gestionnaire de ressources informatiques -**Version incluse :** 5.3.1~ynh1 +**Version incluse :** 5.3.1~ynh2 **Démo :** https://snipeitapp.com/demo/ diff --git a/conf/.env b/conf/.env index 45fba08..715541e 100644 --- a/conf/.env +++ b/conf/.env @@ -3,7 +3,7 @@ # -------------------------------------------- APP_ENV=production APP_DEBUG=false -APP_KEY=ChangeMe +APP_KEY=__KEY__ APP_URL=http://__DOMAIN__ APP_TIMEZONE='UTC' APP_LOCALE=__LANGUAGE__ @@ -77,9 +77,9 @@ CACHE_PREFIX=snipeit # -------------------------------------------- # OPTIONAL: REDIS SETTINGS # -------------------------------------------- -REDIS_HOST=null +REDIS_HOST="127.0.0.1" REDIS_PASSWORD=null -REDIS_PORT=null +REDIS_PORT=__REDIS_DB__ # -------------------------------------------- # OPTIONAL: MEMCACHED SETTINGS diff --git a/conf/nginx.conf b/conf/nginx.conf index a9af33f..82991f6 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location ^~ __PATH__/ { # Path to source alias __FINALPATH__/public/; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.php; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file diff --git a/manifest.json b/manifest.json index bf748d6..ef59458 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Manage assets for IT operations", "fr": "Gestionnaire de ressources informatiques" }, - "version": "5.3.1~ynh1", + "version": "5.3.1~ynh2", "url": "https://snipeitapp.com/", "upstream": { "license": "MIT", diff --git a/scripts/_common.sh b/scripts/_common.sh index 9e24f07..d3386d2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -21,5 +21,43 @@ YNH_COMPOSER_VERSION=2.0.14 #================================================= #================================================= -# FUTURE OFFICIAL HELPERS +# REDIS HELPERS #================================================= + +# get the first available redis database +# +# usage: ynh_redis_get_free_db +# | returns: the database number to use +ynh_redis_get_free_db() { + local result max db + result="$(redis-cli INFO keyspace)" + + # get the num + max=$(cat /etc/redis/redis.conf | grep ^databases | grep -Eow "[0-9]+") + + db=0 + # default Debian setting is 15 databases + for i in $(seq 0 "$max") + do + if ! echo "$result" | grep -q "db$i" + then + db=$i + break 1 + fi + db=-1 + done + + test "$db" -eq -1 && ynh_die --message="No available Redis databases..." + + echo "$db" +} + +# Create a master password and set up global settings +# Please always call this script in install and restore scripts +# +# usage: ynh_redis_remove_db database +# | arg: database - the database to erase +ynh_redis_remove_db() { + local db=$1 + redis-cli -n "$db" flushall +} diff --git a/scripts/install b/scripts/install index 1e256fd..54f6d68 100755 --- a/scripts/install +++ b/scripts/install @@ -29,7 +29,8 @@ admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE email=$(ynh_user_get_info --username=$admin --key=mail) -key= +key=$(ynh_string_random --length=24) +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME @@ -53,6 +54,7 @@ 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=language --value=$language +ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion #================================================= # STANDARD MODIFICATIONS @@ -73,6 +75,14 @@ db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=3 + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -90,14 +100,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=5 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -105,7 +107,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP @@ -122,6 +123,10 @@ ynh_install_composer #================================================= ynh_script_progression --message="Building..." +# Configure redis +redis_db=$(ynh_redis_get_free_db) +ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" + ynh_add_config --template="../conf/.env" --destination="$final_path/.env" chmod 600 "$final_path/.env" @@ -143,7 +148,7 @@ popd ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions to app files -chown -R $app: $final_path +chown -R $app:www-data $final_path chmod -R o-rwx $final_path chmod -R 755 $final_path/storage chmod -R 755 $final_path/public/uploads @@ -151,7 +156,7 @@ chmod -R 755 $final_path/public/uploads #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=3 +ynh_script_progression --message="Configuring permissions..." --weight=3 # Make app public if necessary or protect it if [ $is_public -eq 1 ] diff --git a/scripts/remove b/scripts/remove index dff964c..ae5943e 100755 --- a/scripts/remove +++ b/scripts/remove @@ -20,6 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) +redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) #================================================= # STANDARD REMOVE @@ -31,6 +32,13 @@ ynh_script_progression --message="Removing the MySQL database" --weight=1 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#================================================= +# REMOVE THE REDIS DATABASE +#================================================= +ynh_script_progression --message="Removing the redis database..." + +ynh_redis_remove_db "$redis_db" + #================================================= # REMOVE DEPENDENCIES #================================================= diff --git a/scripts/restore b/scripts/restore index c509ffe..9f8a139 100755 --- a/scripts/restore +++ b/scripts/restore @@ -50,6 +50,14 @@ ynh_script_progression --message="Restoring the nginx configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=2 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -57,22 +65,9 @@ ynh_script_progression --message="Restoring Snipe-IT main directory..." --weight ynh_restore_file --origin_path="$final_path" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=2 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app - -#================================================= -# RESTORE USER RIGHTS -#================================================= -ynh_script_progression --message="Restoring user rights..." - -# Restore permissions on app files -chown -R $app: $final_path -chmod -R o-rwx $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index ee22f88..aca058f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -68,6 +68,14 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -97,14 +105,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=3 ynh_install_app_dependencies $pkg_dependencies -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -143,7 +143,7 @@ ynh_store_file_checksum --file="$final_path/.env" ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions on app files -chown -R $app: $final_path +chown -R $app:www-data $final_path chmod -R o-rwx $final_path chmod -R 755 $final_path/storage chmod -R 755 $final_path/public/uploads From 8bbdd5a9b16749c15400ae66349de510c0f030d8 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jul 2022 00:48:06 +0200 Subject: [PATCH 02/10] Apply example_ynh --- check_process | 14 +++++++----- conf/app.src | 2 ++ conf/nginx.conf | 6 ++--- manifest.json | 12 ++++++---- scripts/_common.sh | 6 ++--- scripts/backup | 1 + scripts/install | 55 ++++++++++++++++++++++++++-------------------- scripts/remove | 32 +++++++++++++-------------- scripts/restore | 41 +++++++++++++++++----------------- scripts/upgrade | 55 +++++++++++++++++++++++++++------------------- 10 files changed, 126 insertions(+), 98 deletions(-) diff --git a/check_process b/check_process index 1976c32..f4bead2 100644 --- a/check_process +++ b/check_process @@ -2,9 +2,9 @@ ; Manifest domain="domain.tld" path="/path" - admin="john" - language="fr" is_public=1 + language="fr" + admin="john" ; Checks pkg_linter=1 setup_sub_dir=0 @@ -13,12 +13,14 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=c0be2e5239ccad4cff25d5bd1584eabd11617220 + # 5.0.4~ynh1 + upgrade=1 from_commit=c0be2e5239ccad4cff25d5bd1584eabd11617220 + # 5.3.1~ynh2 + upgrade=1 from_commit=7461b1d0f1f0da643e348da3d7ac76c51fd7c576 backup_restore=1 multi_instance=0 - incorrect_path=1 + port_already_use=0 change_url=0 ;;; Options Email=anmol@datamol.org -Notification=change - +Notification=none diff --git a/conf/app.src b/conf/app.src index 21d8459..e2f2ad6 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,3 +3,5 @@ SOURCE_SUM=0870373e35dbe34574322d49da647a4c5cf8912a153ab520eb065cc4b06787e0 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 82991f6..945405d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location ^~ __PATH__/ { # Path to source @@ -16,8 +16,8 @@ location ^~ __PATH__/ { fastcgi_index index.php; include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; } diff --git a/manifest.json b/manifest.json index ef59458..d234579 100644 --- a/manifest.json +++ b/manifest.json @@ -6,11 +6,11 @@ "en": "Manage assets for IT operations", "fr": "Gestionnaire de ressources informatiques" }, - "version": "5.3.1~ynh2", - "url": "https://snipeitapp.com/", + "version": "5.3.1~ynh3", + "url": "https://snipeitapp.com", "upstream": { "license": "MIT", - "website": "https://snipeitapp.com/", + "website": "https://snipeitapp.com", "demo": "https://snipeitapp.com/demo/", "admindoc": "https://snipe-it.readme.io/docs", "code": "https://github.com/snipe/snipe-it" @@ -30,7 +30,7 @@ "mysql" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain" @@ -53,6 +53,10 @@ }, "choices": ["en", "fr"], "default": "en" + }, + { + "name": "admin", + "type": "user" } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index d3386d2..1f62eec 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,11 +7,11 @@ # Packages requirements: https://snipe-it.readme.io/docs/requirements YNH_PHP_VERSION="7.3" - -pkg_dependencies="openssl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-gd" - YNH_COMPOSER_VERSION=2.0.14 +# dependencies used by the app +pkg_dependencies="openssl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-gd" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 796c5b4..99f5b6d 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers diff --git a/scripts/install b/scripts/install index 54f6d68..bcf8482 100755 --- a/scripts/install +++ b/scripts/install @@ -25,9 +25,9 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" -admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE +admin=$YNH_APP_ARG_ADMIN email=$(ynh_user_get_info --username=$admin --key=mail) key=$(ynh_string_random --length=24) phpversion=$YNH_PHP_VERSION @@ -52,8 +52,8 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 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=language --value=$language +ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion #================================================= @@ -65,6 +65,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=3 ynh_install_app_dependencies $pkg_dependencies +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=3 + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -75,14 +83,6 @@ db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -92,14 +92,6 @@ 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" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=5 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -108,6 +100,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=5 + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # SPECIFIC SETUP #================================================= @@ -119,9 +119,9 @@ ynh_script_progression --message="Installing Composer..." --weight=21 ynh_install_composer #================================================= -# BUILDING +# ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Building..." +ynh_script_progression --message="Adding a configuration file..." # Configure redis redis_db=$(ynh_redis_get_free_db) @@ -132,6 +132,11 @@ ynh_add_config --template="../conf/.env" --destination="$final_path/.env" chmod 600 "$final_path/.env" chown $app:$app "$final_path/.env" +#================================================= +# BUILDING +#================================================= +ynh_script_progression --message="Building..." + # setup application config pushd "$final_path" php$phpversion artisan key:generate -n --force --env @@ -140,8 +145,6 @@ pushd "$final_path" php$phpversion artisan config:cache -n popd -#================================================= -# GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -153,15 +156,19 @@ chmod -R o-rwx $final_path chmod -R 755 $final_path/storage chmod -R 755 $final_path/public/uploads +#================================================= +# GENERIC FINALIZATION #================================================= # SETUP SSOWAT #================================================= ynh_script_progression --message="Configuring permissions..." --weight=3 -# Make app public if necessary or protect it +# Make app public if necessary if [ $is_public -eq 1 ] then - ynh_permission_update --permission "main" --add "visitors" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/remove b/scripts/remove index ae5943e..a8d9a5a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -24,14 +24,6 @@ redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) #================================================= # STANDARD REMOVE -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Removing the MySQL database" --weight=1 - -# Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - #================================================= # REMOVE THE REDIS DATABASE #================================================= @@ -40,17 +32,17 @@ ynh_script_progression --message="Removing the redis database..." ynh_redis_remove_db "$redis_db" #================================================= -# REMOVE DEPENDENCIES +# REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing dependencies" --weight=2 +ynh_script_progression --message="Removing the MySQL database..." --weight=1 -# Remove metapackage and its dependencies -ynh_remove_app_dependencies +# Remove a database if it exists, along with the associated user +ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing Snipe-IT main directory" --weight=5 +ynh_script_progression --message="Removing app main directory..." --weight=5 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -58,7 +50,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration" --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config @@ -66,17 +58,25 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing PHP-FPM configuration" --weight=2 +ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=2 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # GENERIC FINALIZATION #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user" --weight=1 +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user ynh_system_user_delete --username=$app diff --git a/scripts/restore b/scripts/restore index 9f8a139..44e2195 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -22,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -43,13 +44,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the nginx configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -61,7 +55,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring Snipe-IT main directory..." --weight=7 +ynh_script_progression --message="Restoring the app main directory..." --weight=7 ynh_restore_file --origin_path="$final_path" @@ -69,17 +63,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring PHP-FPM configuration..." - -# Restore the file first, so it can have a backup if different -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -# Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low - #================================================= # SPECIFIC RESTORATION #================================================= @@ -90,6 +73,24 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=8 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." + +# Restore the file first, so it can have a backup if different +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Recreate a dedicated php-fpm config +ynh_add_fpm_config --usage=low --footprint=low + +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index aca058f..a62dcea 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,37 +18,47 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) +language=$(ynh_app_setting_get --app=$app --key=language) admin=$(ynh_app_setting_get --app=$app --key=admin) 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) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up Snipe-IT before upgrading (may take a while)..." --weight=4 +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=4 # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# STANDARD UPGRADE STEPS #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) @@ -61,13 +71,6 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi -# 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 #================================================= @@ -76,8 +79,6 @@ 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" -#================================================= -# STANDARD UPGRADE STEPS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -90,14 +91,6 @@ then ynh_setup_source --dest_dir="$final_path" --keep="$final_path/.env" fi -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=3 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # UPGRADE DEPENDENCIES #================================================= @@ -113,6 +106,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=3 + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # SPECIFIC UPGRADE #================================================= @@ -125,18 +126,26 @@ ynh_install_composer ynh_exec_warn_less ynh_composer_exec --commands="dump-autoload" +#================================================= +# BUILDING +#================================================= +ynh_script_progression --message="Building..." + pushd "$final_path" php$phpversion artisan migrate -n --force php$phpversion artisan config:clear -n php$phpversion artisan config:cache -n popd +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." + ynh_backup_if_checksum_is_different --file="$final_path/.env" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$final_path/.env" -#================================================= -# GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -148,6 +157,8 @@ chmod -R o-rwx $final_path chmod -R 755 $final_path/storage chmod -R 755 $final_path/public/uploads +#================================================= +# GENERIC FINALIZATION #================================================= # RELOAD NGINX #================================================= From 89f6e61c9cabfe364e6d5141101c69d3bea7509a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 1 Jul 2022 22:48:10 +0000 Subject: [PATCH 03/10] Auto-update README --- README.md | 21 +++++++++++---------- README_fr.md | 27 ++++++++++++++++----------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 69a80b2..84c33a9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Snipe-IT for YunoHost -[![Integration level](https://dash.yunohost.org/integration/snipeit.svg)](https://dash.yunohost.org/appci/app/snipeit) ![](https://ci-apps.yunohost.org/ci/badges/snipeit.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/snipeit.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/snipeit.svg)](https://dash.yunohost.org/appci/app/snipeit) ![Working status](https://ci-apps.yunohost.org/ci/badges/snipeit.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/snipeit.maintain.svg) [![Install Snipe-IT with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=snipeit) *[Lire ce readme en français.](./README_fr.md)* @@ -17,31 +17,32 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Manage assets for IT operations -**Shipped version:** 5.3.1~ynh2 +**Shipped version:** 5.3.1~ynh3 **Demo:** https://snipeitapp.com/demo/ ## Screenshots -![](./doc/screenshots/screenshot-license-list.png) +![Screenshot of Snipe-IT](./doc/screenshots/screenshot-license-list.png) ## Documentation and resources -* Official app website: https://snipeitapp.com/ -* Official admin documentation: https://snipe-it.readme.io/docs -* Upstream app code repository: https://github.com/snipe/snipe-it -* YunoHost documentation for this app: https://yunohost.org/app_snipeit -* Report a bug: https://github.com/YunoHost-Apps/snipeit_ynh/issues +* Official app website: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/snipeit_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/snipeit_ynh/tree/testing --debug or sudo yunohost app upgrade snipeit -u https://github.com/YunoHost-Apps/snipeit_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 72f482c..ee5e1f9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # Snipe-IT pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/snipeit.svg)](https://dash.yunohost.org/appci/app/snipeit) ![](https://ci-apps.yunohost.org/ci/badges/snipeit.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/snipeit.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/snipeit.svg)](https://dash.yunohost.org/appci/app/snipeit) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/snipeit.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/snipeit.maintain.svg) [![Installer Snipe-IT avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=snipeit) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Snipe-IT 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.* @@ -13,31 +17,32 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Gestionnaire de ressources informatiques -**Version incluse :** 5.3.1~ynh2 +**Version incluse :** 5.3.1~ynh3 **Démo :** https://snipeitapp.com/demo/ ## Captures d'écran -![](./doc/screenshots/screenshot-license-list.png) +![Capture d'écran de Snipe-IT](./doc/screenshots/screenshot-license-list.png) ## Documentations et ressources -* Site officiel de l'app : https://snipeitapp.com/ -* Documentation officielle de l'admin : https://snipe-it.readme.io/docs -* Dépôt de code officiel de l'app : https://github.com/snipe/snipe-it -* Documentation YunoHost pour cette app : https://yunohost.org/app_snipeit -* Signaler un bug : https://github.com/YunoHost-Apps/snipeit_ynh/issues +* Site officiel de l'app : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/snipeit_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/snipeit_ynh/tree/testing --debug ou sudo yunohost app upgrade snipeit -u https://github.com/YunoHost-Apps/snipeit_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** From 271769aca5cc17e748c78e80039d9c9495c18c77 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jul 2022 04:00:28 +0200 Subject: [PATCH 04/10] manage phpversion --- scripts/install | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/install b/scripts/install index bcf8482..cead50b 100755 --- a/scripts/install +++ b/scripts/install @@ -28,12 +28,12 @@ path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE admin=$YNH_APP_ARG_ADMIN -email=$(ynh_user_get_info --username=$admin --key=mail) -key=$(ynh_string_random --length=24) -phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME +email=$(ynh_user_get_info --username=$admin --key=mail) +key=$(ynh_string_random --length=24) + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -54,7 +54,6 @@ 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=language --value=$language ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion #================================================= # STANDARD MODIFICATIONS @@ -99,6 +98,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -145,11 +145,6 @@ pushd "$final_path" php$phpversion artisan config:cache -n popd -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." --weight=1 - # Set permissions to app files chown -R $app:www-data $final_path chmod -R o-rwx $final_path From e7e456fb25f5a6eddc6a5f6a44b45496359a94e0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jul 2022 19:23:33 +0200 Subject: [PATCH 05/10] Manage app_key --- conf/.env | 2 +- scripts/install | 8 +++++--- scripts/upgrade | 7 +++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/conf/.env b/conf/.env index 715541e..7a447f3 100644 --- a/conf/.env +++ b/conf/.env @@ -3,7 +3,7 @@ # -------------------------------------------- APP_ENV=production APP_DEBUG=false -APP_KEY=__KEY__ +APP_KEY=__APP_KEY__ APP_URL=http://__DOMAIN__ APP_TIMEZONE='UTC' APP_LOCALE=__LANGUAGE__ diff --git a/scripts/install b/scripts/install index cead50b..efdaa02 100755 --- a/scripts/install +++ b/scripts/install @@ -31,9 +31,6 @@ admin=$YNH_APP_ARG_ADMIN app=$YNH_APP_INSTANCE_NAME -email=$(ynh_user_get_info --username=$admin --key=mail) -key=$(ynh_string_random --length=24) - #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -127,6 +124,7 @@ ynh_script_progression --message="Adding a configuration file..." redis_db=$(ynh_redis_get_free_db) ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" +app_key="" ynh_add_config --template="../conf/.env" --destination="$final_path/.env" chmod 600 "$final_path/.env" @@ -145,6 +143,10 @@ pushd "$final_path" php$phpversion artisan config:cache -n popd +app_key="$(grep "^APP_KEY=" "$final_path/.env" | cut -d= -f2)" +ynh_app_setting_set --app=$app --key=app_key --value=$app_key +ynh_store_file_checksum --file="$final_path/.env" + # Set permissions to app files chown -R $app:www-data $final_path chmod -R o-rwx $final_path diff --git a/scripts/upgrade b/scripts/upgrade index a62dcea..85bbf72 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,7 @@ admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +app_key=$(ynh_app_setting_get --app=$app --key=app_key) #================================================= # CHECK VERSION @@ -71,6 +72,12 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# If app_key doesn't exist, create it +if [ -z "$app_key" ]; then + app_key="$(grep "^APP_KEY=" "$final_path/.env" | cut -d= -f2)" + ynh_app_setting_set --app=$app --key=app_key --value=$app_key +fi + #================================================= # CREATE DEDICATED USER #================================================= From de3cc858300545d6b77980833c7e7ac7bdd2bd99 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jul 2022 21:46:05 +0200 Subject: [PATCH 06/10] Update manifest.json --- manifest.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manifest.json b/manifest.json index d234579..710ce17 100644 --- a/manifest.json +++ b/manifest.json @@ -35,10 +35,6 @@ "name": "domain", "type": "domain" }, - { - "name": "admin", - "type": "user" - }, { "name": "is_public", "type": "boolean", From 84c395b3c7566dfccf3ad3a5c6622495e204487d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jul 2022 21:46:44 +0200 Subject: [PATCH 07/10] Update check_process --- check_process | 1 - 1 file changed, 1 deletion(-) diff --git a/check_process b/check_process index f4bead2..5c1cc9e 100644 --- a/check_process +++ b/check_process @@ -1,7 +1,6 @@ ;; Test complet ; Manifest domain="domain.tld" - path="/path" is_public=1 language="fr" admin="john" From be1c5cdc739e4f95450d8f16b35bd30c8ced64df Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jul 2022 21:50:43 +0200 Subject: [PATCH 08/10] Update upgrade --- scripts/upgrade | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 85bbf72..829886c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -133,17 +133,6 @@ ynh_install_composer ynh_exec_warn_less ynh_composer_exec --commands="dump-autoload" -#================================================= -# BUILDING -#================================================= -ynh_script_progression --message="Building..." - -pushd "$final_path" - php$phpversion artisan migrate -n --force - php$phpversion artisan config:clear -n - php$phpversion artisan config:cache -n -popd - #================================================= # UPDATE A CONFIG FILE #================================================= @@ -154,9 +143,15 @@ ynh_backup_if_checksum_is_different --file="$final_path/.env" ynh_store_file_checksum --file="$final_path/.env" #================================================= -# SECURE FILES AND DIRECTORIES +# BUILDING #================================================= -ynh_script_progression --message="Securing files and directories..." --weight=1 +ynh_script_progression --message="Building..." + +pushd "$final_path" + php$phpversion artisan migrate -n --force + php$phpversion artisan config:clear -n + php$phpversion artisan config:cache -n +popd # Set permissions on app files chown -R $app:www-data $final_path From 64e1d76ccf964a0b21ffc61d8520353a3506bd07 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Jul 2022 01:01:46 +0200 Subject: [PATCH 09/10] Remove redis_db --- conf/.env | 2 +- scripts/_common.sh | 43 +------------------------------------------ scripts/install | 4 ---- scripts/remove | 8 -------- 4 files changed, 2 insertions(+), 55 deletions(-) diff --git a/conf/.env b/conf/.env index 7a447f3..c495a9f 100644 --- a/conf/.env +++ b/conf/.env @@ -79,7 +79,7 @@ CACHE_PREFIX=snipeit # -------------------------------------------- REDIS_HOST="127.0.0.1" REDIS_PASSWORD=null -REDIS_PORT=__REDIS_DB__ +REDIS_PORT=6379 # -------------------------------------------- # OPTIONAL: MEMCACHED SETTINGS diff --git a/scripts/_common.sh b/scripts/_common.sh index 1f62eec..01e0d3f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,7 +10,7 @@ YNH_PHP_VERSION="7.3" YNH_COMPOSER_VERSION=2.0.14 # dependencies used by the app -pkg_dependencies="openssl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-gd" +pkg_dependencies="openssl redis php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-redis" #================================================= # PERSONAL HELPERS @@ -20,44 +20,3 @@ pkg_dependencies="openssl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-c # EXPERIMENTAL HELPERS #================================================= -#================================================= -# REDIS HELPERS -#================================================= - -# get the first available redis database -# -# usage: ynh_redis_get_free_db -# | returns: the database number to use -ynh_redis_get_free_db() { - local result max db - result="$(redis-cli INFO keyspace)" - - # get the num - max=$(cat /etc/redis/redis.conf | grep ^databases | grep -Eow "[0-9]+") - - db=0 - # default Debian setting is 15 databases - for i in $(seq 0 "$max") - do - if ! echo "$result" | grep -q "db$i" - then - db=$i - break 1 - fi - db=-1 - done - - test "$db" -eq -1 && ynh_die --message="No available Redis databases..." - - echo "$db" -} - -# Create a master password and set up global settings -# Please always call this script in install and restore scripts -# -# usage: ynh_redis_remove_db database -# | arg: database - the database to erase -ynh_redis_remove_db() { - local db=$1 - redis-cli -n "$db" flushall -} diff --git a/scripts/install b/scripts/install index efdaa02..e294c32 100755 --- a/scripts/install +++ b/scripts/install @@ -120,10 +120,6 @@ ynh_install_composer #================================================= ynh_script_progression --message="Adding a configuration file..." -# Configure redis -redis_db=$(ynh_redis_get_free_db) -ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" - app_key="" ynh_add_config --template="../conf/.env" --destination="$final_path/.env" diff --git a/scripts/remove b/scripts/remove index a8d9a5a..6a62cf1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -20,17 +20,9 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) -redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) #================================================= # STANDARD REMOVE -#================================================= -# REMOVE THE REDIS DATABASE -#================================================= -ynh_script_progression --message="Removing the redis database..." - -ynh_redis_remove_db "$redis_db" - #================================================= # REMOVE THE MYSQL DATABASE #================================================= From 93339e6773f1f760eaca154686d6ddb7cf967cd2 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 12 Jul 2022 21:38:25 +0200 Subject: [PATCH 10/10] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 710ce17..bbc0564 100644 --- a/manifest.json +++ b/manifest.json @@ -17,8 +17,8 @@ }, "license": "MIT", "maintainer": { - "name": "Anmol Sharma", - "email": "anmol@datamol.org" + "name": "", + "email": "" }, "requirements": { "yunohost": ">= 4.3.0"