mirror of
https://github.com/YunoHost-Apps/meilisearch_ynh.git
synced 2024-09-03 19:45:59 +02:00
commit
3a46f1ba3b
3 changed files with 19 additions and 19 deletions
|
@ -74,7 +74,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD AND INSTALL MEILISEARCH
|
# DOWNLOAD AND INSTALL MEILISEARCH
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing meilisearch..." --weight=5
|
ynh_script_progression --message="Installing Meilisearch..." --weight=5
|
||||||
|
|
||||||
arch=$(ynh_detect_arch)
|
arch=$(ynh_detect_arch)
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ yunohost service add $app --description "Opensource next generation search API"
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --time --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
@ -163,7 +163,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring SSOwat..." --time --weight=1
|
ynh_script_progression --message="Configuring SSOwat..." --weight=1
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
|
|
|
@ -62,7 +62,7 @@ ynh_restore_file --origin_path="$final_path"
|
||||||
# RESTORE Meilisearch
|
# RESTORE Meilisearch
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Download again binary for the API." --time --weight=5
|
ynh_script_progression --message="Download again binary for the API." --weight=5
|
||||||
|
|
||||||
arch=$(ynh_detect_arch)
|
arch=$(ynh_detect_arch)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
# Fix is_public as a boolean value
|
# Fix is_public as a boolean value
|
||||||
if [ "$is_public" = "Yes" ]; then
|
if [ "$is_public" = "Yes" ]; then
|
||||||
|
@ -55,7 +55,7 @@ fi
|
||||||
# FIND AND OPEN A PORT
|
# FIND AND OPEN A PORT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Configuring firewall..." --time --weight=1
|
ynh_script_progression --message="Configuring firewall..." --weight=2
|
||||||
|
|
||||||
# Find an available port
|
# Find an available port
|
||||||
port=$(ynh_find_port --port=8095)
|
port=$(ynh_find_port --port=8095)
|
||||||
|
@ -64,7 +64,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up Meilisearch before upgrading (may take a while)..." --time --weight=1
|
ynh_script_progression --message="Backing up Meilisearch before upgrading (may take a while)..." --weight=5
|
||||||
|
|
||||||
# Backup the current version of the app
|
# Backup the current version of the app
|
||||||
ynh_backup_before_upgrade
|
ynh_backup_before_upgrade
|
||||||
|
@ -87,13 +87,13 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url)
|
||||||
# STOP SYSTEMD SERVICE
|
# 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"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1
|
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
@ -101,7 +101,7 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADING MEILISEARCH
|
# UPGRADING MEILISEARCH
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="upgrading Meilisearch..." --time --weight=1
|
ynh_script_progression --message="upgrading Meilisearch..." --weight=5
|
||||||
|
|
||||||
arch=$(ynh_detect_arch)
|
arch=$(ynh_detect_arch)
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ mv "$release_file" /usr/bin/meilisearch
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1
|
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
# Create a dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app
|
ynh_system_user_create --username=$app
|
||||||
|
@ -133,7 +133,7 @@ ynh_store_file_checksum --file="$final_path/CONFIG_FILE"
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP LOGROTATE
|
# SETUP LOGROTATE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1
|
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=2
|
||||||
|
|
||||||
# Use logrotate to manage app-specific logfile(s)
|
# Use logrotate to manage app-specific logfile(s)
|
||||||
ynh_use_logrotate --non-append
|
ynh_use_logrotate --non-append
|
||||||
|
@ -141,7 +141,7 @@ ynh_use_logrotate --non-append
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring a systemd service..." --time --weight=1
|
ynh_script_progression --message="Configuring a systemd service..." --weight=2
|
||||||
|
|
||||||
if [ $allow_analyse ]; then
|
if [ $allow_analyse ]; then
|
||||||
ynh_replace_string "__ANALYTICS__" "false" "../conf/systemd.service"
|
ynh_replace_string "__ANALYTICS__" "false" "../conf/systemd.service"
|
||||||
|
@ -159,7 +159,7 @@ ynh_add_systemd_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE FAIL2BAN
|
# UPGRADE FAIL2BAN
|
||||||
#=================================================
|
#=================================================
|
||||||
#ynh_script_progression --message="Reconfiguring fail2ban..." --time --weight=1
|
#ynh_script_progression --message="Reconfiguring fail2ban..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated fail2ban config
|
# Create a dedicated fail2ban config
|
||||||
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
|
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
|
||||||
|
@ -174,7 +174,7 @@ chown -R $app:$app $final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1
|
ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
|
@ -186,14 +186,14 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --time --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
@ -201,4 +201,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrade of Meilisearch completed" --time --last
|
ynh_script_progression --message="Upgrade of Meilisearch completed" --last
|
||||||
|
|
Loading…
Reference in a new issue