mirror of
https://github.com/YunoHost-Apps/pgadmin_ynh.git
synced 2024-09-03 19:56:38 +02:00
Fix scripts
This commit is contained in:
parent
b43f70d078
commit
9fafb25b23
4 changed files with 14 additions and 13 deletions
|
@ -29,12 +29,12 @@ ynh_script_progression --message="Updating configuration..."
|
|||
if [ "$old_domain" != "$domain" ]
|
||||
then
|
||||
# Delete file checksum for the old conf file location
|
||||
ynh_delete_file_checksum "/etc/nginx/conf.d/$old_domain.d/$app.conf"
|
||||
ynh_delete_file_checksum --file "/etc/nginx/conf.d/$old_domain.d/$app.conf"
|
||||
|
||||
mv "/etc/nginx/conf.d/$old_domain.d/$app.conf" "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
# Store file checksum for the new config file location
|
||||
ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
ynh_store_file_checksum --file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
fi
|
||||
ynh_add_nginx_config
|
||||
|
||||
|
@ -47,4 +47,4 @@ sudo systemctl reload nginx.service
|
|||
ynh_systemd_action --service_name "uwsgi-app@$app.service" --action restart \
|
||||
--line_match "WSGI app 0 (mountpoint='$path_url') ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log"
|
||||
|
||||
ynh_script_progression --message="Change of URL completed for $app" --time --last
|
||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
||||
|
|
|
@ -28,37 +28,37 @@ db_user="$app"
|
|||
ynh_systemd_action --service_name "uwsgi-app@$app.service" --action stop
|
||||
|
||||
# Remove db user
|
||||
ynh_script_progression --message="Cleaning the PostgreSQL database"
|
||||
ynh_script_progression --message="Cleaning the PostgreSQL database..."
|
||||
ynh_psql_drop_user $db_user
|
||||
|
||||
# Remove depandance
|
||||
ynh_script_progression --message="Removing dependencies" --weight=10
|
||||
ynh_script_progression --message="Removing dependencies..." --weight=10
|
||||
ynh_remove_app_dependencies || true
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_script_progression --message="Removing app main directory" --weight=4
|
||||
ynh_script_progression --message="Removing app main directory..." --weight=4
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
||||
# Remove app data
|
||||
ynh_secure_remove --file=/var/lib/$app
|
||||
|
||||
# Remove logrotate
|
||||
ynh_script_progression --message="Removing logrotate configuration"
|
||||
ynh_script_progression --message="Removing logrotate configuration..."
|
||||
ynh_remove_logrotate
|
||||
|
||||
# Remove logs
|
||||
ynh_script_progression --message="Removing logs"
|
||||
ynh_script_progression --message="Removing logs..."
|
||||
ynh_secure_remove --file=/var/log/$app
|
||||
|
||||
# Remove the dedicated nginx config
|
||||
ynh_script_progression --message="Removing configuration"
|
||||
ynh_script_progression --message="Removing configuration..."
|
||||
ynh_remove_nginx_config
|
||||
|
||||
# Remove uwsgi config
|
||||
ynh_remove_uwsgi_service
|
||||
|
||||
# Delete a system user
|
||||
ynh_script_progression --message="Removing the dedicated system user"
|
||||
ynh_script_progression --message="Removing the dedicated system user..."
|
||||
ynh_system_user_delete $app
|
||||
|
||||
ynh_script_progression --message="Removal of $app completed" --last
|
||||
|
|
|
@ -60,11 +60,11 @@ systemctl enable "uwsgi-app@$app.service"
|
|||
#=================================================
|
||||
|
||||
# Set the permission
|
||||
ynh_script_progression --message="Protecting directory"
|
||||
ynh_script_progression --message="Protecting directory..."
|
||||
set_permission
|
||||
|
||||
# Restrict access to admin only
|
||||
ynh_script_progression --message="Configuring permissions"
|
||||
ynh_script_progression --message="Configuring permissions..."
|
||||
yunohost app addaccess --users=$admin $app
|
||||
|
||||
# Configuration de logrotate
|
||||
|
@ -72,6 +72,7 @@ ynh_script_progression --message="Configuring log rotation..."
|
|||
ynh_use_logrotate /var/log/pgadmin
|
||||
|
||||
# reload uwsgi and nginx
|
||||
ynh_script_progression --message="Starting pgadmin services..." --weight=3
|
||||
ynh_systemd_action --service_name "uwsgi-app@$app.service" \
|
||||
--line_match "WSGI app 0 (mountpoint='$path_url') ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log"
|
||||
systemctl reload nginx
|
||||
|
|
|
@ -56,7 +56,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
|
||||
# Set permission after initialisation
|
||||
ynh_script_progression --message="Protecting directory"
|
||||
ynh_script_progression --message="Protecting directory..."
|
||||
set_permission
|
||||
|
||||
# Configuration de logrotate
|
||||
|
|
Loading…
Reference in a new issue