Skip to content

Commit 602745f

Browse files
authored
New env var: EX_APPS_COUNT, EX_APPS_NET_FOR_HTTPS -> EX_APPS_NET (#15)
Signed-off-by: Alexander Piskun <[email protected]>
1 parent 74648f5 commit 602745f

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ USER root
44

55
ENV HAPROXY_PORT 2375
66
ENV BIND_ADDRESS *
7-
ENV EX_APPS_NET_FOR_HTTPS "localhost"
7+
ENV EX_APPS_NET "localhost"
8+
ENV EX_APPS_COUNT 50
89

910
RUN set -ex; \
1011
apk add --no-cache \

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ You should set `BIND_ADDRESS` to the IP on which server with ExApps can accept r
6363

6464
`BIND_ADDRESS`: the address to use for port binding. (Usually needed only for remote installs, **must be accessible from the Nextcloud**)
6565

66-
`EX_APPS_NET_FOR_HTTPS`: only for custom remote ExApp installs with TLS, determines destination of requests to ExApps for HaProxy.
66+
#### Only for ExApp installs with TLS:
67+
68+
* `EX_APPS_NET`: determines destination of requests to ExApps for HaProxy. Default:`localhost`
69+
70+
* `EX_APPS_COUNT`: determines amount of ports HaProxy will open to proxy requests to ExApps. Default:`50`
6771

6872
## Development
6973

@@ -139,8 +143,8 @@ After that create daemon in AppAPI from the Docker Socket Proxy template, with n
139143
140144
_Currently_, not all external applications support the IPv6 protocol, and most often they listen only on IPv4,
141145
so in the case of using HTTPS when HaProxy forwards incoming connections, you should additionally
142-
specify the EX_APPS_NET_FOR_HTTPS variable when creating the container:
146+
specify the EX_APPS_NET variable when creating the container:
143147

144148
```shell
145-
-e EX_APPS_NET_FOR_HTTPS="ipv4@localhost"
149+
-e EX_APPS_NET="ipv4@localhost"
146150
```

haproxy_ex_apps.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ frontend ex_apps
2525

2626
backend bk_ex_apps
2727
mode http
28-
server ex_apps EX_APPS_NET_FOR_HTTPS_PLACEHOLDER
28+
server ex_apps EX_APPS_NET_PLACEHOLDER

start.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ sed -i "s|NC_PASSWORD_PLACEHOLDER|$NC_HAPROXY_PASSWORD|" /haproxy.cfg
44

55
if [ -f "/certs/cert.pem" ]; then
66
sed -i "s|BIND_ADDRESS_PLACEHOLDER|bind $BIND_ADDRESS:$HAPROXY_PORT v4v6 ssl crt /certs/cert.pem|" /haproxy.cfg
7-
sed -i "s|BIND_ADDRESS_PLACEHOLDER|bind $BIND_ADDRESS:23000-23999 v4v6 ssl crt /certs/cert.pem|" /haproxy_ex_apps.cfg
8-
sed -i "s|EX_APPS_NET_FOR_HTTPS_PLACEHOLDER|$EX_APPS_NET_FOR_HTTPS|" /haproxy_ex_apps.cfg
7+
sed -i "s|BIND_ADDRESS_PLACEHOLDER|bind $BIND_ADDRESS:23000-23$EX_APPS_COUNT v4v6 ssl crt /certs/cert.pem|" /haproxy_ex_apps.cfg
8+
sed -i "s|EX_APPS_NET_PLACEHOLDER|$EX_APPS_NET|" /haproxy_ex_apps.cfg
99
# Chmod certs to be accessible by haproxy
1010
chmod 644 /certs/cert.pem
1111
else

0 commit comments

Comments
 (0)