mirror of
https://github.com/YunoHost-Apps/bookstack_ynh.git
synced 2024-09-03 18:16:02 +02:00
Fix
This commit is contained in:
parent
c7707dc1d7
commit
b6cc9b5d15
3 changed files with 59 additions and 29 deletions
|
@ -1,6 +1,6 @@
|
||||||
SOURCE_URL=https://github.com/BookStackApp/BookStack/archive/v0.26.3.tar.gz
|
SOURCE_URL=https://github.com/BookStackApp/BookStack/archive/v0.31.4.tar.gz
|
||||||
SOURCE_SUM=9b577a5d7a2347b2a386bce78ad3ba9e8ee99f61f759cdf91f88a9ba76757c34b09d46ec9e1fb51d62b99aefc153a652d976aa4bcb49c2e38e0c2620ab8dcd9e
|
SOURCE_SUM=967477375f5ba4661b69eec6d60d49a9b7eddd09d9869e21d4201d329a41f553
|
||||||
SOURCE_SUM_PRG=sha512sum
|
SOURCE_SUM_PRG=sha256 checksum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
SOURCE_EXTRACT=true
|
SOURCE_EXTRACT=true
|
||||||
|
|
|
@ -13,7 +13,6 @@ location __PATH__/ {
|
||||||
|
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
try_files $uri $uri/ index.php;
|
|
||||||
location ~ [^/]\.php(/|$) {
|
location ~ [^/]\.php(/|$) {
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||||
|
|
|
@ -1,33 +1,64 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Exit on command errors and treat unset variables as an error
|
#=================================================
|
||||||
set -eu
|
# GENERIC START
|
||||||
|
#=================================================
|
||||||
|
# IMPORT GENERIC HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# See comments in install script
|
source ../settings/scripts/_common.sh
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
# Source YunoHost helpers
|
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup sources & data
|
#=================================================
|
||||||
# Note: the last argument is where to save this path, see the restore script.
|
# MANAGE SCRIPT FAILURE
|
||||||
ynh_backup "/var/www/${app}" "sources"
|
#=================================================
|
||||||
|
|
||||||
### MySQL (remove if not used) ###
|
ynh_abort_if_errors
|
||||||
# If a MySQL database is used:
|
|
||||||
# # Dump the database
|
|
||||||
# dbname=$app
|
|
||||||
# dbuser=$app
|
|
||||||
# dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
|
|
||||||
# mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./dump.sql
|
|
||||||
### MySQL end ###
|
|
||||||
|
|
||||||
# Copy NGINX configuration
|
#=================================================
|
||||||
domain=$(ynh_app_setting_get "$app" domain)
|
# LOAD SETTINGS
|
||||||
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
|
#=================================================
|
||||||
|
ynh_print_info --message="Loading installation settings..."
|
||||||
|
|
||||||
### PHP (remove if not used) ###
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
# If a dedicated php-fpm process is used:
|
|
||||||
# # Copy PHP-FPM pool configuration
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
# ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf"
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
### PHP end ###
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
#=================================================
|
||||||
|
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
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP THE PHP-FPM CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP THE MYSQL DATABASE
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info --message="Backing up the MySQL database..."
|
||||||
|
|
||||||
|
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||||
|
|
Loading…
Reference in a new issue