From 229ff7d04bdd5bf8c47ccadb75f59e774b9baab9 Mon Sep 17 00:00:00 2001 From: MRColor Date: Wed, 3 Apr 2024 15:21:56 +0200 Subject: [PATCH] FIX - proxy setup now removes ports def to avoid network mode incompatibility --- .env.template | 2 +- docker-compose.yaml.template | 12 ++++++------ runme.ps1 | 6 +++++- runme.sh | 4 ++++ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.env.template b/.env.template index 7b8f947..e414a12 100644 --- a/.env.template +++ b/.env.template @@ -12,7 +12,7 @@ # ###################################################################### ## PROJECT_VERSION -PROJECT_VERSION=3.4.1 +PROJECT_VERSION=3.4.2 ## PROJECT NAME COMPOSE_PROJECT_NAME=money4band DS_PROJECT_SERVER_URL=https://discord.com/invite/Fq8eeazBAD diff --git a/docker-compose.yaml.template b/docker-compose.yaml.template index 06ddcdf..6c515b8 100644 --- a/docker-compose.yaml.template +++ b/docker-compose.yaml.template @@ -194,8 +194,8 @@ services: #ENABLE_MYSTNODE command: service --agreed-terms-and-conditions #ENABLE_MYSTNODE cap_add: #ENABLE_MYSTNODE - NET_ADMIN -#ENABLE_MYSTNODE ports: -#ENABLE_MYSTNODE - ${MYSTNODE_DASHBOARD_PORT}:4449 +#ENABLE_MYSTNODE ports: #RMLINE_IF_ENABLE_PROXY +#ENABLE_MYSTNODE - ${MYSTNODE_DASHBOARD_PORT}:4449 #RMLINE_IF_ENABLE_PROXY #ENABLE_MYSTNODE volumes: #ENABLE_MYSTNODE # You have 2 options #ENABLE_MYSTNODE - ./.data/mysterium-node:/var/lib/mysterium-node # Bind an host folder to the container (more insecure but simplier to port and backup) this option mount a new identity or a backed up one from the host file system @@ -214,8 +214,8 @@ services: #ENABLE_PEER2PROFIT image: mrcolorrain/peer2profit:latest #ENABLE_PEER2PROFIT environment: #ENABLE_PEER2PROFIT - P2P_EMAIL=$PEER2PROFIT_EMAIL -#ENABLE_PEER2PROFIT ports: -#ENABLE_PEER2PROFIT - 5901:5900 +#ENABLE_PEER2PROFIT ports: #RMLINE_IF_ENABLE_PROXY +#ENABLE_PEER2PROFIT - 5901:5900 #RMLINE_IF_ENABLE_PROXY #ENABLE_PEER2PROFIT # network_mode: service:tun2socks #ENABLE_PEER2PROFIT restart: always #ENABLE_PEER2PROFIT cpus: ${APP_CPU_LIMIT_HUGE} @@ -276,8 +276,8 @@ services: container_name: ${DEVICE_NAME}_webdashboard hostname: ${DEVICE_NAME}_webdashboard image: nginx:alpine-slim - ports: - - ${M4B_DASHBOARD_PORT}:80 + ports: #RMLINE_IF_ENABLE_PROXY + - ${M4B_DASHBOARD_PORT}:80 #RMLINE_IF_ENABLE_PROXY volumes: - ./.resources/.www:/usr/share/nginx/html:ro restart: always diff --git a/runme.ps1 b/runme.ps1 index 63a005e..00ce02b 100644 --- a/runme.ps1 +++ b/runme.ps1 @@ -1338,7 +1338,11 @@ function fn_setupProxy() { } else { print_and_log "GREEN" "No need to comment out 'hostname:' lines, as they are already commented or absent." } - + + # Remove all lines having the comment #RMLINE_IF_ENABLE_PROXY + $dkComContent = $dkComContent -replace '(?m)^.*#RMLINE_IF_ENABLE_PROXY.*\r?\n', '' + Set-Content $script:DKCOM_FILENAME -Value $dkComContent + print_and_log "BLUE" "Service port lines commented out due to proxy configuration to avoid Docker network_mode conflicts. You can still visit these services through the ports published on the proxy service." # Update the proxy configuration status $script:PROXY_CONF = $true diff --git a/runme.sh b/runme.sh index 12a5b90..7e83947 100644 --- a/runme.sh +++ b/runme.sh @@ -1263,6 +1263,10 @@ fn_setupProxy() { print_and_log "GREEN" "No need to comment out 'hostname:' lines, as they are already commented or absent." fi + # Remove all lines having the comment #RMLINE_IF_ENABLE_PROXY + sed -i '/#RMLINE_IF_ENABLE_PROXY/d' "$DKCOM_FILENAME" + print_and_log "BLUE" "Service port lines commented out due to proxy configuration to avoid Docker network_mode conflicts. You can still visit these services through the ports published on the proxy service." + # Update the proxy configuration status PROXY_CONF='true' sed -i 's/PROXY_CONFIGURATION_STATUS=0/PROXY_CONFIGURATION_STATUS=1/' ${ENV_FILENAME}