diff --git a/readme-vars.yml b/readme-vars.yml index 7d8d435..236bdd8 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -21,25 +21,30 @@ param_volumes: - { vol_path: "/config", vol_host_path: "", desc: "config directory volume mapping" } param_usage_include_env: true param_env_vars: + - { env_var: "TZ", env_value: "", desc: "Timezone (i.e., America/New_York)" } - { env_var: "SUPERUSER_EMAIL", env_value: "", desc: "Email address for `admin` account" } - { env_var: "SUPERUSER_PASSWORD", env_value: "", desc: "Password for `admin` account" } - { env_var: "ALLOWED_HOST", env_value: "", desc: "The hostname you will use to access the app (i.e., netbox.example.com)" } - - { env_var: "BASE_PATH", env_value: "", desc: "The path you will use to access the app (i.e., /netbox, optional, default: none)" } - - { env_var: "DB_NAME", env_value: "", desc: "Database name (optional, default: netbox)" } + - { env_var: "DB_NAME", env_value: "", desc: "Database name (default: netbox)" } - { env_var: "DB_USER", env_value: "", desc: "Database user" } - { env_var: "DB_PASSWORD", env_value: "", desc: "Database password" } - - { env_var: "DB_HOST", env_value: "", desc: "Database host (optional, default: postgres)" } - - { env_var: "DB_PORT", env_value: "", desc: "Database port (optional)" } - - { env_var: "REDIS_HOST", env_value: "", desc: "Redis host (optional, default: redis)" } - - { env_var: "REDIS_PORT", env_value: "", desc: "Redis port number (optional, default: 6379)" } - - { env_var: "REDIS_PASSWORD", env_value: "", desc: "Redis password (optional, default: none)" } + - { env_var: "DB_HOST", env_value: "", desc: "Database host (default: postgres)" } + - { env_var: "DB_PORT", env_value: "", desc: "Database port (defaul: 5432)" } + - { env_var: "REDIS_HOST", env_value: "", desc: "Redis host (default: redis)" } + - { env_var: "REDIS_PORT", env_value: "", desc: "Redis port number (default: 6379)" } + - { env_var: "REDIS_PASSWORD", env_value: "", desc: "Redis password (default: none)" } + - { env_var: "REDIS_DB_TASK", env_value: "", desc: "Redis database ID for tasks (default: 0)" } + - { env_var: "REDIS_DB_CACHE", env_value: "", desc: "Redis database ID for caching (default: 1)" } + +opt_param_usage_include_env: true +opt_param_env_vars: + - { env_var: "BASE_PATH", env_value: "", desc: "The path you will use to access the app (i.e., /netbox, optional, default: none)" } - { env_var: "REMOTE_AUTH_ENABLED", env_value: "", desc: "Enable remote authentication (optional, default: False)" } - { env_var: "REMOTE_AUTH_BACKEND", env_value: "", desc: "Python path to the custom Django authentication backend to use for external user authentication (optional, default: netbox.authentication.RemoteUserBackend)" } - { env_var: "REMOTE_AUTH_HEADER", env_value: "", desc: "Name of the HTTP header which informs NetBox of the currently authenticated user. (optional, default: HTTP_REMOTE_USER)" } - { env_var: "REMOTE_AUTH_AUTO_CREATE_USER", env_value: "", desc: "If true, NetBox will automatically create local accounts for users authenticated via a remote service (optional, default: False)" } - { env_var: "REMOTE_AUTH_DEFAULT_GROUPS", env_value: "", desc: "The list of groups to assign a new user account when created using remote authentication (optional, default: [])" } - { env_var: "REMOTE_AUTH_DEFAULT_PERMISSIONS", env_value: "", desc: "A mapping of permissions to assign a new user account when created using remote authentication (optional, default: {})" } - - { env_var: "TZ", env_value: "", desc: "Timezone (i.e., America/New_York)" } param_usage_include_ports: true param_ports: @@ -48,12 +53,13 @@ param_ports: # application setup block app_setup_block_enabled: true app_setup_block: | - Netbox requires a postgres database. + Netbox requires a postgres database and a redis instance. Access the WebUI at :8000. For more information, check out [NetBox](https://github.com/netbox-community/netbox). # changelog changelogs: + - { date: "26.04.21:", desc: "Added Redis database environment variables." } - { date: "03.02.21:", desc: "Added remote authentication environment variables." } - { date: "02.01.21:", desc: "Added BASE_PATH environment variable." } - { date: "23.08.20:", desc: "Initial Release." } diff --git a/root/defaults/configuration.py b/root/defaults/configuration.py index 78480c3..ca8c460 100644 --- a/root/defaults/configuration.py +++ b/root/defaults/configuration.py @@ -32,7 +32,7 @@ # 'SENTINELS': [('mysentinel.redis.example.com', 6379)], # 'SENTINEL_SERVICE': 'netbox', 'PASSWORD': '{{REDIS_PASSWORD}}', - 'DATABASE': 0, + 'DATABASE': {{REDIS_DB_TASK}}, 'DEFAULT_TIMEOUT': 300, 'SSL': False, }, @@ -43,7 +43,7 @@ # 'SENTINELS': [('mysentinel.redis.example.com', 6379)], # 'SENTINEL_SERVICE': 'netbox', 'PASSWORD': '{{REDIS_PASSWORD}}', - 'DATABASE': 1, + 'DATABASE': {{REDIS_DB_CACHE}}, 'DEFAULT_TIMEOUT': 300, 'SSL': False, } diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 607ea66..b6eb97e 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -13,6 +13,8 @@ NETBOX_CONF[DB_PORT]=${DB_PORT:-} NETBOX_CONF[REDIS_HOST]=${REDIS_HOST:-redis} NETBOX_CONF[REDIS_PORT]=${REDIS_PORT:-6379} NETBOX_CONF[REDIS_PASSWORD]=${REDIS_PASSWORD:-} +NETBOX_CONF[REDIS_DB_TASK]=${REDIS_DB_TASK:-0} +NETBOX_CONF[REDIS_DB_CACHE]=${REDIS_DB_CACHE:-1} NETBOX_CONF[REMOTE_AUTH_ENABLED]=${REMOTE_AUTH_ENABLED:-False} NETBOX_CONF[REMOTE_AUTH_BACKEND]=${REMOTE_AUTH_BACKEND:-netbox.authentication.RemoteUserBackend} NETBOX_CONF[REMOTE_AUTH_HEADER]=${REMOTE_AUTH_HEADER:-HTTP_REMOTE_USER}