diff --git a/scripts/backup b/scripts/backup index a868200..a7c8e56 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,6 +1,5 @@ #!/bin/bash -#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 @@ -18,16 +17,8 @@ ynh_backup "$install_dir" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP LOGROTATE -#================================================= - ynh_backup "/etc/logrotate.d/$app" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup "/etc/systemd/system/$app.service" #================================================= diff --git a/scripts/install b/scripts/install index dbd7cfb..36a4478 100644 --- a/scripts/install +++ b/scripts/install @@ -8,11 +8,8 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" chmod +x "$install_dir/meilisearch" #================================================= @@ -20,13 +17,10 @@ chmod +x "$install_dir/meilisearch" #================================================= ynh_script_progression "Configuring NGINX web server..." -# Create a dedicated nginx config ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd -# Use logrotate to manage application logfile(s) ynh_config_add_logrotate yunohost service add $app --description="Opensource next generation search API" --log="/var/log/$app/$app.log" @@ -42,9 +36,6 @@ key=$(ynh_string_random --length=16) ynh_config_add --template="config.toml" --destination="$install_dir/config.toml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.toml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config.toml" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index fe9e485..96e280a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,20 +9,16 @@ source /usr/share/yunohost/helpers # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) if ynh_hide_warnings yunohost service status $app >/dev/null then ynh_script_progression "Removing Meilisearch service..." yunohost service remove $app fi -# Remove the dedicated systemd config ynh_config_remove_systemd -# Remove the dedicated NGINX config ynh_config_remove_nginx -# Remove the app-specific logrotate config ynh_config_remove_logrotate #================================================= diff --git a/scripts/restore b/scripts/restore index 3f8e40a..804df72 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,17 +1,8 @@ #!/bin/bash -#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 -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -19,8 +10,6 @@ ynh_script_progression "Restoring Meilisearch main directory..." ynh_restore "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # SPECIFIC RESTORATION #================================================= @@ -28,6 +17,8 @@ ynh_restore "$install_dir" #================================================= ynh_script_progression "Restoring $app's systemd service..." +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" + ynh_restore "/etc/systemd/system/$app.service" systemctl enable $app.service --quiet diff --git a/scripts/upgrade b/scripts/upgrade index 721b617..e2a0a9b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -3,12 +3,6 @@ source _common.sh source /usr/share/yunohost/helpers -if ynh_app_upgrading_from_version_before 1.1.0~ynh1; then - ynh_die "Please remove and reinstall Meilisearch" -else - -fi - #================================================= # STOP SYSTEMD SERVICE #================================================= @@ -19,18 +13,10 @@ ynh_systemctl --service=$app --action="stop" #================================================= # UPGRADING MEILISEARCH #================================================= +ynh_script_progression "Upgrading source files..." -# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed -if ynh_app_upstream_version_changed -then - ynh_script_progression "Upgrading source files..." +ynh_setup_source --dest_dir="$install_dir" --keep="$install_dir/config.toml" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="$install_dir/config.toml" -fi - -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" chmod +x "$install_dir/meilisearch" #================================================= @@ -38,13 +24,10 @@ chmod +x "$install_dir/meilisearch" #================================================= ynh_script_progression "Configuring $app's systemd service..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd -# Use logrotate to manage app-specific logfile(s) ynh_config_add_logrotate yunohost service add $app --description="Opensource next generation search API" --log="/var/log/$app/$app.log" @@ -58,9 +41,6 @@ key=$(ynh_string_random --length=16) ynh_config_add --template="config.toml" --destination="$install_dir/config.toml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.toml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config.toml" - #================================================= # START SYSTEMD SERVICE #=================================================