Skip to content

Commit 15ed575

Browse files
Merge pull request #6830 from netbox-community/develop
Release v2.11.10
2 parents 8f6b71d + eae4502 commit 15ed575

File tree

39 files changed

+541
-207
lines changed

39 files changed

+541
-207
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ 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.9
20+
placeholder: v2.11.10
2121
validations:
2222
required: true
2323
- type: dropdown

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 1 deletion
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.9
17+
placeholder: v2.11.10
1818
validations:
1919
required: true
2020
- type: dropdown

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
*.swp
33
/netbox/netbox/configuration.py
44
/netbox/netbox/ldap_config.py
5+
/netbox/project-static/.cache
6+
/netbox/project-static/node_modules
57
/netbox/reports/*
68
!/netbox/reports/__init__.py
79
/netbox/scripts/*

CONTRIBUTING.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,20 @@ accumulating a large backlog of work.
160160
The core maintainers group has chosen to make use of GitHub's [Stale bot](https://github.com/apps/stale)
161161
to aid in issue management.
162162

163-
* Issues will be marked as stale after 45 days of no activity.
164-
* Then after 15 more days of inactivity, the issue will be closed.
163+
* Issues will be marked as stale after 60 days of no activity.
164+
* If the stable label is not removed in the following 30 days, the issue will
165+
be closed automatically.
165166
* Any issue bearing one of the following labels will be exempt from all Stale
166167
bot actions:
167168
* `status: accepted`
168169
* `status: blocked`
169170
* `status: needs milestone`
170171

171-
It is natural that some new issues get more attention than others. Stale bot
172-
helps bring renewed attention to potentially valuable issues that may have been
173-
overlooked.
172+
It is natural that some new issues get more attention than others. The stale
173+
bot helps bring renewed attention to potentially valuable issues that may have
174+
been overlooked. **Do not** comment on an issue that has been marked stale in
175+
an effort to circumvent the bot: Doing so will not remove the stale label.
176+
(Stale labels can be removed only by maintainers.)
174177

175178
## Maintainer Guidance
176179

contrib/nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
server {
2-
listen 443 ssl;
2+
listen [::]:443 ssl ipv6only=off;
33

44
# CHANGE THIS TO YOUR SERVER'S NAME
55
server_name netbox.example.com;
@@ -23,7 +23,7 @@ server {
2323

2424
server {
2525
# Redirect HTTP traffic to HTTPS
26-
listen 80;
26+
listen [::]:80 ipv6only=off;
2727
server_name _;
2828
return 301 https://$host$request_uri;
2929
}

docs/additional-features/caching.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Caching
22

3-
NetBox supports database query caching using [django-cacheops](https://github.com/Suor/django-cacheops) and Redis. When a query is made, the results are cached in Redis for a short period of time, as defined by the [CACHE_TIMEOUT](../configuration/optional-settings.md#cache_timeout) parameter (15 minutes by default). Within that time, all recurrences of that specific query will return the pre-fetched results from the cache.
3+
NetBox supports database query caching using [django-cacheops](https://github.com/Suor/django-cacheops) and Redis. When a query is made, the results are cached in Redis for a short period of time, as defined by the [CACHE_TIMEOUT](../configuration/optional-settings.md#cache_timeout) parameter. Within that time, all recurrences of that specific query will return the pre-fetched results from the cache.
4+
5+
!!! warning
6+
In NetBox v2.11.10 and later queryset caching is disabled by default, and must be configured.
47

58
If a change is made to any of the objects returned by the query within that time, or if the timeout expires, the results are automatically invalidated and the next request for those results will be sent to the database.
69

docs/configuration/optional-settings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ BASE_PATH = 'netbox/'
5454

5555
## CACHE_TIMEOUT
5656

57-
Default: 900
57+
Default: 0 (disabled)
5858

59-
The number of seconds that cache entries will be retained before expiring.
59+
The number of seconds that cached database queries will be retained before expiring.
6060

6161
---
6262

docs/development/adding-models.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Adding Models
2+
3+
## 1. Define the model class
4+
5+
Models within each app are stored in either `models.py` or within a submodule under the `models/` directory. When creating a model, be sure to subclass the [appropriate base model](models.md) from `netbox.models`. This will typically be PrimaryModel or OrganizationalModel. Remember to add the model class to the `__all__` listing for the module.
6+
7+
Each model should define, at a minimum:
8+
9+
* A `__str__()` method returning a user-friendly string representation of the instance
10+
* A `get_absolute_url()` method returning an instance's direct URL (using `reverse()`)
11+
* A `Meta` class specifying a deterministic ordering (if ordered by fields other than the primary ID)
12+
13+
## 2. Define field choices
14+
15+
If the model has one or more fields with static choices, define those choices in `choices.py` by subclassing `utilities.choices.ChoiceSet`.
16+
17+
## 3. Generate database migrations
18+
19+
Once your model definition is complete, generate database migrations by running `manage.py -n $NAME --no-header`. Always specify a short unique name when generating migrations.
20+
21+
!!! info
22+
Set `DEVELOPER = True` in your NetBox configuration to enable the creation of new migrations.
23+
24+
## 4. Add all standard views
25+
26+
Most models will need view classes created in `views.py` to serve the following operations:
27+
28+
* List view
29+
* Detail view
30+
* Edit view
31+
* Delete view
32+
* Bulk import
33+
* Bulk edit
34+
* Bulk delete
35+
36+
## 5. Add URL paths
37+
38+
Add the relevant URL path for each view created in the previous step to `urls.py`.
39+
40+
## 6. Create the FilterSet
41+
42+
Each model should have a corresponding FilterSet class defined. This is used to filter UI and API queries. Subclass the appropriate class from `netbox.filtersets` that matches the model's parent class.
43+
44+
Every model FilterSet should define a `q` filter to support general search queries.
45+
46+
## 7. Create the table
47+
48+
Create a table class for the model in `tables.py` by subclassing `utilities.tables.BaseTable`. Under the table's `Meta` class, be sure to list both the fields and default columns.
49+
50+
## 8. Create the object template
51+
52+
Create the HTML template for the object view. (The other views each typically employ a generic template.) This template should extend `generic/object.html`.
53+
54+
## 9. Add the model to the navigation menu
55+
56+
For NetBox releases prior to v3.0, add the relevant link(s) to the navigation menu template. For later releases, add the relevant items in `netbox/netbox/navigation_menu.py`.
57+
58+
## 10. REST API components
59+
60+
Create the following for each model:
61+
62+
* Detailed (full) model serializer in `api/serializers.py`
63+
* Nested serializer in `api/nested_serializers.py`
64+
* API view in `api/views.py`
65+
* Endpoint route in `api/urls.py`
66+
67+
## 11. GraphQL API components (v3.0+)
68+
69+
Create a Graphene object type for the model in `graphql/types.py` by subclassing the appropriate class from `netbox.graphql.types`.
70+
71+
Also extend the schema class defined in `graphql/schema.py` with the individual object and object list fields per the established convention.
72+
73+
## 12. Add tests
74+
75+
Add tests for the following:
76+
77+
* UI views
78+
* API views
79+
* Filter sets
80+
81+
## 13. Documentation
82+
83+
Create a new documentation page for the model in `docs/models/<app_label>/<model_name>.md`. Include this file under the "features" documentation where appropriate.
84+
85+
Also add your model to the index in `docs/development/models.md`.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![NetBox](netbox_logo.svg "NetBox logo")
1+
![NetBox](netbox_logo.svg "NetBox logo"){style="height: 100px; margin-bottom: 3em"}
22

33
# What is NetBox?
44

docs/installation/3-netbox.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ Next, clone the **master** branch of the NetBox GitHub repository into the curre
7373

7474
```no-highlight
7575
$ sudo git clone -b master https://github.com/netbox-community/netbox.git .
76+
```
77+
78+
The screen below should be the result:
79+
80+
```
7681
Cloning into '.'...
7782
remote: Counting objects: 1994, done.
7883
remote: Compressing objects: 100% (150/150), done.
@@ -262,6 +267,13 @@ Starting development server at http://0.0.0.0:8000/
262267
Quit the server with CONTROL-C.
263268
```
264269

270+
!!! note
271+
By default RHEL based distros will likely block your testing attempts with firewalld. The development server port can be opened with `firewall-cmd` (add `--permanent` if you want the rule to survive server restarts):
272+
273+
```no-highlight
274+
firewall-cmd --zone=public --add-port=8000/tcp
275+
```
276+
265277
Next, connect to the name or IP of the server (as defined in `ALLOWED_HOSTS`) on port 8000; for example, <http://127.0.0.1:8000/>. You should be greeted with the NetBox home page.
266278

267279
!!! danger

0 commit comments

Comments
 (0)