From 39087e09cef6b5a065575a01ef5c607ef4f49c18 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 16 Aug 2019 20:33:56 +0200 Subject: [PATCH 1/6] Bump version 180 --- hassio/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hassio/const.py b/hassio/const.py index cb67d0f9f..5db3a1557 100644 --- a/hassio/const.py +++ b/hassio/const.py @@ -3,7 +3,7 @@ from pathlib import Path from ipaddress import ip_network -HASSIO_VERSION = "179" +HASSIO_VERSION = "180" URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons" URL_HASSIO_VERSION = "https://version.home-assistant.io/{channel}.json" From 981f2b193c5336836bc8075ba3a7a2a184919b50 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 18 Aug 2019 11:06:17 +0200 Subject: [PATCH 2/6] Adjust coredns to use upstream fowarding server in order (#1238) --- hassio/data/coredns.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/hassio/data/coredns.tmpl b/hassio/data/coredns.tmpl index cc528007a..31d51991b 100644 --- a/hassio/data/coredns.tmpl +++ b/hassio/data/coredns.tmpl @@ -4,6 +4,7 @@ fallthrough } forward . $servers { + policy sequential health_check 10s } } From be8439d4ac5784c077d2d26019d937b01978935b Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 18 Aug 2019 11:07:23 +0200 Subject: [PATCH 3/6] Add localhost to hosts file (#1240) --- hassio/dns.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hassio/dns.py b/hassio/dns.py index 1bb24a94d..798d2f9d9 100644 --- a/hassio/dns.py +++ b/hassio/dns.py @@ -222,6 +222,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes): def _init_hosts(self) -> None: """Import hosts entry.""" # Generate Default + self.add_host(IPv4Address("127.0.0.1"), ["localhost"], write=False) self.add_host( self.sys_docker.network.supervisor, ["hassio", "supervisor"], write=False ) From ee2c25705769097661260822cbe8f4a003b76d20 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 18 Aug 2019 11:08:34 +0200 Subject: [PATCH 4/6] Adjust coredns do not forward local.hass.io (#1237) --- hassio/data/coredns.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/hassio/data/coredns.tmpl b/hassio/data/coredns.tmpl index 31d51991b..01ed22b0c 100644 --- a/hassio/data/coredns.tmpl +++ b/hassio/data/coredns.tmpl @@ -4,6 +4,7 @@ fallthrough } forward . $servers { + except local.hass.io policy sequential health_check 10s } From 1f448744f3f15df5250b890833c064d139c64f21 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 18 Aug 2019 11:46:23 +0200 Subject: [PATCH 5/6] Add restart function / options change (#1242) --- API.md | 2 ++ hassio/api/__init__.py | 1 + hassio/api/dns.py | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/API.md b/API.md index a6fc1b6da..36ea2c474 100644 --- a/API.md +++ b/API.md @@ -771,6 +771,8 @@ return: } ``` +- POST `/dns/restart` + - GET `/dns/logs` - GET `/dns/stats` diff --git a/hassio/api/__init__.py b/hassio/api/__init__.py index dbc3decaf..2a02eaeb8 100644 --- a/hassio/api/__init__.py +++ b/hassio/api/__init__.py @@ -278,6 +278,7 @@ class RestAPI(CoreSysAttributes): web.get("/dns/logs", api_dns.logs), web.post("/dns/update", api_dns.update), web.post("/dns/options", api_dns.options), + web.post("/dns/restart", api_dns.restart), ] ) diff --git a/hassio/api/dns.py b/hassio/api/dns.py index b643a6539..b4666b9eb 100644 --- a/hassio/api/dns.py +++ b/hassio/api/dns.py @@ -54,6 +54,7 @@ class APICoreDNS(CoreSysAttributes): if ATTR_SERVERS in body: self.sys_dns.servers = body[ATTR_SERVERS] + self.sys_create_task(self.sys_dns.restart()) self.sys_dns.save_data() @@ -87,3 +88,8 @@ class APICoreDNS(CoreSysAttributes): def logs(self, request: web.Request) -> Awaitable[bytes]: """Return DNS Docker logs.""" return self.sys_dns.logs() + + @api_process + def restart(self, request: web.Request) -> Awaitable[None]: + """Restart CoreDNS plugin.""" + return asyncio.shield(self.sys_dns.restart()) From cc4ee59542096d02c6269f3f0c40b871f5d6a626 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 18 Aug 2019 11:48:29 +0200 Subject: [PATCH 6/6] Replace Google DNS by Quad9, prefer CloudFlare (#1235) --- hassio/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hassio/const.py b/hassio/const.py index 5db3a1557..3e45005a9 100644 --- a/hassio/const.py +++ b/hassio/const.py @@ -32,7 +32,7 @@ DOCKER_NETWORK = "hassio" DOCKER_NETWORK_MASK = ip_network("172.30.32.0/23") DOCKER_NETWORK_RANGE = ip_network("172.30.33.0/24") -DNS_SERVERS = ["dns://8.8.8.8", "dns://1.1.1.1"] +DNS_SERVERS = ["dns://1.1.1.1", "dns://9.9.9.9"] DNS_SUFFIX = "local.hass.io" LABEL_VERSION = "io.hass.version"