Commit Graph

38 Commits

Author SHA1 Message Date
Tobias Genannt
e141d9f16d Prepare for Netbox 4.0 2024-04-17 14:09:24 +02:00
Florian Knodt
607ccd10bf docker-entrypoint.sh: clarify default token message
When a default admin API token is found, a warning is displayed. As it is only called "token", some users might not know what token is referred to. Also the message should give a hint or link to a documentation on how to remove it.
2024-02-22 07:10:06 +01:00
Marc
29e37a31d7
Catch DoesNotExist preventing startup
Fixes failing startup because of python error:

```
Traceback (most recent call last):
  File "/opt/netbox/netbox/./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute
    output = self.handle(*args, **options)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/commands/shell.py", line 127, in handle
    exec(sys.stdin.read(), globals())
  File "<string>", line 2, in <module>
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/models/query.py", line 650, in get
    raise self.model.DoesNotExist(
users.models.Token.DoesNotExist: Token matching query does not exist.
```
2023-03-15 23:04:04 +01:00
Tobias Genannt
3e2bf7ec93 Don't create superuser with default credentials 2023-03-15 12:23:36 +01:00
Tobias Genannt
e60a746eee Fixes #947: Rebuild search index when needed
This rebuilds the search index when models where updated.
2023-02-23 08:37:53 +01:00
Tobias Genannt
1779ba790d Removed warning for initializer scripts 2022-11-30 09:51:36 +01:00
Tobias Genannt
6f1d46d765 Initializers are now a plugin 2022-08-30 16:01:43 +02:00
Mike Kazantsev
fc4b78f74a Print last line of django db connection error while waiting for db to start
Fixes #562
2021-09-02 20:22:03 +05:00
Tobias Genannt
9142aaf78e django-cacheops has been removed from Netbox 3.0.0 2021-08-21 18:22:24 +02:00
Tobias Genannt
4d320f34d5 Optimise migrations on startup
The migrations are only started if there are some that have not been
applied. Additionally the maintenace task needed after an update are
now run after the migrations
2021-05-05 11:42:25 +02:00
Erick Turnquist
6e7d5a6f59 Fix quoting of exec argument in the entrypoint script 2021-04-15 17:36:14 -04:00
Christian Mäder
04ac3d5f4b Format shell scripts with shfmt 2021-02-08 18:56:30 +01:00
Christian Mäder
c6df6a040a Fix shellcheck complaint 2021-02-08 18:56:30 +01:00
Robin Schneider
ee40e339c8
NetBox should always be referred to as NetBox
Fix all instances of "Netbox".

```Shell
git ls-files -z . | xargs --null -I '{}' find './{}' -type f -print0 | xargs --null sed --in-place --regexp-extended 's#Netbox#NetBox#g;'
```

Ref: https://netbox.readthedocs.io/en/stable/development/style-guide/#branding
2021-02-04 21:48:08 +01:00
Tobias Genannt
d273391773 Gunicorn is replaced with nginx-unit
We now serve Netbox with an nginx-unit instance instead of Gunicorn.
This allows us to get rid of the extra Nginx container because Unit is
also serving the static files. The static files are now collected at container
buildtime instead of every startup.
2021-01-15 09:22:22 +01:00
eemil
6bada6660a Prefer secret to env variable if both are configured 2020-10-20 19:20:29 +02:00
Christian Mäder
b118cd5812 Building the Docker image with Github Actions 2019-12-23 18:21:08 +01:00
Christian Mäder
0a9991de96
Merge pull request #186 from netbox-community/non-root
Non root
2019-12-20 14:21:34 +01:00
Christian Mäder
05d32ae705 Massive speedup in executing startup_scripts 2019-12-14 18:16:31 +01:00
Christian Mäder
5e92352b0a set umask in entrypoint 2019-11-26 12:09:26 +01:00
Christian Mäder
79d349133e fix typo 2019-10-13 14:03:22 +02:00
Christian Mäder
20c234a96e Introduce $SKIP_SUPERUSER
This adds a new variable to skip the creation of the superuser.
That is useful for LDAP and for production environments.

Fixes #160
2019-10-12 14:49:40 +02:00
Tobias Genannt
8c95f32b0c Make startup scripts optional
To optimize the application boot time the startup scripts can now be
disabled by an ENV variable. The default when the variable is not set,
is to run the startup scripts. This means that the default behaviour is
not changed from earlier releases.
2019-03-11 12:31:41 +01:00
Christian Mäder
ae9e945851
Remove deprecation warning for netboxcommunity images 2019-02-06 12:38:36 +01:00
Christian Mäder
c7ab15f914
Consistent variable use in build scripts 2019-02-06 12:30:08 +01:00
Stefan Schlesinger
cb37e3ba92
Update docker-entrypoint.sh
Make netbox-docker function with  v2.4-beta1 again, fixes #84.

> The shell --plain option is deprecated in favor of -i python or --interface python.
> The shell --interface option now accepts python to force use of the “plain” Python interpreter.
https://docs.djangoproject.com/en/2.0/releases/1.10/#deprecated-features-1-10
2018-07-24 10:56:46 +02:00
Christoph Petrausch
2579036b0a Fixed missing " 2018-04-19 11:55:41 +02:00
Christoph Petrausch
f124417f69 Added username and email of superuser 2018-04-19 11:53:55 +02:00
Christoph Petrausch
d9b9a8adda Do not print the admin credentials. All outputs from STDOUT may end up in a central log store. This will compromise the superuser credentials. 2018-04-18 13:39:54 +02:00
Christian Mäder
43cb9f7e50
Include Initializers
Initializers are startup scripts for common tasks like creating custom
fields. These are problems many users of Netbox Docker potentially face
and are therefore worth sharing.
2018-02-16 10:25:51 +01:00
David Dieulivol
8e98b8d870 Load custom fields when creating the container. 2018-01-25 09:58:27 +01:00
Christian Mäder
bd9298e668
❇️ Make the default configuration cluster ready
This changes the default configuration to be better prepared for
usage with container management platforms, such as Docker Swarm,
Kubernetes or OpenShift.

Closes #27.
2017-12-14 12:53:19 +01:00
Christian Mäder
7b69fd8a1c
Creates a token for admin by default 2017-11-29 15:08:55 +01:00
Christian Mäder
d58930ab67
🐳 Adds the possibility to overwrite the CMD 2017-08-30 11:10:15 +02:00
Christian Mäder
ab0c255040
🐳 Change to the actual workdir 2017-08-30 11:09:24 +02:00
Christian Mäder
1072d243a3
Fixes logging config that prevented gunicon launch 2017-06-19 09:24:35 +02:00
Christian Mäder
fee1eed522
Checks if the superuser exists before creating it 2017-04-21 13:43:44 +02:00
Jeremy Stretch
582b2abea8 Copied Docker components from main repo 2017-04-19 10:48:21 -04:00