Compare commits
62 Commits
Author | SHA1 | Date | |
---|---|---|---|
f1ca9ab7eb | |||
dfa1904a82 | |||
b5c12a82d2 | |||
7e1750d3a3 | |||
651bbc49ba | |||
d72facf182 | |||
d7866d5f6e | |||
33430fda08 | |||
e020b46f6a | |||
51049781b4 | |||
1e681f30b3 | |||
4680e59a07 | |||
aaaa628585 | |||
e8fa63d18b | |||
17b9569094 | |||
1a3ace957a | |||
96799369fe | |||
f1de85d975 | |||
830d498094 | |||
714a132566 | |||
d0fbb37d66 | |||
87159b56be | |||
252ab33560 | |||
0603f1ebe9 | |||
164b01319c | |||
e6fedf16fe | |||
0594d2c3ae | |||
8b8447f5c6 | |||
f42e78ece2 | |||
c473fcc44a | |||
bcafc4328c | |||
fe27ebc907 | |||
364555eef6 | |||
451337750a | |||
bc6e4f81b0 | |||
e452004526 | |||
caba1b335d | |||
c798e881b0 | |||
b47e85ab3f | |||
28553202a4 | |||
69c5580a3e | |||
4d54bb172b | |||
44d0f47fb5 | |||
12af4233bd | |||
f703bba5e1 | |||
dd0c0b795d | |||
be7af2ea4c | |||
75690ac7dd | |||
ec603633ea | |||
c99172661c | |||
9bdd074ad7 | |||
d69dacef09 | |||
ebc5900206 | |||
8208dedb19 | |||
0d748ed392 | |||
23d5865e3d | |||
2037e42e45 | |||
055538cc21 | |||
5408cf5af0 | |||
22486fefb5 | |||
96bda7fa4f | |||
c085287e64 |
10
.github/workflows/push.yml
vendored
10
.github/workflows/push.yml
vendored
@ -14,12 +14,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Checks syntax of our code
|
name: Checks syntax of our code
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
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
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
- name: Lint Code Base
|
- name: Lint Code Base
|
||||||
@ -62,13 +62,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- id: git-checkout
|
- id: git-checkout
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- id: qemu-setup
|
- id: qemu-setup
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
- id: buildx-setup
|
- id: buildx-setup
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
- id: docker-build
|
- id: docker-build
|
||||||
name: Build the image for '${{ matrix.platform }}' with '${{ matrix.build_cmd }}'
|
name: Build the image for '${{ matrix.platform }}' with '${{ matrix.build_cmd }}'
|
||||||
run: ${{ matrix.build_cmd }}
|
run: ${{ matrix.build_cmd }}
|
||||||
|
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
@ -30,17 +30,17 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- id: source-checkout
|
- id: source-checkout
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- id: set-netbox-docker-version
|
- id: set-netbox-docker-version
|
||||||
name: Get Version of NetBox Docker
|
name: Get Version of NetBox Docker
|
||||||
run: echo "version=$(cat VERSION)" >>"$GITHUB_OUTPUT"
|
run: echo "version=$(cat VERSION)" >>"$GITHUB_OUTPUT"
|
||||||
shell: bash
|
shell: bash
|
||||||
- id: qemu-setup
|
- id: qemu-setup
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
- id: buildx-setup
|
- id: buildx-setup
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
- id: docker-build
|
- id: docker-build
|
||||||
name: Build the image with '${{ matrix.build_cmd }}'
|
name: Build the image with '${{ matrix.build_cmd }}'
|
||||||
run: ${{ matrix.build_cmd }}
|
run: ${{ matrix.build_cmd }}
|
||||||
@ -51,7 +51,7 @@ jobs:
|
|||||||
# docker.io
|
# docker.io
|
||||||
- id: docker-io-login
|
- id: docker-io-login
|
||||||
name: Login to docker.io
|
name: Login to docker.io
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: docker.io
|
registry: docker.io
|
||||||
username: ${{ secrets.dockerhub_username }}
|
username: ${{ secrets.dockerhub_username }}
|
||||||
@ -60,7 +60,7 @@ jobs:
|
|||||||
# quay.io
|
# quay.io
|
||||||
- id: quay-io-login
|
- id: quay-io-login
|
||||||
name: Login to Quay.io
|
name: Login to Quay.io
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: quay.io
|
registry: quay.io
|
||||||
username: ${{ secrets.quayio_username }}
|
username: ${{ secrets.quayio_username }}
|
||||||
@ -69,7 +69,7 @@ jobs:
|
|||||||
# ghcr.io
|
# ghcr.io
|
||||||
- id: ghcr-io-login
|
- id: ghcr-io-login
|
||||||
name: Login to GitHub Container Registry
|
name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,6 @@
|
|||||||
*.sql.gz
|
*.sql.gz
|
||||||
.netbox
|
.netbox
|
||||||
.initializers
|
.python-version
|
||||||
docker-compose.override.yml
|
docker-compose.override.yml
|
||||||
*.pem
|
*.pem
|
||||||
configuration/*
|
configuration/*
|
||||||
@ -11,5 +11,4 @@ configuration/ldap/*
|
|||||||
!configuration/ldap/ldap_config.py
|
!configuration/ldap/ldap_config.py
|
||||||
!configuration/logging.py
|
!configuration/logging.py
|
||||||
!configuration/plugins.py
|
!configuration/plugins.py
|
||||||
prometheus.yml
|
|
||||||
super-linter.log
|
super-linter.log
|
||||||
|
15
Dockerfile
15
Dockerfile
@ -31,8 +31,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \
|
|||||||
ARG NETBOX_PATH
|
ARG NETBOX_PATH
|
||||||
COPY ${NETBOX_PATH}/requirements.txt requirements-container.txt /
|
COPY ${NETBOX_PATH}/requirements.txt requirements-container.txt /
|
||||||
RUN \
|
RUN \
|
||||||
# We compile 'psycopg2' in the build process
|
# We compile 'psycopg' in the build process
|
||||||
sed -i -e '/psycopg2-binary/d' /requirements.txt && \
|
sed -i -e '/psycopg/d' /requirements.txt && \
|
||||||
# Gunicorn is not needed because we use Nginx Unit
|
# Gunicorn is not needed because we use Nginx Unit
|
||||||
sed -i -e '/gunicorn/d' /requirements.txt && \
|
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
|
# We need 'social-auth-core[all]' in the Docker image. But if we put it in our own requirements-container.txt
|
||||||
@ -62,19 +62,20 @@ RUN export DEBIAN_FRONTEND=noninteractive \
|
|||||||
libldap-common \
|
libldap-common \
|
||||||
libpq5 \
|
libpq5 \
|
||||||
libxmlsec1-openssl \
|
libxmlsec1-openssl \
|
||||||
|
openssh-client \
|
||||||
openssl \
|
openssl \
|
||||||
python3 \
|
python3 \
|
||||||
python3-distutils \
|
python3-distutils \
|
||||||
tini \
|
tini \
|
||||||
&& curl -sL https://nginx.org/keys/nginx_signing.key \
|
&& curl --silent --output /usr/share/keyrings/nginx-keyring.gpg \
|
||||||
> /etc/apt/trusted.gpg.d/nginx.asc && \
|
https://unit.nginx.org/keys/nginx-keyring.gpg \
|
||||||
echo "deb https://packages.nginx.org/unit/ubuntu/ jammy unit" \
|
&& 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 \
|
> /etc/apt/sources.list.d/unit.list \
|
||||||
&& apt-get update -qq \
|
&& apt-get update -qq \
|
||||||
&& apt-get install \
|
&& apt-get install \
|
||||||
--yes -qq --no-install-recommends \
|
--yes -qq --no-install-recommends \
|
||||||
unit=1.29.1-1~jammy \
|
unit=1.31.1-1~lunar \
|
||||||
unit-python3.10=1.29.1-1~jammy \
|
unit-python3.11=1.31.1-1~lunar \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY --from=builder /opt/netbox/venv /opt/netbox/venv
|
COPY --from=builder /opt/netbox/venv /opt/netbox/venv
|
||||||
|
4
build.sh
4
build.sh
@ -61,7 +61,7 @@ DOCKERFILE The name of Dockerfile to use.
|
|||||||
${_GREEN}Default:${_CLEAR} Dockerfile
|
${_GREEN}Default:${_CLEAR} Dockerfile
|
||||||
|
|
||||||
DOCKER_FROM The base image to use.
|
DOCKER_FROM The base image to use.
|
||||||
${_GREEN}Default:${_CLEAR} 'ubuntu:22.04'
|
${_GREEN}Default:${_CLEAR} 'ubuntu:23.04'
|
||||||
|
|
||||||
BUILDX_PLATFORMS
|
BUILDX_PLATFORMS
|
||||||
Specifies the platform(s) to build the image for.
|
Specifies the platform(s) to build the image for.
|
||||||
@ -219,7 +219,7 @@ fi
|
|||||||
# Determining the value for DOCKER_FROM
|
# Determining the value for DOCKER_FROM
|
||||||
###
|
###
|
||||||
if [ -z "$DOCKER_FROM" ]; then
|
if [ -z "$DOCKER_FROM" ]; then
|
||||||
DOCKER_FROM="docker.io/ubuntu:22.04"
|
DOCKER_FROM="docker.io/ubuntu:23.04"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###
|
###
|
||||||
|
@ -141,8 +141,11 @@ if 'CHANGELOG_RETENTION' in environ:
|
|||||||
CHANGELOG_RETENTION = _environ_get_and_map('CHANGELOG_RETENTION', None, _AS_INT)
|
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)
|
# 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:
|
if 'JOB_RETENTION' in environ:
|
||||||
JOBRESULT_RETENTION = _environ_get_and_map('JOBRESULT_RETENTION', None, _AS_INT)
|
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
|
# 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
|
# allowed. Otherwise, define a list of allowed origins using either CORS_ORIGIN_WHITELIST or
|
||||||
@ -272,9 +275,9 @@ if 'RACK_ELEVATION_DEFAULT_UNIT_WIDTH' in environ:
|
|||||||
|
|
||||||
# Remote authentication support
|
# Remote authentication support
|
||||||
REMOTE_AUTH_ENABLED = _environ_get_and_map('REMOTE_AUTH_ENABLED', 'False', _AS_BOOL)
|
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_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_GROUPS = _environ_get_and_map('REMOTE_AUTH_DEFAULT_GROUPS', '', _AS_LIST)
|
||||||
# REMOTE_AUTH_DEFAULT_PERMISSIONS = {}
|
# REMOTE_AUTH_DEFAULT_PERMISSIONS = {}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ services:
|
|||||||
env_file: env/netbox.env
|
env_file: env/netbox.env
|
||||||
user: 'unit:root'
|
user: 'unit:root'
|
||||||
volumes:
|
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:
|
healthcheck:
|
||||||
start_period: ${NETBOX_START_PERIOD-120s}
|
start_period: ${NETBOX_START_PERIOD-120s}
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
@ -39,7 +39,7 @@ services:
|
|||||||
interval: 15s
|
interval: 15s
|
||||||
test: "ps -aux | grep -v grep | grep -q housekeeping || exit 1"
|
test: "ps -aux | grep -v grep | grep -q housekeeping || exit 1"
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:15-alpine
|
image: postgres:16-alpine
|
||||||
env_file: env/postgres.env
|
env_file: env/postgres.env
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: "pg_isready -t 2 -d $$POSTGRES_DB -U $$POSTGRES_USER" ## $$ because of docker-compose
|
test: "pg_isready -t 2 -d $$POSTGRES_DB -U $$POSTGRES_USER" ## $$ because of docker-compose
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
version: '3.4'
|
version: '3.4'
|
||||||
services:
|
services:
|
||||||
netbox: &netbox
|
netbox: &netbox
|
||||||
image: docker.io/netboxcommunity/netbox:${VERSION-v3.4-2.6.0}
|
image: docker.io/netboxcommunity/netbox:${VERSION-v3.7-2.8.0}
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
@ -15,9 +15,9 @@ services:
|
|||||||
test: "curl -f http://localhost:8080/api/ || exit 1"
|
test: "curl -f http://localhost:8080/api/ || exit 1"
|
||||||
volumes:
|
volumes:
|
||||||
- ./configuration:/etc/netbox/config:z,ro
|
- ./configuration:/etc/netbox/config:z,ro
|
||||||
- netbox-media-files:/opt/netbox/netbox/media:z,rw
|
- netbox-media-files:/opt/netbox/netbox/media:rw
|
||||||
- netbox-reports-files:/opt/netbox/netbox/reports:z,rw
|
- netbox-reports-files:/opt/netbox/netbox/reports:rw
|
||||||
- netbox-scripts-files:/opt/netbox/netbox/scripts:z,rw
|
- netbox-scripts-files:/opt/netbox/netbox/scripts:rw
|
||||||
netbox-worker:
|
netbox-worker:
|
||||||
<<: *netbox
|
<<: *netbox
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -47,7 +47,7 @@ services:
|
|||||||
|
|
||||||
# postgres
|
# postgres
|
||||||
postgres:
|
postgres:
|
||||||
image: docker.io/postgres:15-alpine
|
image: docker.io/postgres:16-alpine
|
||||||
env_file: env/postgres.env
|
env_file: env/postgres.env
|
||||||
volumes:
|
volumes:
|
||||||
- netbox-postgres-data:/var/lib/postgresql/data
|
- netbox-postgres-data:/var/lib/postgresql/data
|
||||||
|
@ -51,7 +51,7 @@ exec unitd \
|
|||||||
--control unix:$UNIT_SOCKET \
|
--control unix:$UNIT_SOCKET \
|
||||||
--pid /opt/unit/unit.pid \
|
--pid /opt/unit/unit.pid \
|
||||||
--log /dev/stdout \
|
--log /dev/stdout \
|
||||||
--state /opt/unit/state/ \
|
--statedir /opt/unit/state/ \
|
||||||
--tmp /opt/unit/tmp/ \
|
--tmpdir /opt/unit/tmp/ \
|
||||||
--user unit \
|
--user unit \
|
||||||
--group root
|
--group root
|
||||||
|
2
env/netbox.env
vendored
2
env/netbox.env
vendored
@ -29,6 +29,6 @@ REDIS_INSECURE_SKIP_TLS_VERIFY=false
|
|||||||
REDIS_PASSWORD=H733Kdjndks81
|
REDIS_PASSWORD=H733Kdjndks81
|
||||||
REDIS_SSL=false
|
REDIS_SSL=false
|
||||||
RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases
|
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
|
SKIP_SUPERUSER=true
|
||||||
WEBHOOKS_ENABLED=true
|
WEBHOOKS_ENABLED=true
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
django-auth-ldap==4.3.0
|
django-auth-ldap==4.6.0
|
||||||
django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.13.2
|
django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.14.2
|
||||||
psycopg2==2.9.6
|
dulwich==0.21.7
|
||||||
python3-saml==1.15.0
|
psycopg[c,pool]==3.1.16
|
||||||
|
python3-saml==1.16.0
|
||||||
|
@ -2,3 +2,5 @@ LOGGING = {
|
|||||||
'version': 1,
|
'version': 1,
|
||||||
'disable_existing_loggers': True
|
'disable_existing_loggers': True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFAULT_PERMISSIONS = {}
|
Reference in New Issue
Block a user