1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/searx_ynh.git synced 2024-09-03 20:16:30 +02:00
This commit is contained in:
ericgaspar 2020-12-19 23:34:40 +01:00
parent 0afc2a9984
commit 3aeae05ae7
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 19 additions and 20 deletions

View file

@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
@ -90,7 +90,7 @@ fi
#=================================================
# RECONFIGURING SEARX
#=================================================
ynh_script_progression --message="Reconfiguring Searx..."
ynh_script_progression --message="Reconfiguring Searx..." --weight=2
ynh_replace_string --match_string="base_url : https://${old_domain}${old_path%/}/" --replace_string="base_url : https://${new_domain}${new_path%/}/" --target_file="$final_path/searx/settings.yml"
@ -106,7 +106,7 @@ ynh_systemd_action --service_name=uwsgi-app@$app.service --action=restart --line
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -32,7 +32,7 @@ app=$YNH_APP_INSTANCE_NAME
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THIS ARGS
#=================================================
ynh_script_progression --message="Validating installation parameters..."
ynh_script_progression --message="Validating installation parameters..." --weight=1
final_path="/opt/yunohost/$app"
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
@ -61,7 +61,7 @@ ynh_install_app_dependencies $pkg_dependencies
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..."
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
path_no_root=${path_url%/}
# Create a dedicated NGINX config
@ -89,7 +89,7 @@ ynh_setup_source --dest_dir="$final_path"
#=================================================
# INSTALL SEARX IN A VIRTUALENV
#=================================================
ynh_script_progression --message="Installing Searx..."
ynh_script_progression --message="Installing Searx..." --weight=2
python3 -m venv --system-site-packages "$final_path"
set +u; source $final_path/bin/activate; set -u
@ -121,7 +121,7 @@ chown -R $app: "$final_path"
#=================================================
# CONFIGURE UWSGI FOR SEARX
#=================================================
ynh_script_progression --message="Configuring uWSGI for Searx..."
ynh_script_progression --message="Configuring uWSGI for Searx..." --weight=2
ynh_add_uwsgi_service
@ -145,7 +145,7 @@ ynh_systemd_action --service_name=uwsgi-app@$app.service --action=start --line_m
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring SSOwat..."
ynh_script_progression --message="Configuring SSOwat..." --weight=2
# Make app public if necessary or protect it
if [ $is_public -eq 1 ]
@ -156,7 +156,7 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -24,7 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..."
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2
# Remove the uwsgi configuration
ynh_systemd_action --service_name "uwsgi-app@$app.service" --action stop
@ -40,7 +40,7 @@ ynh_remove_app_dependencies
#=================================================
# REMOVE THE MAIN DIR OF THE APP
#=================================================
ynh_script_progression --message="Removing app main directory..."
ynh_script_progression --message="Removing app main directory..." --weight=2
ynh_secure_remove --file="$final_path"
@ -73,7 +73,7 @@ fi
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_script_progression --message="Removing the dedicated system user..."
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
# Delete a system user
ynh_system_user_delete --username=$app

View file

@ -50,7 +50,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE OF THE MAIN DIR OF THE APP
#=================================================
ynh_script_progression --message="Restoring the app main directory..."
ynh_script_progression --message="Restoring the app main directory..." --weight=2
mkdir -p "$(dirname "$final_path")"
ynh_restore_file --origin_path="$final_path"
@ -100,7 +100,7 @@ yunohost service add uwsgi --log "/var/log/uwsgi/app/$app.log"
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -88,7 +88,7 @@ fi
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
path_no_root=${path_url%/}
# Create a dedicated NGINX config
@ -97,7 +97,7 @@ ynh_add_nginx_config "path_no_root"
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
@ -123,8 +123,7 @@ python3 -m venv --system-site-packages "$final_path"
set +u; source $final_path/bin/activate; set -u
pip3 install -U setuptools
#pip3 install --requirement $final_path/requirements-ynh.txt --upgrade
pip install --upgrade --force-reinstall -r $final_path/requirements-ynh.txt
pip3 install --requirement $final_path/requirements-ynh.txt --upgrade
#=================================================
# CONFIGURE SEARX
@ -153,7 +152,7 @@ chown -R $app: "$final_path"
#=================================================
# CONFIGURE UWSGI FOR SEARX
#=================================================
ynh_script_progression --message="Reconfiguring uWSGI for Searx..."
ynh_script_progression --message="Reconfiguring uWSGI for Searx..." --weight=2
# Clean old files
ynh_secure_remove --file="/etc/uwsgi/apps-enabled/$app.ini"
@ -178,7 +177,7 @@ ynh_systemd_action --service_name=uwsgi-app@$app.service --action=restart --line
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload