1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/BicBucStriim_ynh.git synced 2024-09-03 18:15:53 +02:00
This commit is contained in:
ericgaspar 2021-07-07 10:47:34 +02:00
parent 4aac3bbb82
commit a29b308ba4
5 changed files with 3 additions and 59 deletions

View file

@ -25,7 +25,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
admin=$(ynh_app_setting_get --app=$app --key=admin)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
@ -38,19 +37,12 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$datadir" --is_big
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================

View file

@ -70,6 +70,7 @@ ynh_setup_source --dest_dir="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod -R ga+w "$final_path/data"
#=================================================
# NGINX CONFIGURATION
@ -88,21 +89,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# CREATE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Creating a data directory..." --weight=1
datadir=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
mkdir -p $datadir
cp -r ../empty_library $datadir
chmod 750 "$datadir"
#chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
chmod -R ga+w "$datadir"
# Disable BicBucStriim login if checked
if [[ $login -eq 1 ]]; then

View file

@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
admin=$(ynh_app_setting_get --app=$app --key=admin)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
@ -29,14 +28,6 @@ ynh_script_progression --message="Removing app main directory..." --weight=4
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE CALIBRE LIBRARY
#=================================================
ynh_script_progression --message="Removing app main directory..." --weight=4
# Remove the app directory securely
ynh_secure_remove --file="$datadir"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================

View file

@ -27,7 +27,6 @@ domain=$(ynh_app_setting_get "$app" domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get "$app" admin)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
@ -66,14 +65,7 @@ ynh_restore_file --origin_path="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# RESTORE USER RIGHTS
#=================================================
# you may need to make some file and/or directory writeable by www-data (nginx user)
chown -R root: "$final_path"
chown -R $admin "$datadir"
chmod -R ga+w "$final_path/data"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
@ -84,23 +76,6 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_add_fpm_config --package="$extra_php_dependencies"
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Restoring the data directory..." --time --weight=1
ynh_restore_file --origin_path="$datadir" --not_mandatory
mkdir -p $datadir
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
books_path=/home/$admin/calibre_library
cp -a ./data "$books_path"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -21,7 +21,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get "$app" admin)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# CHECK VERSION
@ -86,6 +85,7 @@ fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod -R ga+w "$final_path/data"
#=================================================
# NGINX CONFIGURATION