Skip to content

Commit fd16c47

Browse files
Merge pull request #7069 from netbox-community/develop
Release v3.0.0
2 parents 9cc4992 + b784517 commit fd16c47

File tree

1,681 files changed

+32760
-198114
lines changed

Some content is hidden

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

1,681 files changed

+32760
-198114
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ body:
1717
What version of NetBox are you currently running? (If you don't have access to the most
1818
recent NetBox release, consider testing on our [demo instance](https://demo.netbox.dev/)
1919
before opening a bug report to see if your issue has already been addressed.)
20-
placeholder: v2.11.12
20+
placeholder: v3.0.0
2121
validations:
2222
required: true
2323
- type: dropdown
2424
attributes:
2525
label: Python version
2626
description: What version of Python are you currently running?
2727
options:
28-
- 3.6
2928
- 3.7
3029
- 3.8
3130
- 3.9

.github/ISSUE_TEMPLATE/feature_request.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
attributes:
1515
label: NetBox version
1616
description: What version of NetBox are you currently running?
17-
placeholder: v2.11.12
17+
placeholder: v3.0.0
1818
validations:
1919
required: true
2020
- type: dropdown

.github/workflows/ci.yml

+18-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
python-version: [3.6, 3.7, 3.8]
8+
python-version: [3.7, 3.8, 3.9]
9+
node-version: [14.x]
910
services:
1011
redis:
1112
image: redis
@@ -33,15 +34,30 @@ jobs:
3334
with:
3435
python-version: ${{ matrix.python-version }}
3536

37+
- name: Use Node.js ${{ matrix.node-version }}
38+
uses: actions/setup-node@v2
39+
with:
40+
node-version: ${{ matrix.node-version }}
41+
3642
- name: Install dependencies & set up configuration
3743
run: |
3844
python -m pip install --upgrade pip
3945
pip install -r requirements.txt
4046
pip install pycodestyle coverage
4147
ln -s configuration.testing.py netbox/netbox/configuration.py
48+
yarn --cwd netbox/project-static
49+
50+
- name: Build documentation
51+
run: mkdocs build
52+
53+
- name: Collect static files
54+
run: python netbox/manage.py collectstatic --no-input
4255

4356
- name: Check PEP8 compliance
44-
run: pycodestyle --ignore=W504,E501 netbox/
57+
run: pycodestyle --ignore=W504,E501 --exclude=node_modules netbox/
58+
59+
- name: Check UI ESLint, TypeScript, and Prettier Compliance
60+
run: yarn --cwd netbox/project-static validate
4561

4662
- name: Run tests
4763
run: coverage run --source="netbox/" netbox/manage.py test netbox/

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
*.pyc
22
*.swp
3+
node_modules
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
/netbox/project-static/.cache
8+
/netbox/project-static/docs/*
9+
!/netbox/project-static/docs/.info
310
/netbox/netbox/configuration.py
411
/netbox/netbox/ldap_config.py
512
/netbox/project-static/.cache

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@ our [contributing guide](CONTRIBUTING.md) prior to beginning any work.
5454

5555
### Screenshots
5656

57-
![Screenshot of main page](docs/media/screenshot1.png "Main page")
57+
![Screenshot of main page (light mode)](docs/media/screenshots/home-light.png "Main page (light mode)")
5858

59-
![Screenshot of rack elevation](docs/media/screenshot2.png "Rack elevation")
59+
![Screenshot of main page (dark mode)](docs/media/screenshots/home-dark.png "Main page (dark mode)")
6060

61-
![Screenshot of prefix hierarchy](docs/media/screenshot3.png "Prefix hierarchy")
61+
![Screenshot of rack elevation](docs/media/screenshots/rack.png "Rack elevation")
62+
63+
![Screenshot of prefixes hierarchy](docs/media/screenshots/prefixes-list.png "Prefixes hierarchy")
64+
65+
![Screenshot of cable trace](docs/media/screenshots/cable-trace.png "Cable tracing")
6266

6367
### Related projects
6468

base_requirements.txt

+20-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
# https://github.com/django/django
33
Django
44

5-
# Django caching using Redis
6-
# https://github.com/Suor/django-cacheops
7-
django-cacheops
8-
95
# Django middleware which permits cross-domain API requests
106
# https://github.com/OttoYiu/django-cors-headers
117
django-cors-headers
@@ -18,6 +14,10 @@ django-debug-toolbar
1814
# https://github.com/carltongibson/django-filter
1915
django-filter
2016

17+
# Django debug toolbar extension with support for GraphiQL
18+
# https://github.com/flavors/django-graphiql-debug-toolbar/
19+
django-graphiql-debug-toolbar
20+
2121
# Modified Preorder Tree Traversal (recursive nesting of objects)
2222
# https://github.com/django-mptt/django-mptt
2323
django-mptt
@@ -30,6 +30,10 @@ django-pglocks
3030
# https://github.com/korfuri/django-prometheus
3131
django-prometheus
3232

33+
# Django chaching backend using Redis
34+
# https://github.com/jazzband/django-redis
35+
django-redis
36+
3337
# Django integration for RQ (Reqis queuing)
3438
# https://github.com/rq/django-rq
3539
django-rq
@@ -54,6 +58,10 @@ djangorestframework
5458
# https://github.com/axnsan12/drf-yasg
5559
drf-yasg[validation]
5660

61+
# Django wrapper for Graphene (GraphQL support)
62+
# https://github.com/graphql-python/graphene-django
63+
graphene_django
64+
5765
# WSGI HTTP server
5866
# https://gunicorn.org/
5967
gunicorn
@@ -66,6 +74,14 @@ Jinja2
6674
# https://github.com/Python-Markdown/markdown
6775
Markdown
6876

77+
# File inclusion plugin for Python-Markdown
78+
# https://github.com/cmacmackin/markdown-include
79+
markdown-include
80+
81+
# MkDocs Material theme (for documentation build)
82+
# https://github.com/squidfunk/mkdocs-material
83+
mkdocs-material
84+
6985
# Library for manipulating IP prefixes and addresses
7086
# https://github.com/drkjam/netaddr
7187
netaddr

contrib/netbox-housekeeping.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
# This shell script invokes NetBox's housekeeping management command, which
3+
# intended to be run nightly. This script can be copied into your system's
4+
# daily cron directory (e.g. /etc/cron.daily), or referenced directly from
5+
# within the cron configuration file.
6+
#
7+
# If NetBox has been installed into a nonstandard location, update the paths
8+
# below.
9+
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py housekeeping

contrib/netbox-rq.service

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ User=netbox
1111
Group=netbox
1212
WorkingDirectory=/opt/netbox
1313

14-
ExecStart=/opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py rqworker
14+
ExecStart=/opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py rqworker high default low
1515

1616
Restart=on-failure
1717
RestartSec=30

docs/additional-features/caching.md

-28
This file was deleted.

docs/additional-features/napalm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NAPALM
22

3-
NetBox supports integration with the [NAPALM automation](https://napalm-automation.net/) library. NAPALM allows NetBox to serve a proxy for operational data, fetching live data from network devices and returning it to a requester via its REST API. Note that NetBox does not store any NAPALM data locally.
3+
NetBox supports integration with the [NAPALM automation](https://github.com/napalm-automation/napalm) library. NAPALM allows NetBox to serve a proxy for operational data, fetching live data from network devices and returning it to a requester via its REST API. Note that NetBox does not store any NAPALM data locally.
44

55
The NetBox UI will display tabs for status, LLDP neighbors, and configuration under the device view if the following conditions are met:
66

docs/additional-features/webhooks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Webhooks
22

3-
A webhook is a mechanism for conveying to some external system a change that took place in NetBox. For example, you may want to notify a monitoring system whenever the status of a device is updated in NetBox. This can be done by creating a webhook for the device model in NetBox and identifying the webhook receiver. When NetBox detects a change to a device, an HTTP request containing the details of the change and who made it be sent to the specified receiver. Webhooks are configured in the admin UI under Extras > Webhooks.
3+
A webhook is a mechanism for conveying to some external system a change that took place in NetBox. For example, you may want to notify a monitoring system whenever the status of a device is updated in NetBox. This can be done by creating a webhook for the device model in NetBox and identifying the webhook receiver. When NetBox detects a change to a device, an HTTP request containing the details of the change and who made it be sent to the specified receiver. Webhooks are managed under Logging > Webhooks.
44

55
!!! warning
66
Webhooks support the inclusion of user-submitted code to generate custom headers and payloads, which may pose security risks under certain conditions. Only grant permission to create or modify webhooks to trusted users.

docs/administration/housekeeping.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Housekeeping
2+
3+
NetBox includes a `housekeeping` management command that should be run nightly. This command handles:
4+
5+
* Clearing expired authentication sessions from the database
6+
* Deleting changelog records older than the configured [retention time](../configuration/optional-settings.md#changelog_retention)
7+
8+
This command can be invoked directly, or by using the shell script provided at `/opt/netbox/contrib/netbox-housekeeping.sh`. This script can be copied into your cron scheduler's daily jobs directory (e.g. `/etc/cron.daily`) or referenced directly within the cron configuration file.
9+
10+
The `housekeeping` command can also be run manually at any time: Running the command outside of scheduled execution times will not interfere with its operation.

docs/administration/netbox-shell.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This will launch a lightly customized version of [the built-in Django shell](htt
1111
```
1212
$ ./manage.py nbshell
1313
### NetBox interactive shell (localhost)
14-
### Python 3.6.9 | Django 2.2.11 | NetBox 2.7.10
14+
### Python 3.7.10 | Django 3.2.5 | NetBox 3.0
1515
### lsmodels() will show available models. Use help(<model>) for more info.
1616
```
1717

@@ -194,7 +194,7 @@ To delete multiple objects at once, call `delete()` on a filtered queryset. It's
194194
>>> Device.objects.filter(name__icontains='test').count()
195195
27
196196
>>> Device.objects.filter(name__icontains='test').delete()
197-
(35, {'dcim.DeviceBay': 0, 'secrets.Secret': 0, 'dcim.InterfaceConnection': 4,
197+
(35, {'dcim.DeviceBay': 0, 'dcim.InterfaceConnection': 4,
198198
'extras.ImageAttachment': 0, 'dcim.Device': 27, 'dcim.Interface': 4,
199199
'dcim.ConsolePort': 0, 'dcim.PowerPort': 0})
200200
```

docs/configuration/optional-settings.md

+30-22
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ BASE_PATH = 'netbox/'
5252

5353
---
5454

55-
## CACHE_TIMEOUT
56-
57-
Default: 0 (disabled)
58-
59-
The number of seconds that cached database queries will be retained before expiring.
60-
61-
---
62-
6355
## CHANGELOG_RETENTION
6456

6557
Default: 90
@@ -96,6 +88,22 @@ CORS_ORIGIN_WHITELIST = [
9688

9789
---
9890

91+
## CUSTOM_VALIDATORS
92+
93+
This is a mapping of models to [custom validators](../customization/custom-validation.md) that have been defined locally to enforce custom validation logic. An example is provided below:
94+
95+
```python
96+
CUSTOM_VALIDATORS = {
97+
'dcim.site': (
98+
Validator1,
99+
Validator2,
100+
Validator3
101+
)
102+
}
103+
```
104+
105+
---
106+
99107
## DEBUG
100108

101109
Default: False
@@ -144,7 +152,7 @@ In order to send email, NetBox needs an email server configured. The following i
144152
!!! note
145153
The `USE_SSL` and `USE_TLS` parameters are mutually exclusive.
146154

147-
Email is sent from NetBox only for critical events or if configured for [logging](#logging). If you would like to test the email server configuration, Django provides a convenient [send_mail()](https://docs.djangoproject.com/en/stable/topics/email/#send-mail) fuction accessible within the NetBox shell:
155+
Email is sent from NetBox only for critical events or if configured for [logging](#logging). If you would like to test the email server configuration, Django provides a convenient [send_mail()](https://docs.djangoproject.com/en/stable/topics/email/#send-mail) function accessible within the NetBox shell:
148156

149157
```no-highlight
150158
# python ./manage.py nbshell
@@ -195,6 +203,14 @@ EXEMPT_VIEW_PERMISSIONS = ['*']
195203

196204
---
197205

206+
## GRAPHQL_ENABLED
207+
208+
Default: True
209+
210+
Setting this to False will disable the GraphQL API.
211+
212+
---
213+
198214
## HTTP_PROXIES
199215

200216
Default: None
@@ -271,7 +287,7 @@ Note that enabling this setting causes NetBox to update a user's session in the
271287

272288
Default: False
273289

274-
Setting this to True will permit only authenticated users to access any part of NetBox. By default, anonymous users are permitted to access most data in NetBox (excluding secrets) but not make any changes.
290+
Setting this to True will permit only authenticated users to access any part of NetBox. By default, anonymous users are permitted to access most data in NetBox but not make any changes.
275291

276292
---
277293

@@ -327,7 +343,7 @@ Toggle the availability Prometheus-compatible metrics at `/metrics`. See the [Pr
327343

328344
## NAPALM_PASSWORD
329345

330-
NetBox will use these credentials when authenticating to remote devices via the [NAPALM library](https://napalm-automation.net/), if installed. Both parameters are optional.
346+
NetBox will use these credentials when authenticating to remote devices via the supported [NAPALM integration](../additional-features/napalm.md), if installed. Both parameters are optional.
331347

332348
!!! note
333349
If SSH public key authentication has been set up on the remote device(s) for the system account under which NetBox runs, these parameters are not needed.
@@ -482,19 +498,11 @@ When remote user authentication is in use, this is the name of the HTTP header w
482498

483499
---
484500

485-
## RELEASE_CHECK_TIMEOUT
486-
487-
Default: 86,400 (24 hours)
488-
489-
The number of seconds to retain the latest version that is fetched from the GitHub API before automatically invalidating it and fetching it from the API again. This must be set to at least one hour (3600 seconds).
490-
491-
---
492-
493501
## RELEASE_CHECK_URL
494502

495503
Default: None (disabled)
496504

497-
This parameter defines the URL of the repository that will be checked periodically for new NetBox releases. When a new release is detected, a message will be displayed to administrative users on the home page. This can be set to the official repository (`'https://api.github.com/repos/netbox-community/netbox/releases'`) or a custom fork. Set this to `None` to disable automatic update checks.
505+
This parameter defines the URL of the repository that will be checked for new NetBox releases. When a new release is detected, a message will be displayed to administrative users on the home page. This can be set to the official repository (`'https://api.github.com/repos/netbox-community/netbox/releases'`) or a custom fork. Set this to `None` to disable automatic update checks.
498506

499507
!!! note
500508
The URL provided **must** be compatible with the [GitHub REST API](https://docs.github.com/en/rest).
@@ -505,7 +513,7 @@ This parameter defines the URL of the repository that will be checked periodical
505513

506514
Default: `$INSTALL_ROOT/netbox/reports/`
507515

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

510518
---
511519

@@ -521,7 +529,7 @@ The maximum execution time of a background task (such as running a custom script
521529

522530
Default: `$INSTALL_ROOT/netbox/scripts/`
523531

524-
The file path to the location where custom scripts will be kept. By default, this is the `netbox/scripts/` directory within the base NetBox installation path.
532+
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.
525533

526534
---
527535

docs/core-functionality/ipam.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
---
1212

13+
{!docs/models/ipam/iprange.md!}
1314
{!docs/models/ipam/ipaddress.md!}
1415

1516
---

docs/core-functionality/secrets.md

-8
This file was deleted.

docs/additional-features/custom-fields.md renamed to docs/customization/custom-fields.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Within the database, custom fields are stored as JSON data directly alongside ea
88

99
## Creating Custom Fields
1010

11-
Custom fields must be created through the admin UI under Extras > Custom Fields. NetBox supports six types of custom field:
11+
Custom fields may be created by navigating to Customization > Custom Fields. NetBox supports six types of custom field:
1212

1313
* Text: Free-form text (up to 255 characters)
1414
* Integer: A whole number (positive or negative)

0 commit comments

Comments
 (0)