Commit Graph

37 Commits

Author SHA1 Message Date
Christian Mäder 43c05d816d Dynamically load configuration files 2020-10-20 20:46:43 +02:00
eemil 6bada6660a Prefer secret to env variable if both are configured 2020-10-20 19:20:29 +02:00
Christian Mäder 5624ecc65e Remove the 'X-Forwarded-Proto' line from the nginx config
The reason is that in the default configuration nginx is only serving 'http' traffic.
So if an upstream proxy sets the 'X-Forwarded-Proto' header, because it is terminating
TLS, then nginx will overwrite it to 'http'. This will cause django to think the page
is served via 'http' and it will not create 'https://...' URLs.

Related to #292
2020-06-02 16:06:52 +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
Christian Mäder 013f81b791
♻️ Make netbox-worker it's own container
One container should ideally have one responsibility [1]. Therefore I
implemented the netbox-worker to start in it's own container. This is
possible, because netbox and the worker communicate via redis anyway.

They still use the same image underneath, just the "command" they
execute while starting different.

Or in other words: I see no reason to introduce supervisord, when we
already have docker-compose which can take care of running multiple
processes.

Also, here's another benefit: Now it's possible to view the logs of the
webhook worker independently of the other netbox logs (and vice-versa).

Other changes in this commit:
* I don't see a reason to put a password for Redis in the docker-compose
  setup, so I removed it.
* Slightly changed the nginx config, so that the nginx startup command
  becomes simpler and any error should be visible in the docker log.
* Some housekeeping in the `Dockerfile`.
* Added some troubleshooting advice regarding webhooks to the README.

I'd like to thank Brady (@bdlamprecht [2]) here who did the harder
work of figuring out what's even required to have webhooks working. [3]

[1] 
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#decouple-applications
[2] https://github.com/bdlamprecht
[3] https://github.com/ninech/netbox-docker/pull/90
2018-08-13 14:04:09 -07: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
Tobias Genannt b46bd58e0a
Move config to /etc/netbox/config (Fixes #54)
With this the configuration is moved to /etc/netbox/config and the
default reports directory is set to /etc/netbox/reports. This enables
the user to mount reports from a config map or persistent volume in
OpenShift.
2018-04-04 10:13:30 +02:00
Tobias Genannt 2a1b6e42a8 Externalize gunicorn-config
This moves the gunicorn_config.py into /etc/netbox so that it can be
easily mapped through a Openshift config map
2018-03-07 14:57:56 +01:00
Tobias Genannt 6a01a3379d Add django_ldap_auth
In the ldap.Dockerfile the django_ldap_auth module is installed to
enable authentication againt LDAP servers.
2018-02-27 10:09:14 +01:00
Tobias Genannt ef76e4e8ea Modifications for Openshift
With these modifications the netbox containers can run on Openshift.
The configuration files can be imported from a config map to the
'/etc/netbox' directory and will be loaded from there.
2018-02-22 17:22:04 +01: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 55c31ae803
🐞 Convert numbers from ENV to int
Fixes #36
2018-01-15 11:33:40 +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 a18a1f22db
Merge branch 'master' into Allow-setting-ENFORCE_GLOBAL_UNIQUE-in-env 2017-12-01 17:56:03 +01:00
Viktor Fogelberg f96ddf1377 Allow setting ENFORCE_GLOBAL_UNIQUE in env 2017-12-01 17:48:20 +01:00
Christian Mäder 0dd34f3147
Merge branch 'master' into Enable-uploading-of-images 2017-12-01 17:32:25 +01:00
Viktor Fogelberg 1f114dfd34 Enable uploading of images
Set client_max_body_size to 10M so that we can upload images
2017-12-01 12:44:37 +01:00
Christian Mäder 7b69fd8a1c
Creates a token for admin by default 2017-11-29 15:08:55 +01:00
Christian Mäder 94746ac5de
🐞 The upstream repo remove the docker config
.. so I copied it over to this repo.
2017-10-13 10:10:43 +02:00
Ondrej Kinovic c8fa7b9054 use http_host insteda of server_name 2017-09-20 16:56:12 +02: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