Fix Node-RED container net: extra_hosts, CODE HTTPS, force-recreate

Detect host LAN IP and CODE URL so OCS/Collabora work unattended
on each VM. Avoid 127.0.1.1 Nextcloud DNS and HTTP-to-TLS CODE.
This commit is contained in:
root
2026-08-22 19:41:55 +02:00
parent 4d1c1285f5
commit 078252b125
4 changed files with 172 additions and 24 deletions
+8
View File
@@ -35,6 +35,13 @@ NODERED_CONTAINER="${NODERED_CONTAINER:-nextcloud-node-red}"
NODERED_PORT="${NODERED_PORT:-1880}"
CODE_CONTAINER="${CODE_CONTAINER:-code}"
COLLABORA_IP="${COLLABORA_IP:-}"
# Aldrig http://127.0.0.1:9980 eller http://host.docker.internal:9980
case "${COLLABORA_URL:-https://code:9980}" in
http://127.0.0.1:*|http://localhost:*|http://host.docker.internal:*|\
https://127.0.0.1:*|https://localhost:*|https://host.docker.internal:*|"")
COLLABORA_URL="https://code:9980" ;;
*) COLLABORA_URL="${COLLABORA_URL}" ;;
esac
NEXTCLOUD_URL="${NEXTCLOUD_URL:-https://cloud.hannesahlin.se}"
[ -n "${NEXTCLOUD_URL}" ] || NEXTCLOUD_URL="https://cloud.hannesahlin.se"
@@ -69,6 +76,7 @@ PKG_SRC="${INSTALL_DIR}" \
NODERED_PORT="${NODERED_PORT}" \
CODE_CONTAINER="${CODE_CONTAINER}" \
COLLABORA_IP="${COLLABORA_IP}" \
COLLABORA_URL="${COLLABORA_URL}" \
NEXTCLOUD_URL="${NEXTCLOUD_URL}" \
INSTALL_USER="${INSTALL_USER:-}" \
bash "${SCRIPT_DIR}/scripts/integrate-into-nodered.sh"