mirror of
https://github.com/YunoHost-Apps/shaarli_ynh.git
synced 2024-09-03 20:26:10 +02:00
Fix
This commit is contained in:
parent
206f5173ac
commit
733cfdc207
4 changed files with 28 additions and 39 deletions
|
@ -133,14 +133,11 @@ ynh_add_config --template="../conf/config.json.php" --destination="$final_path/d
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
# set proper permissions
|
# set proper permissions
|
||||||
ynh_script_progression --message="Set permissions..."
|
ynh_script_progression --message="Securing files and directories..."
|
||||||
|
|
||||||
find $final_path -type f | xargs chmod 644
|
|
||||||
find $final_path -type d | xargs chmod 755
|
|
||||||
|
|
||||||
# Set right permissions for curl install
|
|
||||||
ynh_script_progression --message="Set rights..."
|
|
||||||
chown -R $app: $final_path
|
chown -R $app: $final_path
|
||||||
|
chmod -R g+rX $final_path
|
||||||
|
chmod -R g+rwX $final_path/{cache/,data/,pagecache/,tmp/}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
|
|
|
@ -69,9 +69,11 @@ ynh_system_user_create --username=$app
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE USER RIGHTS
|
# RESTORE USER RIGHTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring user rights..."
|
||||||
|
|
||||||
# Restore permissions on app files
|
|
||||||
chown -R $app: $final_path
|
chown -R $app: $final_path
|
||||||
|
chmod -R g+rX $final_path
|
||||||
|
chmod -R g+rwX $final_path/{cache/,data/,pagecache/,tmp/}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
|
|
|
@ -72,34 +72,27 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..."
|
ynh_script_progression --message="Upgrading source files..."
|
||||||
|
|
||||||
|
# Create a temporary directory
|
||||||
|
tmpdir="$(mktemp -d)"
|
||||||
|
|
||||||
|
# Backup the config file in the temp dir
|
||||||
|
cp -a "$final_path/data" "$tmpdir/data"
|
||||||
|
cp -a "$final_path/tpl" "$tmpdir/tpl"
|
||||||
|
|
||||||
|
# Remove the app directory securely
|
||||||
|
ynh_secure_remove "$final_path"
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --dest_dir="$final_path"
|
||||||
|
|
||||||
|
cp -a "$tmpdir/data" "$final_path/"
|
||||||
|
cp -a "$tmpdir/tpl" "$final_path/"
|
||||||
|
|
||||||
|
# Remove the tmp directory securely
|
||||||
|
ynh_secure_remove --file="$tmpdir"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE APP MAIN DIR
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Create a temporary directory
|
|
||||||
tmpdir="$(ynh_smart_mktemp 600)"
|
|
||||||
# Backup the config file in the temp dir
|
|
||||||
cp -a "$final_path/data" "$tmpdir/"
|
|
||||||
# Backup the theme file in the temp dir
|
|
||||||
cp -a "$final_path/tpl" "$tmpdir/"
|
|
||||||
|
|
||||||
# Remove the app directory securely
|
|
||||||
ynh_secure_remove "$final_path"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info "Upgrading source files..."
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
|
||||||
ynh_setup_source "$final_path"
|
|
||||||
cp -a "$tmpdir/data" "${final_path}/"
|
|
||||||
cp -a "$tmpdir/tpl" "${final_path}/"
|
|
||||||
ynh_secure_remove "$tmpdir"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -143,20 +136,17 @@ then
|
||||||
ynh_secure_remove "$final_path/data/log.txt"
|
ynh_secure_remove "$final_path/data/log.txt"
|
||||||
touch "$final_path/data/log.txt"
|
touch "$final_path/data/log.txt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ynh_use_logrotate --non-append
|
ynh_use_logrotate --non-append
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
# set proper permissions
|
ynh_script_progression --message="Securing files and directories..."
|
||||||
ynh_script_progression --message="Set permissions..."
|
|
||||||
|
|
||||||
find $final_path -type f | xargs chmod 644
|
|
||||||
find $final_path -type d | xargs chmod 755
|
|
||||||
|
|
||||||
# Set right permissions for curl install
|
|
||||||
ynh_script_progression --message="Set rights..."
|
|
||||||
chown -R $app: $final_path
|
chown -R $app: $final_path
|
||||||
|
chmod -R g+rX $final_path
|
||||||
|
chmod -R g+rwX $final_path/{cache/,data/,pagecache/,tmp/}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE FAIL2BAN
|
# UPGRADE FAIL2BAN
|
||||||
|
|
Loading…
Add table
Reference in a new issue