1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dont-code_ynh.git synced 2024-09-03 18:26:34 +02:00

Merge pull request #37 from YunoHost-Apps/dev

Ensure only needed files are left after upgrade
This commit is contained in:
Gérard Collin 2024-03-13 17:04:49 +01:00 committed by GitHub
commit 59cedbb35c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 4 deletions

View file

@ -32,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to
- As well any documents or images uploaded by users will be backed up
**Shipped version:** 0.2.10~ynh5
**Shipped version:** 0.2.10~ynh6
**Demo:** https://dont-code.net/apps.html

View file

@ -32,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to
- As well any documents or images uploaded by users will be backed up
**Version incluse :** 0.2.10~ynh5
**Version incluse :** 0.2.10~ynh6
**Démo :** https://dont-code.net/apps.html

View file

@ -7,7 +7,7 @@ name = "Dont-code Services"
description.en = "Install services and databases needed to support Dont-code platform"
description.fr = "Installe les services et base de données nécessaires pour utiliser la plateforme Dont-code"
version = "0.2.10~ynh5"
version = "0.2.10~ynh6"
maintainers = ["Dont-code Team"]

View file

@ -42,6 +42,13 @@ if [[ -n "${document_path:-}" ]]; then
fi
if [[ -n "${html_path:-}" ]]; then
# document dir has moved from html_path to data_dir, so set the variable accordingly
if [[ ${document_dir} == ${html_path}* ]]; then
document_dir=$data_dir/docs
ynh_app_setting_set --app="$app" --key=document_dir --value="$document_dir"
fi
# Migrate html_path to data_dir
mv "$html_path/index.html" "$html_path/docs" "$data_dir"
old_doc_dir="$html_path/docs"
@ -56,6 +63,7 @@ if [[ -n "${html_path:-}" ]]; then
ynh_backup_if_checksum_is_different --file="$install_dir/.env"
ynh_replace_string --match_string="$old_doc_dir" --replace_string="$document_dir" --target_file="$install_dir/.env"
ynh_store_file_checksum --file="$install_dir/.env"
fi
# Regenerate the .env file if the document_url was incorrectly set before
@ -83,7 +91,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]; then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep ".env .ssh/authorized_keys"
fi
chmod -R o-rwx "$install_dir"

View file

@ -10,3 +10,5 @@ test_format = 1.0
# -------------------------------
test_upgrade_from.7852cc4bf44ff20ee51fe35f3f53dc105e0f6d79.name= "2023-01-07 - Added Ssh support for dev."
test_upgrade_from.e89eebdac9f59202202d07972e274ebe6fc7c51c.name= "Before Manifest v2."