Skip to content

Commit

Permalink
Merge branch 'develop' into feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Mar 13, 2023
2 parents a717ddf + 520493c commit 2a9178a
Show file tree
Hide file tree
Showing 63 changed files with 500 additions and 210 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body:
attributes:
label: NetBox version
description: What version of NetBox are you currently running?
placeholder: v3.4.4
placeholder: v3.4.6
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body:
attributes:
label: NetBox version
description: What version of NetBox are you currently running?
placeholder: v3.4.4
placeholder: v3.4.6
validations:
required: true
- type: dropdown
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ NetBox provides the ideal "source of truth" to power network automation.
Available as open source software under the Apache 2.0 license, NetBox serves
as the cornerstone for network automation in thousands of organizations.

* **Physical infrasucture:** Accurately model the physical world, from global regions down to individual racks of gear. Then connect everything - network, console, and power!
* **Physical infrastructure:** Accurately model the physical world, from global regions down to individual racks of gear. Then connect everything - network, console, and power!
* **Modern IPAM:** All the standard IPAM functionality you expect, plus VRF import/export tracking, VLAN management, and overlay support.
* **Data circuits:** Confidently manage the delivery of crtical circuits from various service providers, modeled seamlessly alongside your own infrastructure.
* **Data circuits:** Confidently manage the delivery of critical circuits from various service providers, modeled seamlessly alongside your own infrastructure.
* **Power tracking:** Map the distribution of power from upstream sources to individual feeds and outlets.
* **Organization:** Manage tenant and contact assignments natively.
* **Powerful search:** Easily find anything you need using a single global search function.
Expand Down
9 changes: 9 additions & 0 deletions contrib/apache.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<VirtualHost *:80>
# CHANGE THIS TO YOUR SERVER'S NAME
ServerName netbox.example.com

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>

<VirtualHost *:443>
ProxyPreserveHost On

Expand Down
6 changes: 3 additions & 3 deletions docs/configuration/miscellaneous.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ By default, NetBox will permit users to create duplicate prefixes and IP address

---

## FILE_UPLOAD_MAX_MEMORY_SIZE
## `FILE_UPLOAD_MAX_MEMORY_SIZE`

Default: 2621440 (i.e. 2.5 MB).
Default: `2621440` (2.5 MB).

The maximum size (in bytes) that an upload will be before it gets streamed to the file system. Changing this setting can be useful for example to be able to upload files bigger than 2.5MB to custom scripts for processing.
The maximum amount (in bytes) of uploaded data that will be held in memory before being written to the filesystem. Changing this setting can be useful for example to be able to upload files bigger than 2.5MB to custom scripts for processing.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/installation/5-http-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ sudo cp /opt/netbox/contrib/apache.conf /etc/apache2/sites-available/netbox.conf
Finally, ensure that the required Apache modules are enabled, enable the `netbox` site, and reload Apache:

```no-highlight
sudo a2enmod ssl proxy proxy_http headers
sudo a2enmod ssl proxy proxy_http headers rewrite
sudo a2ensite netbox
sudo systemctl restart apache2
```
Expand Down
33 changes: 31 additions & 2 deletions docs/release-notes/version-3.4.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,54 @@
# NetBox v3.4

## v3.4.5 (FUTURE)
## v3.4.6 (2023-03-13)

### Enhancements

* [#10058](https://github.com/netbox-community/netbox/issues/10058) - Enable searching for devices/VMs by primary IP address
* [#11011](https://github.com/netbox-community/netbox/issues/11011) - Add ability to toggle visibility of virtual interfaces under device view
* [#11294](https://github.com/netbox-community/netbox/issues/11294) - Enable live preview of Markdown content
* [#11807](https://github.com/netbox-community/netbox/issues/11807) - Restore default page size when navigating between views
* [#11817](https://github.com/netbox-community/netbox/issues/11817) - Add `connected_endpoints` field to GraphQL API for cabled objects
* [#11851](https://github.com/netbox-community/netbox/issues/11851) - Include IP version in GraphQL API representations of aggregates, prefixes, and IP addresses
* [#11862](https://github.com/netbox-community/netbox/issues/11862) - Add Cisco StackWise 1T interface type
* [#11871](https://github.com/netbox-community/netbox/issues/11871) - Add IEEE 802.3az PoE type for interfaces
* [#11929](https://github.com/netbox-community/netbox/issues/11929) - Strip whitespace from CSV headers prior to validation

### Bug Fixes

* [#11470](https://github.com/netbox-community/netbox/issues/11470) - Avoid raising exception when filtering IPs by an invalid address
* [#11565](https://github.com/netbox-community/netbox/issues/11565) - Apply custom field defaults to IP address created during FHRP group creation
* [#11631](https://github.com/netbox-community/netbox/issues/11631) - Fix filtering changelog & journal entries by multiple content type IDs
* [#11758](https://github.com/netbox-community/netbox/issues/11758) - Support non-URL-safe characters in plugin menu titles
* [#11796](https://github.com/netbox-community/netbox/issues/11796) - When importing devices, restrict rack by location only if the location field is specified
* [#11819](https://github.com/netbox-community/netbox/issues/11819) - Fix filtering of cable terminations by object type
* [#11850](https://github.com/netbox-community/netbox/issues/11850) - Fix loading of CSV files containing a byte order mark
* [#11903](https://github.com/netbox-community/netbox/issues/11903) - Fix escaping of return URL values for action buttons in tables
* [#11927](https://github.com/netbox-community/netbox/issues/11927) - Correct loading of plugin resources with custom paths

---

## v3.4.5 (2023-02-21)

### Enhancements

* [#11110](https://github.com/netbox-community/netbox/issues/11110) - Add `start_address` and `end_address` filters for IP ranges
* [#11592](https://github.com/netbox-community/netbox/issues/11592) - Introduce `FILE_UPLOAD_MAX_MEMORY_SIZE` configuration parameter
* [#11685](https://github.com/netbox-community/netbox/issues/11685) - Match on containing prefixes and aggregates when querying for IP addresses using global search
* [#11787](https://github.com/netbox-community/netbox/issues/11787) - Upgrade script will automatically rebuild missing search cache

### Bug Fixes

* [#11032](https://github.com/netbox-community/netbox/issues/11032) - Fix false custom validation errors during component creation
* [#11226](https://github.com/netbox-community/netbox/issues/11226) - Ensure scripts and reports within submodules are automatically reloaded
* [#11335](https://github.com/netbox-community/netbox/issues/11335) - Avoid exception when rendering change log after uninstalling a plugin
* [#11459](https://github.com/netbox-community/netbox/issues/11459) - Enable evaluating null values in custom validation rules
* [#11473](https://github.com/netbox-community/netbox/issues/11473) - GraphQL requests specifying an invalid filter should return an empty queryset
* [#11582](https://github.com/netbox-community/netbox/issues/11582) - Ensure form validation errors are displayed when adding virtual chassis members
* [#11601](https://github.com/netbox-community/netbox/issues/11601) - Fix partial matching of start/end addresses for IP range search
* [#11683](https://github.com/netbox-community/netbox/issues/11683) - Fix CSV header attribute detection when auto-detecting import format
* [#11711](https://github.com/netbox-community/netbox/issues/11711) - Fix CSV import for multiple-object custom fields
* [#11723](https://github.com/netbox-community/netbox/issues/11723) - Circuit terminations should link to their associated circuits (rather than site or provider network)
* [#11775](https://github.com/netbox-community/netbox/issues/11775) - Skip checking for old search cache records when creating a new object
* [#11786](https://github.com/netbox-community/netbox/issues/11786) - List only applicable object types in form widget when filtering custom fields

---
Expand Down
3 changes: 0 additions & 3 deletions netbox/circuits/forms/bulk_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class ProviderBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label=_('Comments')
)

Expand Down Expand Up @@ -62,7 +61,6 @@ class ProviderNetworkBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label=_('Comments')
)

Expand Down Expand Up @@ -123,7 +121,6 @@ class CircuitBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label=_('Comments')
)

Expand Down
4 changes: 4 additions & 0 deletions netbox/dcim/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ class InterfaceTypeChoices(ChoiceSet):
TYPE_STACKWISE160 = 'cisco-stackwise-160'
TYPE_STACKWISE320 = 'cisco-stackwise-320'
TYPE_STACKWISE480 = 'cisco-stackwise-480'
TYPE_STACKWISE1T = 'cisco-stackwise-1t'
TYPE_JUNIPER_VCP = 'juniper-vcp'
TYPE_SUMMITSTACK = 'extreme-summitstack'
TYPE_SUMMITSTACK128 = 'extreme-summitstack-128'
Expand Down Expand Up @@ -1078,6 +1079,7 @@ class InterfaceTypeChoices(ChoiceSet):
(TYPE_STACKWISE160, 'Cisco StackWise-160'),
(TYPE_STACKWISE320, 'Cisco StackWise-320'),
(TYPE_STACKWISE480, 'Cisco StackWise-480'),
(TYPE_STACKWISE1T, 'Cisco StackWise-1T'),
(TYPE_JUNIPER_VCP, 'Juniper VCP'),
(TYPE_SUMMITSTACK, 'Extreme SummitStack'),
(TYPE_SUMMITSTACK128, 'Extreme SummitStack-128'),
Expand Down Expand Up @@ -1135,6 +1137,7 @@ class InterfacePoETypeChoices(ChoiceSet):

TYPE_1_8023AF = 'type1-ieee802.3af'
TYPE_2_8023AT = 'type2-ieee802.3at'
TYPE_2_8023AZ = 'type2-ieee802.3az'
TYPE_3_8023BT = 'type3-ieee802.3bt'
TYPE_4_8023BT = 'type4-ieee802.3bt'

Expand All @@ -1149,6 +1152,7 @@ class InterfacePoETypeChoices(ChoiceSet):
(
(TYPE_1_8023AF, '802.3af (Type 1)'),
(TYPE_2_8023AT, '802.3at (Type 2)'),
(TYPE_2_8023AZ, '802.3az (Type 2)'),
(TYPE_3_8023BT, '802.3bt (Type 3)'),
(TYPE_4_8023BT, '802.3bt (Type 4)'),
)
Expand Down
5 changes: 4 additions & 1 deletion netbox/dcim/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,9 @@ def search(self, queryset, name, value):
Q(serial__icontains=value.strip()) |
Q(inventoryitems__serial__icontains=value.strip()) |
Q(asset_tag__icontains=value.strip()) |
Q(comments__icontains=value)
Q(comments__icontains=value) |
Q(primary_ip4__address__startswith=value) |
Q(primary_ip6__address__startswith=value)
).distinct()

def _has_primary_ip(self, queryset, name, value):
Expand Down Expand Up @@ -1748,6 +1750,7 @@ def filter_by_termination(self, queryset, name, value):


class CableTerminationFilterSet(BaseFilterSet):
termination_type = ContentTypeFilter()

class Meta:
model = CableTermination
Expand Down
11 changes: 0 additions & 11 deletions netbox/dcim/forms/bulk_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ class SiteBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label='Comments'
)

Expand Down Expand Up @@ -302,7 +301,6 @@ class RackBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label='Comments'
)

Expand Down Expand Up @@ -337,7 +335,6 @@ class RackReservationBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label='Comments'
)

Expand Down Expand Up @@ -400,7 +397,6 @@ class DeviceTypeBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label='Comments'
)

Expand Down Expand Up @@ -434,7 +430,6 @@ class ModuleTypeBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label='Comments'
)

Expand Down Expand Up @@ -549,7 +544,6 @@ class DeviceBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label='Comments'
)

Expand Down Expand Up @@ -592,7 +586,6 @@ class ModuleBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label='Comments'
)

Expand Down Expand Up @@ -639,7 +632,6 @@ class CableBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label='Comments'
)

Expand All @@ -663,7 +655,6 @@ class VirtualChassisBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label='Comments'
)

Expand Down Expand Up @@ -709,7 +700,6 @@ class PowerPanelBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label='Comments'
)

Expand Down Expand Up @@ -767,7 +757,6 @@ class PowerFeedBulkEditForm(NetBoxModelBulkEditForm):
required=False
)
comments = CommentField(
widget=forms.Textarea,
label=_('Comments')
)

Expand Down
7 changes: 5 additions & 2 deletions netbox/dcim/forms/bulk_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,14 @@ def __init__(self, data=None, *args, **kwargs):
self.fields['location'].queryset = self.fields['location'].queryset.filter(**params)
self.fields['parent'].queryset = self.fields['parent'].queryset.filter(**params)

# Limit rack queryset by assigned site and group
# Limit rack queryset by assigned site and location
params = {
f"site__{self.fields['site'].to_field_name}": data.get('site'),
f"location__{self.fields['location'].to_field_name}": data.get('location'),
}
if 'location' in data:
params.update({
f"location__{self.fields['location'].to_field_name}": data.get('location'),
})
self.fields['rack'].queryset = self.fields['rack'].queryset.filter(**params)

# Limit device bay queryset by parent device
Expand Down
8 changes: 8 additions & 0 deletions netbox/dcim/graphql/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ def resolve_cable_end(self, info):

def resolve_link_peers(self, info):
return self.link_peers


class PathEndpointMixin:
connected_endpoints = graphene.List('dcim.graphql.gfk_mixins.LinkPeerType')

def resolve_connected_endpoints(self, info):
# Handle empty values
return self.connected_endpoints or None
14 changes: 7 additions & 7 deletions netbox/dcim/graphql/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ipam.graphql.mixins import IPAddressesMixin, VLANGroupsMixin
from netbox.graphql.scalars import BigInt
from netbox.graphql.types import BaseObjectType, OrganizationalObjectType, NetBoxObjectType
from .mixins import CabledObjectMixin
from .mixins import CabledObjectMixin, PathEndpointMixin

__all__ = (
'CableType',
Expand Down Expand Up @@ -117,7 +117,7 @@ class Meta:
filterset_class = filtersets.CableTerminationFilterSet


class ConsolePortType(ComponentObjectType, CabledObjectMixin):
class ConsolePortType(ComponentObjectType, CabledObjectMixin, PathEndpointMixin):

class Meta:
model = models.ConsolePort
Expand All @@ -139,7 +139,7 @@ def resolve_type(self, info):
return self.type or None


class ConsoleServerPortType(ComponentObjectType, CabledObjectMixin):
class ConsoleServerPortType(ComponentObjectType, CabledObjectMixin, PathEndpointMixin):

class Meta:
model = models.ConsoleServerPort
Expand Down Expand Up @@ -241,7 +241,7 @@ class Meta:
filterset_class = filtersets.FrontPortTemplateFilterSet


class InterfaceType(IPAddressesMixin, ComponentObjectType, CabledObjectMixin):
class InterfaceType(IPAddressesMixin, ComponentObjectType, CabledObjectMixin, PathEndpointMixin):

class Meta:
model = models.Interface
Expand Down Expand Up @@ -354,15 +354,15 @@ class Meta:
filterset_class = filtersets.PlatformFilterSet


class PowerFeedType(NetBoxObjectType, CabledObjectMixin):
class PowerFeedType(NetBoxObjectType, CabledObjectMixin, PathEndpointMixin):

class Meta:
model = models.PowerFeed
exclude = ('_path',)
filterset_class = filtersets.PowerFeedFilterSet


class PowerOutletType(ComponentObjectType, CabledObjectMixin):
class PowerOutletType(ComponentObjectType, CabledObjectMixin, PathEndpointMixin):

class Meta:
model = models.PowerOutlet
Expand Down Expand Up @@ -398,7 +398,7 @@ class Meta:
filterset_class = filtersets.PowerPanelFilterSet


class PowerPortType(ComponentObjectType, CabledObjectMixin):
class PowerPortType(ComponentObjectType, CabledObjectMixin, PathEndpointMixin):

class Meta:
model = models.PowerPort
Expand Down
1 change: 1 addition & 0 deletions netbox/dcim/tables/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ class Meta(DeviceComponentTable.Meta):
'class': get_interface_row_class,
'data-name': lambda record: record.name,
'data-enabled': get_interface_state_attribute,
'data-type': lambda record: record.type,
}


Expand Down
Loading

0 comments on commit 2a9178a

Please sign in to comment.