Skip to content

Commit 8842e0c

Browse files
authored
Add base path option (#8)
* Add BASE_PATH environment variable * Update readme-vars.yml * Re-ordered changelog as per @tobbenb feedback
1 parent 6668a30 commit 8842e0c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

readme-vars.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ param_usage_include_env: true
2323
param_env_vars:
2424
- { env_var: "SUPERUSER_EMAIL", env_value: "<SUPERUSER_EMAIL>", desc: "Username for admin account" }
2525
- { env_var: "SUPERUSER_PASSWORD", env_value: "<SUPERUSER_PASSWORD>", desc: "Password for admin account" }
26-
- { env_var: "ALLOWED_HOST", env_value: "<ALLOWED_HOST>", desc: "The hostname you will use to access the app (i.e., netbox.example.com" }
26+
- { env_var: "ALLOWED_HOST", env_value: "<ALLOWED_HOST>", desc: "The hostname you will use to access the app (i.e., netbox.example.com)" }
27+
- { env_var: "BASE_PATH", env_value: "<BASE_PATH>", desc: "The path you will use to access the app (i.e., /netbox, optional, default: none)" }
2728
- { env_var: "DB_NAME", env_value: "<DB_NAME>", desc: "Databaes name (optional, default: netbox)" }
2829
- { env_var: "DB_USER", env_value: "<DB_USER>", desc: "Database user" }
2930
- { env_var: "DB_PASSWORD", env_value: "<DB_PASSWORD>", desc: "Database password" }
30-
- { env_var: "DB_HOST", env_value: "<DB_HOST>", desc: "Database post (optional, default: postgres" }
31+
- { env_var: "DB_HOST", env_value: "<DB_HOST>", desc: "Database post (optional, default: postgres)" }
3132
- { env_var: "DB_PORT", env_value: "<DB_PORT>", desc: "Database port (optional)" }
32-
- { env_var: "REDIS_HOST", env_value: "<REDIS_HOST>", desc: "Redis host (optional, default: redis" }
33+
- { env_var: "REDIS_HOST", env_value: "<REDIS_HOST>", desc: "Redis host (optional, default: redis)" }
3334
- { env_var: "REDIS_PORT", env_value: "<REDIS_PORT>", desc: "Redis port number (optional, default: 6379)" }
3435
- { env_var: "REDIS_PASSWORD", env_value: "<REDIS_PASSWORD>", desc: "Redis password (optional, default: none)" }
3536
- { env_var: "TZ", env_value: "<TZ>", desc: "Timezone (i.e., America/New_York)" }
@@ -45,4 +46,5 @@ app_setup_block: |
4546
4647
# changelog
4748
changelogs:
49+
- { date: "02.01.21:", desc: "Added BASE_PATH environment variable." }
4850
- { date: "23.08.20:", desc: "Initial Release." }

root/defaults/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
# Base URL path if accessing NetBox within a directory. For example, if installed at http://example.com/netbox/, set:
8585
# BASE_PATH = 'netbox/'
86-
BASE_PATH = ''
86+
BASE_PATH = '{{BASE_PATH}}'
8787

8888
# Cache timeout in seconds. Set to 0 to dissable caching. Defaults to 900 (15 minutes)
8989
CACHE_TIMEOUT = 900

root/etc/cont-init.d/50-config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mkdir -p /config/scripts
44

55
declare -A NETBOX_CONF
66
NETBOX_CONF[ALLOWED_HOST]=${ALLOWED_HOST:-netbox.example.com}
7+
NETBOX_CONF[BASE_PATH]=${BASE_PATH:-}
78
NETBOX_CONF[DB_NAME]=${DB_NAME:-netbox}
89
NETBOX_CONF[DB_USER]=${DB_USER:-root}
910
NETBOX_CONF[DB_PASSWORD]=${DB_PASSWORD:-}

0 commit comments

Comments
 (0)