Skip to content

Commit

Permalink
LOADED_PLUGINS docker variable #975
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Jan 24, 2025
1 parent dd1580e commit c63f424
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ services:
- PORT=${PORT}
# ❗ DANGER ZONE BELOW - Setting ALWAYS_FRESH_INSTALL=true will delete the content of the /db & /config folders
- ALWAYS_FRESH_INSTALL=${ALWAYS_FRESH_INSTALL}
# - LOADED_PLUGINS=["DHCPLSS","PIHOLE","ASUSWRT","FREEBOX"]

11 changes: 9 additions & 2 deletions dockerfiles/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ else
echo "Config file saved to ${INSTALL_DIR}/config/app_conf_override.json"
fi

# 🔻 FOR BACKWARD COMPATIBILITY - REMOVE AFTER 12/12/2024
# 🔻 FOR BACKWARD COMPATIBILITY - REMOVE AFTER 12/12/2025

# Check if pialert.db exists, then create a symbolic link to app.db
if [ -f "${INSTALL_DIR_OLD}/db/${OLD_APP_NAME}.db" ]; then
Expand All @@ -66,7 +66,7 @@ fi
if [ -f "${INSTALL_DIR_OLD}/config/${OLD_APP_NAME}.conf" ]; then
ln -s "${INSTALL_DIR_OLD}/config/${OLD_APP_NAME}.conf" "${INSTALL_DIR}/config/${CONF_FILE}"
fi
# 🔺 FOR BACKWARD COMPATIBILITY - REMOVE AFTER 12/12/2024
# 🔺 FOR BACKWARD COMPATIBILITY - REMOVE AFTER 12/12/2025

# Copy starter .db and .conf if they don't exist
cp -na "${INSTALL_DIR}/back/${CONF_FILE}" "${INSTALL_DIR}/config/${CONF_FILE}"
Expand All @@ -83,6 +83,13 @@ if [ -n "${TZ}" ]; then
echo $TZ > /etc/timezone
fi

# if custom variables not set we do not need to do anything
if [ -n "${LOADED_PLUGINS}" ]; then
FILECONF="${INSTALL_DIR}/config/${CONF_FILE}"
echo "[INSTALL] Setup custom LOADED_PLUGINS variable"
sed -i "\#^LOADED_PLUGINS=#c\LOADED_PLUGINS=${LOADED_PLUGINS}" "${FILECONF}"
fi

echo "[INSTALL] Setup NGINX"
echo "Setting webserver to address ($LISTEN_ADDR) and port ($PORT)"
envsubst '$INSTALL_DIR $LISTEN_ADDR $PORT' < "${INSTALL_DIR}/install/netalertx.template.conf" > "${NGINX_CONFIG_FILE}"
Expand Down
3 changes: 1 addition & 2 deletions server/initialise.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,7 @@ def importConfigs (db, all_plugins):

# -----------------
# HANDLE APP_CONF_OVERRIDE via app_conf_override.json

# Assuming fullConfFolder is defined elsewhere

app_conf_override_path = fullConfFolder + '/app_conf_override.json'

if os.path.exists(app_conf_override_path):
Expand Down

0 comments on commit c63f424

Please sign in to comment.