1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mygpo_ynh.git synced 2024-09-03 19:55:52 +02:00

Apply last example_ynh

This commit is contained in:
yalh76 2022-06-20 23:52:21 +02:00
parent a6ff126673
commit e6f4e812a8
9 changed files with 27 additions and 27 deletions

View file

@ -1,8 +1,8 @@
;; Test complet
; Manifest
domain="domain.tld"
admin="john"
is_public=1
admin="john"
; Checks
pkg_linter=1
setup_sub_dir=0

View file

@ -2,7 +2,6 @@
Description=GPodder-beat
After=network.target postgresql.service redis.service __APP__.scoket
[Service]
User=__APP__
Group=__APP__

View file

@ -2,7 +2,6 @@
Description=GPodder-celery
After=network.target postgresql.service redis.service __APP__.socket
[Service]
User=__APP__
Group=__APP__

View file

@ -3,7 +3,6 @@ Description=GPodder
After=network.target postgresql.service nginx.service redis.service __APP__-celery.service __APP__-beat.service
Requires=__APP__.socket
[Service]
Type=notify
User=__APP__

View file

@ -35,10 +35,6 @@
"name": "domain",
"type": "domain"
},
{
"name": "admin",
"type": "user"
},
{
"name": "is_public",
"type": "boolean",
@ -47,6 +43,10 @@
"fr": "Si public, n'importe-qui pourra créer un compte et accéder a certaines statistiques d'utilization. Si privé, certaines parties de l'API seront inaccessibles"
},
"default": true
},
{
"name": "admin",
"type": "user"
}
]
}

View file

@ -36,6 +36,7 @@ ynh_script_progression --message="Backing up the app before changing its URL (ma
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"

View file

@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_clean_setup () {
true
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
@ -25,14 +25,15 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url="/"
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
admin=$YNH_APP_ARG_ADMIN
app=$YNH_APP_INSTANCE_NAME
admin_email=$(ynh_user_get_info --username=$admin --key="mail")
secret_key=$(ynh_string_random --length=64)
staff_token=$(ynh_string_random --length=64)
app=$YNH_APP_INSTANCE_NAME
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_clean_setup () {
true
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
@ -39,13 +39,6 @@ test ! -d $final_path \
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
@ -84,6 +77,13 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE POSTGRESQL DATABASE
#=================================================

View file

@ -33,6 +33,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
@ -91,6 +92,13 @@ fi
set_permissions
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -99,13 +107,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# SPECIFIC UPGRADE
#=================================================