mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2025-12-10 05:42:36 +00:00
commit
b1394ff9cb
8
.github/workflows/push.yml
vendored
8
.github/workflows/push.yml
vendored
|
|
@ -23,13 +23,13 @@ jobs:
|
||||||
packages: read
|
packages: read
|
||||||
statuses: write
|
statuses: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
# Full git history is needed to get a proper
|
# Full git history is needed to get a proper
|
||||||
# list of changed files within `super-linter`
|
# list of changed files within `super-linter`
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Lint Code Base
|
- name: Lint Code Base
|
||||||
uses: super-linter/super-linter@v7
|
uses: super-linter/super-linter@v8
|
||||||
env:
|
env:
|
||||||
DEFAULT_BRANCH: develop
|
DEFAULT_BRANCH: develop
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
@ -40,6 +40,8 @@ jobs:
|
||||||
VALIDATE_DOCKERFILE: false
|
VALIDATE_DOCKERFILE: false
|
||||||
VALIDATE_GITLEAKS: false
|
VALIDATE_GITLEAKS: false
|
||||||
VALIDATE_JSCPD: false
|
VALIDATE_JSCPD: false
|
||||||
|
VALIDATE_TRIVY: false
|
||||||
|
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
|
||||||
FILTER_REGEX_EXCLUDE: (.*/)?(LICENSE|configuration/.*)
|
FILTER_REGEX_EXCLUDE: (.*/)?(LICENSE|configuration/.*)
|
||||||
EDITORCONFIG_FILE_NAME: .editorconfig-checker.json
|
EDITORCONFIG_FILE_NAME: .editorconfig-checker.json
|
||||||
DOCKERFILE_HADOLINT_FILE_NAME: .hadolint.yaml
|
DOCKERFILE_HADOLINT_FILE_NAME: .hadolint.yaml
|
||||||
|
|
@ -70,7 +72,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- id: git-checkout
|
- id: git-checkout
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- id: buildx-setup
|
- id: buildx-setup
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
|
||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -32,7 +32,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- id: source-checkout
|
- id: source-checkout
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ matrix.build.branch }}
|
ref: ${{ matrix.build.branch }}
|
||||||
- id: set-netbox-docker-version
|
- id: set-netbox-docker-version
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
ARG FROM
|
ARG FROM
|
||||||
FROM ${FROM} AS builder
|
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 \
|
RUN export DEBIAN_FRONTEND=noninteractive \
|
||||||
&& apt-get update -qq \
|
&& apt-get update -qq \
|
||||||
&& apt-get upgrade \
|
&& apt-get upgrade \
|
||||||
|
|
@ -79,7 +79,6 @@ COPY ${NETBOX_PATH} /opt/netbox
|
||||||
COPY docker/configuration.docker.py /opt/netbox/netbox/netbox/configuration.py
|
COPY docker/configuration.docker.py /opt/netbox/netbox/netbox/configuration.py
|
||||||
COPY docker/ldap_config.docker.py /opt/netbox/netbox/netbox/ldap_config.py
|
COPY docker/ldap_config.docker.py /opt/netbox/netbox/netbox/ldap_config.py
|
||||||
COPY docker/docker-entrypoint.sh /opt/netbox/docker-entrypoint.sh
|
COPY docker/docker-entrypoint.sh /opt/netbox/docker-entrypoint.sh
|
||||||
COPY docker/housekeeping.sh /opt/netbox/housekeeping.sh
|
|
||||||
COPY docker/launch-netbox.sh /opt/netbox/launch-netbox.sh
|
COPY docker/launch-netbox.sh /opt/netbox/launch-netbox.sh
|
||||||
COPY configuration/ /etc/netbox/config/
|
COPY configuration/ /etc/netbox/config/
|
||||||
COPY docker/nginx-unit.json /etc/unit/
|
COPY docker/nginx-unit.json /etc/unit/
|
||||||
|
|
@ -89,7 +88,7 @@ WORKDIR /opt/netbox/netbox
|
||||||
|
|
||||||
# Must set permissions for '/opt/netbox/netbox/media' directory
|
# Must set permissions for '/opt/netbox/netbox/media' directory
|
||||||
# to g+w so that pictures can be uploaded to netbox.
|
# 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 \
|
&& chown -R unit:root /opt/unit/ media reports scripts \
|
||||||
&& chmod -R g+w /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 \
|
&& cd /opt/netbox/ && SECRET_KEY="dummyKeyWithMinimumLength-------------------------" /opt/netbox/venv/bin/python -m mkdocs build \
|
||||||
|
|
|
||||||
2
build.sh
2
build.sh
|
|
@ -62,7 +62,7 @@ DOCKERFILE The name of Dockerfile to use.
|
||||||
DOCKER_FROM The base image to use.
|
DOCKER_FROM The base image to use.
|
||||||
${_GREEN}Default:${_CLEAR} 'ubuntu:24.04'
|
${_GREEN}Default:${_CLEAR} 'ubuntu:24.04'
|
||||||
|
|
||||||
BUILDX_PLATFORMS
|
BUILDX_PLATFORM
|
||||||
Specifies the platform(s) to build the image for.
|
Specifies the platform(s) to build the image for.
|
||||||
${_CYAN}Example:${_CLEAR} 'linux/amd64,linux/arm64'
|
${_CYAN}Example:${_CLEAR} 'linux/amd64,linux/arm64'
|
||||||
${_GREEN}Default:${_CLEAR} 'linux/amd64'
|
${_GREEN}Default:${_CLEAR} 'linux/amd64'
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,8 @@ 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:
|
# PostgreSQL database configuration. See the Django documentation for a complete list of available parameters:
|
||||||
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
|
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
|
||||||
DATABASE = {
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
'NAME': environ.get('DB_NAME', 'netbox'), # Database name
|
'NAME': environ.get('DB_NAME', 'netbox'), # Database name
|
||||||
'USER': environ.get('DB_USER', ''), # PostgreSQL username
|
'USER': environ.get('DB_USER', ''), # PostgreSQL username
|
||||||
'PASSWORD': _read_secret('db_password', environ.get('DB_PASSWORD', '')),
|
'PASSWORD': _read_secret('db_password', environ.get('DB_PASSWORD', '')),
|
||||||
|
|
@ -78,6 +79,7 @@ DATABASE = {
|
||||||
'DISABLE_SERVER_SIDE_CURSORS': _environ_get_and_map('DB_DISABLE_SERVER_SIDE_CURSORS', 'False', _AS_BOOL),
|
'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
|
# 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
|
# Redis database settings. Redis is used for caching and for queuing background tasks such as webhook events. A separate
|
||||||
# configuration exists for each. Full connection details are required in both sections, and it is strongly recommended
|
# configuration exists for each. Full connection details are required in both sections, and it is strongly recommended
|
||||||
|
|
|
||||||
|
|
@ -109,3 +109,6 @@ AUTH_LDAP_USER_ATTR_MAP = {
|
||||||
"last_name": environ.get('AUTH_LDAP_ATTR_LASTNAME', 'sn'),
|
"last_name": environ.get('AUTH_LDAP_ATTR_LASTNAME', 'sn'),
|
||||||
"email": environ.get('AUTH_LDAP_ATTR_MAIL', 'mail')
|
"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'
|
||||||
|
|
|
||||||
|
|
@ -28,15 +28,6 @@ services:
|
||||||
start_period: 40s
|
start_period: 40s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
interval: 15s
|
interval: 15s
|
||||||
netbox-housekeeping:
|
|
||||||
<<: *netbox
|
|
||||||
command:
|
|
||||||
- /opt/netbox/housekeeping.sh
|
|
||||||
healthcheck:
|
|
||||||
test: ps -aux | grep -v grep | grep -q housekeeping || exit 1
|
|
||||||
start_period: 40s
|
|
||||||
timeout: 3s
|
|
||||||
interval: 15s
|
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: docker.io/postgres:17-alpine
|
image: docker.io/postgres:17-alpine
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
services:
|
services:
|
||||||
netbox: &netbox
|
netbox: &netbox
|
||||||
image: docker.io/netboxcommunity/netbox:${VERSION-v4.3-3.3.0}
|
image: docker.io/netboxcommunity/netbox:${VERSION-v4.4-3.4.0}
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
|
|
@ -31,18 +31,6 @@ services:
|
||||||
start_period: 20s
|
start_period: 20s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
interval: 15s
|
interval: 15s
|
||||||
netbox-housekeeping:
|
|
||||||
<<: *netbox
|
|
||||||
depends_on:
|
|
||||||
netbox:
|
|
||||||
condition: service_healthy
|
|
||||||
command:
|
|
||||||
- /opt/netbox/housekeeping.sh
|
|
||||||
healthcheck:
|
|
||||||
test: ps -aux | grep -v grep | grep -q housekeeping || exit 1
|
|
||||||
start_period: 20s
|
|
||||||
timeout: 3s
|
|
||||||
interval: 15s
|
|
||||||
|
|
||||||
# postgres
|
# postgres
|
||||||
postgres:
|
postgres:
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
SLEEP_SECONDS=${HOUSEKEEPING_INTERVAL:=86400}
|
|
||||||
echo "Interval set to ${SLEEP_SECONDS} seconds"
|
|
||||||
while true; do
|
|
||||||
date
|
|
||||||
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py housekeeping
|
|
||||||
sleep "${SLEEP_SECONDS}s"
|
|
||||||
done
|
|
||||||
1
env/netbox.env
vendored
1
env/netbox.env
vendored
|
|
@ -15,7 +15,6 @@ EMAIL_USERNAME=netbox
|
||||||
EMAIL_USE_SSL=false
|
EMAIL_USE_SSL=false
|
||||||
EMAIL_USE_TLS=false
|
EMAIL_USE_TLS=false
|
||||||
GRAPHQL_ENABLED=true
|
GRAPHQL_ENABLED=true
|
||||||
HOUSEKEEPING_INTERVAL=86400
|
|
||||||
MEDIA_ROOT=/opt/netbox/netbox/media
|
MEDIA_ROOT=/opt/netbox/netbox/media
|
||||||
METRICS_ENABLED=false
|
METRICS_ENABLED=false
|
||||||
REDIS_CACHE_DATABASE=1
|
REDIS_CACHE_DATABASE=1
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
django-auth-ldap==5.1.0
|
django-auth-ldap==5.2.0
|
||||||
dulwich==0.22.8
|
dulwich==0.24.1
|
||||||
python3-saml==1.16.0
|
python3-saml==1.16.0
|
||||||
--no-binary lxml
|
--no-binary lxml
|
||||||
--no-binary xmlsec
|
--no-binary xmlsec
|
||||||
sentry-sdk[django]==2.27.0
|
sentry-sdk[django]==2.35.2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue