瀏覽代碼

Extend installation docs to include creation of a specific netbox user

Jeremy Stretch 6 年之前
父節點
當前提交
1b6f721e50
共有 3 個文件被更改,包括 11 次插入8 次删除
  1. 2 3
      contrib/netbox-rq.service
  2. 2 2
      contrib/netbox.service
  3. 7 3
      docs/installation/3-netbox.md

+ 2 - 3
contrib/netbox-rq.service

@@ -7,9 +7,8 @@ Wants=network-online.target
 [Service]
 Type=simple
 
-User=www-data
-Group=www-data
-
+User=netbox
+Group=netbox
 WorkingDirectory=/opt/netbox
 
 ExecStart=/opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py rqworker

+ 2 - 2
contrib/netbox.service

@@ -7,8 +7,8 @@ Wants=network-online.target
 [Service]
 Type=simple
 
-User=www-data
-Group=www-data
+User=netbox
+Group=netbox
 PIDFile=/var/tmp/netbox.pid
 WorkingDirectory=/opt/netbox
 

+ 7 - 3
docs/installation/3-netbox.md

@@ -68,10 +68,14 @@ Resolving deltas: 100% (1495/1495), done.
 Checking connectivity... done.
 ```
 
-!!! warning
-    Ensure that the media directory (`/opt/netbox/netbox/media/` in this example) and all its subdirectories are writable by the user account as which NetBox runs. If the NetBox process does not have permission to write to this directory, attempts to upload files (e.g. image attachments) will fail. (The appropriate user account will vary by platform.)
+## Create the NetBox User
+
+Create a system user account named `netbox`. We'll configure the WSGI and HTTP services to run under this account. We'll also assign this user ownership of the media directory. This ensures that NetBox will be able to save local files.
 
-    `# chown -R netbox:netbox /opt/netbox/netbox/media/`
+```
+# adduser --system --group netbox
+# chown --recursive netbox /opt/netbox/netbox/media/`
+```
 
 ## Set Up Python Environment