core: rework templating

Use frep [0] which uses the Go templating capabilities.

[0]: https://github.com/subchen/frep
This commit is contained in:
Saúl Ibarra Corretgé
2018-08-09 21:29:58 +02:00
parent 36d98c9e17
commit 1010c71b33
8 changed files with 26 additions and 37 deletions

View File

@@ -31,8 +31,8 @@ server {
# BOSH
location /http-bind {
proxy_pass ${XMPP_BOSH_URL_BASE}/http-bind;
proxy_pass {{ .Env.XMPP_BOSH_URL_BASE }}/http-bind;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host ${XMPP_DOMAIN};
proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
}
}

View File

@@ -13,11 +13,7 @@ if [[ ! -f /config/nginx/nginx.conf ]]; then
fi
if [[ ! -f /config/nginx/site-confs/default ]]; then
cp /defaults/default /config/nginx/site-confs/default
sed -i \
-e "s,\${XMPP_DOMAIN},$XMPP_DOMAIN,g" \
-e "s,\${XMPP_BOSH_URL_BASE},$XMPP_BOSH_URL_BASE,g" \
/config/nginx/site-confs/default
tpl /defaults/default > /config/nginx/site-confs/default
fi
if [[ ! -f /config/config.js ]]; then