mirror of
https://github.com/YunoHost-Apps/petrolette_ynh.git
synced 2024-09-03 19:56:26 +02:00
change backup script
This commit is contained in:
parent
c5691b7bab
commit
f4e49412fc
4 changed files with 25 additions and 39 deletions
|
@ -8,7 +8,7 @@
|
|||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
setup_sub_dir=0
|
||||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=1
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"email": "tobias.ollive@oiseauroch.fr"
|
||||
}],
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.0.0"
|
||||
"yunohost": ">= 4.1.0"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
@ -25,30 +25,16 @@
|
|||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain for Petrolette",
|
||||
"fr": "Choisissez un domaine pour Petrolette"
|
||||
},
|
||||
"example": "domain.org"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"ask": {
|
||||
"en": "choose a path",
|
||||
"fr": "Choisissez un chemin"
|
||||
},
|
||||
"example": "petrolette",
|
||||
"default": "/"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Is it a public application?",
|
||||
"fr": "Cette application doit-elle être publique ?"
|
||||
},
|
||||
"default": true
|
||||
"default": true,
|
||||
"help" : {
|
||||
"fr" : "Cette page sera accessible par n'importe qui. En revanche, la configuration reste personnelle"
|
||||
"en" : "The page will be accessible by anyone."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -37,12 +37,6 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
|||
#=================================================
|
||||
ynh_print_info --message="Declaring files to be backed up..."
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -52,12 +52,27 @@ test ! -d $final_path \
|
|||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RESTORE MAINDIR
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app main directory..." --weight=5
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
|
||||
|
||||
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
||||
|
||||
#=================================================
|
||||
# REINSTALL PETROLLETTE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling the app ..." --weight=5
|
||||
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
|
||||
pushd $final_path
|
||||
ynh_use_nodejs
|
||||
ynh_npm install
|
||||
popd
|
||||
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
|
@ -74,15 +89,6 @@ ynh_system_user_create --username=$app
|
|||
chown -R $app:$app $final_path
|
||||
chmod -R o-rwx $final_path
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
|
||||
|
||||
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
#=================================================
|
||||
|
@ -96,7 +102,7 @@ systemctl enable $app.service --quiet
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add $app --description="The news reader that doesn't know you " --log="/home/yunohost.app/${app}/storage/logs/petrollette.log"
|
||||
yunohost service add $app --description="The news reader that doesn't know you" --log="/home/yunohost.app/${app}/storage/logs/petrollette.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
Loading…
Add table
Reference in a new issue