1
0
Fork 0
mirror of https://github.com/librenms/docker.git synced 2026-07-21 09:18:49 +00:00

Add LIBRENMS_BASE_URL env var (#95 #99 #100)

This commit is contained in:
CrazyMax 2020-07-10 22:52:25 +02:00
parent 5c00943ddb
commit ee2d7dd04d
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
3 changed files with 16 additions and 1 deletions

View file

@ -1,5 +1,9 @@
# Changelog
## 1.65.1-RC2 (2020/07/10)
* Add `LIBRENMS_BASE_URL` env var (#95 #99 #100)
## 1.65.1-RC1 (2020/07/10)
* LibreNMS 1.65.1

View file

@ -41,6 +41,7 @@
### Misc
* `LIBRENMS_BASE_URL`: URL of your LibreNMS instance (default `/`)
* `LIBRENMS_SNMP_COMMUNITY`: This container's SNMP v2c community string (default `librenmsdocker`)
* `LIBRENMS_WEATHERMAP`: Enable LibreNMS [Weathermap plugin](https://docs.librenms.org/Extensions/Weathermap/) (default `false`)
* `LIBRENMS_WEATHERMAP_SCHEDULE`: CRON expression format (default `*/5 * * * *`)

View file

@ -41,6 +41,8 @@ DB_NAME=${DB_NAME:-librenms}
DB_USER=${DB_USER:-librenms}
DB_TIMEOUT=${DB_TIMEOUT:-30}
LIBRENMS_BASE_URL=${LIBRENMS_BASE_URL:-/}
# Timezone
echo "Setting timezone to ${TZ}..."
ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime
@ -88,7 +90,7 @@ rm -f ${LIBRENMS_PATH}/config.d/*
echo "Setting LibreNMS configuration..."
# Env : Database
# Env file
if [ -z "$DB_HOST" ]; then
>&2 echo "ERROR: DB_HOST must be defined"
exit 1
@ -99,6 +101,7 @@ if [ -z "$DB_PASSWORD" ]; then
exit 1
fi
cat > ${LIBRENMS_PATH}/.env <<EOL
APP_URL=${LIBRENMS_BASE_URL}
DB_HOST=${DB_HOST}
DB_PORT=${DB_PORT}
DB_DATABASE=${DB_NAME}
@ -115,6 +118,13 @@ EOL
EOL
ln -sf /data/logs ${LIBRENMS_PATH}/logs
# Config : Server
cat > ${LIBRENMS_PATH}/config.d/server.php <<EOL
<?php
\$config['own_hostname'] = '$(hostname)';
\$config['base_url'] = '${LIBRENMS_BASE_URL}';
EOL
# Config : User
cat > ${LIBRENMS_PATH}/config.d/user.php <<EOL
<?php