From 24edb3eb0ec9dd51975a487f9c6c1aceb1b323f4 Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Fri, 23 Feb 2024 10:41:20 +0300 Subject: [PATCH 1/3] latest version for HaProxy image Signed-off-by: Alexander Piskun --- Dockerfile | 1 + README.md | 4 ++++ start.sh | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 78f3094..8031897 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ USER root ENV HAPROXY_PORT 2375 ENV BIND_ADDRESS * ENV EX_APPS_NET_FOR_HTTPS "localhost" +ENV EX_APPS_COUNT 50 RUN set -ex; \ apk add --no-cache \ diff --git a/README.md b/README.md index b985f54..ac6c383 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ 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. + Default:`localhost` + +`EX_APPS_COUNT`: only for remote ExApp installs with TLS, determines amount of ports HaProxy will open to proxy requests to ExApps. + Default:`50` ## Development diff --git a/start.sh b/start.sh index 10f2c94..149ae4d 100644 --- a/start.sh +++ b/start.sh @@ -4,7 +4,7 @@ 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|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_FOR_HTTPS_PLACEHOLDER|$EX_APPS_NET_FOR_HTTPS|" /haproxy_ex_apps.cfg # Chmod certs to be accessible by haproxy chmod 644 /certs/cert.pem From d0b1c44f901631735556956589e3a5b828beb5eb Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Fri, 23 Feb 2024 10:50:34 +0300 Subject: [PATCH 2/3] readme: little bit more clear Signed-off-by: Alexander Piskun --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ac6c383..b0c5a7b 100644 --- a/README.md +++ b/README.md @@ -63,11 +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. - Default:`localhost` +#### Only for ExApp installs with TLS: -`EX_APPS_COUNT`: only for remote ExApp installs with TLS, determines amount of ports HaProxy will open to proxy requests to ExApps. - Default:`50` +* `EX_APPS_NET_FOR_HTTPS`: 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 From 4dc12647ce26675dc9bb689efcf1d71169b24efc Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Fri, 23 Feb 2024 11:08:59 +0300 Subject: [PATCH 3/3] `EX_APPS_NET_FOR_HTTPS` -> `EX_APPS_NET` Signed-off-by: Alexander Piskun --- Dockerfile | 2 +- README.md | 6 +++--- haproxy_ex_apps.cfg | 2 +- start.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8031897..599ff0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ 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; \ diff --git a/README.md b/README.md index b0c5a7b..3ec7335 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ You should set `BIND_ADDRESS` to the IP on which server with ExApps can accept r #### Only for ExApp installs with TLS: -* `EX_APPS_NET_FOR_HTTPS`: determines destination of requests to ExApps for HaProxy. Default:`localhost` +* `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` @@ -143,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 149ae4d..4951ae7 100644 --- a/start.sh +++ b/start.sh @@ -5,7 +5,7 @@ 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-23$EX_APPS_COUNT 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|EX_APPS_NET_PLACEHOLDER|$EX_APPS_NET|" /haproxy_ex_apps.cfg # Chmod certs to be accessible by haproxy chmod 644 /certs/cert.pem else