From 5815bac0df9937f23e5a9c8d740b222812a3685b Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Thu, 22 Sep 2022 19:54:58 +0200 Subject: [PATCH] [FIX] Default permissions for static files A little fallacy on my end in the docs. 655 is enough for files in those directories, but the directories themselves need to be traversal, so 755 for the directories ... --- docs/installation/switch_to_non_root.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/installation/switch_to_non_root.md b/docs/installation/switch_to_non_root.md index 740c7bd3..1e04bcb5 100644 --- a/docs/installation/switch_to_non_root.md +++ b/docs/installation/switch_to_non_root.md @@ -13,9 +13,15 @@ The migration itself is rather straightforward. The main idea is to change owner First, log in as your sudo user and run the following commands in order: ```shell +# Set the right owner sudo chown -R allianceserver: /home/allianceserver sudo chown -R allianceserver: /var/www/myauth -sudo chmod -R 655 /var/www/myauth + +# Remove static files, they will be re-added later +sudo rm -rf /var/www/mayauth/static/* + +# Fix directory permissions +sudo chmod -R 755 /var/www/myauth ``` That's it. Your AA installation is now configured to be maintained with the `allianceserver` user. @@ -45,6 +51,13 @@ Finally, switch to the main AA folder, from where you can run most commands dire cd myauth ``` +Now it's time to re-add the static files with the right permissions. To do so simply +run: + +```shell +python manage.py collectstatic +``` + When you want to restart myauth, you need to switch back to your sudo user, because `allianceserver` does not have sudo privileges: ```shell