Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
🔨 Use Hass.io DNS as NGinx resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Aug 21, 2019
1 parent b4b3b46 commit b45e1dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ide/rootfs/etc/cont-init.d/nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Community Hass.io Add-ons: IDE
# Configure the use of SSL in NGINX
# ==============================================================================
declare hassio_dns

bashio::config.require.ssl
if bashio::config.true 'ssl'; then
certfile=$(bashio::config 'certfile')
Expand All @@ -11,3 +13,7 @@ if bashio::config.true 'ssl'; then
sed -i "s#%%certfile%%#${certfile}#g" /etc/nginx/nginx-ssl.conf
sed -i "s#%%keyfile%%#${keyfile}#g" /etc/nginx/nginx-ssl.conf
fi

hassio_dns=$(bashio::dns.host)
sed -i "s/%%hassio_dns%%/${hassio_dns}/g" /etc/nginx/nginx-ssl.conf
sed -i "s/%%hassio_dns%%/${hassio_dns}/g" /etc/nginx/nginx.conf
2 changes: 1 addition & 1 deletion ide/rootfs/etc/nginx/nginx-ssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ http {
gzip_disable "msie6";
lua_load_resty_core off;
lua_shared_dict auths 16k;
resolver 127.0.0.11;
resolver %%hassio_dns%%;

upstream cloud9 {
ip_hash;
Expand Down
2 changes: 1 addition & 1 deletion ide/rootfs/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ http {
gzip_disable "msie6";
lua_load_resty_core off;
lua_shared_dict auths 16k;
resolver 127.0.0.11;
resolver %%hassio_dns%%;

upstream cloud9 {
ip_hash;
Expand Down

0 comments on commit b45e1dc

Please sign in to comment.