From 249e5890965f164fc0cad6e6876c5328b9095e0a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 7 Jan 2024 16:16:19 +0000 Subject: [PATCH 01/28] Update dependency psycopg to v3.1.17 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 870eee9..2085b03 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -1,5 +1,5 @@ django-auth-ldap==4.6.0 django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.21.7 -psycopg[c,pool]==3.1.16 +psycopg[c,pool]==3.1.17 python3-saml==1.16.0 From 2fbb5dd0b00abf95d46d98011e44a36b35cb5c33 Mon Sep 17 00:00:00 2001 From: kindlich Date: Tue, 16 Jan 2024 10:13:57 +0100 Subject: [PATCH 02/28] Add env var for CENSUS_REPORTING_ENABLED See #999 --- configuration/configuration.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configuration/configuration.py b/configuration/configuration.py index d3bffb4..ed2baf2 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -183,6 +183,13 @@ EMAIL = { if 'ENFORCE_GLOBAL_UNIQUE' in environ: ENFORCE_GLOBAL_UNIQUE = _environ_get_and_map('ENFORCE_GLOBAL_UNIQUE', None, _AS_BOOL) +# By default, netbox sends census reporting data using a single HTTP request each time a worker starts. +# This data enables the project maintainers to estimate how many NetBox deployments exist and track the adoption of new versions over time. +# The only data reported by this function are the NetBox version, Python version, and a pseudorandom unique identifier. +# To opt out of census reporting, set CENSUS_REPORTING_ENABLED to False. +if 'CENSUS_REPORTING_ENABLED' in environ: + CENSUS_REPORTING_ENABLED = _environ_get_and_map('CENSUS_REPORTING_ENABLED', None, _AS_BOOL) + # Exempt certain models from the enforcement of view permissions. Models listed here will be viewable by all users and # by anonymous users. List models in the form `.`. Add '*' to this list to exempt all models. EXEMPT_VIEW_PERMISSIONS = _environ_get_and_map('EXEMPT_VIEW_PERMISSIONS', '', _AS_LIST) From 291ba760f11d184f23d35c862ed9dcfde6058b85 Mon Sep 17 00:00:00 2001 From: NdFeB <32781483+NeodymiumFerBore@users.noreply.github.com> Date: Tue, 16 Jan 2024 14:28:59 +0100 Subject: [PATCH 03/28] Add Redis Sentinel config as environment vars --- configuration/configuration.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configuration/configuration.py b/configuration/configuration.py index d3bffb4..4adc3da 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -86,6 +86,9 @@ REDIS = { 'tasks': { 'HOST': environ.get('REDIS_HOST', 'localhost'), 'PORT': _environ_get_and_map('REDIS_PORT', 6379, _AS_INT), + 'SENTINELS': [tuple(uri.split(':')) for uri in _environ_get_and_map('REDIS_SENTINELS', '', _AS_LIST) if uri != ''], + 'SENTINEL_SERVICE': environ.get('REDIS_SENTINEL_SERVICE', 'default'), + 'SENTINEL_TIMEOUT': _environ_get_and_map('REDIS_SENTINEL_TIMEOUT', 10, _AS_INT), 'USERNAME': environ.get('REDIS_USERNAME', ''), 'PASSWORD': _read_secret('redis_password', environ.get('REDIS_PASSWORD', '')), 'DATABASE': _environ_get_and_map('REDIS_DATABASE', 0, _AS_INT), @@ -95,6 +98,8 @@ REDIS = { 'caching': { 'HOST': environ.get('REDIS_CACHE_HOST', environ.get('REDIS_HOST', 'localhost')), 'PORT': _environ_get_and_map('REDIS_CACHE_PORT', environ.get('REDIS_PORT', '6379'), _AS_INT), + 'SENTINELS': [tuple(uri.split(':')) for uri in _environ_get_and_map('REDIS_CACHE_SENTINELS', '', _AS_LIST) if uri != ''], + 'SENTINEL_SERVICE': environ.get('REDIS_CACHE_SENTINEL_SERVICE', environ.get('REDIS_SENTINEL_SERVICE', 'default')), 'USERNAME': environ.get('REDIS_CACHE_USERNAME', environ.get('REDIS_USERNAME', '')), 'PASSWORD': _read_secret('redis_cache_password', environ.get('REDIS_CACHE_PASSWORD', environ.get('REDIS_PASSWORD', ''))), 'DATABASE': _environ_get_and_map('REDIS_CACHE_DATABASE', '1', _AS_INT), From 064b71348972bbd25697a66f60bbc278b9ae9617 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 4 Feb 2024 21:43:13 +0000 Subject: [PATCH 04/28] Update dependency psycopg to v3.1.18 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 2085b03..97dbd7b 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -1,5 +1,5 @@ django-auth-ldap==4.6.0 django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.21.7 -psycopg[c,pool]==3.1.17 +psycopg[c,pool]==3.1.18 python3-saml==1.16.0 From f27148634a230ecd5f781e79d9a2bfa44de38460 Mon Sep 17 00:00:00 2001 From: tbotnz Date: Wed, 17 Jan 2024 08:23:34 +1300 Subject: [PATCH 05/28] fix segfault --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 97dbd7b..4013e73 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -2,4 +2,4 @@ django-auth-ldap==4.6.0 django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.21.7 psycopg[c,pool]==3.1.18 -python3-saml==1.16.0 +python3-saml==1.16.0 --no-binary lxml From 607ccd10bfe91bf42e7152e56249fc06e20cef4e Mon Sep 17 00:00:00 2001 From: Florian Knodt Date: Fri, 19 Jan 2024 09:12:56 +0100 Subject: [PATCH 06/28] docker-entrypoint.sh: clarify default token message When a default admin API token is found, a warning is displayed. As it is only called "token", some users might not know what token is referred to. Also the message should give a hint or link to a documentation on how to remove it. --- docker/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 9b39689..14406d3 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -87,7 +87,7 @@ from users.models import Token try: old_default_token = Token.objects.get(key="0123456789abcdef0123456789abcdef01234567") if old_default_token: - print("⚠️ Warning: You have the old default admin token in your database. This token is widely known; please remove it.") + print("⚠️ Warning: You have the old default admin API token in your database. This token is widely known; please remove it. Log in as your superuser and check API Tokens in your user menu.") except Token.DoesNotExist: pass END From 99b906c4f1bc39b805064db3940462ad55a31065 Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Wed, 28 Feb 2024 08:05:22 +0100 Subject: [PATCH 07/28] Update Ubuntu and Nginx Unit --- Dockerfile | 6 +++--- build.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c55c4c9..0c694a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,13 +69,13 @@ RUN export DEBIAN_FRONTEND=noninteractive \ tini \ && 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" \ + && echo "deb [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/ubuntu/ mantic unit" \ > /etc/apt/sources.list.d/unit.list \ && apt-get update -qq \ && apt-get install \ --yes -qq --no-install-recommends \ - unit=1.31.1-1~lunar \ - unit-python3.11=1.31.1-1~lunar \ + unit=1.32.0-1~mantic \ + unit-python3.11=1.32.0-1~mantic \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /opt/netbox/venv /opt/netbox/venv diff --git a/build.sh b/build.sh index fd34029..352c1ce 100755 --- a/build.sh +++ b/build.sh @@ -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:23.04' + ${_GREEN}Default:${_CLEAR} 'ubuntu:23.10' BUILDX_PLATFORMS Specifies the platform(s) to build the image for. @@ -219,7 +219,7 @@ fi # Determining the value for DOCKER_FROM ### if [ -z "$DOCKER_FROM" ]; then - DOCKER_FROM="docker.io/ubuntu:23.04" + DOCKER_FROM="docker.io/ubuntu:23.10" fi ### From 24eaba7f9bb675f268179d1fafc492a4e2a63b7f Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Sat, 2 Mar 2024 11:12:23 +0100 Subject: [PATCH 08/28] Use ARM64 self-hosted runner --- .github/workflows/push.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5a9528a..3ce7018 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -49,35 +49,36 @@ jobs: - PRERELEASE=true ./build-latest.sh - ./build.sh feature - ./build.sh develop - platform: - - linux/amd64 - - linux/arm64 + os: + - ubuntu-latest + - self-hosted fail-fast: false env: GH_ACTION: enable GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} IMAGE_NAMES: docker.io/netboxcommunity/netbox - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} name: Builds new NetBox Docker Images steps: - id: git-checkout name: Checkout uses: actions/checkout@v4 - - id: qemu-setup - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - id: buildx-setup name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - id: arm-buildx-platform + name: Set BUILDX_PLATFORM to ARM64 + if: matrix.os == 'self-hosted' + run: | + echo "BUILDX_PLATFORM=linux/arm64" >>"${GITHUB_ENV}" - id: docker-build - name: Build the image for '${{ matrix.platform }}' with '${{ matrix.build_cmd }}' + name: Build the image for '${{ matrix.os }}' with '${{ matrix.build_cmd }}' run: ${{ matrix.build_cmd }} env: - BUILDX_PLATFORM: ${{ matrix.platform }} BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }} - id: arm-time-limit name: Set Netbox container start_period higher on ARM64 - if: matrix.platform == 'linux/arm64' + if: matrix.os == 'self-hosted' run: | echo "NETBOX_START_PERIOD=240s" >>"${GITHUB_ENV}" - id: docker-test From 31a4da297ac0c32aacadc745aca28f43a9a62d14 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 16:12:04 +0000 Subject: [PATCH 09/28] Update dependency django-auth-ldap to v4.7.0 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 4013e73..0afc316 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -1,4 +1,4 @@ -django-auth-ldap==4.6.0 +django-auth-ldap==4.7.0 django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.21.7 psycopg[c,pool]==3.1.18 From d2d79480210fe8144ac3a31073efc814ff998956 Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Tue, 26 Mar 2024 17:32:05 +0100 Subject: [PATCH 10/28] Avoid duplicate checks for Renovate PRs --- .github/workflows/push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 3ce7018..713eb70 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -5,6 +5,7 @@ on: push: branches-ignore: - release + - renovate/** pull_request: branches-ignore: - release From 73ce1f9b7a1ccdd5cb8541b40bb1fdf07215a268 Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Fri, 23 Feb 2024 08:10:21 +0100 Subject: [PATCH 11/28] Fix #1127: Added sentry-sdk to requirements --- requirements-container.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-container.txt b/requirements-container.txt index 0afc316..d7a4a59 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -3,3 +3,4 @@ django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.21.7 psycopg[c,pool]==3.1.18 python3-saml==1.16.0 --no-binary lxml +sentry-sdk==1.43.0 From 46f628e91b543bfa958adc1b073f04e58b5a68fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 17:06:50 +0000 Subject: [PATCH 12/28] Update dependency sentry-sdk to v1.44.0 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index d7a4a59..1b78d9e 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -3,4 +3,4 @@ django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.21.7 psycopg[c,pool]==3.1.18 python3-saml==1.16.0 --no-binary lxml -sentry-sdk==1.43.0 +sentry-sdk==1.44.0 From 6c01ada88251ed370521e81890da678b35259837 Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Mon, 1 Apr 2024 16:57:53 -0400 Subject: [PATCH 13/28] Removed version line from the yaml file as it is obsolete --- README.md | 1 - docker-compose.override.yml.example | 1 - docker-compose.test.override.yml | 1 - docker-compose.test.yml | 1 - docker-compose.yml | 1 - 5 files changed, 5 deletions(-) diff --git a/README.md b/README.md index e472945..7b70f81 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ There is a more complete [_Getting Started_ guide on our wiki][wiki-getting-star git clone -b release https://github.com/netbox-community/netbox-docker.git cd netbox-docker tee docker-compose.override.yml < Date: Wed, 3 Apr 2024 10:47:45 +0000 Subject: [PATCH 14/28] Update dependency sentry-sdk to v1.44.1 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 1b78d9e..036d9c8 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -3,4 +3,4 @@ django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.21.7 psycopg[c,pool]==3.1.18 python3-saml==1.16.0 --no-binary lxml -sentry-sdk==1.44.0 +sentry-sdk==1.44.1 From 3df807faa019ff323ea461900eae95e94cec73f2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:21:43 +0000 Subject: [PATCH 15/28] Update dependency django-auth-ldap to v4.8.0 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 1b78d9e..8c4b86f 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -1,4 +1,4 @@ -django-auth-ldap==4.7.0 +django-auth-ldap==4.8.0 django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.21.7 psycopg[c,pool]==3.1.18 From 2ee4acba21f633318cb6fe474a557218b66f7ac2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 14:59:14 +0000 Subject: [PATCH 16/28] Update dependency sentry-sdk to v1.45.0 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 27671bf..3932065 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -3,4 +3,4 @@ django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.21.7 psycopg[c,pool]==3.1.18 python3-saml==1.16.0 --no-binary lxml -sentry-sdk==1.44.1 +sentry-sdk==1.45.0 From e141d9f16de99f2771c360fbb1bb80bbaf13fae4 Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Thu, 28 Mar 2024 10:39:51 +0100 Subject: [PATCH 17/28] Prepare for Netbox 4.0 --- Dockerfile | 2 -- configuration/configuration.py | 8 -------- docker/docker-entrypoint.sh | 5 ++--- requirements-container.txt | 1 - 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0c694a7..a2ceb95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,8 +31,6 @@ RUN export DEBIAN_FRONTEND=noninteractive \ ARG NETBOX_PATH COPY ${NETBOX_PATH}/requirements.txt requirements-container.txt / RUN \ - # 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 diff --git a/configuration/configuration.py b/configuration/configuration.py index 8568071..d74a7a9 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -320,11 +320,3 @@ SESSION_FILE_PATH = environ.get('SESSION_FILE_PATH', environ.get('SESSIONS_ROOT' # Time zone (default: UTC) TIME_ZONE = environ.get('TIME_ZONE', 'UTC') -# Date/time formatting. See the following link for supported formats: -# https://docs.djangoproject.com/en/stable/ref/templates/builtins/#date -DATE_FORMAT = environ.get('DATE_FORMAT', 'N j, Y') -SHORT_DATE_FORMAT = environ.get('SHORT_DATE_FORMAT', 'Y-m-d') -TIME_FORMAT = environ.get('TIME_FORMAT', 'g:i a') -SHORT_TIME_FORMAT = environ.get('SHORT_TIME_FORMAT', 'H:i:s') -DATETIME_FORMAT = environ.get('DATETIME_FORMAT', 'N j, Y g:i a') -SHORT_DATETIME_FORMAT = environ.get('SHORT_DATETIME_FORMAT', 'Y-m-d H:i') diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 14406d3..fa5930d 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -72,10 +72,9 @@ else fi ./manage.py shell --interface python < Date: Fri, 19 Apr 2024 21:53:06 +0200 Subject: [PATCH 18/28] Cancel workflow runs for in progress PRs --- .github/workflows/push.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 713eb70..26828fa 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -10,6 +10,10 @@ on: branches-ignore: - release +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: lint: runs-on: ubuntu-latest From e024427428be7c128085ba34f05bcc11ffa1116f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 19:13:28 +0000 Subject: [PATCH 19/28] Update dependency dulwich to v0.22.0 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 3932065..b8c940f 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -1,6 +1,6 @@ django-auth-ldap==4.8.0 django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 -dulwich==0.21.7 +dulwich==0.22.0 psycopg[c,pool]==3.1.18 python3-saml==1.16.0 --no-binary lxml sentry-sdk==1.45.0 From 347b943b759982834b4fa331f95b12e4419613f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:58:41 +0000 Subject: [PATCH 20/28] Update dependency dulwich to v0.22.1 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index b8c940f..7e623ce 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -1,6 +1,6 @@ django-auth-ldap==4.8.0 django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 -dulwich==0.22.0 +dulwich==0.22.1 psycopg[c,pool]==3.1.18 python3-saml==1.16.0 --no-binary lxml sentry-sdk==1.45.0 From e1335a1194ff92ce9e628c2e8a35852739d59df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Tue, 23 Apr 2024 16:40:40 +0200 Subject: [PATCH 21/28] Adds SECURE_* parameters introduced in 3.7.6 See https://github.com/netbox-community/netbox/issues/15644 --- configuration/configuration.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/configuration/configuration.py b/configuration/configuration.py index 8568071..5efbdc0 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -312,6 +312,23 @@ CSRF_TRUSTED_ORIGINS = _environ_get_and_map('CSRF_TRUSTED_ORIGINS', '', _AS_LIST # The name to use for the session cookie. SESSION_COOKIE_NAME = environ.get('SESSION_COOKIE_NAME', 'sessionid') +# If true, the `includeSubDomains` directive will be included in the HTTP Strict Transport Security (HSTS) header. +# This directive instructs the browser to apply the HSTS policy to all subdomains of the current domain. +SECURE_HSTS_INCLUDE_SUBDOMAINS = _environ_get_and_map('SECURE_HSTS_INCLUDE_SUBDOMAINS', 'False', _AS_BOOL) + +# If true, the `preload` directive will be included in the HTTP Strict Transport Security (HSTS) header. +# This directive instructs the browser to preload the site in HTTPS. Browsers that use the HSTS preload list will force the +# site to be accessed via HTTPS even if the user types HTTP in the address bar. +SECURE_HSTS_PRELOAD = _environ_get_and_map('SECURE_HSTS_PRELOAD', 'False', _AS_BOOL) + +# If set to a non-zero integer value, the SecurityMiddleware sets the HTTP Strict Transport Security (HSTS) header on all +# responses that do not already have it. This will instruct the browser that the website must be accessed via HTTPS, +# blocking any HTTP request. +SECURE_HSTS_SECONDS = _environ_get_and_map('SECURE_HSTS_SECONDS', 0, _AS_INT) + +# If true, all non-HTTPS requests will be automatically redirected to use HTTPS. +SECURE_SSL_REDIRECT = _environ_get_and_map('SECURE_SSL_REDIRECT', 'False', _AS_BOOL) + # By default, NetBox will store session data in the database. Alternatively, a file path can be specified here to use # local file storage instead. (This can be useful for enabling authentication on a standby instance with read-only # database access.) Note that the user as which NetBox runs must have read and write permissions to this path. From b7d99c9c69a90aa595c885b846c566fd1780e9d5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 19:44:05 +0000 Subject: [PATCH 22/28] Update github/super-linter action to v6 --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 26828fa..893a650 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -28,7 +28,7 @@ jobs: with: python-version: '3.9' - name: Lint Code Base - uses: github/super-linter@v5 + uses: github/super-linter@v6 env: DEFAULT_BRANCH: develop GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8fb42b321324a5e379bff6ebdfb2caff58fbf149 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 10:16:25 +0000 Subject: [PATCH 23/28] Update dependency sentry-sdk to v2 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 7e623ce..1029f51 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -3,4 +3,4 @@ django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.22.1 psycopg[c,pool]==3.1.18 python3-saml==1.16.0 --no-binary lxml -sentry-sdk==1.45.0 +sentry-sdk==2.0.1 From f1787b47753d7d4f5d083dd0f1a26c310d62413d Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Sun, 28 Apr 2024 09:29:43 +0200 Subject: [PATCH 24/28] Disabled new tests --- .github/workflows/push.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 893a650..d7bf3b9 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -35,8 +35,10 @@ jobs: SUPPRESS_POSSUM: true LINTER_RULES_PATH: / VALIDATE_ALL_CODEBASE: false + VALIDATE_CHECKOV: false VALIDATE_DOCKERFILE: false VALIDATE_GITLEAKS: false + VALIDATE_JSCPD: false FILTER_REGEX_EXCLUDE: (.*/)?(LICENSE|configuration/.*) EDITORCONFIG_FILE_NAME: .ecrc DOCKERFILE_HADOLINT_FILE_NAME: .hadolint.yaml From 40f24105e61eb2b02942613dac49c1d5805f610d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 4 May 2024 23:02:30 +0000 Subject: [PATCH 25/28] Update dependency django-storages to v1.14.3 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 1029f51..595be87 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -1,5 +1,5 @@ django-auth-ldap==4.8.0 -django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 +django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.3 dulwich==0.22.1 psycopg[c,pool]==3.1.18 python3-saml==1.16.0 --no-binary lxml From 1e78c386a5a3259173aa90b5243a9d5150d4e682 Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Mon, 6 May 2024 09:56:49 +0200 Subject: [PATCH 26/28] Fixed regex for social-auth-core replacement --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a2ceb95..2a6de8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ RUN \ # We need 'social-auth-core[all]' in the Docker image. But if we put it in our own requirements-container.txt # we have potential version conflicts and the build will fail. # That's why we just replace it in the original requirements.txt. - sed -i -e 's/social-auth-core\[openidconnect\]/social-auth-core\[all\]/g' /requirements.txt && \ + sed -i -e 's/social-auth-core/social-auth-core\[all\]/g' /requirements.txt && \ /opt/netbox/venv/bin/pip install \ -r /requirements.txt \ -r /requirements-container.txt From 6307a58c4ac5db22cbd9360f562082010faa5e8b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 12:35:54 +0000 Subject: [PATCH 27/28] Update dependency sentry-sdk to v2.1.1 --- requirements-container.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-container.txt b/requirements-container.txt index 1029f51..7c1c229 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -3,4 +3,4 @@ django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2 dulwich==0.22.1 psycopg[c,pool]==3.1.18 python3-saml==1.16.0 --no-binary lxml -sentry-sdk==2.0.1 +sentry-sdk==2.1.1 From 36f409a16b6a10a862d6219c7a136c07174a2114 Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Mon, 6 May 2024 19:04:09 +0200 Subject: [PATCH 28/28] Preparation for 2.9.0 --- VERSION | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 834f262..c8e38b6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.8.0 +2.9.0 diff --git a/docker-compose.yml b/docker-compose.yml index 105b9a1..9af4480 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: netbox: &netbox - image: docker.io/netboxcommunity/netbox:${VERSION-v3.7-2.8.0} + image: docker.io/netboxcommunity/netbox:${VERSION-v4.0-2.9.0} depends_on: - postgres - redis