Merge pull request #1215 from tobiasge/prepare-nb40

Prepare for NetBox 4.0
This commit is contained in:
Tobias Genannt 2024-05-06 18:57:57 +02:00 committed by GitHub
commit f5a3e3f955
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 3 additions and 15 deletions

View File

@ -31,14 +31,12 @@ 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 'psycopg' in the build process
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
# we have potential version conflicts and the build will fail. # we have potential version conflicts and the build will fail.
# That's why we just replace it in the original requirements.txt. # 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 \ /opt/netbox/venv/bin/pip install \
-r /requirements.txt \ -r /requirements.txt \
-r /requirements-container.txt -r /requirements-container.txt

View File

@ -337,11 +337,3 @@ SESSION_FILE_PATH = environ.get('SESSION_FILE_PATH', environ.get('SESSIONS_ROOT'
# Time zone (default: UTC) # Time zone (default: UTC)
TIME_ZONE = environ.get('TIME_ZONE', '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')

View File

@ -72,10 +72,9 @@ else
fi fi
./manage.py shell --interface python <<END ./manage.py shell --interface python <<END
from django.contrib.auth.models import User from users.models import Token, User
from users.models import Token
if not User.objects.filter(username='${SUPERUSER_NAME}'): if not User.objects.filter(username='${SUPERUSER_NAME}'):
u=User.objects.create_superuser('${SUPERUSER_NAME}', '${SUPERUSER_EMAIL}', '${SUPERUSER_PASSWORD}') u = User.objects.create_superuser('${SUPERUSER_NAME}', '${SUPERUSER_EMAIL}', '${SUPERUSER_PASSWORD}')
Token.objects.create(user=u, key='${SUPERUSER_API_TOKEN}') Token.objects.create(user=u, key='${SUPERUSER_API_TOKEN}')
END END

View File

@ -1,6 +1,5 @@
django-auth-ldap==4.8.0 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.2
dulwich==0.22.1 dulwich==0.22.1
psycopg[c,pool]==3.1.18
python3-saml==1.16.0 --no-binary lxml python3-saml==1.16.0 --no-binary lxml
sentry-sdk==2.0.1 sentry-sdk==2.0.1