Skip to content

Commit c95098c

Browse files
Merge pull request #19371 from netbox-community/release-v4.3.0
Release v4.3.0
2 parents dd90009 + c32d1e6 commit c95098c

File tree

426 files changed

+18996
-12303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

426 files changed

+18996
-12303
lines changed

.github/ISSUE_TEMPLATE/01-feature_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ body:
1515
attributes:
1616
label: NetBox version
1717
description: What version of NetBox are you currently running?
18-
placeholder: v4.2.9
18+
placeholder: v4.3.0
1919
validations:
2020
required: true
2121
- type: dropdown

.github/ISSUE_TEMPLATE/02-bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ body:
2727
attributes:
2828
label: NetBox Version
2929
description: What version of NetBox are you currently running?
30-
placeholder: v4.2.9
30+
placeholder: v4.3.0
3131
validations:
3232
required: true
3333
- type: dropdown

base_requirements.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The Python web framework on which NetBox is built
22
# https://docs.djangoproject.com/en/stable/releases/
3-
Django<5.2
3+
Django==5.2.*
44

55
# Django middleware which permits cross-domain API requests
66
# https://github.com/adamchainz/django-cors-headers/blob/main/CHANGELOG.rst
@@ -42,6 +42,10 @@ django-rich
4242
# https://github.com/rq/django-rq/blob/master/CHANGELOG.md
4343
django-rq
4444

45+
# Provides a variety of storage backends
46+
# https://github.com/jschneier/django-storages/blob/master/CHANGELOG.rst
47+
django-storages
48+
4549
# Abstraction models for rendering and paginating HTML tables
4650
# https://github.com/jieter/django-tables2/blob/master/CHANGELOG.md
4751
django-tables2
@@ -78,6 +82,10 @@ gunicorn
7882
# https://jinja.palletsprojects.com/changes/
7983
Jinja2
8084

85+
# JSON schema validation
86+
# https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst
87+
jsonschema
88+
8189
# Simple markup language for rendering HTML
8290
# https://python-markdown.github.io/changelog/
8391
Markdown

docs/administration/replicating-netbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pg_dump --username netbox --password --host localhost -s netbox > netbox_schema.
5454
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.
5555

5656
!!! 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).
5858

5959
### Archive the Media Directory
6060

docs/configuration/plugins.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,21 @@ Note that a plugin must be listed in `PLUGINS` for its configuration to take eff
3333

3434
---
3535

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.
41+
42+
An example configuration is shown below:
43+
44+
```python
45+
PLUGINS_CATALOG_CONFIG = {
46+
'hidden': [
47+
'plugin1',
48+
],
49+
'static': [
50+
'plugin2',
51+
],
52+
}
53+
```

docs/configuration/required-parameters.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,30 @@ ALLOWED_HOSTS = ['*']
2525

2626
## DATABASE
2727

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:
2952

3053
* `NAME` - Database name
3154
* `USER` - PostgreSQL username
@@ -38,22 +61,24 @@ NetBox requires access to a PostgreSQL 13 or later database service to store dat
3861
Example:
3962

4063
```python
41-
DATABASE = {
42-
'ENGINE': 'django.db.backends.postgresql',
43-
'NAME': 'netbox', # Database name
44-
'USER': 'netbox', # PostgreSQL username
45-
'PASSWORD': 'J5brHrAXFLQSif0K', # PostgreSQL password
46-
'HOST': 'localhost', # Database server
47-
'PORT': '', # Database port (leave blank for default)
48-
'CONN_MAX_AGE': 300, # Max database connection age
64+
DATABASES = {
65+
'default': {
66+
'ENGINE': 'django.db.backends.postgresql',
67+
'NAME': 'netbox', # Database name
68+
'USER': 'netbox', # PostgreSQL username
69+
'PASSWORD': 'J5brHrAXFLQSif0K', # PostgreSQL password
70+
'HOST': 'localhost', # Database server
71+
'PORT': '', # Database port (leave blank for default)
72+
'CONN_MAX_AGE': 300, # Max database connection age
73+
}
4974
}
5075
```
5176

5277
!!! note
5378
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).
5479

5580
!!! 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.
5782

5883
---
5984

docs/configuration/security.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
## ALLOW_TOKEN_RETRIEVAL
44

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.
69

710
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.
811

@@ -186,6 +189,17 @@ The lifetime (in seconds) of the authentication cookie issued to a NetBox user u
186189

187190
---
188191

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.
200+
201+
---
202+
189203
## LOGOUT_REDIRECT_URL
190204

191205
Default: `'home'`

docs/configuration/system.md

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ BASE_PATH = 'netbox/'
1212

1313
---
1414

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+
1525
## DEFAULT_LANGUAGE
1626

1727
Default: `en-us` (US English)
@@ -75,6 +85,8 @@ HTTP_PROXIES = {
7585
}
7686
```
7787

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+
7890
---
7991

8092
## INTERNAL_IPS
@@ -160,6 +172,18 @@ The file path to the location where media files (such as image attachments) are
160172

161173
---
162174

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+
163187
## REPORTS_ROOT
164188

165189
Default: `$INSTALL_ROOT/netbox/reports/`
@@ -184,23 +208,46 @@ The dotted path to the desired search backend class. `CachedValueSearchBackend`
184208

185209
---
186210

187-
## STORAGE_BACKEND
211+
## STORAGES
188212

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.
190214

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:
192216

193-
The configuration parameters for the specified storage backend are defined under the `STORAGE_CONFIG` setting.
217+
```python
218+
STORAGES = {
219+
"default": {
220+
"BACKEND": "django.core.files.storage.FileSystemStorage",
221+
},
222+
"staticfiles": {
223+
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
224+
},
225+
"scripts": {
226+
"BACKEND": "extras.storage.ScriptFileSystemStorage",
227+
},
228+
}
229+
```
194230

195-
---
231+
Within the `STORAGES` dictionary, `"default"` is used for image uploads, "staticfiles" is for static files and `"scripts"` is used for custom scripts.
196232

197-
## STORAGE_CONFIG
233+
If using a remote storage like S3, define the config as `STORAGES[key]["OPTIONS"]` for each storage item as needed. For example:
198234

199-
Default: Empty
235+
```python
236+
STORAGES = {
237+
"scripts": {
238+
"BACKEND": "storages.backends.s3boto3.S3Boto3Storage",
239+
"OPTIONS": {
240+
'access_key': 'access key',
241+
'secret_key': 'secret key',
242+
}
243+
},
244+
}
245+
```
200246

201-
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).
202248

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.
204251

205252
---
206253

docs/customization/custom-scripts.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ The Script class provides two convenience methods for reading data from files:
140140

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

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+
143145
## Logging
144146

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

docs/development/adding-models.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ Create the following for each model:
7676

7777
## 13. GraphQL API components
7878

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:
8080

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
8284

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.
8486

8587
## 14. Add tests
8688

0 commit comments

Comments
 (0)