Skip to content

Commit 8eb8f19

Browse files
committed
entrypoint: Only run puppet once.
If DISABLE_HTTPS was set, puppet would run twice, unnecessarily. Move the `zulip.conf` and subsequent Puppet application to be grouped with the others; this requires moving that above the nginx configuration, as it tweaks puppet-controlled nginx files.
1 parent 49df507 commit 8eb8f19

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

entrypoint.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@ setConfigurationValue() {
121121
}
122122
nginxConfiguration() {
123123
echo "Executing nginx configuration ..."
124-
if [ "$DISABLE_HTTPS" == "True" ] || [ "$DISABLE_HTTPS" == "true" ]; then
125-
echo "Disabling https in nginx."
126-
crudini --set /etc/zulip/zulip.conf application_server http_only true
127-
/home/zulip/deployments/current/scripts/zulip-puppet-apply -f
128-
fi
129124
sed -i "s/worker_processes .*/worker_processes $NGINX_WORKERS;/g" /etc/nginx/nginx.conf
130125
sed -i "s/client_max_body_size .*/client_max_body_size $NGINX_MAX_UPLOAD_SIZE;/g" /etc/nginx/nginx.conf
131126
sed -i "s/proxy_buffering .*/proxy_buffering $NGINX_PROXY_BUFFERING;/g" /etc/nginx/zulip-include/proxy_longpolling
@@ -134,6 +129,10 @@ nginxConfiguration() {
134129
puppetConfiguration() {
135130
echo "Executing puppet configuration ..."
136131

132+
if [ "$DISABLE_HTTPS" == "True" ] || [ "$DISABLE_HTTPS" == "true" ]; then
133+
echo "Disabling https in nginx."
134+
crudini --set /etc/zulip/zulip.conf application_server http_only true
135+
fi
137136
if [ "$QUEUE_WORKERS_MULTIPROCESS" == "True" ] || [ "$QUEUE_WORKERS_MULTIPROCESS" == "true" ]; then
138137
echo "Setting queue workers to run in multiprocess mode ..."
139138
crudini --set /etc/zulip/zulip.conf application_server queue_workers_multiprocess true
@@ -318,9 +317,9 @@ autoBackupConfiguration() {
318317
initialConfiguration() {
319318
echo "=== Begin Initial Configuration Phase ==="
320319
prepareDirectories
320+
puppetConfiguration
321321
nginxConfiguration
322322
configureCerts
323-
additionalPuppetConfiguration
324323
if [ "$MANUAL_CONFIGURATION" = "False" ] || [ "$MANUAL_CONFIGURATION" = "false" ]; then
325324
# Start with the settings template file.
326325
cp -a /home/zulip/deployments/current/zproject/prod_settings_template.py "$SETTINGS_PY"

0 commit comments

Comments
 (0)