Skip to content

Commit aa4d630

Browse files
authored
Merge pull request #371 from netbox-community/develop
Version 0.27.0
2 parents a51ad36 + 4e8588a commit aa4d630

33 files changed

+224
-288
lines changed

.github/workflows/push.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
- ./build.sh develop
2020
docker_from:
2121
- '' # use the default of the build script
22-
- python:3.8-alpine
23-
- python:3.9-alpine
22+
# - python:3.10-rc-alpine # disable until dependencies work
2423
fail-fast: false
2524
runs-on: ubuntu-latest
2625
name: Builds new Netbox Docker Images

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,34 @@ jobs:
5050
name: Logout of the Docker Registry
5151
run: docker logout "${DOCKER_REGISTRY}"
5252
if: steps.docker-build.outputs.skipped != 'true'
53+
54+
# Quay.io
55+
- id: quayio-docker-build
56+
name: Build the image with '${{ matrix.build_cmd }}'
57+
run: ${{ matrix.build_cmd }}
58+
env:
59+
DOCKER_REGISTRY: quay.io
60+
GH_ACTION: enable
61+
- id: quayio-registry-login
62+
name: Login to the Quay.io Registry
63+
run: |
64+
echo "::add-mask::$QUAYIO_USERNAME"
65+
echo "::add-mask::$QUAYIO_PASSWORD"
66+
docker login -u "$QUAYIO_USERNAME" --password "${QUAYIO_PASSWORD}" "${DOCKER_REGISTRY}"
67+
env:
68+
DOCKER_REGISTRY: quay.io
69+
QUAYIO_USERNAME: ${{ secrets.quayio_username }}
70+
QUAYIO_PASSWORD: ${{ secrets.quayio_password }}
71+
if: steps.docker-build.outputs.skipped != 'true'
72+
- id: quayio-registry-push
73+
name: Push the image
74+
run: ${{ matrix.build_cmd }} --push-only
75+
env:
76+
DOCKER_REGISTRY: quay.io
77+
if: steps.docker-build.outputs.skipped != 'true'
78+
- id: quayio-registry-logout
79+
name: Logout of the Docker Registry
80+
run: docker logout "${DOCKER_REGISTRY}"
81+
env:
82+
DOCKER_REGISTRY: quay.io
83+
if: steps.docker-build.outputs.skipped != 'true'

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,20 @@
1010
[![GitHub license](https://img.shields.io/github/license/netbox-community/netbox-docker)][netbox-docker-license]
1111

1212
[The Github repository](netbox-docker-github) houses the components needed to build Netbox as a Docker container.
13-
Images are built using this code and are released to [Docker Hub][netbox-dockerhub] once a day.
13+
Images are built using this code and are released to [Docker Hub][netbox-dockerhub] and [Quay.io][netbox-quayio] once a day.
1414

1515
Do you have any questions?
1616
Before opening an issue on Github, please join the [Network To Code][ntc-slack] Slack and ask for help in our [`#netbox-docker`][netbox-docker-slack] channel.
1717

1818
[github-stargazers]: https://github.com/netbox-community/netbox-docker/stargazers
1919
[github-release]: https://github.com/netbox-community/netbox-docker/releases
2020
[netbox-docker-microbadger]: https://microbadger.com/images/netboxcommunity/netbox
21-
[netbox-dockerhub]: https://hub.docker.com/r/netboxcommunity/netbox/tags/
21+
[netbox-dockerhub]: https://hub.docker.com/r/netboxcommunity/netbox/
2222
[netbox-docker-github]: https://github.com/netbox-community/netbox-docker/
2323
[ntc-slack]: http://slack.networktocode.com/
2424
[netbox-docker-slack]: https://slack.com/app_redirect?channel=netbox-docker&team=T09LQ7E9E
2525
[netbox-docker-license]: https://github.com/netbox-community/netbox-docker/blob/release/LICENSE
26+
[netbox-quayio]: https://quay.io/repository/netboxcommunity/netbox
2627

2728
## Docker Tags
2829

@@ -85,11 +86,13 @@ It covers advanced topics such as using files for secrets, deployment to Kuberne
8586

8687
## Getting Help
8788

88-
Please join [our Slack channel `#netbox-docker`][netbox-docker-slack] on the [Network To Code Slack][ntc-slack].
89-
It's free to use and there are almost always people online that can help.
89+
Feel free to ask questions in our [Github Community][netbox-community] or join [our Slack channel `#netbox-docker`][netbox-docker-slack] on the [Network To Code Slack][ntc-slack],
90+
which is free to use and where there are almost always people online that can help you in the Slack channel.
9091

9192
If you need help with using Netbox or developing for it or against it's API you may find the `#netbox` channel on the same Slack instance very helpful.
9293

94+
[netbox-community]: https://github.com/netbox-community/netbox-docker/discussions
95+
9396
## Dependencies
9497

9598
This project relies only on *Docker* and *docker-compose* meeting these requirements:
@@ -104,7 +107,7 @@ To check the version installed on your system run `docker --version` and `docker
104107
The `docker-compose.yml` file is prepared to run a specific version of Netbox, instead of `latest`.
105108
To use this feature, set and export the environment-variable `VERSION` before launching `docker-compose`, as shown below.
106109
`VERSION` may be set to the name of
107-
[any tag of the `netboxcommunity/netbox` Docker image on Docker Hub][netbox-dockerhub].
110+
[any tag of the `netboxcommunity/netbox` Docker image on Docker Hub][netbox-dockerhub] or [Quay.io][netbox-quayio].
108111

109112
```bash
110113
export VERSION=v2.7.1

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.26.2
1+
0.27.0

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if [ "${1}x" == "x" ] || [ "${1}" == "--help" ] || [ "${1}" == "-h" ]; then
4949
echo " DOCKERFILE The name of Dockerfile to use."
5050
echo " Default: Dockerfile"
5151
echo " DOCKER_FROM The base image to use."
52-
echo " Default: 'python:3.8-alpine'"
52+
echo " Default: 'python:3.9-alpine'"
5353
echo " DOCKER_TARGET A specific target to build."
5454
echo " It's currently not possible to pass multiple targets."
5555
echo " Default: main ldap"
@@ -157,7 +157,7 @@ fi
157157
# Determining the value for DOCKER_FROM
158158
###
159159
if [ -z "$DOCKER_FROM" ]; then
160-
DOCKER_FROM="python:3.8-alpine"
160+
DOCKER_FROM="python:3.9-alpine"
161161
fi
162162

163163
###

configuration/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _read_secret(secret_name, default = None):
157157

158158
# The length of time (in seconds) for which a user will remain logged into the web UI before being prompted to
159159
# re-authenticate. (Default: 1209600 [14 days])
160-
LOGIN_TIMEOUT = environ.get('LOGIN_TIMEOUT', None)
160+
LOGIN_TIMEOUT = int(environ.get('LOGIN_TIMEOUT', 1209600))
161161

162162
# Setting this to True will display a "maintenance mode" banner at the top of every page.
163163
MAINTENANCE_MODE = environ.get('MAINTENANCE_MODE', 'False').lower() == 'true'
@@ -233,7 +233,7 @@ def _read_secret(secret_name, default = None):
233233
# By default, NetBox will store session data in the database. Alternatively, a file path can be specified here to use
234234
# local file storage instead. (This can be useful for enabling authentication on a standby instance with read-only
235235
# database access.) Note that the user as which NetBox runs must have read and write permissions to this path.
236-
SESSION_FILE_PATH = environ.get('REPORTS_ROOT', None)
236+
SESSION_FILE_PATH = environ.get('SESSIONS_ROOT', None)
237237

238238
# Time zone (default: UTC)
239239
TIME_ZONE = environ.get('TIME_ZONE', 'UTC')

configuration/ldap/ldap_config.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,17 @@ def _import_group_type(group_type_name):
6060
AUTH_LDAP_GROUP_TYPE = _import_group_type(environ.get('AUTH_LDAP_GROUP_TYPE', 'GroupOfNamesType'))
6161

6262
# Define a group required to login.
63-
AUTH_LDAP_REQUIRE_GROUP = environ.get('AUTH_LDAP_REQUIRE_GROUP_DN', '')
63+
AUTH_LDAP_REQUIRE_GROUP = environ.get('AUTH_LDAP_REQUIRE_GROUP_DN')
6464

6565
# Define special user types using groups. Exercise great caution when assigning superuser status.
66-
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
67-
"is_active": environ.get('AUTH_LDAP_REQUIRE_GROUP_DN', ''),
68-
"is_staff": environ.get('AUTH_LDAP_IS_ADMIN_DN', ''),
69-
"is_superuser": environ.get('AUTH_LDAP_IS_SUPERUSER_DN', '')
70-
}
66+
AUTH_LDAP_USER_FLAGS_BY_GROUP = {}
67+
68+
if AUTH_LDAP_REQUIRE_GROUP is not None:
69+
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
70+
"is_active": environ.get('AUTH_LDAP_REQUIRE_GROUP_DN', ''),
71+
"is_staff": environ.get('AUTH_LDAP_IS_ADMIN_DN', ''),
72+
"is_superuser": environ.get('AUTH_LDAP_IS_SUPERUSER_DN', '')
73+
}
7174

7275
# For more granular permissions, we can map LDAP groups to Django groups.
7376
AUTH_LDAP_FIND_GROUP_PERMS = environ.get('AUTH_LDAP_FIND_GROUP_PERMS', 'True').lower() == 'true'

initializers/custom_fields.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,16 @@
4343
# required: false
4444
# filter_logic: exact
4545
# weight: 30
46+
# default: First Item
4647
# on_objects:
4748
# - dcim.models.Device
4849
# choices:
49-
# - value: First Item
50-
# weight: 10
51-
# - value: Second Item
52-
# weight: 20
53-
# - value: Third Item
54-
# weight: 30
55-
# - value: Fifth Item
56-
# weight: 50
57-
# - value: Fourth Item
58-
# weight: 40
59-
# select_field_auto_weight:
50+
# - First Item
51+
# - Second Item
52+
# - Third Item
53+
# - Fifth Item
54+
# - Fourth Item
55+
# select_field_legacy_format:
6056
# type: select
6157
# label: Choose between items
6258
# required: false
@@ -65,9 +61,9 @@
6561
# on_objects:
6662
# - dcim.models.Device
6763
# choices:
68-
# - value: A
69-
# - value: B
70-
# - value: C
64+
# - value: A # this is the deprecated format.
65+
# - value: B # we only use it for the tests.
66+
# - value: C # please see above for the new format.
7167
# - value: "D like deprecated"
7268
# weight: 999
7369
# - value: E
@@ -76,7 +72,7 @@
7672
# label: Yes Or No?
7773
# required: true
7874
# filter_logic: loose
79-
# default: "false" # important: but "false" in quotes!
75+
# default: "false" # important: put "false" in quotes!
8076
# weight: 90
8177
# on_objects:
8278
# - dcim.models.Device

initializers/device_types.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
# manufacturer: Manufacturer 1
33
# slug: model-1
44
# u_height: 2
5-
# custom_fields:
5+
# custom_field_data:
66
# text_field: Description
77
# - model: Model 2
88
# manufacturer: Manufacturer 1
99
# slug: model-2
10-
# custom_fields:
10+
# custom_field_data:
1111
# text_field: Description
1212
# - model: Model 3
1313
# manufacturer: Manufacturer 1
1414
# slug: model-3
1515
# is_full_depth: false
1616
# u_height: 0
17-
# custom_fields:
17+
# custom_field_data:
1818
# text_field: Description
1919
# - model: Other
2020
# manufacturer: No Name
2121
# slug: other
22-
# custom_fields:
22+
# custom_field_data:
2323
# text_field: Description

initializers/devices.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# rack: rack-01
2121
# face: front
2222
# position: 1
23-
# custom_fields:
23+
# custom_field_data:
2424
# text_field: Description
2525
# - name: server02
2626
# device_role: server
@@ -31,7 +31,7 @@
3131
# position: 2
3232
# primary_ip4: 10.1.1.2/24
3333
# primary_ip6: 2001:db8:a000:1::2/64
34-
# custom_fields:
34+
# custom_field_data:
3535
# text_field: Description
3636
# - name: server03
3737
# device_role: server
@@ -40,5 +40,5 @@
4040
# rack: rack-03
4141
# face: front
4242
# position: 3
43-
# custom_fields:
43+
# custom_field_data:
4444
# text_field: Description

0 commit comments

Comments
 (0)