Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
df16a431ca | |||
585e411cde | |||
e17baea76c | |||
8c95f32b0c | |||
d4b394c999 | |||
9c259adc88 | |||
582064f4cd |
@ -25,7 +25,7 @@ RUN pip install \
|
|||||||
# pinning django to the version required by netbox
|
# pinning django to the version required by netbox
|
||||||
# adding it here, to install the correct version of
|
# adding it here, to install the correct version of
|
||||||
# django-rq
|
# django-rq
|
||||||
'Django>=1.11,<2.1' \
|
'Django>=2.1.5,<2.2' \
|
||||||
# django-rq is used for webhooks
|
# django-rq is used for webhooks
|
||||||
django-rq
|
django-rq
|
||||||
|
|
||||||
|
@ -144,6 +144,7 @@ You can also dynamically add any other report to this same directory and Netbox
|
|||||||
### Custom Initialization Code (e.g. Automatically Setting Up Custom Fields)
|
### Custom Initialization Code (e.g. Automatically Setting Up Custom Fields)
|
||||||
|
|
||||||
When using `docker-compose`, all the python scripts present in `/opt/netbox/startup_scripts` will automatically be executed after the application boots in the context of `./manage.py`.
|
When using `docker-compose`, all the python scripts present in `/opt/netbox/startup_scripts` will automatically be executed after the application boots in the context of `./manage.py`.
|
||||||
|
The execution of the startup scripts can be prevented by setting the environment variable `SKIP_STARTUP_SCRIPTS` to `true`, e.g. in the file `env/netbox.env`.
|
||||||
|
|
||||||
That mechanism can be used for many things, e.g. to create Netbox custom fields:
|
That mechanism can be used for many things, e.g. to create Netbox custom fields:
|
||||||
|
|
||||||
@ -378,6 +379,7 @@ Compare the version with the list below to check whether a breaking change was i
|
|||||||
|
|
||||||
The following is a list of breaking changes of the `netbox-docker` project:
|
The following is a list of breaking changes of the `netbox-docker` project:
|
||||||
|
|
||||||
|
* 0.9.0: Upgrade to at least 2.1.5
|
||||||
* 0.8.0: Alpine linux was upgraded to 3.9 [#126][126]
|
* 0.8.0: Alpine linux was upgraded to 3.9 [#126][126]
|
||||||
* 0.7.0: The value of the `MAX_PAGE_SIZE` environment variable was changed to `1000`, which is the default of Netbox.
|
* 0.7.0: The value of the `MAX_PAGE_SIZE` environment variable was changed to `1000`, which is the default of Netbox.
|
||||||
* 0.6.0: The naming of the default startup_scripts were changed.
|
* 0.6.0: The naming of the default startup_scripts were changed.
|
||||||
|
@ -39,10 +39,14 @@ if not User.objects.filter(username='${SUPERUSER_NAME}'):
|
|||||||
Token.objects.create(user=u, key='${SUPERUSER_API_TOKEN}')
|
Token.objects.create(user=u, key='${SUPERUSER_API_TOKEN}')
|
||||||
END
|
END
|
||||||
|
|
||||||
for script in /opt/netbox/startup_scripts/*.py; do
|
if [ "$SKIP_STARTUP_SCRIPTS" == "true" ]; then
|
||||||
echo "⚙️ Executing '$script'"
|
echo "☇ Skipping startup scripts"
|
||||||
./manage.py shell --interface python < "${script}"
|
else
|
||||||
done
|
for script in /opt/netbox/startup_scripts/*.py; do
|
||||||
|
echo "⚙️ Executing '$script'"
|
||||||
|
./manage.py shell --interface python < "${script}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# copy static files
|
# copy static files
|
||||||
./manage.py collectstatic --no-input
|
./manage.py collectstatic --no-input
|
||||||
|
Reference in New Issue
Block a user