From d78c23959171f64d7cca2aa40f65b9b2aa1747aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:04:58 +0200 Subject: [PATCH] cleaning --- manifest.toml | 14 +++++++------- scripts/_common.sh | 2 +- scripts/backup | 6 ------ scripts/change_url | 8 ++++---- scripts/install | 9 +-------- scripts/restore | 10 ---------- scripts/upgrade | 5 +++-- 7 files changed, 16 insertions(+), 38 deletions(-) diff --git a/manifest.toml b/manifest.toml index c65240a..b708da6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -4,10 +4,10 @@ packaging_format = 2 id = "tandoor" name = "Tandoor" -description.en = "Application for managing and sharing recipes, planning meals, building shopping lists and much much more!" -description.fr = "Gérez et partagez vos recettes, planifiez vos repas, créez vos listes de courses et beaucoup plus encore !" +description.en = "Manage and share recipes, plan meals, build shopping lists" +description.fr = "Gérez et partagez des recettes, planifiez des repas, créez des listes de courses" -version = "1.5.18~ynh1" +version = "1.5.18~ynh2" maintainers = ["Navan Chauhan"] @@ -21,14 +21,14 @@ code = "https://github.com/TandoorRecipes/recipes" cpe = "cpe:2.3:a:tandoor:recipes" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.20" architectures = "all" multi_instance = true ldap = false sso = false -disk = "50M" -ram.build = "50M" -ram.runtime = "50M" +disk = "1000M" +ram.build = "2000M" +ram.runtime = "1500M" [install] [install.domain] diff --git a/scripts/_common.sh b/scripts/_common.sh index 02ac495..57695b7 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,8 +6,8 @@ nodejs_version=16 -# Used in .env timezone="$(cat /etc/timezone)" +version=$(ynh_app_upstream_version) #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 866f7ac..34ea8d1 100755 --- a/scripts/backup +++ b/scripts/backup @@ -44,12 +44,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - -ynh_backup --src_path="/var/log/$app/" - #================================================= # BACKUP THE PostgreSQL DATABASE #================================================= diff --git a/scripts/change_url b/scripts/change_url index 4988f8a..80493ed 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -14,14 +14,14 @@ source /usr/share/yunohost/helpers #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 ynh_change_url_nginx_config @@ -40,7 +40,7 @@ chown "$app:$app" "$install_dir/.env" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" @@ -48,4 +48,4 @@ ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$ # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 8453120..4492aa7 100755 --- a/scripts/install +++ b/scripts/install @@ -40,14 +40,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir/source" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R "$app:www-data" "$data_dir" - #================================================= # ADD A CONFIGURATION #================================================= @@ -58,9 +52,8 @@ ynh_add_config --template="dot_env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown "$app:$app" "$install_dir/.env" -version=$(ynh_app_upstream_version) - ynh_add_config --template="version.py" --destination="$install_dir/source/recipes/version.py" + chmod 400 "$install_dir/source/recipes/version.py" chown "$app:$app" "$install_dir/source/recipes/version.py" diff --git a/scripts/restore b/scripts/restore index 1ed1148..fdfe5bd 100755 --- a/scripts/restore +++ b/scripts/restore @@ -17,8 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" #================================================= @@ -28,8 +26,6 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$data_dir" --not_mandatory -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" chown -R "$app:www-data" "$data_dir" #================================================= @@ -52,12 +48,6 @@ yunohost service add "$app" --description="Smart recipe management" --log="/var/ ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# RESTORE VARIOUS FILES -#================================================= - -ynh_restore_file --origin_path="/var/log/$app/" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 597450e..cf82f9d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -47,9 +47,8 @@ ynh_add_config --template="dot_env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown "$app:$app" "$install_dir/.env" -version=$(ynh_app_upstream_version) - ynh_add_config --template="version.py" --destination="$install_dir/source/recipes/version.py" + chmod 400 "$install_dir/source/recipes/version.py" chown "$app:$app" "$install_dir/source/recipes/version.py" @@ -57,9 +56,11 @@ chown "$app:$app" "$install_dir/source/recipes/version.py" # SPECIFIC SETUP #================================================= ynh_script_progression --message="Building frontend..." --weight=5 + _tandoor_build_frontend ynh_script_progression --message="Installing Tandoor and its python dependencies..." --weight=1 + _tandoor_venv_install ynh_script_progression --message="Running migrations and generating static files..." --weight=2