diff --git a/README.md b/README.md index 9fa842f..6622af1 100644 --- a/README.md +++ b/README.md @@ -114,22 +114,13 @@ uv run python manage.py backup_db --output-dir "" --prefix "ttvdrops" ### How the duck does permissions work on Linux? ```bash -sudo groupadd responses -sudo usermod -aG responses lovinator -sudo usermod -aG responses ttvdrops +sudo chown -R ttvdrops:http /home/ttvdrops/.local/share/TTVDrops/media/ +sudo chgrp -R http /home/ttvdrops/.local/share/TTVDrops/media +sudo find /home/ttvdrops/.local/share/TTVDrops/media -type d -exec chmod 2775 {} \; +sudo find /home/ttvdrops/.local/share/TTVDrops/media -type f -exec chmod 664 {} \; -sudo chown -R lovinator:responses /mnt/fourteen/Data/Responses -sudo chown -R lovinator:responses /mnt/fourteen/Data/ttvdrops -sudo chmod -R 2775 /mnt/fourteen/Data/Responses -sudo chmod -R 2775 /mnt/fourteen/Data/ttvdrops - -# Import dir -sudo setfacl -b /mnt/fourteen/Data/Responses /mnt/fourteen/Data/Responses/imported -sudo setfacl -m g:responses:rwx /mnt/fourteen/Data/Responses /mnt/fourteen/Data/Responses/imported -sudo setfacl -d -m g:responses:rwx /mnt/fourteen/Data/Responses /mnt/fourteen/Data/Responses/imported - -# Backup dir -sudo setfacl -b /mnt/fourteen/Data/ttvdrops -sudo setfacl -m g:responses:rwx /mnt/fourteen/Data/ttvdrops -sudo setfacl -d -m g:responses:rwx /mnt/fourteen/Data/ttvdrops +sudo chown -R ttvdrops:http /home/ttvdrops/.local/share/TTVDrops/datasets/ +sudo chgrp -R http /home/ttvdrops/.local/share/TTVDrops/datasets/ +sudo find /home/ttvdrops/.local/share/TTVDrops/datasets -type d -exec chmod 2775 {} \; +sudo find /home/ttvdrops/.local/share/TTVDrops/datasets -type f -exec chmod 664 {} \; ``` diff --git a/tools/systemd/ttvdrops-import-drops.service b/tools/systemd/ttvdrops-import-drops.service index 85f2b4d..d4e204b 100644 --- a/tools/systemd/ttvdrops-import-drops.service +++ b/tools/systemd/ttvdrops-import-drops.service @@ -7,6 +7,8 @@ Wants=network-online.target Type=simple User=ttvdrops Group=ttvdrops +SupplementaryGroups=http +UMask=0002 WorkingDirectory=/home/ttvdrops/ttvdrops EnvironmentFile=/home/ttvdrops/ttvdrops/.env ExecStart=/usr/bin/uv run python manage.py watch_imports /mnt/fourteen/Data/Responses/pending --verbose diff --git a/tools/systemd/ttvdrops-import-kick-drops.service b/tools/systemd/ttvdrops-import-kick-drops.service index 6858562..2932aab 100644 --- a/tools/systemd/ttvdrops-import-kick-drops.service +++ b/tools/systemd/ttvdrops-import-kick-drops.service @@ -7,6 +7,8 @@ Wants=network-online.target Type=oneshot User=ttvdrops Group=ttvdrops +SupplementaryGroups=http +UMask=0002 WorkingDirectory=/home/ttvdrops/ttvdrops EnvironmentFile=/home/ttvdrops/ttvdrops/.env ExecStart=/usr/bin/uv run python manage.py import_kick_drops