mirror of
https://github.com/YunoHost-Apps/writefreely_ynh.git
synced 2024-09-03 20:36:02 +02:00
Update of backup, restore and upgrade steps
This commit is contained in:
parent
30c31877a2
commit
32b35c026c
7 changed files with 63 additions and 27 deletions
|
@ -15,9 +15,9 @@ Each User can be limited from 1 to unlimited blogs.
|
|||
|
||||
**Shipped version:** 0.70
|
||||
|
||||
## Screenshots
|
||||
## Licence
|
||||
|
||||

|
||||
LICENSE GPL-3.0
|
||||
|
||||
## Demo
|
||||
|
||||
|
|
|
@ -6,21 +6,28 @@
|
|||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
admin="john" (USER)
|
||||
language="fr"
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
password="pass"
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
single_user="true"
|
||||
site_name="WriteFreely"
|
||||
site_description="WriteFreely Blogs"
|
||||
open_registration="true"
|
||||
max_blogs="1"
|
||||
federation="true"
|
||||
public_stats="true"
|
||||
private="false"
|
||||
local_timeline="true"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
setup_sub_dir=0
|
||||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
multi_instance=0
|
||||
incorrect_path=1
|
||||
port_already_use=0
|
||||
change_url=0
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"requirements": {
|
||||
"yunohost": ">= 2.7.14"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
"nginx",
|
||||
"mysql"
|
||||
|
@ -85,7 +85,7 @@
|
|||
"en": "Choose a description for your WriteFreely instance",
|
||||
"fr": "Choisissez une description pour votre instance WriteFreely"
|
||||
},
|
||||
"default": "WriteFreely Blogs"
|
||||
"default": "WriteFreely_Blogs"
|
||||
},
|
||||
{
|
||||
"name": "open_registration",
|
||||
|
@ -102,7 +102,7 @@
|
|||
"en": "How many blogs each user can create ?",
|
||||
"fr": "Combien de blogs chaque utilisateur peut créer ?"
|
||||
},
|
||||
"default": "1"
|
||||
"default": "3"
|
||||
},
|
||||
{
|
||||
"name": "federation",
|
||||
|
|
|
@ -48,8 +48,8 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
# BACKUP THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
|
||||
ynh_backup "/etc/php5/fpm/conf.d/20-$app.ini"
|
||||
#ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
|
||||
#ynh_backup "/etc/php5/fpm/conf.d/20-$app.ini"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE MYSQL DATABASE
|
||||
|
@ -75,4 +75,4 @@ ynh_backup "/etc/systemd/system/$app.service"
|
|||
# BACKUP A CRON FILE
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/cron.d/$app"
|
||||
#ynh_backup "/etc/cron.d/$app"
|
||||
|
|
|
@ -68,6 +68,7 @@ ynh_secure_remove "$final_path"
|
|||
|
||||
# Remove the dedicated nginx config
|
||||
ynh_remove_nginx_config
|
||||
systemctl restart nginx
|
||||
|
||||
#=================================================
|
||||
# REMOVE PHP-FPM CONFIGURATION
|
||||
|
|
|
@ -27,10 +27,24 @@ ynh_abort_if_errors
|
|||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get $app domain)
|
||||
port=$(ynh_app_setting_get $app port)
|
||||
path_url=$(ynh_app_setting_get $app path)
|
||||
admin=$(ynh_app_setting_get $app admin)
|
||||
is_public=$(ynh_app_setting_get $app is_public)
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
|
||||
db_name=$(ynh_app_setting_get $app db_name)
|
||||
|
||||
single_user=$(ynh_app_setting_get $app single_user)
|
||||
site_name=$(ynh_app_setting_get $app site_name)
|
||||
site_description=$(ynh_app_setting_get $app site_description)
|
||||
open_registration=$(ynh_app_setting_get $app open_registration)
|
||||
max_blogs=$(ynh_app_setting_get $app max_blogs)
|
||||
federation=$(ynh_app_setting_get $app federation)
|
||||
public_stats=$(ynh_app_setting_get $app public_stats)
|
||||
private=$(ynh_app_setting_get $app private)
|
||||
local_timeline=$(ynh_app_setting_get $app local_timeline)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
|
@ -80,8 +94,8 @@ chown -R root: $final_path
|
|||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf"
|
||||
ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini"
|
||||
#ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf"
|
||||
#ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
|
@ -109,7 +123,7 @@ systemctl enable $app.service
|
|||
# RESTORE THE CRON FILE
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file "/etc/cron.d/$app"
|
||||
#ynh_restore_file "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
|
@ -123,5 +137,7 @@ ynh_restore_file "/etc/logrotate.d/$app"
|
|||
# RELOAD NGINX AND PHP-FPM
|
||||
#=================================================
|
||||
|
||||
systemctl reload php5-fpm
|
||||
#systemctl reload php5-fpm
|
||||
systemctl reload nginx
|
||||
systemctl start "$app"
|
||||
|
||||
|
|
|
@ -16,12 +16,23 @@ source /usr/share/yunohost/helpers
|
|||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get $app domain)
|
||||
port=$(ynh_app_setting_get $app port)
|
||||
path_url=$(ynh_app_setting_get $app path)
|
||||
admin=$(ynh_app_setting_get $app admin)
|
||||
is_public=$(ynh_app_setting_get $app is_public)
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
language=$(ynh_app_setting_get $app language)
|
||||
#language=$(ynh_app_setting_get $app language)
|
||||
|
||||
db_name=$(ynh_app_setting_get $app db_name)
|
||||
single_user=$(ynh_app_setting_get $app single_user)
|
||||
site_name=$(ynh_app_setting_get $app site_name)
|
||||
site_description=$(ynh_app_setting_get $app site_description)
|
||||
open_registration=$(ynh_app_setting_get $app open_registration)
|
||||
max_blogs=$(ynh_app_setting_get $app max_blogs)
|
||||
federation=$(ynh_app_setting_get $app federation)
|
||||
public_stats=$(ynh_app_setting_get $app public_stats)
|
||||
private=$(ynh_app_setting_get $app private)
|
||||
local_timeline=$(ynh_app_setting_get $app local_timeline)
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
|
@ -70,13 +81,6 @@ path_url=$(ynh_normalize_url_path $path_url)
|
|||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -84,6 +88,13 @@ ynh_setup_source "$final_path"
|
|||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source "$final_path"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
|
@ -102,7 +113,7 @@ ynh_system_user_create $app
|
|||
#=================================================
|
||||
|
||||
# Create a dedicated php-fpm config
|
||||
ynh_add_fpm_config
|
||||
#ynh_add_fpm_config
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
|
@ -137,7 +148,7 @@ ynh_add_systemd_config
|
|||
#=================================================
|
||||
|
||||
# Set permissions on app files
|
||||
chown -R root: $final_path
|
||||
chown -R $app: $final_path
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
@ -155,3 +166,4 @@ fi
|
|||
#=================================================
|
||||
|
||||
systemctl reload nginx
|
||||
systemctl start "$app"
|
||||
|
|
Loading…
Add table
Reference in a new issue