Skip to content

Commit e2503cd

Browse files
ben221199alexmv
authored andcommitted
Add a setting for load balancer IPs.
1 parent 26c0b81 commit e2503cd

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ putting it in `/opt/docker/zulip/zulip/certs/` (by default, the
209209
`zulip` container startup script will generate a self-signed certificate and
210210
install it in that directory).
211211

212+
**Load balancer**. To tell Zulip it's behind a load balancer, you can set
213+
`LOADBALANCER_IPS` to a comma-separated list of IPs. This will tell Zulip
214+
to pass the real IP of the client instead of the IP of the load balancer itself
215+
by [setting the IPs][loadbalancer-ips] under `[loadbalancer]` in `zulip.conf`.
216+
217+
[loadbalancer-ips]: https://zulip.readthedocs.io/en/latest/production/deployment.html#configuring-zulip-to-trust-proxies
218+
212219
### Manual configuration
213220

214221
The way the environment variables configuration process described in

entrypoint.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,32 @@ nginxConfiguration() {
133133
}
134134
additionalPuppetConfiguration() {
135135
echo "Executing additional puppet configuration ..."
136+
137+
local changedPuppetConf=false
138+
136139
if [ "$QUEUE_WORKERS_MULTIPROCESS" == "True" ] || [ "$QUEUE_WORKERS_MULTIPROCESS" == "true" ]; then
137140
echo "Setting queue workers to run in multiprocess mode ..."
138141
crudini --set /etc/zulip/zulip.conf application_server queue_workers_multiprocess true
142+
changedPuppetConf=true
139143
elif [ "$QUEUE_WORKERS_MULTIPROCESS" == "False" ] || [ "$QUEUE_WORKERS_MULTIPROCESS" == "false" ]; then
140144
echo "Setting queue workers to run in multithreaded mode ..."
141145
crudini --set /etc/zulip/zulip.conf application_server queue_workers_multiprocess false
146+
changedPuppetConf=true
142147
else
143-
echo "No additional puppet configuration executed."
144-
return 0
148+
echo "No additional puppet configuration executed for queue workers."
149+
fi
150+
151+
if [ -n "$LOADBALANCER_IPS" ]; then
152+
echo "Setting IPs for load balancer"
153+
crudini --set /etc/zulip/zulip.conf loadbalancer ips "${LOADBALANCER_IPS}"
154+
changedPuppetConf=true
155+
else
156+
echo "No additional puppet configuration executed for load balancer IPs."
157+
fi
158+
159+
if [ "$changedPuppetConf" = true ]; then
160+
/home/zulip/deployments/current/scripts/zulip-puppet-apply -f
145161
fi
146-
/home/zulip/deployments/current/scripts/zulip-puppet-apply -f
147162
}
148163
configureCerts() {
149164
case "$SSL_CERTIFICATE_GENERATION" in

0 commit comments

Comments
 (0)