Skip to content

Commit

Permalink
18423 update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arthanson committed Feb 26, 2025
1 parent 099242e commit 45e2a93
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
26 changes: 23 additions & 3 deletions docs/configuration/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ Default: `$INSTALL_ROOT/netbox/scripts/`

The file path to the location where [custom scripts](../customization/custom-scripts.md) will be kept. By default, this is the `netbox/scripts/` directory within the base NetBox installation path.

**Note:** If configuring STORAGES to use AWS S3 set SCRIPTS_ROOT to the prefix (or folder) you want scripts stored in, for example: `scripts`

---

## SEARCH_BACKEND
Expand All @@ -184,11 +186,29 @@ The dotted path to the desired search backend class. `CachedValueSearchBackend`

---

## STORAGE_BACKEND
## STORAGES

Default: See below (local storage)

The backend storage engine for handling uploaded files (e.g. image attachments) and scripts. NetBox integration with the [`django-storages`](https://django-storages.readthedocs.io/en/stable/) and [`django-storage-swift`](https://github.com/dennisv/django-storage-swift) packages, which provide backends for several popular file storage services. If not configured, local filesystem storage will be used.

Default: None (local storage)
By default the following configuration is used:

```python
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
"scripts": {
"BACKEND": "extras.storage.ScriptFileSystemStorage",
},
}
```

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/) and [`django-storage-swift`](https://github.com/dennisv/django-storage-swift) packages, which provide backends for several popular file storage services. If not configured, local filesystem storage will be used.
Within the STORAGES dict, "default" is used for image uploads and "scripts" is used for Scripts.

The configuration parameters for the specified storage backend are defined under the `STORAGE_CONFIG` setting.

Expand Down
2 changes: 2 additions & 0 deletions docs/customization/custom-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ The Script class provides two convenience methods for reading data from files:

These two methods will load data in YAML or JSON format, respectively, from files within the local path (i.e. `SCRIPTS_ROOT`).

**Note:** These convenience methods only work if running scripts within the local path, they will not work if running scripts using AWS S3.

## Logging

The Script object provides a set of convenient functions for recording messages at different severity levels:
Expand Down

0 comments on commit 45e2a93

Please sign in to comment.