FreedomBox/data/usr/lib/systemd/system/plinth.service
Joseph Nuthalapati 21f6c9128f
django: Improve handling of file uploads
1. Set temporary directory to /var/tmp
2. Drop MemoryFileUploadHandler

Tests:

- During upload notice that file are in /var/tmp/system-private... folder
instead of /var/tmp.

- Upload a file but rename with another extension instead of moving to
destination through changes in code. Notice that the file is available in
/var/tmp/systemd-private... directory after the upload operation is completed.
Stop the service and notice that the file has been deleted. Folder is empty
after the service starts again.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Add PrivateTmp=yes in plinth.service file]
[sunil: Update comments]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-10-03 11:44:51 +03:00

22 lines
387 B
Desktop File

# SPDX-License-Identifier: AGPL-3.0-or-later
[Unit]
Description=FreedomBox Service (Plinth)
Documentation=man:plinth(1)
After=network.target
StartLimitIntervalSec=0
[Service]
ExecStart=/usr/bin/plinth
Restart=on-failure
RestartSec=5
ExecReload=/bin/kill -HUP $MAINPID
User=plinth
Group=plinth
StandardOutput=null
StandardError=null
PrivateTmp=yes
[Install]
WantedBy=multi-user.target