diff --git a/scripts/install b/scripts/install index 604d0b8..2fd47aa 100755 --- a/scripts/install +++ b/scripts/install @@ -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 #================================================= diff --git a/scripts/remove b/scripts/remove index 0730658..3931665 100755 --- a/scripts/remove +++ b/scripts/remove @@ -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" diff --git a/scripts/upgrade b/scripts/upgrade index 7db5401..c234e8e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 #=================================================