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

Commit

Permalink
🔨 ⬆️ Upgrade base and use Hass.io DNS as NGinx resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
timmo001 committed Aug 31, 2019
1 parent 5cb1f83 commit ef0ea60
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ variables:

ADDON_LEGACY_TAGS: "true"

ADDON_AARCH64_BASE: "hassioaddons/base-aarch64:4.0.2"
ADDON_AMD64_BASE: "hassioaddons/base-amd64:4.0.2"
ADDON_ARMHF_BASE: "hassioaddons/base-armhf:4.0.2"
ADDON_ARMV7_BASE: "hassioaddons/base-armv7:4.0.2"
ADDON_I386_BASE: "hassioaddons/base-i386:4.0.2"
ADDON_AARCH64_BASE: "hassioaddons/base-aarch64:4.1.1"
ADDON_AMD64_BASE: "hassioaddons/base-amd64:4.1.1"
ADDON_ARMHF_BASE: "hassioaddons/base-armhf:4.1.1"
ADDON_ARMV7_BASE: "hassioaddons/base-armv7:4.1.1"
ADDON_I386_BASE: "hassioaddons/base-i386:4.1.1"
2 changes: 1 addition & 1 deletion home-panel/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BUILD_FROM=hassioaddons/base:4.0.2
ARG BUILD_FROM=hassioaddons/base:4.1.1
# hadolint ignore=DL3006
FROM ${BUILD_FROM}

Expand Down
10 changes: 5 additions & 5 deletions home-panel/build.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"args": {},
"build_from": {
"aarch64": "hassioaddons/base-aarch64:4.0.2",
"amd64": "hassioaddons/base-amd64:4.0.2",
"armhf": "hassioaddons/base-armhf:4.0.2",
"armv7": "hassioaddons/base-armv7:4.0.2",
"i386": "hassioaddons/base-i386:4.0.2"
"aarch64": "hassioaddons/base-aarch64:4.1.1",
"amd64": "hassioaddons/base-amd64:4.1.1",
"armhf": "hassioaddons/base-armhf:4.1.1",
"armv7": "hassioaddons/base-armv7:4.1.1",
"i386": "hassioaddons/base-i386:4.1.1"
},
"squash": false
}
13 changes: 12 additions & 1 deletion home-panel/rootfs/etc/cont-init.d/nginx.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Community Hass.io Add-ons: Home Panel
# Configures NGINX for use with thelounge
# Configures NGINX for use with Home Panel
# ==============================================================================
declare port
declare certfile
declare hassio_dns
declare ingress_interface
declare ingress_port
declare keyfile

port=$(bashio::addon.port 80)
Expand All @@ -23,3 +26,11 @@ if bashio::var.has_value "${port}"; then
mv /etc/nginx/servers/direct.disabled /etc/nginx/servers/direct.conf
fi
fi

ingress_port=$(bashio::addon.ingress_port)
ingress_interface=$(bashio::addon.ip_address)
sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf

hassio_dns=$(bashio::dns.host)
sed -i "s/%%hassio_dns%%/${hassio_dns}/g" /etc/nginx/includes/resolver.conf
2 changes: 1 addition & 1 deletion home-panel/rootfs/etc/nginx/includes/resolver.conf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
resolver 127.0.0.11;
resolver %%hassio_dns%%;
6 changes: 3 additions & 3 deletions home-panel/rootfs/etc/nginx/includes/server_params.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
root /dev/null;
server_name $hostname;

add_header "X-Content-Type-Options" "nosniff";
add_header "X-XSS-Protection" "1; mode=block";
add_header "X-Robots-Tag" "none";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
1 change: 1 addition & 0 deletions home-panel/rootfs/etc/nginx/servers/direct-ssl.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ server {
include /etc/nginx/includes/ssl_params.conf;
include /etc/nginx/includes/proxy_params.conf;

ssl on;
ssl_certificate /ssl/%%certfile%%;
ssl_certificate_key /ssl/%%keyfile%%;

Expand Down

0 comments on commit ef0ea60

Please sign in to comment.