Skip to content

Commit 68fbd9b

Browse files
Merge pull request #4088 from netbox-community/develop
Release v2.7.4
2 parents 3143f75 + 11d6750 commit 68fbd9b

File tree

77 files changed

+2566
-1833
lines changed

Some content is hidden

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

77 files changed

+2566
-1833
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ about: Report a reproducible bug in the current release of NetBox
55
---
66

77
<!--
8-
NOTE: This form is only for reproducible bugs. If you need assistance with
8+
NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED.
9+
10+
This form is only for reproducible bugs. If you need assistance with
911
NetBox installation, or if you have a general question, DO NOT open an
1012
issue. Instead, post to our mailing list:
1113
@@ -16,8 +18,8 @@ about: Report a reproducible bug in the current release of NetBox
1618
before submitting a bug report.
1719
-->
1820
### Environment
19-
* Python version: <!-- Example: 3.5.4 -->
20-
* NetBox version: <!-- Example: 2.5.2 -->
21+
* Python version: <!-- Example: 3.6.9 -->
22+
* NetBox version: <!-- Example: 2.7.3 -->
2123

2224
<!--
2325
Describe in detail the exact steps that someone else can take to reproduce

.github/ISSUE_TEMPLATE/documentation_change.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ about: Suggest an addition or modification to the NetBox documentation
55
---
66

77
<!--
8+
NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED.
9+
810
Please indicate the nature of the change by placing an X in one of the
911
boxes below.
1012
-->
@@ -14,5 +16,13 @@ about: Suggest an addition or modification to the NetBox documentation
1416
[ ] Deprecation
1517
[ ] Cleanup (formatting, typos, etc.)
1618

19+
### Area
20+
[ ] Installation instructions
21+
[ ] Configuration parameters
22+
[ ] Functionality/features
23+
[ ] REST API
24+
[ ] Administration/development
25+
[ ] Other
26+
1727
<!-- Describe the proposed change(s). -->
1828
### Proposed Changes

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ about: Propose a new NetBox feature or enhancement
55
---
66

77
<!--
8-
NOTE: This form is only for proposing specific new features or enhancements.
8+
NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED.
9+
10+
This form is only for proposing specific new features or enhancements.
911
If you have a general idea or question, please post to our mailing list
1012
instead of opening an issue:
1113
@@ -19,8 +21,8 @@ about: Propose a new NetBox feature or enhancement
1921
before submitting a bug report.
2022
-->
2123
### Environment
22-
* Python version: <!-- Example: 3.5.4 -->
23-
* NetBox version: <!-- Example: 2.3.6 -->
24+
* Python version: <!-- Example: 3.6.9 -->
25+
* NetBox version: <!-- Example: 2.7.3 -->
2426

2527
<!--
2628
Describe in detail the new functionality you are proposing. Include any

.github/ISSUE_TEMPLATE/housekeeping.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
22
name: 🏡 Housekeeping
3-
about: A change pertaining to the codebase itself
3+
about: A change pertaining to the codebase itself (developers only)
44

55
---
66

77
<!--
8-
NOTE: This type of issue should be opened only by those reasonably familiar
9-
with NetBox's code base and interested in contributing to its development.
10-
11-
Describe the proposed change(s) in detail.
8+
NOTE: This template is for use by maintainers only. Please do not submit
9+
an issue using this template unless you have been specifically asked to
10+
do so.
1211
-->
1312
### Proposed Changes
1413

docs/configuration/optional-settings.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ This setting enables debugging. This should be done only during development or t
9090

9191
---
9292

93+
## DEVELOPER
94+
95+
Default: False
96+
97+
This parameter serves as a safeguard to prevent some potentially dangerous behavior, such as generating new database schema migrations. Set this to `True` **only** if you are actively developing the NetBox code base.
98+
99+
---
100+
93101
## EMAIL
94102

95103
In order to send email, NetBox needs an email server configured. The following items can be defined within the `EMAIL` setting:
@@ -127,7 +135,7 @@ EXEMPT_VIEW_PERMISSIONS = ['*']
127135

128136
---
129137

130-
# ENFORCE_GLOBAL_UNIQUE
138+
## ENFORCE_GLOBAL_UNIQUE
131139

132140
Default: False
133141

docs/installation/3-http-daemon.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ server {
2929
3030
location / {
3131
proxy_pass http://127.0.0.1:8001;
32-
proxy_set_header X-Forwarded-Host $server_name;
32+
proxy_set_header X-Forwarded-Host $http_host;
3333
proxy_set_header X-Real-IP $remote_addr;
3434
proxy_set_header X-Forwarded-Proto $scheme;
3535
}
@@ -107,9 +107,10 @@ Install gunicorn:
107107
# pip3 install gunicorn
108108
```
109109

110-
Copy `contrib/gunicorn.py` to `/opt/netbox/gunicorn.py`. We make a copy of this file to ensure that any changes to it do not get overwritten by a future upgrade.
110+
Copy `/opt/netbox/contrib/gunicorn.py` to `/opt/netbox/gunicorn.py`. We make a copy of this file to ensure that any changes to it do not get overwritten by a future upgrade.
111111

112112
```no-highlight
113+
# cd /opt/netbox
113114
# cp contrib/gunicorn.py /opt/netbox/gunicorn.py
114115
```
115116

docs/installation/4-ldap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ AUTH_LDAP_USER_FLAGS_BY_GROUP = {
110110
AUTH_LDAP_FIND_GROUP_PERMS = True
111111

112112
# Cache groups for one hour to reduce LDAP traffic
113-
AUTH_LDAP_CACHE_GROUPS = True
114-
AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600
113+
AUTH_LDAP_CACHE_TIMEOUT = 3600
114+
115115
```
116116

117117
* `is_active` - All users must be mapped to at least this group to enable authentication. Without this, users cannot log in.

docs/installation/migrating-to-systemd.md

Lines changed: 28 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -12,89 +12,46 @@ Migration is not required, as supervisord will still continue to function.
1212

1313
### systemd configuration:
1414

15-
Copy or link contrib/netbox.service and contrib/netbox-rq.service to /etc/systemd/system/netbox.service and /etc/systemd/system/netbox-rq.service
15+
We'll use systemd to control the daemonization of NetBox services. First, copy `contrib/netbox.service` and `contrib/netbox-rq.service` to the `/etc/systemd/system/` directory:
1616

1717
```no-highlight
18-
# cp contrib/netbox.service /etc/systemd/system/netbox.service
19-
# cp contrib/netbox-rq.service /etc/systemd/system/netbox-rq.service
18+
# cp contrib/*.service /etc/systemd/system/
2019
```
2120

22-
Edit /etc/systemd/system/netbox.service and /etc/systemd/system/netbox-rq.service. Be sure to verify the location of the gunicorn executable on your server (e.g. `which gunicorn`). If using CentOS/RHEL. Change the username from `www-data` to `nginx` or `apache`:
21+
!!! note
22+
These service files assume that gunicorn is installed at `/usr/local/bin/gunicorn`. If the output of `which gunicorn` indicates a different path, you'll need to correct the `ExecStart` path in both files.
2323

24-
```no-highlight
25-
/usr/local/bin/gunicorn --pid ${PidPath} --pythonpath ${WorkingDirectory}/netbox --config ${ConfigPath} netbox.wsgi
26-
```
27-
28-
```no-highlight
29-
User=www-data
30-
Group=www-data
31-
```
32-
33-
Copy contrib/netbox.env to /etc/sysconfig/netbox.env
34-
35-
```no-highlight
36-
# cp contrib/netbox.env /etc/sysconfig/netbox.env
37-
```
38-
39-
Edit /etc/sysconfig/netbox.env and change the settings as required. Update the `WorkingDirectory` variable if needed.
40-
41-
```no-highlight
42-
# Name is the Process Name
43-
#
44-
Name = 'Netbox'
45-
46-
# ConfigPath is the path to the gunicorn config file.
47-
#
48-
ConfigPath=/opt/netbox/gunicorn.conf
49-
50-
# WorkingDirectory is the Working Directory for Netbox.
51-
#
52-
WorkingDirectory=/opt/netbox/
53-
54-
# PidPath is the path to the pid for the netbox WSGI
55-
#
56-
PidPath=/var/run/netbox.pid
57-
```
24+
!!! note
25+
You may need to modify the user that the systemd service runs as. Please verify the user for httpd on your specific release and edit both files to match your httpd service under user and group. The username could be "nobody", "nginx", "apache", "www-data" or any number of other usernames.
5826

59-
Copy contrib/gunicorn.conf to gunicorn.conf
27+
Then, start the `netbox` and `netbox-rq` services and enable them to initiate at boot time:
6028

6129
```no-highlight
62-
# cp contrib/gunicorn.conf to gunicorn.conf
30+
# systemctl daemon-reload
31+
# systemctl start netbox.service
32+
# systemctl start netbox-rq.service
33+
# systemctl enable netbox.service
34+
# systemctl enable netbox-rq.service
6335
```
6436

65-
Edit gunicorn.conf and change the settings as required.
37+
You can use the command `systemctl status netbox` to verify that the WSGI service is running:
6638

6739
```
68-
# Bind is the ip and port that the Netbox WSGI should bind to
69-
#
70-
bind='127.0.0.1:8001'
71-
72-
# Workers is the number of workers that GUnicorn should spawn.
73-
# Workers should be: cores * 2 + 1. So if you have 8 cores, it would be 17.
74-
#
75-
workers=3
76-
77-
# Threads
78-
# The number of threads for handling requests
79-
#
80-
threads=3
81-
82-
# Timeout is the timeout between gunicorn receiving a request and returning a response (or failing with a 500 error)
83-
#
84-
timeout=120
85-
86-
# ErrorLog
87-
# ErrorLog is the logfile for the ErrorLog
88-
#
89-
errorlog='/opt/netbox/netbox.log'
40+
# systemctl status netbox.service
41+
● netbox.service - NetBox WSGI Service
42+
Loaded: loaded (/etc/systemd/system/netbox.service; enabled; vendor preset: enabled)
43+
Active: active (running) since Thu 2019-12-12 19:23:40 UTC; 25s ago
44+
Docs: https://netbox.readthedocs.io/en/stable/
45+
Main PID: 11993 (gunicorn)
46+
Tasks: 6 (limit: 2362)
47+
CGroup: /system.slice/netbox.service
48+
├─11993 /usr/bin/python3 /usr/local/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/...
49+
├─12015 /usr/bin/python3 /usr/local/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/...
50+
├─12016 /usr/bin/python3 /usr/local/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/...
51+
...
9052
```
9153

92-
Finally, start the `netbox` and `netbox-rq` services and enable them to initiate at boot time:
54+
At this point, you should be able to connect to the HTTP service at the server name or IP address you provided. If you are unable to connect, check that the nginx service is running and properly configured. If you receive a 502 (bad gateway) error, this indicates that gunicorn is misconfigured or not running.
9355

94-
```no-highlight
95-
# systemctl daemon-reload
96-
# systemctl start netbox.service
97-
# systemctl start netbox-rq.service
98-
# systemctl enable netbox.service
99-
# systemctl enable netbox-rq.service
100-
```
56+
!!! info
57+
Please keep in mind that the configurations provided here are bare minimums required to get NetBox up and running. You may want to make adjustments to better suit your production environment.

docs/release-notes/version-2.7.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# v2.7.4 (2020-02-04)
2+
3+
## Enhancements
4+
5+
* [#568](https://github.com/netbox-community/netbox/issues/568) - Allow custom fields to be imported and exported using CSV
6+
* [#2921](https://github.com/netbox-community/netbox/issues/2921) - Replace tags filter with Select2 widget
7+
* [#3313](https://github.com/netbox-community/netbox/issues/3313) - Toggle config context display between JSON and YAML
8+
* [#3886](https://github.com/netbox-community/netbox/issues/3886) - Enable assigning config contexts by cluster and cluster group
9+
* [#4051](https://github.com/netbox-community/netbox/issues/4051) - Disable the `makemigrations` management command
10+
11+
## Bug Fixes
12+
13+
* [#4030](https://github.com/netbox-community/netbox/issues/4030) - Fix exception when bulk editing interfaces (revised)
14+
* [#4043](https://github.com/netbox-community/netbox/issues/4043) - Fix toggling of required fields in custom scripts
15+
* [#4049](https://github.com/netbox-community/netbox/issues/4049) - Restore missing `tags` field in IPAM service serializer
16+
* [#4052](https://github.com/netbox-community/netbox/issues/4052) - Fix error when bulk importing interfaces to virtual machines
17+
* [#4056](https://github.com/netbox-community/netbox/issues/4056) - Repair schema migration for Rack.outer_unit (from #3569)
18+
* [#4067](https://github.com/netbox-community/netbox/issues/4067) - Correct permission checked when creating a rack (vs. editing)
19+
* [#4071](https://github.com/netbox-community/netbox/issues/4071) - Enforce "view tag" permission on individual tag view
20+
* [#4079](https://github.com/netbox-community/netbox/issues/4079) - Fix assignment of power panel when bulk editing power feeds
21+
* [#4084](https://github.com/netbox-community/netbox/issues/4084) - Fix exception when creating an interface with tagged VLANs
22+
23+
---
24+
125
# v2.7.3 (2020-01-28)
226

327
## Enhancements

netbox/circuits/forms.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
from taggit.forms import TagField
33

44
from dcim.models import Region, Site
5-
from extras.forms import AddRemoveTagsForm, CustomFieldForm, CustomFieldBulkEditForm, CustomFieldFilterForm
5+
from extras.forms import (
6+
AddRemoveTagsForm, CustomFieldBulkEditForm, CustomFieldFilterForm, CustomFieldModelForm, CustomFieldModelCSVForm,
7+
)
68
from tenancy.forms import TenancyFilterForm, TenancyForm
79
from tenancy.models import Tenant
810
from utilities.forms import (
9-
APISelect, APISelectMultiple, add_blank_choice, BootstrapMixin, CommentField, CSVChoiceField,
10-
DatePicker, FilterChoiceField, SmallTextarea, SlugField, StaticSelect2, StaticSelect2Multiple
11+
APISelect, APISelectMultiple, add_blank_choice, BootstrapMixin, CommentField, CSVChoiceField, DatePicker,
12+
FilterChoiceField, SmallTextarea, SlugField, StaticSelect2, StaticSelect2Multiple, TagFilterField
1113
)
1214
from .choices import CircuitStatusChoices
1315
from .models import Circuit, CircuitTermination, CircuitType, Provider
@@ -17,7 +19,7 @@
1719
# Providers
1820
#
1921

20-
class ProviderForm(BootstrapMixin, CustomFieldForm):
22+
class ProviderForm(BootstrapMixin, CustomFieldModelForm):
2123
slug = SlugField()
2224
comments = CommentField()
2325
tags = TagField(
@@ -46,7 +48,7 @@ class Meta:
4648
}
4749

4850

49-
class ProviderCSVForm(forms.ModelForm):
51+
class ProviderCSVForm(CustomFieldModelCSVForm):
5052
slug = SlugField()
5153

5254
class Meta:
@@ -129,6 +131,7 @@ class ProviderFilterForm(BootstrapMixin, CustomFieldFilterForm):
129131
required=False,
130132
label='ASN'
131133
)
134+
tag = TagFilterField(model)
132135

133136

134137
#
@@ -160,7 +163,7 @@ class Meta:
160163
# Circuits
161164
#
162165

163-
class CircuitForm(BootstrapMixin, TenancyForm, CustomFieldForm):
166+
class CircuitForm(BootstrapMixin, TenancyForm, CustomFieldModelForm):
164167
comments = CommentField()
165168
tags = TagField(
166169
required=False
@@ -188,7 +191,7 @@ class Meta:
188191
}
189192

190193

191-
class CircuitCSVForm(forms.ModelForm):
194+
class CircuitCSVForm(CustomFieldModelCSVForm):
192195
provider = forms.ModelChoiceField(
193196
queryset=Provider.objects.all(),
194197
to_field_name='name',
@@ -333,6 +336,7 @@ class CircuitFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldFilterForm
333336
min_value=0,
334337
label='Commit rate (Kbps)'
335338
)
339+
tag = TagFilterField(model)
336340

337341

338342
#

0 commit comments

Comments
 (0)