Skip to content

Commit

Permalink
Merge pull request #1062 from netbox-community/develop
Browse files Browse the repository at this point in the history
Release 2.7.0
  • Loading branch information
tobiasge authored Aug 30, 2023
2 parents 22486fe + 2855320 commit b47e85a
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 26 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.sql.gz
.netbox
.initializers
.python-version
docker-compose.override.yml
*.pem
configuration/*
Expand All @@ -11,5 +11,4 @@ configuration/ldap/*
!configuration/ldap/ldap_config.py
!configuration/logging.py
!configuration/plugins.py
prometheus.yml
super-linter.log
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \
ARG NETBOX_PATH
COPY ${NETBOX_PATH}/requirements.txt requirements-container.txt /
RUN \
# We compile 'psycopg2' in the build process
sed -i -e '/psycopg2-binary/d' /requirements.txt && \
# We compile 'psycopg' in the build process
sed -i -e '/psycopg/d' /requirements.txt && \
# Gunicorn is not needed because we use Nginx Unit
sed -i -e '/gunicorn/d' /requirements.txt && \
# We need 'social-auth-core[all]' in the Docker image. But if we put it in our own requirements-container.txt
Expand Down Expand Up @@ -62,19 +62,20 @@ RUN export DEBIAN_FRONTEND=noninteractive \
libldap-common \
libpq5 \
libxmlsec1-openssl \
openssh-client \
openssl \
python3 \
python3-distutils \
tini \
&& curl -sL https://nginx.org/keys/nginx_signing.key \
> /etc/apt/trusted.gpg.d/nginx.asc && \
echo "deb https://packages.nginx.org/unit/ubuntu/ jammy unit" \
&& curl --silent --output /usr/share/keyrings/nginx-keyring.gpg \
https://unit.nginx.org/keys/nginx-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/ubuntu/ lunar unit" \
> /etc/apt/sources.list.d/unit.list \
&& apt-get update -qq \
&& apt-get install \
--yes -qq --no-install-recommends \
unit=1.29.1-1~jammy \
unit-python3.10=1.29.1-1~jammy \
unit=1.30.0-1~lunar \
unit-python3.11=1.30.0-1~lunar \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /opt/netbox/venv /opt/netbox/venv
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.1
2.7.0
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ DOCKERFILE The name of Dockerfile to use.
${_GREEN}Default:${_CLEAR} Dockerfile
DOCKER_FROM The base image to use.
${_GREEN}Default:${_CLEAR} 'ubuntu:22.04'
${_GREEN}Default:${_CLEAR} 'ubuntu:23.04'
BUILDX_PLATFORMS
Specifies the platform(s) to build the image for.
Expand Down Expand Up @@ -219,7 +219,7 @@ fi
# Determining the value for DOCKER_FROM
###
if [ -z "$DOCKER_FROM" ]; then
DOCKER_FROM="docker.io/ubuntu:22.04"
DOCKER_FROM="docker.io/ubuntu:23.04"
fi

###
Expand Down
11 changes: 7 additions & 4 deletions configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ def _environ_get_and_map(variable_name: str, default: str | None = None, map_fn:
CHANGELOG_RETENTION = _environ_get_and_map('CHANGELOG_RETENTION', None, _AS_INT)

# Maximum number of days to retain job results (scripts and reports). Set to 0 to retain job results in the database indefinitely. (Default: 90)
if 'JOBRESULT_RETENTION' in environ:
JOBRESULT_RETENTION = _environ_get_and_map('JOBRESULT_RETENTION', None, _AS_INT)
if 'JOB_RETENTION' in environ:
JOB_RETENTION = _environ_get_and_map('JOB_RETENTION', None, _AS_INT)
# JOBRESULT_RETENTION was renamed to JOB_RETENTION in the v3.5.0 release of NetBox. For backwards compatibility, map JOBRESULT_RETENTION to JOB_RETENTION
elif 'JOBRESULT_RETENTION' in environ:
JOB_RETENTION = _environ_get_and_map('JOBRESULT_RETENTION', None, _AS_INT)

# API Cross-Origin Resource Sharing (CORS) settings. If CORS_ORIGIN_ALLOW_ALL is set to True, all origins will be
# allowed. Otherwise, define a list of allowed origins using either CORS_ORIGIN_WHITELIST or
Expand Down Expand Up @@ -272,9 +275,9 @@ def _environ_get_and_map(variable_name: str, default: str | None = None, map_fn:

# Remote authentication support
REMOTE_AUTH_ENABLED = _environ_get_and_map('REMOTE_AUTH_ENABLED', 'False', _AS_BOOL)
REMOTE_AUTH_BACKEND = environ.get('REMOTE_AUTH_BACKEND', 'netbox.authentication.RemoteUserBackend')
REMOTE_AUTH_BACKEND = _environ_get_and_map('REMOTE_AUTH_BACKEND', 'netbox.authentication.RemoteUserBackend', _AS_LIST)
REMOTE_AUTH_HEADER = environ.get('REMOTE_AUTH_HEADER', 'HTTP_REMOTE_USER')
REMOTE_AUTH_AUTO_CREATE_USER = _environ_get_and_map('REMOTE_AUTH_AUTO_CREATE_USER', 'True', _AS_BOOL)
REMOTE_AUTH_AUTO_CREATE_USER = _environ_get_and_map('REMOTE_AUTH_AUTO_CREATE_USER', 'False', _AS_BOOL)
REMOTE_AUTH_DEFAULT_GROUPS = _environ_get_and_map('REMOTE_AUTH_DEFAULT_GROUPS', '', _AS_LIST)
# REMOTE_AUTH_DEFAULT_PERMISSIONS = {}

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
env_file: env/netbox.env
user: 'unit:root'
volumes:
- ./test-configuration/logging.py:/etc/netbox/config/logging.py:z,ro
- ./test-configuration/test_config.py:/etc/netbox/config/test_config.py:z,ro
healthcheck:
start_period: ${NETBOX_START_PERIOD-120s}
timeout: 3s
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.4'
services:
netbox: &netbox
image: docker.io/netboxcommunity/netbox:${VERSION-v3.5-2.6.1}
image: docker.io/netboxcommunity/netbox:${VERSION-v3.6-2.7.0}
depends_on:
- postgres
- redis
Expand All @@ -15,9 +15,9 @@ services:
test: "curl -f http://localhost:8080/api/ || exit 1"
volumes:
- ./configuration:/etc/netbox/config:z,ro
- netbox-media-files:/opt/netbox/netbox/media:z,rw
- netbox-reports-files:/opt/netbox/netbox/reports:z,rw
- netbox-scripts-files:/opt/netbox/netbox/scripts:z,rw
- netbox-media-files:/opt/netbox/netbox/media:rw
- netbox-reports-files:/opt/netbox/netbox/reports:rw
- netbox-scripts-files:/opt/netbox/netbox/scripts:rw
netbox-worker:
<<: *netbox
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions docker/launch-netbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ exec unitd \
--control unix:$UNIT_SOCKET \
--pid /opt/unit/unit.pid \
--log /dev/stdout \
--state /opt/unit/state/ \
--tmp /opt/unit/tmp/ \
--statedir /opt/unit/state/ \
--tmpdir /opt/unit/tmp/ \
--user unit \
--group root
2 changes: 1 addition & 1 deletion env/netbox.env
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ REDIS_INSECURE_SKIP_TLS_VERIFY=false
REDIS_PASSWORD=H733Kdjndks81
REDIS_SSL=false
RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases
SECRET_KEY=r(m)9nLGnz$(_q3N4z1k(EFsMCjjjzx08x9VhNVcfd%6RF#r!6DE@+V5Zk2X
SECRET_KEY='r(m)9nLGnz$(_q3N4z1k(EFsMCjjjzx08x9VhNVcfd%6RF#r!6DE@+V5Zk2X'
SKIP_SUPERUSER=true
WEBHOOKS_ENABLED=true
5 changes: 3 additions & 2 deletions requirements-container.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
django-auth-ldap==4.3.0
django-auth-ldap==4.5.0
django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.13.2
psycopg2==2.9.6
dulwich==0.21.5
psycopg[c,pool]==3.1.10
python3-saml==1.15.0
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
'version': 1,
'disable_existing_loggers': True
}

DEFAULT_PERMISSIONS = {}

0 comments on commit b47e85a

Please sign in to comment.