You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, NetBox stores uploaded files (such as image attachments) in its media directory. To fully replicate an instance of NetBox, you'll need to copy both the database and the media files.
55
55
56
56
!!! note
57
-
These operations are not necessary if your installation is utilizing a [remote storage backend](../configuration/system.md#storage_backend).
57
+
These operations are not necessary if your installation is utilizing a [remote storage backend](../configuration/system.md#storages).
Copy file name to clipboardExpand all lines: docs/configuration/plugins.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,3 +33,21 @@ Note that a plugin must be listed in `PLUGINS` for its configuration to take eff
33
33
34
34
---
35
35
36
+
## PLUGINS_CATALOG_CONFIG
37
+
38
+
Default: Empty
39
+
40
+
This parameter controls how individual plugins are displayed in the plugins catalog under Admin > System > Plugins. Adding a plugin to the `hidden` list will omit that plugin from the catalog. Adding a plugin to the `static` list will display the plugin, but not link to the plugin details or upgrade instructions.
Copy file name to clipboardExpand all lines: docs/configuration/required-parameters.md
+35-10Lines changed: 35 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,30 @@ ALLOWED_HOSTS = ['*']
25
25
26
26
## DATABASE
27
27
28
-
NetBox requires access to a PostgreSQL 13 or later database service to store data. This service can run locally on the NetBox server or on a remote system. The following parameters must be defined within the `DATABASE` dictionary:
28
+
!!! warning "Legacy Configuration Parameter"
29
+
The `DATABASE` configuration parameter is deprecated and will be removed in a future release. Users are advised to adopt the new `DATABASES` (plural) parameter, which allows for the configuration of multiple databases.
30
+
31
+
See the [`DATABASES`](#databases) configuration below for usage.
32
+
33
+
---
34
+
35
+
## DATABASES
36
+
37
+
!!! info "This parameter was introduced in NetBox v4.3."
38
+
39
+
NetBox requires access to a PostgreSQL 14 or later database service to store data. This service can run locally on the NetBox server or on a remote system. Databases are defined as named dictionaries:
40
+
41
+
```python
42
+
DATABASES= {
43
+
'default': {...},
44
+
'external1': {...},
45
+
'external2': {...},
46
+
}
47
+
```
48
+
49
+
NetBox itself requires only that a `default` database is defined. However, certain plugins may require the configuration of additional databases. (Consider also configuring the [`DATABASE_ROUTERS`](./system.md#database_routers) parameter when multiple databases are in use.)
50
+
51
+
The following parameters must be defined for each database:
29
52
30
53
*`NAME` - Database name
31
54
*`USER` - PostgreSQL username
@@ -38,22 +61,24 @@ NetBox requires access to a PostgreSQL 13 or later database service to store dat
'PORT': '', # Database port (leave blank for default)
72
+
'CONN_MAX_AGE': 300, # Max database connection age
73
+
}
49
74
}
50
75
```
51
76
52
77
!!! note
53
78
NetBox supports all PostgreSQL database options supported by the underlying Django framework. For a complete list of available parameters, please see [the Django documentation](https://docs.djangoproject.com/en/stable/ref/settings/#databases).
54
79
55
80
!!! warning
56
-
Make sure to use a PostgreSQL-compatible backend for the ENGINE setting. If you don't specify an ENGINE, the default will be django.db.backends.postgresql.
81
+
The `ENGINE` parameter must specify a PostgreSQL-compatible database backend. If not defined, the default engine `django.db.backends.postgresql` will be used.
Copy file name to clipboardExpand all lines: docs/configuration/security.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,10 @@
2
2
3
3
## ALLOW_TOKEN_RETRIEVAL
4
4
5
-
Default: `True`
5
+
Default: `False`
6
+
7
+
!!! note
8
+
The default value of this parameter changed from true to false in NetBox v4.3.0.
6
9
7
10
If disabled, the values of API tokens will not be displayed after each token's initial creation. A user **must** record the value of a token prior to its creation, or it will be lost. Note that this affects _all_ users, regardless of assigned permissions.
8
11
@@ -186,6 +189,17 @@ The lifetime (in seconds) of the authentication cookie issued to a NetBox user u
186
189
187
190
---
188
191
192
+
## LOGIN_FORM_HIDDEN
193
+
194
+
Default: False
195
+
196
+
Option to hide the login form when only SSO authentication is in use.
197
+
198
+
!!! warning
199
+
If the SSO provider is unreachable, login to NetBox will be impossible if this option is enabled. The only recourse is to disable it in the local configuration and restart the NetBox service.
Copy file name to clipboardExpand all lines: docs/configuration/system.md
+56-9Lines changed: 56 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,16 @@ BASE_PATH = 'netbox/'
12
12
13
13
---
14
14
15
+
## DATABASE_ROUTERS
16
+
17
+
!!! info "This parameter was introduced in NetBox v4.3."
18
+
19
+
Default: `[]` (empty list)
20
+
21
+
An iterable of [database routers](https://docs.djangoproject.com/en/stable/topics/db/multi-db/) to use for automatically selecting the appropriate database(s) for a query. This is useful only when [multiple databases](./required-parameters.md#databases) have been configured.
22
+
23
+
---
24
+
15
25
## DEFAULT_LANGUAGE
16
26
17
27
Default: `en-us` (US English)
@@ -75,6 +85,8 @@ HTTP_PROXIES = {
75
85
}
76
86
```
77
87
88
+
If more flexibility is needed in determining which proxy to use for a given request, consider implementing one or more custom proxy routers via the [`PROXY_ROUTERS`](#proxy_routers) parameter.
89
+
78
90
---
79
91
80
92
## INTERNAL_IPS
@@ -160,6 +172,18 @@ The file path to the location where media files (such as image attachments) are
160
172
161
173
---
162
174
175
+
## PROXY_ROUTERS
176
+
177
+
!!! info "This parameter was introduced in NetBox v4.3."
178
+
179
+
Default: `["utilities.proxy.DefaultProxyRouter"]`
180
+
181
+
A list of Python classes responsible for determining which proxy server(s) to use for outbound HTTP requests. Each item in the list can be the class itself or the dotted path to the class.
182
+
183
+
The `route()` method on each class must return a dictionary of candidate proxies arranged by protocol (e.g. `http` and/or `https`), or None if no viable proxy can be determined. The default class, `DefaultProxyRouter`, simply returns the content of [`HTTP_PROXIES`](#http_proxies).
184
+
185
+
---
186
+
163
187
## REPORTS_ROOT
164
188
165
189
Default: `$INSTALL_ROOT/netbox/reports/`
@@ -184,23 +208,46 @@ The dotted path to the desired search backend class. `CachedValueSearchBackend`
184
208
185
209
---
186
210
187
-
## STORAGE_BACKEND
211
+
## STORAGES
188
212
189
-
Default: None (local storage)
213
+
The backend storage engine for handling uploaded files such as [image attachments](../models/extras/imageattachment.md) and [custom scripts](../customization/custom-scripts.md). NetBox integrates with the [`django-storages`](https://django-storages.readthedocs.io/en/stable/) and [`django-storage-swift`](https://github.com/dennisv/django-storage-swift) libraries, which provide backends for several popular file storage services. If not configured, local filesystem storage will be used.
190
214
191
-
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.
215
+
By default, the following configuration is used:
192
216
193
-
The configuration parameters for the specified storage backend are defined under the `STORAGE_CONFIG` setting.
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 documentation for your selected backend ([`django-storages`](https://django-storages.readthedocs.io/en/stable/) or [`django-storage-swift`](https://github.com/dennisv/django-storage-swift)) for more detail.
247
+
The specific configuration settings for each storage backend can be found in the [django-storages documentation](https://django-storages.readthedocs.io/en/latest/index.html).
202
248
203
-
If `STORAGE_BACKEND` is not defined, this setting will be ignored.
249
+
!!! note
250
+
Any keys defined in the `STORAGES` configuration parameter replace those in the default configuration. It is only necessary to define keys within the `STORAGES` for the specific backend(s) you wish to configure.
Copy file name to clipboardExpand all lines: docs/customization/custom-scripts.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,8 @@ The Script class provides two convenience methods for reading data from files:
140
140
141
141
These two methods will load data in YAML or JSON format, respectively, from files within the local path (i.e. `SCRIPTS_ROOT`).
142
142
143
+
**Note:** These convenience methods are deprecated and will be removed in NetBox v4.4. These only work if running scripts within the local path, they will not work if using a storage other than ScriptFileSystemStorage.
144
+
143
145
## Logging
144
146
145
147
The Script object provides a set of convenient functions for recording messages at different severity levels:
Copy file name to clipboardExpand all lines: docs/development/adding-models.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,11 +76,13 @@ Create the following for each model:
76
76
77
77
## 13. GraphQL API components
78
78
79
-
Create a GraphQL object type for the model in `graphql/types.py` by subclassing the appropriate class from `netbox.graphql.types`.
79
+
Create the following for each model:
80
80
81
-
**Note:** GraphQL unit tests may fail citing null values on a non-nullable field if related objects are prefetched. You may need to fix this by setting the type annotation to be `= strawberry_django.field(select_related=["policy"])` or similar.
81
+
* GraphQL object type for the model in `graphql/types.py` (subclass the appropriate class from `netbox.graphql.types`)
82
+
* Add a GraphQL filter for the model in `graphql/filters.py`
83
+
* Extend the query class for the app in `graphql/schema.py` with the individual object and object list fields
82
84
83
-
Also extend the schema class defined in `graphql/schema.py` with the individual object and object list fields per the established convention.
85
+
**Note:** GraphQL unit tests may fail citing null values on a non-nullable field if related objects are prefetched. You may need to fix this by setting the type annotation to be `= strawberry_django.field(select_related=["foo"])` or similar.
0 commit comments