Jeremy Stretch 6 лет назад
Родитель
Сommit
9f204f72ef

+ 20 - 0
docs/configuration/optional-settings.md

@@ -293,6 +293,26 @@ Session data is used to track authenticated users when they access NetBox. By de
 
 ---
 
+## STORAGE_BACKEND
+
+Default: None (local storage)
+
+The backend storage engine for handling uploaded files (e.g. image attachments). NetBox supports integration with the [`django-storages`](https://django-storages.readthedocs.io/en/stable/) package, which provides backends for several popular file storage services. If not configured, local filesystem storage will be used.
+
+The configuration parameters for the specified storage backend are defined under the `STORAGE_CONFIG` setting.
+
+---
+
+## STORAGE_CONFIG
+
+Default: Empty
+
+A dictionary of configuration parameters for the storage backend configured as `STORAGE_BACKEND`. The specific parameters to be used here are specific to each backend; see the [`django-storages` documentation](https://django-storages.readthedocs.io/en/stable/) for more detail.
+
+If `STORAGE_BACKEND` is not defined, this setting will be ignored.
+
+---
+
 ## TIME_ZONE
 
 Default: UTC

+ 8 - 0
docs/installation/2-netbox.md

@@ -90,6 +90,14 @@ NetBox supports integration with the [NAPALM automation](https://napalm-automati
 # pip3 install napalm
 ```
 
+## Remote File Storage (Optional)
+
+By default, NetBox will use the local filesystem to storage uploaded files. To use a remote filesystem, install the [`django-storages`](https://django-storages.readthedocs.io/en/stable/) library and configure your [desired backend](../../configuration/optional-settings/#storage_backend) in `configuration.py`.
+
+```no-highlight
+# pip3 install django-storages
+```
+
 # Configuration
 
 Move into the NetBox configuration directory and make a copy of `configuration.example.py` named `configuration.py`.

+ 34 - 0
docs/release-notes/version-2.7.md

@@ -40,6 +40,40 @@ This new functionality replaces the existing CSV-based import form, which did no
 NetBox now supports the bulk import of device components such as console ports, power ports, and interfaces. Device
 components can be imported in CSV-format.
 
+### External File Storage ([#1814](https://github.com/netbox-community/netbox/issues/1814))
+
+In prior releases, the only option for storing uploaded file (e.g. image attachments) was to save them to the local
+filesystem on the NetBox server. This release introduces support for several remote storage backends via the
+[`django-storages`](https://django-storages.readthedocs.io/en/stable/) package. These include:
+
+* Amazon S3
+* ApacheLibcloud
+* Azure Storage
+* DigitalOcean Spaces
+* Dropbox
+* FTP
+* Google Cloud Storage
+* SFTP
+
+To enable remote file storage, first install `django-storages`:
+
+```
+pip install django-storages
+```
+
+Then, set the appropriate storage backend and its configuration in `configuration.py`. Here's an example using Amazon
+S3:
+
+```python
+STORAGE_BACKEND = 'storages.backends.s3boto3.S3Boto3Storage'
+STORAGE_CONFIG = {
+    'AWS_ACCESS_KEY_ID': '<Key>',
+    'AWS_SECRET_ACCESS_KEY': '<Secret>',
+    'AWS_STORAGE_BUCKET_NAME': 'netbox',
+    'AWS_S3_REGION_NAME': 'eu-west-1',
+}
+```
+
 ## Changes
 
 ### Topology Maps Removed ([#2745](https://github.com/netbox-community/netbox/issues/2745))