mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 18:16:32 +00:00
commit
09c0e1320f
2
API.md
2
API.md
@ -771,6 +771,8 @@ return:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- POST `/dns/restart`
|
||||||
|
|
||||||
- GET `/dns/logs`
|
- GET `/dns/logs`
|
||||||
|
|
||||||
- GET `/dns/stats`
|
- GET `/dns/stats`
|
||||||
|
@ -278,6 +278,7 @@ class RestAPI(CoreSysAttributes):
|
|||||||
web.get("/dns/logs", api_dns.logs),
|
web.get("/dns/logs", api_dns.logs),
|
||||||
web.post("/dns/update", api_dns.update),
|
web.post("/dns/update", api_dns.update),
|
||||||
web.post("/dns/options", api_dns.options),
|
web.post("/dns/options", api_dns.options),
|
||||||
|
web.post("/dns/restart", api_dns.restart),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ class APICoreDNS(CoreSysAttributes):
|
|||||||
|
|
||||||
if ATTR_SERVERS in body:
|
if ATTR_SERVERS in body:
|
||||||
self.sys_dns.servers = body[ATTR_SERVERS]
|
self.sys_dns.servers = body[ATTR_SERVERS]
|
||||||
|
self.sys_create_task(self.sys_dns.restart())
|
||||||
|
|
||||||
self.sys_dns.save_data()
|
self.sys_dns.save_data()
|
||||||
|
|
||||||
@ -87,3 +88,8 @@ class APICoreDNS(CoreSysAttributes):
|
|||||||
def logs(self, request: web.Request) -> Awaitable[bytes]:
|
def logs(self, request: web.Request) -> Awaitable[bytes]:
|
||||||
"""Return DNS Docker logs."""
|
"""Return DNS Docker logs."""
|
||||||
return self.sys_dns.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())
|
||||||
|
@ -3,7 +3,7 @@ from pathlib import Path
|
|||||||
from ipaddress import ip_network
|
from ipaddress import ip_network
|
||||||
|
|
||||||
|
|
||||||
HASSIO_VERSION = "179"
|
HASSIO_VERSION = "180"
|
||||||
|
|
||||||
URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"
|
URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"
|
||||||
URL_HASSIO_VERSION = "https://version.home-assistant.io/{channel}.json"
|
URL_HASSIO_VERSION = "https://version.home-assistant.io/{channel}.json"
|
||||||
@ -32,7 +32,7 @@ DOCKER_NETWORK = "hassio"
|
|||||||
DOCKER_NETWORK_MASK = ip_network("172.30.32.0/23")
|
DOCKER_NETWORK_MASK = ip_network("172.30.32.0/23")
|
||||||
DOCKER_NETWORK_RANGE = ip_network("172.30.33.0/24")
|
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"
|
DNS_SUFFIX = "local.hass.io"
|
||||||
|
|
||||||
LABEL_VERSION = "io.hass.version"
|
LABEL_VERSION = "io.hass.version"
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
fallthrough
|
fallthrough
|
||||||
}
|
}
|
||||||
forward . $servers {
|
forward . $servers {
|
||||||
|
except local.hass.io
|
||||||
|
policy sequential
|
||||||
health_check 10s
|
health_check 10s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,6 +222,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
|||||||
def _init_hosts(self) -> None:
|
def _init_hosts(self) -> None:
|
||||||
"""Import hosts entry."""
|
"""Import hosts entry."""
|
||||||
# Generate Default
|
# Generate Default
|
||||||
|
self.add_host(IPv4Address("127.0.0.1"), ["localhost"], write=False)
|
||||||
self.add_host(
|
self.add_host(
|
||||||
self.sys_docker.network.supervisor, ["hassio", "supervisor"], write=False
|
self.sys_docker.network.supervisor, ["hassio", "supervisor"], write=False
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user