From 3aeae05ae75b5bbdfab32cb6d30a4cc848b2cb5f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 19 Dec 2020 23:34:40 +0100 Subject: [PATCH] Set time --- scripts/change_url | 6 +++--- scripts/install | 12 ++++++------ scripts/remove | 6 +++--- scripts/restore | 4 ++-- scripts/upgrade | 11 +++++------ 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index fb74ad1..e5016e4 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -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 diff --git a/scripts/install b/scripts/install index a593ea4..ca3fb2d 100644 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/remove b/scripts/remove index 5aa7e90..364e882 100644 --- a/scripts/remove +++ b/scripts/remove @@ -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 diff --git a/scripts/restore b/scripts/restore index 7660cd7..f9866b0 100755 --- a/scripts/restore +++ b/scripts/restore @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index a91c7a2..a0b34c2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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