Skip to content

Commit

Permalink
Merge pull request netbox-community#3938 from netbox-community/develop
Browse files Browse the repository at this point in the history
Release v2.7.0
  • Loading branch information
jeremystretch authored Jan 16, 2020
2 parents 9467790 + 0f1518e commit ea91e09
Show file tree
Hide file tree
Showing 1,030 changed files with 94,683 additions and 6,993 deletions.
2 changes: 1 addition & 1 deletion .github/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ daysUntilLock: 90

# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: 2020-01-01
skipCreatedBefore: false

# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: []
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
fabfile.py
*.swp
gunicorn_config.py
gunicorn.py
netbox.log
netbox.pid
.DS_Store
.vscode
.coverage
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ python:
install:
- pip install -r requirements.txt
- pip install pycodestyle
- pip install coverage
before_script:
- psql --version
- psql -U postgres -c 'SELECT version();'
Expand Down
26 changes: 19 additions & 7 deletions base_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ django-filter
# https://github.com/django-mptt/django-mptt
django-mptt

# Django integration for RQ (Reqis queuing)
# https://github.com/rq/django-rq
django-rq

# Prometheus metrics library for Django
# https://github.com/korfuri/django-prometheus
django-prometheus

# Django integration for RQ (Reqis queuing)
# https://github.com/rq/django-rq
django-rq

# Abstraction models for rendering and paginating HTML tables
# https://github.com/jieter/django-tables2
django-tables2
Expand All @@ -54,9 +54,9 @@ djangorestframework
# https://github.com/axnsan12/drf-yasg
drf-yasg[validation]

# Python interface to the graphviz graph rendering utility
# https://github.com/xflr6/graphviz
graphviz
# Platform-agnostic template rendering engine
# https://github.com/pallets/jinja
Jinja2

# Simple markup language for rendering HTML
# https://github.com/Python-Markdown/markdown
Expand All @@ -82,3 +82,15 @@ py-gfm
# Extensive cryptographic library (fork of pycrypto)
# https://github.com/Legrandin/pycryptodome
pycryptodome

# YAML rendering library
# https://github.com/yaml/pyyaml
PyYAML

# In-memory key/value store used for caching and queuing
# https://github.com/andymccurdy/redis-py
redis

# SVG image rendering (used for rack elevations)
# https://github.com/mozman/svgwrite
svgwrite
16 changes: 16 additions & 0 deletions contrib/gunicorn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# The IP address (typically localhost) and port that the Netbox WSGI process should listen on
bind = '127.0.0.1:8001'

# Number of gunicorn workers to spawn. This should typically be 2n+1, where
# n is the number of CPU cores present.
workers = 5

# Number of threads per worker process
threads = 3

# Timeout (in seconds) for a request to complete
timeout = 120

# The maximum number of requests a worker can handle before being respawned
max_requests = 5000
max_requests_jitter = 500
22 changes: 22 additions & 0 deletions contrib/netbox-rq.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[Unit]
Description=NetBox Request Queue Worker
Documentation=https://netbox.readthedocs.io/en/stable/
After=network-online.target
Wants=network-online.target

[Service]
Type=simple

User=www-data
Group=www-data

WorkingDirectory=/opt/netbox

ExecStart=/usr/bin/python3 /opt/netbox/netbox/manage.py rqworker

Restart=on-failure
RestartSec=30
PrivateTmp=true

[Install]
WantedBy=multi-user.target
22 changes: 22 additions & 0 deletions contrib/netbox.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[Unit]
Description=NetBox WSGI Service
Documentation=https://netbox.readthedocs.io/en/stable/
After=network-online.target
Wants=network-online.target

[Service]
Type=simple

User=www-data
Group=www-data
PIDFile=/var/tmp/netbox.pid
WorkingDirectory=/opt/netbox

ExecStart=/usr/local/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netbox.wsgi

Restart=on-failure
RestartSec=30
PrivateTmp=true

[Install]
WantedBy=multi-user.target
5 changes: 5 additions & 0 deletions docs/additional-features/graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ NetBox does not have the ability to generate graphs natively, but this feature a
* **Source URL:** The source of the image to be embedded. The associated object will be available as a template variable named `obj`.
* **Link URL (optional):** A URL to which the graph will be linked. The associated object will be available as a template variable named `obj`.

Graph names and links can be rendered using the Django or Jinja2 template languages.

!!! warning
Support for the Django templating language will be removed in NetBox v2.8. Jinja2 is recommended.

## Examples

You only need to define one graph object for each graph you want to include when viewing an object. For example, if you want to include a graph of traffic through an interface over the past five minutes, your graph source might looks like this:
Expand Down
17 changes: 0 additions & 17 deletions docs/additional-features/topology-maps.md

This file was deleted.

24 changes: 18 additions & 6 deletions docs/configuration/optional-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,19 +293,31 @@ Session data is used to track authenticated users when they access NetBox. By de

---

## TIME_ZONE
## STORAGE_BACKEND

Default: UTC
Default: None (local storage)

The time zone NetBox will use when dealing with dates and times. It is recommended to use UTC time unless you have a specific need to use a local time zone. [List of available time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
The backend storage engine for handling uploaded files (e.g. image attachments). NetBox supports integration with the [`django-storages`](https://django-storages.readthedocs.io/en/stable/) package, which provides backends for several popular file storage services. If not configured, local filesystem storage will be used.

The configuration parameters for the specified storage backend are defined under the `STORAGE_CONFIG` setting.

---

## WEBHOOKS_ENABLED
## STORAGE_CONFIG

Default: False
Default: Empty

A dictionary of configuration parameters for the storage backend configured as `STORAGE_BACKEND`. The specific parameters to be used here are specific to each backend; see the [`django-storages` documentation](https://django-storages.readthedocs.io/en/stable/) for more detail.

If `STORAGE_BACKEND` is not defined, this setting will be ignored.

Enable this option to run the webhook backend. See the docs section on the webhook backend [here](../../additional-features/webhooks/) for more information on setup and use.
---

## TIME_ZONE

Default: UTC

The time zone NetBox will use when dealing with dates and times. It is recommended to use UTC time unless you have a specific need to use a local time zone. [List of available time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

---

Expand Down
44 changes: 26 additions & 18 deletions docs/configuration/required-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ NetBox requires access to a PostgreSQL database service to store data. This serv

Example:

```
```python
DATABASE = {
'NAME': 'netbox', # Database name
'USER': 'netbox', # PostgreSQL username
Expand All @@ -42,40 +42,48 @@ DATABASE = {

[Redis](https://redis.io/) is an in-memory data store similar to memcached. While Redis has been an optional component of
NetBox since the introduction of webhooks in version 2.4, it is required starting in 2.6 to support NetBox's caching
functionality (as well as other planned features).
functionality (as well as other planned features). In 2.7, the connection settings were broken down into two sections for
webhooks and caching, allowing the user to connect to different Redis instances/databases per feature.

Redis is configured using a configuration setting similar to `DATABASE`:
Redis is configured using a configuration setting similar to `DATABASE` and these settings are the same for both of the `webhooks` and `caching` subsections:

* `HOST` - Name or IP address of the Redis server (use `localhost` if running locally)
* `PORT` - TCP port of the Redis service; leave blank for default port (6379)
* `PASSWORD` - Redis password (if set)
* `DATABASE` - Numeric database ID for webhooks
* `CACHE_DATABASE` - Numeric database ID for caching
* `DATABASE` - Numeric database ID
* `DEFAULT_TIMEOUT` - Connection timeout in seconds
* `SSL` - Use SSL connection to Redis

Example:

```
```python
REDIS = {
'HOST': 'localhost',
'PORT': 6379,
'PASSWORD': '',
'DATABASE': 0,
'CACHE_DATABASE': 1,
'DEFAULT_TIMEOUT': 300,
'SSL': False,
'webhooks': {
'HOST': 'redis.example.com',
'PORT': 1234,
'PASSWORD': 'foobar',
'DATABASE': 0,
'DEFAULT_TIMEOUT': 300,
'SSL': False,
},
'caching': {
'HOST': 'localhost',
'PORT': 6379,
'PASSWORD': '',
'DATABASE': 1,
'DEFAULT_TIMEOUT': 300,
'SSL': False,
}
}
```

!!! note:
If you were using these settings in a prior release with webhooks, the `DATABASE` setting remains the same but
an additional `CACHE_DATABASE` setting has been added with a default value of 1 to support the caching backend. The
`DATABASE` setting will be renamed in a future release of NetBox to better relay the meaning of the setting.
If you are upgrading from a version prior to v2.7, please note that the Redis connection configuration settings have
changed. Manual modification to bring the `REDIS` section inline with the above specification is necessary

!!! warning:
It is highly recommended to keep the webhook and cache databases seperate. Using the same database number for both may result in webhook
processing data being lost in cache flushing events.
It is highly recommended to keep the webhook and cache databases separate. Using the same database number on the
same Redis instance for both may result in webhook processing data being lost during cache flushing events.

---

Expand Down
2 changes: 2 additions & 0 deletions docs/core-functionality/sites-and-racks.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Racks can be arranged into groups. As with sites, how you choose to designate ra

Each rack group must be assigned to a parent site. Hierarchical recursion of rack groups is not currently supported.

The name and facility ID of each rack within a group must be unique. (Racks not assigned to the same rack group may have identical names and/or facility IDs.)

## Rack Roles

Each rack can optionally be assigned a functional role. For example, you might designate a rack for compute or storage resources, or to house colocated customer devices. Rack roles are fully customizable.
Expand Down
4 changes: 4 additions & 0 deletions docs/development/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Update the following static libraries to their most recent stable release:
* jQuery
* jQuery UI

## Squash Schema Migrations

Database schema migrations should be squashed for each new minor release. See the [squashing guide](squashing-migrations.md) for the detailed process.

## Create a new Release Notes Page

Create a file at `/docs/release-notes/X.Y.md` to establish the release notes for the new release. Add the file to the table of contents within `mkdocs.yml`.
Expand Down
Loading

0 comments on commit ea91e09

Please sign in to comment.