Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.0.5 #1251

Merged
merged 40 commits into from
Jun 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5ff4e3b
Enhance LDAP documentation
bellwood Apr 13, 2017
bc18d24
Post-release version bump
jeremystretch May 25, 2017
834c396
Tweaked upgrade script to prefer pip3/python3 if present
jeremystretch May 26, 2017
b5a1b69
Fixes #1225: Fixed border on empty circuits table on provider view
jeremystretch May 26, 2017
d5016c7
Fixes #1235: Fix permission name for adding/editing inventory items
jeremystretch May 30, 2017
6d908d3
Fixes #1236: Truncate rack names in elevations list; add facility ID
jeremystretch May 30, 2017
6aae8ae
Closes #1237: Enabled setting limit=0 to disable pagination in API re…
jeremystretch May 31, 2017
f03a378
Fixes #1239: Fix server error when creating VLANGroup via API
jeremystretch May 31, 2017
293dbd8
Fixes #1226: Improve validation for custom field values submitted via…
jeremystretch May 31, 2017
a598f0e
Initial work on #655: CSV import headers
jeremystretch May 31, 2017
95fdb54
Fixes #1243: Catch ValueError in IP-based object filters
jeremystretch Jun 1, 2017
583830c
#1190: Allow partial string matching when searching on custom fields
jeremystretch Jun 1, 2017
4a8147f
Converted circuits import views to new scheme
jeremystretch Jun 2, 2017
7e660d4
Converted site/rack/device import views to new scheme
jeremystretch Jun 2, 2017
c826584
Converted IPAM import views to new scheme
jeremystretch Jun 2, 2017
af604ab
Converted secrets import view to new scheme
jeremystretch Jun 2, 2017
b732c24
Fixes #1244
Jun 2, 2017
1b78f54
Merge pull request #1245 from digitalocean/fix-secret-device-filter
jeremystretch Jun 3, 2017
0e863ff
Converted interface connections import view to new scheme
jeremystretch Jun 5, 2017
2520d9f
Converted console/power import views to new scheme
jeremystretch Jun 5, 2017
08c8bd3
Renamed new import view to BulkImportView
jeremystretch Jun 5, 2017
ec9d0d4
Implemented ConnectionStatusCSVField
jeremystretch Jun 5, 2017
1ddd741
Replaced old CSVDataField
jeremystretch Jun 5, 2017
1ec0927
Update ldap.md
bellwood Jun 6, 2017
d0649ba
Update ldap.md
bellwood Jun 6, 2017
d122f9f
Added dynamic examples for CSV form fields
jeremystretch Jun 6, 2017
3924063
Converted ConnectionStatusCSVField to a ChoiceField
jeremystretch Jun 7, 2017
e6c4ce5
Replaced all CSVForm ChoiceFields with CSVChoiceField
jeremystretch Jun 7, 2017
0a6e4f3
Updated CSVForm validation
jeremystretch Jun 7, 2017
293be75
Form cleanup and fixed child device import
jeremystretch Jun 7, 2017
4671829
Removed obsolete validation from InterfaceConnectionCSVForm
jeremystretch Jun 7, 2017
65b6fe5
Converted device fields to use FlexibleModelChoiceField; misc cleanup
jeremystretch Jun 7, 2017
26a13ed
Layout tweaks
jeremystretch Jun 7, 2017
e06221b
Merge branch 'import_headers' into develop
jeremystretch Jun 7, 2017
aab1fab
PEP8 fix
jeremystretch Jun 7, 2017
203895f
upgrading.md: fix typo
feuerrot Jun 8, 2017
aaad428
Merge pull request #1249 from feuerrot/patch-1
jeremystretch Jun 8, 2017
b032bc1
Merge pull request #1080 from bellwood/patch-2
jeremystretch Jun 8, 2017
13add41
Fixed formatting and typos
jeremystretch Jun 8, 2017
9736d63
Release v2.0.5
jeremystretch Jun 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/api/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,8 @@ The response will return devices 1 through 100. The URL provided in the `next` a
"results": [...]
}
```

The maximum number of objects that can be returned is limited by the [`MAX_PAGE_SIZE`](../configuration/optional-settings/#max_page_size) setting, which is 1000 by default. Setting this to `0` or `None` will remove the maximum limit. An API consumer can then pass `?limit=0` to retrieve _all_ matching objects with a single request.

!!! warning
Disabling the page size limit introduces a potential for very resource-intensive requests, since one API request can effectively retrieve an entire table from the database.
8 changes: 8 additions & 0 deletions docs/configuration/optional-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ Setting this to True will display a "maintenance mode" banner at the top of ever

---

## MAX_PAGE_SIZE

Default: 1000

An API consumer can request an arbitrary number of objects by appending the "limit" parameter to the URL (e.g. `?limit=1000`). This setting defines the maximum limit. Setting it to `0` or `None` will allow an API consumer to request all objects by specifying `?limit=0`.

---

## NETBOX_USERNAME

## NETBOX_PASSWORD
Expand Down
23 changes: 21 additions & 2 deletions docs/installation/ldap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
This guide explains how to implement LDAP authentication using an external server. User authentication will fall back to
built-in Django users in the event of a failure.
This guide explains how to implement LDAP authentication using an external server. User authentication will fall back to built-in Django users in the event of a failure.

# Requirements

Expand Down Expand Up @@ -50,6 +49,9 @@ AUTH_LDAP_BIND_PASSWORD = "demo"
LDAP_IGNORE_CERT_ERRORS = True
```

!!! info
When using Windows Server 2012 you may need to specify a port on AUTH_LDAP_SERVER_URI - 3269 for secure, 3268 for non-secure.

## User Authentication

```python
Expand All @@ -71,6 +73,9 @@ AUTH_LDAP_USER_ATTR_MAP = {
}
```

!!! info
When using Windows Server 2012 AUTH_LDAP_USER_DN_TEMPLATE should be set to None.

# User Groups for Permissions

```python
Expand Down Expand Up @@ -99,3 +104,17 @@ AUTH_LDAP_FIND_GROUP_PERMS = True
AUTH_LDAP_CACHE_GROUPS = True
AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600
```

* `is_active` - All users must be mapped to at least this group to enable authentication. Without this, users cannot log in.
* `is_staff` - Users mapped to this group are enabled for access to the administration tools; this is the equivalent of checking the "staff status" box on a manually created user. This doesn't grant any specific permissions.
* `is_superuser` - Users mapped to this group will be granted superuser status. Superusers are implicitly granted all permissions.

!!! info
It is also possible map user attributes to Django attributes:

```no-highlight
AUTH_LDAP_USER_ATTR_MAP = {
"first_name": "givenName",
"last_name": "sn"
}
```
2 changes: 1 addition & 1 deletion docs/installation/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ This script:
Your models have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

This may occur due to semantic differences in environment, and can be safely ignored. Never attempt to create new migrations unless you are inentionally modifying the database schema.
This may occur due to semantic differences in environment, and can be safely ignored. Never attempt to create new migrations unless you are intentionally modifying the database schema.

# Restart the WSGI Service

Expand Down
58 changes: 38 additions & 20 deletions netbox/circuits/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from tenancy.forms import TenancyForm
from tenancy.models import Tenant
from utilities.forms import (
APISelect, BootstrapMixin, BulkImportForm, ChainedFieldsMixin, ChainedModelChoiceField, CommentField, CSVDataField,
FilterChoiceField, Livesearch, SmallTextarea, SlugField,
APISelect, BootstrapMixin, ChainedFieldsMixin, ChainedModelChoiceField, CommentField, FilterChoiceField,
SmallTextarea, SlugField,
)

from .models import Circuit, CircuitTermination, CircuitType, Provider
Expand Down Expand Up @@ -39,15 +39,18 @@ class Meta:
}


class ProviderFromCSVForm(forms.ModelForm):
class ProviderCSVForm(forms.ModelForm):
slug = SlugField()

class Meta:
model = Provider
fields = ['name', 'slug', 'asn', 'account', 'portal_url']


class ProviderImportForm(BootstrapMixin, BulkImportForm):
csv = CSVDataField(csv_form=ProviderFromCSVForm)
fields = ['name', 'slug', 'asn', 'account', 'portal_url', 'comments']
help_texts = {
'name': 'Provider name',
'asn': '32-bit autonomous system number',
'portal_url': 'Portal URL',
'comments': 'Free-form comments',
}


class ProviderBulkEditForm(BootstrapMixin, CustomFieldBulkEditForm):
Expand Down Expand Up @@ -102,21 +105,36 @@ class Meta:
}


class CircuitFromCSVForm(forms.ModelForm):
provider = forms.ModelChoiceField(Provider.objects.all(), to_field_name='name',
error_messages={'invalid_choice': 'Provider not found.'})
type = forms.ModelChoiceField(CircuitType.objects.all(), to_field_name='name',
error_messages={'invalid_choice': 'Invalid circuit type.'})
tenant = forms.ModelChoiceField(Tenant.objects.all(), to_field_name='name', required=False,
error_messages={'invalid_choice': 'Tenant not found.'})
class CircuitCSVForm(forms.ModelForm):
provider = forms.ModelChoiceField(
queryset=Provider.objects.all(),
to_field_name='name',
help_text='Name of parent provider',
error_messages={
'invalid_choice': 'Provider not found.'
}
)
type = forms.ModelChoiceField(
queryset=CircuitType.objects.all(),
to_field_name='name',
help_text='Type of circuit',
error_messages={
'invalid_choice': 'Invalid circuit type.'
}
)
tenant = forms.ModelChoiceField(
queryset=Tenant.objects.all(),
required=False,
to_field_name='name',
help_text='Name of assigned tenant',
error_messages={
'invalid_choice': 'Tenant not found.'
}
)

class Meta:
model = Circuit
fields = ['cid', 'provider', 'type', 'tenant', 'install_date', 'commit_rate', 'description']


class CircuitImportForm(BootstrapMixin, BulkImportForm):
csv = CSVDataField(csv_form=CircuitFromCSVForm)
fields = ['cid', 'provider', 'type', 'tenant', 'install_date', 'commit_rate', 'description', 'comments']


class CircuitBulkEditForm(BootstrapMixin, CustomFieldBulkEditForm):
Expand Down
6 changes: 2 additions & 4 deletions netbox/circuits/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ class ProviderDeleteView(PermissionRequiredMixin, ObjectDeleteView):

class ProviderBulkImportView(PermissionRequiredMixin, BulkImportView):
permission_required = 'circuits.add_provider'
form = forms.ProviderImportForm
model_form = forms.ProviderCSVForm
table = tables.ProviderTable
template_name = 'circuits/provider_import.html'
default_return_url = 'circuits:provider_list'


Expand Down Expand Up @@ -163,9 +162,8 @@ class CircuitDeleteView(PermissionRequiredMixin, ObjectDeleteView):

class CircuitBulkImportView(PermissionRequiredMixin, BulkImportView):
permission_required = 'circuits.add_circuit'
form = forms.CircuitImportForm
model_form = forms.CircuitCSVForm
table = tables.CircuitTable
template_name = 'circuits/circuit_import.html'
default_return_url = 'circuits:circuit_list'


Expand Down
Loading