From ef1c48508273150c177b2641b6c1c61eec306a45 Mon Sep 17 00:00:00 2001 From: Daniele Bonomi Date: Sun, 2 Feb 2020 16:27:18 +0100 Subject: [PATCH] Drop privileges --- bootstrap.sh | 4 ++++ uwsgi.ini | 2 ++ 2 files changed, 6 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index 80bc7d0..bbccee3 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -3,10 +3,14 @@ # Create data folder if it does not exist mkdir -p data + # Run database migration python manage.py migrate # Generate secret key file if it does not exist python manage.py generate_secret_key +# Ensure the DB folder is owned by the right user +chown -R www-data: /etc/linkding/data + # Start uwsgi server uwsgi uwsgi.ini diff --git a/uwsgi.ini b/uwsgi.ini index 930ef65..571eee8 100644 --- a/uwsgi.ini +++ b/uwsgi.ini @@ -9,3 +9,5 @@ threads = 2 pidfile = /tmp/linkding.pid vacuum=True stats = 127.0.0.1:9191 +uid = www-data +gid = www-data