Allow use of ports other than 8123 in HA (#2307)

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
Felipe Santos
2021-12-22 13:51:10 -03:00
committed by GitHub
parent 455a992805
commit 21215aa9d0
4 changed files with 10 additions and 2 deletions

View File

@@ -13,6 +13,8 @@ KEYFILE=$(bashio::config 'keyfile')
CERTFILE=$(bashio::config 'certfile')
HSTS=$(bashio::config 'hsts')
HA_PORT=$(bashio::core.port)
# Generate dhparams
if ! bashio::fs.file_exists "${DHPARAMS_PATH}"; then
bashio::log.info "Generating dhparams (this will take some time)..."
@@ -52,6 +54,7 @@ fi
sed -i "s#%%FULLCHAIN%%#$CERTFILE#g" /etc/nginx.conf
sed -i "s#%%PRIVKEY%%#$KEYFILE#g" /etc/nginx.conf
sed -i "s/%%DOMAIN%%/$DOMAIN/g" /etc/nginx.conf
sed -i "s/%%HA_PORT%%/$HA_PORT/g" /etc/nginx.conf
[ -n "$HSTS" ] && HSTS="add_header Strict-Transport-Security \"$HSTS\" always;"
sed -i "s/%%HSTS%%/$HSTS/g" /etc/nginx.conf