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

Removes temp dir on install, upgrade and restore operations, let the service create it.

This commit is contained in:
Emmanuel Bouaziz 2023-04-15 19:30:06 +02:00
parent 1bebd75c16
commit 610425de7a
3 changed files with 12 additions and 12 deletions

View file

@ -157,13 +157,10 @@ chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
#=================================================
# CREATE TEMP DIRECTORY
# REMOVE 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"
ynh_script_progression --message="Cleanup temp directory..." --weight=1
ynh_secure_remove --file="/tmp/$app"
#=================================================
# ADD A CONFIGURATION

View file

@ -87,6 +87,12 @@ chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:$app "$datadir"
#=================================================
# REMOVE TEMP DIRECTORY
#=================================================
ynh_script_progression --message="Cleanup temp directory..." --weight=1
ynh_secure_remove --file="/tmp/$app"
#=================================================
# ADD A CONFIGURATION
#=================================================

View file

@ -148,13 +148,10 @@ chmod 400 "$final_path/paperless.conf"
chown $app:$app "$final_path/paperless.conf"
#=================================================
# ENSURE TEMP DIR OWNERSHIP
# REMOVE TEMP DIRECTORY
#=================================================
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"
ynh_script_progression --message="Cleanup temp directory..." --weight=1
ynh_secure_remove --file="/tmp/$app"
#=================================================
# SETUP THE DATABASE