1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/paperless-ngx_ynh.git synced 2024-09-03 19:56:33 +02:00

Ensures temp dir ownership

This commit is contained in:
Emmanuel Bouaziz 2023-04-15 17:40:41 +02:00
parent 69f0a2c48e
commit 1bebd75c16
3 changed files with 20 additions and 2 deletions

View file

@ -156,6 +156,15 @@ chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
#=================================================
# CREATE TEMP DIRECTORY
#=================================================
ynh_script_progression --message="Creating temp directory..." --weight=1
mkdir -p "/tmp/$app"
chmod 700 "/tmp/$app"
chmod -R go-rwx "/tmp/$app"
chown -R $app:$app "/tmp/$app"
#=================================================
# ADD A CONFIGURATION
#=================================================

View file

@ -119,8 +119,8 @@ ynh_remove_app_dependencies
#=================================================
ynh_script_progression --message="Removing various files..." --weight=1
# Remove a directory securely
#ynh_secure_remove --file="/etc/$app"
# Remove temp directory securely
ynh_secure_remove --file="/tmp/$app"
# Remove the log files
ynh_secure_remove --file="/var/log/$app"

View file

@ -147,6 +147,15 @@ ynh_add_config --template="paperless.conf.example" --destination="$final_path/pa
chmod 400 "$final_path/paperless.conf"
chown $app:$app "$final_path/paperless.conf"
#=================================================
# ENSURE TEMP DIR OWNERSHIP
#=================================================
ynh_script_progression --message="Updating temp directory ownership..." --weight=1
mkdir -p "/tmp/$app"
chmod 700 "/tmp/$app"
chmod -R go-rwx "/tmp/$app"
chown -R $app:$app "/tmp/$app"
#=================================================
# SETUP THE DATABASE
#=================================================