1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bookstack_ynh.git synced 2024-09-03 18:16:02 +02:00
This commit is contained in:
ericgaspar 2021-01-28 23:25:02 +01:00
parent c7707dc1d7
commit b6cc9b5d15
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 59 additions and 29 deletions

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/BookStackApp/BookStack/archive/v0.26.3.tar.gz
SOURCE_SUM=9b577a5d7a2347b2a386bce78ad3ba9e8ee99f61f759cdf91f88a9ba76757c34b09d46ec9e1fb51d62b99aefc153a652d976aa4bcb49c2e38e0c2620ab8dcd9e
SOURCE_SUM_PRG=sha512sum
SOURCE_URL=https://github.com/BookStackApp/BookStack/archive/v0.31.4.tar.gz
SOURCE_SUM=967477375f5ba4661b69eec6d60d49a9b7eddd09d9869e21d4201d329a41f553
SOURCE_SUM_PRG=sha256 checksum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_EXTRACT=true

View file

@ -13,7 +13,6 @@ location __PATH__/ {
index index.php;
try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;

View file

@ -1,33 +1,64 @@
#!/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
app=$YNH_APP_INSTANCE_NAME
# Source YunoHost helpers
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
# Backup sources & data
# Note: the last argument is where to save this path, see the restore script.
ynh_backup "/var/www/${app}" "sources"
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
### MySQL (remove if not used) ###
# 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 ###
ynh_abort_if_errors
# Copy NGINX configuration
domain=$(ynh_app_setting_get "$app" domain)
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."
### PHP (remove if not used) ###
# If a dedicated php-fpm process is used:
# # Copy PHP-FPM pool configuration
# ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf"
### PHP end ###
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
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)."