From 602745f13b46f7324a6953faa42179db3e0e49d0 Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Fri, 23 Feb 2024 11:16:37 +0300 Subject: [PATCH] New env var: EX_APPS_COUNT, `EX_APPS_NET_FOR_HTTPS` -> `EX_APPS_NET` (#15) Signed-off-by: Alexander Piskun --- Dockerfile | 3 ++- README.md | 10 +++++++--- haproxy_ex_apps.cfg | 2 +- start.sh | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 78f3094..599ff0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,8 @@ USER root ENV HAPROXY_PORT 2375 ENV BIND_ADDRESS * -ENV EX_APPS_NET_FOR_HTTPS "localhost" +ENV EX_APPS_NET "localhost" +ENV EX_APPS_COUNT 50 RUN set -ex; \ apk add --no-cache \ diff --git a/README.md b/README.md index b985f54..3ec7335 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,11 @@ You should set `BIND_ADDRESS` to the IP on which server with ExApps can accept r `BIND_ADDRESS`: the address to use for port binding. (Usually needed only for remote installs, **must be accessible from the Nextcloud**) -`EX_APPS_NET_FOR_HTTPS`: only for custom remote ExApp installs with TLS, determines destination of requests to ExApps for HaProxy. +#### Only for ExApp installs with TLS: + +* `EX_APPS_NET`: determines destination of requests to ExApps for HaProxy. Default:`localhost` + +* `EX_APPS_COUNT`: determines amount of ports HaProxy will open to proxy requests to ExApps. Default:`50` ## Development @@ -139,8 +143,8 @@ After that create daemon in AppAPI from the Docker Socket Proxy template, with n _Currently_, not all external applications support the IPv6 protocol, and most often they listen only on IPv4, so in the case of using HTTPS when HaProxy forwards incoming connections, you should additionally -specify the EX_APPS_NET_FOR_HTTPS variable when creating the container: +specify the EX_APPS_NET variable when creating the container: ```shell - -e EX_APPS_NET_FOR_HTTPS="ipv4@localhost" + -e EX_APPS_NET="ipv4@localhost" ``` diff --git a/haproxy_ex_apps.cfg b/haproxy_ex_apps.cfg index 42a7e9d..374ba63 100644 --- a/haproxy_ex_apps.cfg +++ b/haproxy_ex_apps.cfg @@ -25,4 +25,4 @@ frontend ex_apps backend bk_ex_apps mode http - server ex_apps EX_APPS_NET_FOR_HTTPS_PLACEHOLDER + server ex_apps EX_APPS_NET_PLACEHOLDER diff --git a/start.sh b/start.sh index 10f2c94..4951ae7 100644 --- a/start.sh +++ b/start.sh @@ -4,8 +4,8 @@ sed -i "s|NC_PASSWORD_PLACEHOLDER|$NC_HAPROXY_PASSWORD|" /haproxy.cfg if [ -f "/certs/cert.pem" ]; then sed -i "s|BIND_ADDRESS_PLACEHOLDER|bind $BIND_ADDRESS:$HAPROXY_PORT v4v6 ssl crt /certs/cert.pem|" /haproxy.cfg - sed -i "s|BIND_ADDRESS_PLACEHOLDER|bind $BIND_ADDRESS:23000-23999 v4v6 ssl crt /certs/cert.pem|" /haproxy_ex_apps.cfg - sed -i "s|EX_APPS_NET_FOR_HTTPS_PLACEHOLDER|$EX_APPS_NET_FOR_HTTPS|" /haproxy_ex_apps.cfg + sed -i "s|BIND_ADDRESS_PLACEHOLDER|bind $BIND_ADDRESS:23000-23$EX_APPS_COUNT v4v6 ssl crt /certs/cert.pem|" /haproxy_ex_apps.cfg + sed -i "s|EX_APPS_NET_PLACEHOLDER|$EX_APPS_NET|" /haproxy_ex_apps.cfg # Chmod certs to be accessible by haproxy chmod 644 /certs/cert.pem else