diff --git a/config.sh b/config.sh index 5475bb0..7b2d0a8 100755 --- a/config.sh +++ b/config.sh @@ -603,9 +603,21 @@ generate_nginx_configs() { # Homepage services.yaml # ============================================================================= +# Read a variable from .env with fallback default +read_env_var() { + local key=$1 default=$2 + local val + val=$(grep "^${key}=" "$ENV_FILE" 2>/dev/null | head -1 | cut -d= -f2-) + echo "${val:-$default}" +} + generate_services_yaml() { local domain="${CONFIGURED_DOMAIN:-cmlite.org}" + # Read embed proxy ports from .env (supports multi-instance port customization) + local rc_port; rc_port=$(read_env_var ROCKETCHAT_EMBED_PORT 8891) + local jitsi_port; jitsi_port=$(read_env_var JITSI_EMBED_PORT 8893) + mkdir -p "$(dirname "$SERVICES_YAML")" cat > "$SERVICES_YAML" << YAML @@ -868,14 +880,14 @@ generate_services_yaml() { - Rocket.Chat: icon: mdi-chat - href: "http://localhost:8891" - description: Team chat (port 8891) + href: "http://localhost:$rc_port" + description: Team chat (port $rc_port) container: rocketchat-changemaker - Jitsi Meet: icon: mdi-video - href: "http://localhost:8893" - description: Video conferencing (port 8893) + href: "http://localhost:$jitsi_port" + description: Video conferencing (port $jitsi_port) container: jitsi-web-changemaker - Local - Integrations: