mirror of
https://github.com/YunoHost-Apps/meilisearch_ynh.git
synced 2024-09-03 19:45:59 +02:00
cleaning
This commit is contained in:
parent
2a44eb02e9
commit
db7bd26d45
5 changed files with 4 additions and 55 deletions
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/bash
|
#!/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 ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
@ -18,16 +17,8 @@ ynh_backup "$install_dir"
|
||||||
|
|
||||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP LOGROTATE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_backup "/etc/logrotate.d/$app"
|
ynh_backup "/etc/logrotate.d/$app"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP SYSTEMD
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_backup "/etc/systemd/system/$app.service"
|
ynh_backup "/etc/systemd/system/$app.service"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -8,11 +8,8 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Setting up source files..."
|
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"
|
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"
|
chmod +x "$install_dir/meilisearch"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -20,13 +17,10 @@ chmod +x "$install_dir/meilisearch"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Configuring NGINX web server..."
|
ynh_script_progression "Configuring NGINX web server..."
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
|
||||||
ynh_config_add_nginx
|
ynh_config_add_nginx
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
|
||||||
ynh_config_add_systemd
|
ynh_config_add_systemd
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
|
||||||
ynh_config_add_logrotate
|
ynh_config_add_logrotate
|
||||||
|
|
||||||
yunohost service add $app --description="Opensource next generation search API" --log="/var/log/$app/$app.log"
|
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"
|
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
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -9,20 +9,16 @@ source /usr/share/yunohost/helpers
|
||||||
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
# 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
|
if ynh_hide_warnings yunohost service status $app >/dev/null
|
||||||
then
|
then
|
||||||
ynh_script_progression "Removing Meilisearch service..."
|
ynh_script_progression "Removing Meilisearch service..."
|
||||||
yunohost service remove $app
|
yunohost service remove $app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove the dedicated systemd config
|
|
||||||
ynh_config_remove_systemd
|
ynh_config_remove_systemd
|
||||||
|
|
||||||
# Remove the dedicated NGINX config
|
|
||||||
ynh_config_remove_nginx
|
ynh_config_remove_nginx
|
||||||
|
|
||||||
# Remove the app-specific logrotate config
|
|
||||||
ynh_config_remove_logrotate
|
ynh_config_remove_logrotate
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -1,17 +1,8 @@
|
||||||
#!/bin/bash
|
#!/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 ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
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
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -19,8 +10,6 @@ ynh_script_progression "Restoring Meilisearch main directory..."
|
||||||
|
|
||||||
ynh_restore "$install_dir"
|
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
|
# SPECIFIC RESTORATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -28,6 +17,8 @@ ynh_restore "$install_dir"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Restoring $app's systemd service..."
|
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"
|
ynh_restore "/etc/systemd/system/$app.service"
|
||||||
systemctl enable $app.service --quiet
|
systemctl enable $app.service --quiet
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
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
|
# STOP SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -19,18 +13,10 @@ ynh_systemctl --service=$app --action="stop"
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADING MEILISEARCH
|
# UPGRADING MEILISEARCH
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# 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_script_progression "Upgrading source files..."
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
|
||||||
ynh_setup_source --dest_dir="$install_dir" --keep="$install_dir/config.toml"
|
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"
|
chmod +x "$install_dir/meilisearch"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -38,13 +24,10 @@ chmod +x "$install_dir/meilisearch"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Configuring $app's systemd service..."
|
ynh_script_progression "Configuring $app's systemd service..."
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_config_add_nginx
|
ynh_config_add_nginx
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
|
||||||
ynh_config_add_systemd
|
ynh_config_add_systemd
|
||||||
|
|
||||||
# Use logrotate to manage app-specific logfile(s)
|
|
||||||
ynh_config_add_logrotate
|
ynh_config_add_logrotate
|
||||||
|
|
||||||
yunohost service add $app --description="Opensource next generation search API" --log="/var/log/$app/$app.log"
|
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"
|
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
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue