diff --git a/hassio/addons/__init__.py b/hassio/addons/__init__.py index e522da543..c6e1a6fb7 100644 --- a/hassio/addons/__init__.py +++ b/hassio/addons/__init__.py @@ -11,6 +11,7 @@ from ..exceptions import ( AddonsError, AddonsNotSupportedError, DockerAPIError, + HomeAssistantAPIError, HostAppArmorError, ) from ..store.addon import AddonStore @@ -155,8 +156,15 @@ class AddonManager(CoreSysAttributes): with suppress(HostAppArmorError): await addon.uninstall_apparmor() + # Cleanup Ingress panel from sidebar + if addon.ingress_panel: + addon.ingress_panel = False + with suppress(HomeAssistantAPIError): + await self.sys_ingress.update_hass_panel(addon) + # Cleanup internal data addon.remove_discovery() + self.data.uninstall(addon) self.local.pop(slug) diff --git a/hassio/api/security.py b/hassio/api/security.py index d84cb9fe7..7346097db 100644 --- a/hassio/api/security.py +++ b/hassio/api/security.py @@ -67,6 +67,7 @@ ADDONS_ROLE_ACCESS = { ), ROLE_MANAGER: re.compile( r"^(?:" + r"|/dns/.*" r"|/homeassistant/.+" r"|/host/.+" r"|/hardware/.+" diff --git a/hassio/const.py b/hassio/const.py index e15b3893f..ff06edda2 100644 --- a/hassio/const.py +++ b/hassio/const.py @@ -3,7 +3,7 @@ from pathlib import Path from ipaddress import ip_network -HASSIO_VERSION = "176" +HASSIO_VERSION = "177" URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons" URL_HASSIO_VERSION = "https://version.home-assistant.io/{channel}.json" diff --git a/hassio/validate.py b/hassio/validate.py index 068e64aa1..b45792ecd 100644 --- a/hassio/validate.py +++ b/hassio/validate.py @@ -51,7 +51,8 @@ UUID_MATCH = vol.Match(r"^[0-9a-f]{32}$") SHA256 = vol.Match(r"^[0-9a-f]{64}$") TOKEN = vol.Match(r"^[0-9a-f]{32,256}$") LOG_LEVEL = vol.In(["debug", "info", "warning", "error", "critical"]) -DNS_SERVER_LIST = vol.All([vol.Url()], vol.Length(max=8)) +DNS_URL = vol.Match(r"^dns://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$") +DNS_SERVER_LIST = vol.All([DNS_URL], vol.Length(max=8)) def validate_repository(repository):