diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c4f22d6..e5aaf69 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -23,13 +23,13 @@ jobs: packages: read statuses: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: # Full git history is needed to get a proper # list of changed files within `super-linter` fetch-depth: 0 - name: Lint Code Base - uses: super-linter/super-linter@v7 + uses: super-linter/super-linter@v8 env: DEFAULT_BRANCH: develop GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -70,7 +70,7 @@ jobs: steps: - id: git-checkout name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - id: buildx-setup name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71b718c..2d83729 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: steps: - id: source-checkout name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: ${{ matrix.build.branch }} - id: set-netbox-docker-version diff --git a/Dockerfile b/Dockerfile index ffb3682..e22c55d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ARG FROM FROM ${FROM} AS builder -COPY --from=ghcr.io/astral-sh/uv:0.7 /uv /usr/local/bin/ +COPY --from=ghcr.io/astral-sh/uv:0.8 /uv /usr/local/bin/ RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get update -qq \ && apt-get upgrade \ @@ -89,7 +89,7 @@ WORKDIR /opt/netbox/netbox # Must set permissions for '/opt/netbox/netbox/media' directory # to g+w so that pictures can be uploaded to netbox. -RUN mkdir -p static /opt/unit/state/ /opt/unit/tmp/ \ +RUN mkdir -p static media /opt/unit/state/ /opt/unit/tmp/ \ && chown -R unit:root /opt/unit/ media reports scripts \ && chmod -R g+w /opt/unit/ media reports scripts \ && cd /opt/netbox/ && SECRET_KEY="dummyKeyWithMinimumLength-------------------------" /opt/netbox/venv/bin/python -m mkdocs build \ diff --git a/build.sh b/build.sh index a7ac817..c12fbe4 100755 --- a/build.sh +++ b/build.sh @@ -62,7 +62,7 @@ DOCKERFILE The name of Dockerfile to use. DOCKER_FROM The base image to use. ${_GREEN}Default:${_CLEAR} 'ubuntu:24.04' -BUILDX_PLATFORMS +BUILDX_PLATFORM Specifies the platform(s) to build the image for. ${_CYAN}Example:${_CLEAR} 'linux/amd64,linux/arm64' ${_GREEN}Default:${_CLEAR} 'linux/amd64' diff --git a/configuration/configuration.py b/configuration/configuration.py index 577c3f4..6125e2b 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -64,19 +64,21 @@ if '*' not in ALLOWED_HOSTS and 'localhost' not in ALLOWED_HOSTS: # PostgreSQL database configuration. See the Django documentation for a complete list of available parameters: # https://docs.djangoproject.com/en/stable/ref/settings/#databases -DATABASE = { - 'NAME': environ.get('DB_NAME', 'netbox'), # Database name - 'USER': environ.get('DB_USER', ''), # PostgreSQL username - 'PASSWORD': _read_secret('db_password', environ.get('DB_PASSWORD', '')), - # PostgreSQL password - 'HOST': environ.get('DB_HOST', 'localhost'), # Database server - 'PORT': environ.get('DB_PORT', ''), # Database port (leave blank for default) - 'OPTIONS': {'sslmode': environ.get('DB_SSLMODE', 'prefer')}, - # Database connection SSLMODE - 'CONN_MAX_AGE': _environ_get_and_map('DB_CONN_MAX_AGE', '300', _AS_INT), - # Max database connection age - 'DISABLE_SERVER_SIDE_CURSORS': _environ_get_and_map('DB_DISABLE_SERVER_SIDE_CURSORS', 'False', _AS_BOOL), - # Disable the use of server-side cursors transaction pooling +DATABASES = { + 'default': { + 'NAME': environ.get('DB_NAME', 'netbox'), # Database name + 'USER': environ.get('DB_USER', ''), # PostgreSQL username + 'PASSWORD': _read_secret('db_password', environ.get('DB_PASSWORD', '')), + # PostgreSQL password + 'HOST': environ.get('DB_HOST', 'localhost'), # Database server + 'PORT': environ.get('DB_PORT', ''), # Database port (leave blank for default) + 'OPTIONS': {'sslmode': environ.get('DB_SSLMODE', 'prefer')}, + # Database connection SSLMODE + 'CONN_MAX_AGE': _environ_get_and_map('DB_CONN_MAX_AGE', '300', _AS_INT), + # Max database connection age + 'DISABLE_SERVER_SIDE_CURSORS': _environ_get_and_map('DB_DISABLE_SERVER_SIDE_CURSORS', 'False', _AS_BOOL), + # Disable the use of server-side cursors transaction pooling + } } # Redis database settings. Redis is used for caching and for queuing background tasks such as webhook events. A separate diff --git a/configuration/ldap/ldap_config.py b/configuration/ldap/ldap_config.py index 82fad72..59e6aea 100644 --- a/configuration/ldap/ldap_config.py +++ b/configuration/ldap/ldap_config.py @@ -109,3 +109,6 @@ AUTH_LDAP_USER_ATTR_MAP = { "last_name": environ.get('AUTH_LDAP_ATTR_LASTNAME', 'sn'), "email": environ.get('AUTH_LDAP_ATTR_MAIL', 'mail') } + +# Update user object with the latest values from the LDAP directory every time the user logs in. +AUTH_LDAP_ALWAYS_UPDATE_USER = environ.get('AUTH_LDAP_ALWAYS_UPDATE_USER', 'True').lower() == 'true' diff --git a/requirements-container.txt b/requirements-container.txt index 831c49e..0865c1a 100644 --- a/requirements-container.txt +++ b/requirements-container.txt @@ -1,6 +1,6 @@ django-auth-ldap==5.2.0 -dulwich==0.22.8 +dulwich==0.24.1 python3-saml==1.16.0 --no-binary lxml --no-binary xmlsec -sentry-sdk[django]==2.27.0 +sentry-sdk[django]==2.34.1