Skip to content

Commit

Permalink
New env var: EX_APPS_COUNT, EX_APPS_NET_FOR_HTTPS -> EX_APPS_NET (#…
Browse files Browse the repository at this point in the history
…15)

Signed-off-by: Alexander Piskun <[email protected]>
  • Loading branch information
bigcat88 authored Feb 23, 2024
1 parent 74648f5 commit 602745f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
```
2 changes: 1 addition & 1 deletion haproxy_ex_apps.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 602745f

Please sign in to comment.