Skip to content

Commit

Permalink
Merge pull request #1215 from tobiasge/prepare-nb40
Browse files Browse the repository at this point in the history
Prepare for NetBox 4.0
  • Loading branch information
tobiasge committed May 6, 2024
2 parents 3d6b6c2 + 1e78c38 commit f5a3e3f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ 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
# 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
Expand Down
8 changes: 0 additions & 8 deletions configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,3 @@ def _environ_get_and_map(variable_name: str, default: str | None = None, map_fn:
# 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')
5 changes: 2 additions & 3 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ else
fi

./manage.py shell --interface python <<END
from django.contrib.auth.models import User
from users.models import Token
from users.models import Token, User
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}')
END

Expand Down
1 change: 0 additions & 1 deletion requirements-container.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
django-auth-ldap==4.8.0
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

0 comments on commit f5a3e3f

Please sign in to comment.