mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-09-01 04:10:21 +00:00
Compare commits
53 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2470d16d85 | ||
![]() |
5c0172440a | ||
![]() |
006db94cc0 | ||
![]() |
9f1ab99265 | ||
![]() |
29b2de6998 | ||
![]() |
057a048504 | ||
![]() |
29a1e6f68b | ||
![]() |
702cb4f5be | ||
![]() |
13c10dbb47 | ||
![]() |
2279c813d0 | ||
![]() |
1b52b2d23b | ||
![]() |
27ac96f5f9 | ||
![]() |
f87209f66f | ||
![]() |
b670efa47f | ||
![]() |
c749e21d3f | ||
![]() |
4f8f28b9f6 | ||
![]() |
2b4f46f6b3 | ||
![]() |
5d6e2eeaac | ||
![]() |
a45789c906 | ||
![]() |
d097044fa8 | ||
![]() |
73778780ef | ||
![]() |
df05c844c0 | ||
![]() |
ebeff31bf6 | ||
![]() |
037e42e894 | ||
![]() |
13db0e5c70 | ||
![]() |
dab75b597c | ||
![]() |
a1bab8ad08 | ||
![]() |
48c5dd064c | ||
![]() |
fd998155c2 | ||
![]() |
4a3ab4ba8d | ||
![]() |
c76e7a22df | ||
![]() |
d19166bb86 | ||
![]() |
14bc771ba9 | ||
![]() |
8f84eaa096 | ||
![]() |
2fd51c36b8 | ||
![]() |
c473d7ca62 | ||
![]() |
2de5b2f0fb | ||
![]() |
cf30810677 | ||
![]() |
a8dc842f97 | ||
![]() |
38509aa3b8 | ||
![]() |
9be2b3bced | ||
![]() |
ceed1bc318 | ||
![]() |
389aab8d4a | ||
![]() |
8b7aa7640c | ||
![]() |
a5cc3cba63 | ||
![]() |
9266062709 | ||
![]() |
bacedd1622 | ||
![]() |
7227f022b1 | ||
![]() |
0ce91f2e25 | ||
![]() |
fdb195cf59 | ||
![]() |
b85936774a | ||
![]() |
bd106be026 | ||
![]() |
e588541fe3 |
4
.github/workflows/builder.yml
vendored
4
.github/workflows/builder.yml
vendored
@@ -91,7 +91,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
if: needs.init.outputs.requirements == 'true'
|
if: needs.init.outputs.requirements == 'true'
|
||||||
uses: home-assistant/wheels@master
|
uses: home-assistant/wheels@2022.01.2
|
||||||
with:
|
with:
|
||||||
tag: ${{ env.WHEELS_TAG }}
|
tag: ${{ env.WHEELS_TAG }}
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.arch }}
|
||||||
@@ -151,7 +151,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
if: needs.init.outputs.publish == 'true'
|
if: needs.init.outputs.publish == 'true'
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
|
||||||
|
50
.github/workflows/ci.yaml
vendored
50
.github/workflows/ci.yaml
vendored
@@ -26,12 +26,12 @@ jobs:
|
|||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
id: python
|
id: python
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: |
|
key: |
|
||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
pip install -r requirements.txt -r requirements_tests.txt
|
pip install -r requirements.txt -r requirements_tests.txt
|
||||||
- name: Restore pre-commit environment from cache
|
- name: Restore pre-commit environment from cache
|
||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_HOME }}
|
path: ${{ env.PRE_COMMIT_HOME }}
|
||||||
key: |
|
key: |
|
||||||
@@ -66,13 +66,13 @@ jobs:
|
|||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: |
|
key: |
|
||||||
@@ -110,13 +110,13 @@ jobs:
|
|||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: |
|
key: |
|
||||||
@@ -128,7 +128,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
- name: Restore pre-commit environment from cache
|
- name: Restore pre-commit environment from cache
|
||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_HOME }}
|
path: ${{ env.PRE_COMMIT_HOME }}
|
||||||
key: |
|
key: |
|
||||||
@@ -154,13 +154,13 @@ jobs:
|
|||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: |
|
key: |
|
||||||
@@ -186,13 +186,13 @@ jobs:
|
|||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: |
|
key: |
|
||||||
@@ -204,7 +204,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
- name: Restore pre-commit environment from cache
|
- name: Restore pre-commit environment from cache
|
||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_HOME }}
|
path: ${{ env.PRE_COMMIT_HOME }}
|
||||||
key: |
|
key: |
|
||||||
@@ -227,13 +227,13 @@ jobs:
|
|||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: |
|
key: |
|
||||||
@@ -245,7 +245,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
- name: Restore pre-commit environment from cache
|
- name: Restore pre-commit environment from cache
|
||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_HOME }}
|
path: ${{ env.PRE_COMMIT_HOME }}
|
||||||
key: |
|
key: |
|
||||||
@@ -271,13 +271,13 @@ jobs:
|
|||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: |
|
key: |
|
||||||
@@ -303,13 +303,13 @@ jobs:
|
|||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: |
|
key: |
|
||||||
@@ -321,7 +321,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
- name: Restore pre-commit environment from cache
|
- name: Restore pre-commit environment from cache
|
||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_HOME }}
|
path: ${{ env.PRE_COMMIT_HOME }}
|
||||||
key: |
|
key: |
|
||||||
@@ -347,7 +347,7 @@ jobs:
|
|||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
@@ -357,7 +357,7 @@ jobs:
|
|||||||
version: ${{ env.DEFAULT_CAS }}
|
version: ${{ env.DEFAULT_CAS }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: |
|
key: |
|
||||||
@@ -405,13 +405,13 @@ jobs:
|
|||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
uses: actions/setup-python@v4.0.0
|
uses: actions/setup-python@v4.2.0
|
||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.4
|
uses: actions/cache@v3.0.6
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: |
|
key: |
|
||||||
|
2
.github/workflows/sentry.yaml
vendored
2
.github/workflows/sentry.yaml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
- name: Sentry Release
|
- name: Sentry Release
|
||||||
uses: getsentry/action-release@v1.1.6
|
uses: getsentry/action-release@v1.2.0
|
||||||
env:
|
env:
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||||
|
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
stale:
|
stale:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v5.0.0
|
- uses: actions/stale@v5.1.1
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
days-before-stale: 60
|
days-before-stale: 60
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 22.3.0
|
rev: 22.6.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
args:
|
args:
|
||||||
|
Submodule home-assistant-polymer updated: e7848262ea...ca28feca80
2
pytest.ini
Normal file
2
pytest.ini
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[pytest]
|
||||||
|
asyncio_mode = auto
|
@@ -1,16 +1,16 @@
|
|||||||
aiodns==3.0.0
|
aiodns==3.0.0
|
||||||
aiohttp==3.8.1
|
aiohttp==3.8.1
|
||||||
async_timeout==4.0.2
|
async_timeout==4.0.2
|
||||||
atomicwrites==1.4.0
|
atomicwrites-homeassistant==1.4.1
|
||||||
attrs==21.4.0
|
attrs==22.1.0
|
||||||
awesomeversion==22.5.2
|
awesomeversion==22.6.0
|
||||||
brotli==1.0.9
|
brotli==1.0.9
|
||||||
cchardet==2.1.7
|
cchardet==2.1.7
|
||||||
ciso8601==2.2.0
|
ciso8601==2.2.0
|
||||||
colorlog==6.6.0
|
colorlog==6.6.0
|
||||||
cpe==1.2.1
|
cpe==1.2.1
|
||||||
cryptography==36.0.2
|
cryptography==37.0.4
|
||||||
debugpy==1.6.0
|
debugpy==1.6.2
|
||||||
deepmerge==1.0.1
|
deepmerge==1.0.1
|
||||||
dirhash==0.2.1
|
dirhash==0.2.1
|
||||||
docker==5.0.3
|
docker==5.0.3
|
||||||
@@ -20,6 +20,6 @@ pulsectl==22.3.2
|
|||||||
pyudev==0.23.2
|
pyudev==0.23.2
|
||||||
ruamel.yaml==0.17.17
|
ruamel.yaml==0.17.17
|
||||||
securetar==2022.2.0
|
securetar==2022.2.0
|
||||||
sentry-sdk==1.5.12
|
sentry-sdk==1.9.2
|
||||||
voluptuous==0.13.1
|
voluptuous==0.13.1
|
||||||
dbus-next==0.2.3
|
dbus-next==0.2.3
|
||||||
|
@@ -1,15 +1,15 @@
|
|||||||
black==22.3.0
|
black==22.6.0
|
||||||
codecov==2.1.12
|
codecov==2.1.12
|
||||||
coverage==6.4.1
|
coverage==6.4.3
|
||||||
flake8-docstrings==1.6.0
|
flake8-docstrings==1.6.0
|
||||||
flake8==4.0.1
|
flake8==5.0.4
|
||||||
pre-commit==2.19.0
|
pre-commit==2.20.0
|
||||||
pydocstyle==6.1.1
|
pydocstyle==6.1.1
|
||||||
pylint==2.14.3
|
pylint==2.14.5
|
||||||
pytest-aiohttp==0.3.0
|
pytest-aiohttp==1.0.4
|
||||||
pytest-asyncio==0.12.0 # NB!: Versions over 0.12.0 breaks pytest-aiohttp (https://github.com/aio-libs/pytest-aiohttp/issues/16)
|
pytest-asyncio==0.18.3
|
||||||
pytest-cov==3.0.0
|
pytest-cov==3.0.0
|
||||||
pytest-timeout==2.1.0
|
pytest-timeout==2.1.0
|
||||||
pytest==7.1.2
|
pytest==7.1.2
|
||||||
pyupgrade==2.34.0
|
pyupgrade==2.37.3
|
||||||
time-machine==2.7.1
|
time-machine==2.7.1
|
||||||
|
@@ -167,6 +167,7 @@ class AddonManager(CoreSysAttributes):
|
|||||||
|
|
||||||
self.data.install(store)
|
self.data.install(store)
|
||||||
addon = Addon(self.coresys, slug)
|
addon = Addon(self.coresys, slug)
|
||||||
|
await addon.load()
|
||||||
|
|
||||||
if not addon.path_data.is_dir():
|
if not addon.path_data.is_dir():
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
|
@@ -48,9 +48,12 @@ from ..const import (
|
|||||||
AddonBoot,
|
AddonBoot,
|
||||||
AddonStartup,
|
AddonStartup,
|
||||||
AddonState,
|
AddonState,
|
||||||
|
BusEvent,
|
||||||
)
|
)
|
||||||
from ..coresys import CoreSys
|
from ..coresys import CoreSys
|
||||||
from ..docker.addon import DockerAddon
|
from ..docker.addon import DockerAddon
|
||||||
|
from ..docker.const import ContainerState
|
||||||
|
from ..docker.monitor import DockerContainerStateEvent
|
||||||
from ..docker.stats import DockerStats
|
from ..docker.stats import DockerStats
|
||||||
from ..exceptions import (
|
from ..exceptions import (
|
||||||
AddonConfigurationError,
|
AddonConfigurationError,
|
||||||
@@ -58,7 +61,6 @@ from ..exceptions import (
|
|||||||
AddonsNotSupportedError,
|
AddonsNotSupportedError,
|
||||||
ConfigurationFileError,
|
ConfigurationFileError,
|
||||||
DockerError,
|
DockerError,
|
||||||
DockerRequestError,
|
|
||||||
HostAppArmorError,
|
HostAppArmorError,
|
||||||
)
|
)
|
||||||
from ..hardware.data import Device
|
from ..hardware.data import Device
|
||||||
@@ -66,7 +68,7 @@ from ..homeassistant.const import WSEvent, WSType
|
|||||||
from ..utils import check_port
|
from ..utils import check_port
|
||||||
from ..utils.apparmor import adjust_profile
|
from ..utils.apparmor import adjust_profile
|
||||||
from ..utils.json import read_json_file, write_json_file
|
from ..utils.json import read_json_file, write_json_file
|
||||||
from .const import AddonBackupMode
|
from .const import WATCHDOG_RETRY_SECONDS, AddonBackupMode
|
||||||
from .model import AddonModel, Data
|
from .model import AddonModel, Data
|
||||||
from .options import AddonOptions
|
from .options import AddonOptions
|
||||||
from .utils import remove_data
|
from .utils import remove_data
|
||||||
@@ -135,15 +137,16 @@ class Addon(AddonModel):
|
|||||||
|
|
||||||
async def load(self) -> None:
|
async def load(self) -> None:
|
||||||
"""Async initialize of object."""
|
"""Async initialize of object."""
|
||||||
|
self.sys_bus.register_event(
|
||||||
|
BusEvent.DOCKER_CONTAINER_STATE_CHANGE, self.container_state_changed
|
||||||
|
)
|
||||||
|
self.sys_bus.register_event(
|
||||||
|
BusEvent.DOCKER_CONTAINER_STATE_CHANGE, self.watchdog_container
|
||||||
|
)
|
||||||
|
|
||||||
with suppress(DockerError):
|
with suppress(DockerError):
|
||||||
await self.instance.attach(version=self.version)
|
await self.instance.attach(version=self.version)
|
||||||
|
|
||||||
# Evaluate state
|
|
||||||
if await self.instance.is_running():
|
|
||||||
self.state = AddonState.STARTED
|
|
||||||
else:
|
|
||||||
self.state = AddonState.STOPPED
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ip_address(self) -> IPv4Address:
|
def ip_address(self) -> IPv4Address:
|
||||||
"""Return IP of add-on instance."""
|
"""Return IP of add-on instance."""
|
||||||
@@ -353,6 +356,9 @@ class Addon(AddonModel):
|
|||||||
@property
|
@property
|
||||||
def ingress_panel(self) -> Optional[bool]:
|
def ingress_panel(self) -> Optional[bool]:
|
||||||
"""Return True if the add-on access support ingress."""
|
"""Return True if the add-on access support ingress."""
|
||||||
|
if not self.with_ingress:
|
||||||
|
return None
|
||||||
|
|
||||||
return self.persist[ATTR_INGRESS_PANEL]
|
return self.persist[ATTR_INGRESS_PANEL]
|
||||||
|
|
||||||
@ingress_panel.setter
|
@ingress_panel.setter
|
||||||
@@ -613,27 +619,17 @@ class Addon(AddonModel):
|
|||||||
# Start Add-on
|
# Start Add-on
|
||||||
try:
|
try:
|
||||||
await self.instance.run()
|
await self.instance.run()
|
||||||
except DockerRequestError as err:
|
|
||||||
self.state = AddonState.ERROR
|
|
||||||
raise AddonsError() from err
|
|
||||||
except DockerError as err:
|
except DockerError as err:
|
||||||
self.state = AddonState.ERROR
|
self.state = AddonState.ERROR
|
||||||
raise AddonsError() from err
|
raise AddonsError() from err
|
||||||
else:
|
|
||||||
self.state = AddonState.STARTED
|
|
||||||
|
|
||||||
async def stop(self) -> None:
|
async def stop(self) -> None:
|
||||||
"""Stop add-on."""
|
"""Stop add-on."""
|
||||||
try:
|
try:
|
||||||
await self.instance.stop()
|
await self.instance.stop()
|
||||||
except DockerRequestError as err:
|
|
||||||
self.state = AddonState.ERROR
|
|
||||||
raise AddonsError() from err
|
|
||||||
except DockerError as err:
|
except DockerError as err:
|
||||||
self.state = AddonState.ERROR
|
self.state = AddonState.ERROR
|
||||||
raise AddonsError() from err
|
raise AddonsError() from err
|
||||||
else:
|
|
||||||
self.state = AddonState.STOPPED
|
|
||||||
|
|
||||||
async def restart(self) -> None:
|
async def restart(self) -> None:
|
||||||
"""Restart add-on."""
|
"""Restart add-on."""
|
||||||
@@ -681,16 +677,18 @@ class Addon(AddonModel):
|
|||||||
try:
|
try:
|
||||||
command_return = await self.instance.run_inside(command)
|
command_return = await self.instance.run_inside(command)
|
||||||
if command_return.exit_code != 0:
|
if command_return.exit_code != 0:
|
||||||
_LOGGER.error(
|
_LOGGER.debug(
|
||||||
"Pre-/Post backup command returned error code: %s",
|
"Pre-/Post backup command failed with: %s", command_return.output
|
||||||
command_return.exit_code,
|
)
|
||||||
|
raise AddonsError(
|
||||||
|
f"Pre-/Post backup command returned error code: {command_return.exit_code}",
|
||||||
|
_LOGGER.error,
|
||||||
)
|
)
|
||||||
raise AddonsError()
|
|
||||||
except DockerError as err:
|
except DockerError as err:
|
||||||
_LOGGER.error(
|
raise AddonsError(
|
||||||
"Failed running pre-/post backup command %s: %s", command, err
|
f"Failed running pre-/post backup command {command}: {str(err)}",
|
||||||
)
|
_LOGGER.error,
|
||||||
raise AddonsError() from err
|
) from err
|
||||||
|
|
||||||
async def backup(self, tar_file: tarfile.TarFile) -> None:
|
async def backup(self, tar_file: tarfile.TarFile) -> None:
|
||||||
"""Backup state of an add-on."""
|
"""Backup state of an add-on."""
|
||||||
@@ -884,3 +882,62 @@ class Addon(AddonModel):
|
|||||||
Return Coroutine.
|
Return Coroutine.
|
||||||
"""
|
"""
|
||||||
return self.instance.check_trust()
|
return self.instance.check_trust()
|
||||||
|
|
||||||
|
async def container_state_changed(self, event: DockerContainerStateEvent) -> None:
|
||||||
|
"""Set addon state from container state."""
|
||||||
|
if event.name != self.instance.name:
|
||||||
|
return
|
||||||
|
|
||||||
|
if event.state in [
|
||||||
|
ContainerState.RUNNING,
|
||||||
|
ContainerState.HEALTHY,
|
||||||
|
ContainerState.UNHEALTHY,
|
||||||
|
]:
|
||||||
|
self.state = AddonState.STARTED
|
||||||
|
elif event.state == ContainerState.STOPPED:
|
||||||
|
self.state = AddonState.STOPPED
|
||||||
|
elif event.state == ContainerState.FAILED:
|
||||||
|
self.state = AddonState.ERROR
|
||||||
|
|
||||||
|
async def watchdog_container(self, event: DockerContainerStateEvent) -> None:
|
||||||
|
"""Process state changes in addon container and restart if necessary."""
|
||||||
|
if not (event.name == self.instance.name and self.watchdog):
|
||||||
|
return
|
||||||
|
|
||||||
|
if event.state == ContainerState.UNHEALTHY:
|
||||||
|
while await self.instance.current_state() == event.state:
|
||||||
|
if not self.in_progress:
|
||||||
|
_LOGGER.warning(
|
||||||
|
"Watchdog found addon %s is unhealthy, restarting...", self.name
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
await self.restart()
|
||||||
|
except AddonsError as err:
|
||||||
|
_LOGGER.error("Watchdog restart of addon %s failed!", self.name)
|
||||||
|
self.sys_capture_exception(err)
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
|
await asyncio.sleep(WATCHDOG_RETRY_SECONDS)
|
||||||
|
|
||||||
|
elif event.state == ContainerState.FAILED:
|
||||||
|
# Ensure failed container is removed before attempting reanimation
|
||||||
|
with suppress(DockerError):
|
||||||
|
await self.instance.stop(remove_container=True)
|
||||||
|
|
||||||
|
while await self.instance.current_state() == event.state:
|
||||||
|
if not self.in_progress:
|
||||||
|
_LOGGER.warning(
|
||||||
|
"Watchdog found addon %s failed, restarting...", self.name
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
await self.start()
|
||||||
|
except AddonsError as err:
|
||||||
|
_LOGGER.error(
|
||||||
|
"Watchdog reanimation of addon %s failed!", self.name
|
||||||
|
)
|
||||||
|
self.sys_capture_exception(err)
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
|
await asyncio.sleep(WATCHDOG_RETRY_SECONDS)
|
||||||
|
@@ -11,3 +11,4 @@ class AddonBackupMode(str, Enum):
|
|||||||
|
|
||||||
ATTR_BACKUP = "backup"
|
ATTR_BACKUP = "backup"
|
||||||
ATTR_CODENOTARY = "codenotary"
|
ATTR_CODENOTARY = "codenotary"
|
||||||
|
WATCHDOG_RETRY_SECONDS = 10
|
||||||
|
@@ -1,10 +1,14 @@
|
|||||||
"""Init file for Supervisor RESTful API."""
|
"""Init file for Supervisor RESTful API."""
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Any, Optional
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
|
||||||
|
from supervisor.api.utils import api_process
|
||||||
|
from supervisor.const import AddonState
|
||||||
|
from supervisor.exceptions import APIAddonNotInstalled
|
||||||
|
|
||||||
from ..coresys import CoreSys, CoreSysAttributes
|
from ..coresys import CoreSys, CoreSysAttributes
|
||||||
from .addons import APIAddons
|
from .addons import APIAddons
|
||||||
from .audio import APIAudio
|
from .audio import APIAudio
|
||||||
@@ -36,6 +40,7 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
MAX_CLIENT_SIZE: int = 1024**2 * 16
|
MAX_CLIENT_SIZE: int = 1024**2 * 16
|
||||||
|
MAX_LINE_SIZE: int = 24570
|
||||||
|
|
||||||
|
|
||||||
class RestAPI(CoreSysAttributes):
|
class RestAPI(CoreSysAttributes):
|
||||||
@@ -51,6 +56,10 @@ class RestAPI(CoreSysAttributes):
|
|||||||
self.security.system_validation,
|
self.security.system_validation,
|
||||||
self.security.token_validation,
|
self.security.token_validation,
|
||||||
],
|
],
|
||||||
|
handler_args={
|
||||||
|
"max_line_size": MAX_LINE_SIZE,
|
||||||
|
"max_field_size": MAX_LINE_SIZE,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
# service stuff
|
# service stuff
|
||||||
@@ -378,7 +387,6 @@ class RestAPI(CoreSysAttributes):
|
|||||||
self.webapp.add_routes(
|
self.webapp.add_routes(
|
||||||
[
|
[
|
||||||
web.get("/addons", api_addons.list),
|
web.get("/addons", api_addons.list),
|
||||||
web.get("/addons/{addon}/info", api_addons.info),
|
|
||||||
web.post("/addons/{addon}/uninstall", api_addons.uninstall),
|
web.post("/addons/{addon}/uninstall", api_addons.uninstall),
|
||||||
web.post("/addons/{addon}/start", api_addons.start),
|
web.post("/addons/{addon}/start", api_addons.start),
|
||||||
web.post("/addons/{addon}/stop", api_addons.stop),
|
web.post("/addons/{addon}/stop", api_addons.stop),
|
||||||
@@ -396,6 +404,25 @@ class RestAPI(CoreSysAttributes):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Legacy routing to support requests for not installed addons
|
||||||
|
api_store = APIStore()
|
||||||
|
api_store.coresys = self.coresys
|
||||||
|
|
||||||
|
@api_process
|
||||||
|
async def addons_addon_info(request: web.Request) -> dict[str, Any]:
|
||||||
|
"""Route to store if info requested for not installed addon."""
|
||||||
|
try:
|
||||||
|
return await api_addons.info(request)
|
||||||
|
except APIAddonNotInstalled:
|
||||||
|
# Route to store/{addon}/info but add missing fields
|
||||||
|
return dict(
|
||||||
|
await api_store.addons_addon_info_wrapped(request),
|
||||||
|
state=AddonState.UNKNOWN,
|
||||||
|
options=self.sys_addons.store[request.match_info["addon"]].options,
|
||||||
|
)
|
||||||
|
|
||||||
|
self.webapp.add_routes([web.get("/addons/{addon}/info", addons_addon_info)])
|
||||||
|
|
||||||
def _register_ingress(self) -> None:
|
def _register_ingress(self) -> None:
|
||||||
"""Register Ingress functions."""
|
"""Register Ingress functions."""
|
||||||
api_ingress = APIIngress()
|
api_ingress = APIIngress()
|
||||||
|
@@ -96,7 +96,13 @@ from ..const import (
|
|||||||
)
|
)
|
||||||
from ..coresys import CoreSysAttributes
|
from ..coresys import CoreSysAttributes
|
||||||
from ..docker.stats import DockerStats
|
from ..docker.stats import DockerStats
|
||||||
from ..exceptions import APIError, APIForbidden, PwnedError, PwnedSecret
|
from ..exceptions import (
|
||||||
|
APIAddonNotInstalled,
|
||||||
|
APIError,
|
||||||
|
APIForbidden,
|
||||||
|
PwnedError,
|
||||||
|
PwnedSecret,
|
||||||
|
)
|
||||||
from ..validate import docker_ports
|
from ..validate import docker_ports
|
||||||
from .const import ATTR_SIGNED, CONTENT_TYPE_BINARY
|
from .const import ATTR_SIGNED, CONTENT_TYPE_BINARY
|
||||||
from .utils import api_process, api_process_raw, api_validate, json_loads
|
from .utils import api_process, api_process_raw, api_validate, json_loads
|
||||||
@@ -140,7 +146,7 @@ class APIAddons(CoreSysAttributes):
|
|||||||
if not addon:
|
if not addon:
|
||||||
raise APIError(f"Addon {addon_slug} does not exist")
|
raise APIError(f"Addon {addon_slug} does not exist")
|
||||||
if not isinstance(addon, Addon) or not addon.is_installed:
|
if not isinstance(addon, Addon) or not addon.is_installed:
|
||||||
raise APIError("Addon is not installed")
|
raise APIAddonNotInstalled("Addon is not installed")
|
||||||
|
|
||||||
return addon
|
return addon
|
||||||
|
|
||||||
@@ -177,7 +183,6 @@ class APIAddons(CoreSysAttributes):
|
|||||||
"""Reload all add-on data from store."""
|
"""Reload all add-on data from store."""
|
||||||
await asyncio.shield(self.sys_store.reload())
|
await asyncio.shield(self.sys_store.reload())
|
||||||
|
|
||||||
@api_process
|
|
||||||
async def info(self, request: web.Request) -> dict[str, Any]:
|
async def info(self, request: web.Request) -> dict[str, Any]:
|
||||||
"""Return add-on information."""
|
"""Return add-on information."""
|
||||||
addon: AnyAddon = self._extract_addon(request)
|
addon: AnyAddon = self._extract_addon(request)
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
|
|
||||||
function loadES5() {
|
function loadES5() {
|
||||||
var el = document.createElement('script');
|
var el = document.createElement('script');
|
||||||
el.src = '/api/hassio/app/frontend_es5/entrypoint.f8f83860.js';
|
el.src = '/api/hassio/app/frontend_es5/entrypoint.75b60951.js';
|
||||||
document.body.appendChild(el);
|
document.body.appendChild(el);
|
||||||
}
|
}
|
||||||
if (/.*Version\/(?:11|12)(?:\.\d+)*.*Safari\//.test(navigator.userAgent)) {
|
if (/.*Version\/(?:11|12)(?:\.\d+)*.*Safari\//.test(navigator.userAgent)) {
|
||||||
loadES5();
|
loadES5();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
new Function("import('/api/hassio/app/frontend_latest/entrypoint.b6cf778b.js')")();
|
new Function("import('/api/hassio/app/frontend_latest/entrypoint.f358ba39.js')")();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
loadES5();
|
loadES5();
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
1
supervisor/api/panel/frontend_es5/0ce034b1.js
Normal file
1
supervisor/api/panel/frontend_es5/0ce034b1.js
Normal file
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_es5/0ce034b1.js.gz
Normal file
BIN
supervisor/api/panel/frontend_es5/0ce034b1.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
1
supervisor/api/panel/frontend_es5/16aa06d8.js
Normal file
1
supervisor/api/panel/frontend_es5/16aa06d8.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[639],{71639:function(s){s.exports=[]}}]);
|
1
supervisor/api/panel/frontend_es5/19929d68.js
Normal file
1
supervisor/api/panel/frontend_es5/19929d68.js
Normal file
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_es5/19929d68.js.gz
Normal file
BIN
supervisor/api/panel/frontend_es5/19929d68.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_es5/231b432f.js.gz
Normal file
BIN
supervisor/api/panel/frontend_es5/231b432f.js.gz
Normal file
Binary file not shown.
1
supervisor/api/panel/frontend_es5/28b142f6.js
Normal file
1
supervisor/api/panel/frontend_es5/28b142f6.js
Normal file
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_es5/28b142f6.js.gz
Normal file
BIN
supervisor/api/panel/frontend_es5/28b142f6.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
1
supervisor/api/panel/frontend_es5/86d46eef.js
Normal file
1
supervisor/api/panel/frontend_es5/86d46eef.js
Normal file
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_es5/86d46eef.js.gz
Normal file
BIN
supervisor/api/panel/frontend_es5/86d46eef.js.gz
Normal file
Binary file not shown.
Binary file not shown.
1
supervisor/api/panel/frontend_es5/978fdab9.js
Normal file
1
supervisor/api/panel/frontend_es5/978fdab9.js
Normal file
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_es5/978fdab9.js.gz
Normal file
BIN
supervisor/api/panel/frontend_es5/978fdab9.js.gz
Normal file
Binary file not shown.
2
supervisor/api/panel/frontend_es5/991beab2.js
Normal file
2
supervisor/api/panel/frontend_es5/991beab2.js
Normal file
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_es5/991beab2.js.gz
Normal file
BIN
supervisor/api/panel/frontend_es5/991beab2.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
1
supervisor/api/panel/frontend_es5/abc63622.js
Normal file
1
supervisor/api/panel/frontend_es5/abc63622.js
Normal file
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_es5/abc63622.js.gz
Normal file
BIN
supervisor/api/panel/frontend_es5/abc63622.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
2
supervisor/api/panel/frontend_es5/entrypoint.75b60951.js
Normal file
2
supervisor/api/panel/frontend_es5/entrypoint.75b60951.js
Normal file
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_es5/entrypoint.75b60951.js.gz
Normal file
BIN
supervisor/api/panel/frontend_es5/entrypoint.75b60951.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"entrypoint.js": "/api/hassio/app/frontend_es5/entrypoint.f8f83860.js"
|
"entrypoint.js": "/api/hassio/app/frontend_es5/entrypoint.75b60951.js"
|
||||||
}
|
}
|
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_latest/29a9c475.js.gz
Normal file
BIN
supervisor/api/panel/frontend_latest/29a9c475.js.gz
Normal file
Binary file not shown.
1
supervisor/api/panel/frontend_latest/29a9c475.js.map
Normal file
1
supervisor/api/panel/frontend_latest/29a9c475.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_latest/4e85eb44.js.gz
Normal file
BIN
supervisor/api/panel/frontend_latest/4e85eb44.js.gz
Normal file
Binary file not shown.
1
supervisor/api/panel/frontend_latest/4e85eb44.js.map
Normal file
1
supervisor/api/panel/frontend_latest/4e85eb44.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_latest/5754faba.js.gz
Normal file
BIN
supervisor/api/panel/frontend_latest/5754faba.js.gz
Normal file
Binary file not shown.
1
supervisor/api/panel/frontend_latest/5754faba.js.map
Normal file
1
supervisor/api/panel/frontend_latest/5754faba.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_latest/6402d1b0.js.gz
Normal file
BIN
supervisor/api/panel/frontend_latest/6402d1b0.js.gz
Normal file
Binary file not shown.
1
supervisor/api/panel/frontend_latest/6402d1b0.js.map
Normal file
1
supervisor/api/panel/frontend_latest/6402d1b0.js.map
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
578
supervisor/api/panel/frontend_latest/7b9d33d3.js
Normal file
578
supervisor/api/panel/frontend_latest/7b9d33d3.js
Normal file
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_latest/7b9d33d3.js.gz
Normal file
BIN
supervisor/api/panel/frontend_latest/7b9d33d3.js.gz
Normal file
Binary file not shown.
1
supervisor/api/panel/frontend_latest/7b9d33d3.js.map
Normal file
1
supervisor/api/panel/frontend_latest/7b9d33d3.js.map
Normal file
File diff suppressed because one or more lines are too long
@@ -68,5 +68,5 @@
|
|||||||
ha-icon-button {
|
ha-icon-button {
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
`]}},{kind:"method",key:"_handleMenuAction",value:function(e){switch(e.detail.index){case 0:this._downloadClicked();break;case 1:this._deleteClicked()}}},{kind:"method",key:"_restoreClicked",value:async function(){const e=this._backupContent.backupDetails();this._restoringBackup=!0,"full"===this._backupContent.backupType?await this._fullRestoreClicked(e):await this._partialRestoreClicked(e),this._restoringBackup=!1}},{kind:"method",key:"_partialRestoreClicked",value:async function(e){var t,i,r,o;void 0===(null===(t=this._dialogParams)||void 0===t?void 0:t.supervisor)||"running"===(null===(i=this._dialogParams)||void 0===i?void 0:i.supervisor.info.state)?await(0,d.g7)(this,{title:"Are you sure you want partially to restore this backup?",confirmText:"restore",dismissText:"cancel"})&&(null!==(r=this._dialogParams)&&void 0!==r&&r.onboarding?((0,s.B)(this,"restoring"),fetch(`/api/hassio/backups/${this._backup.slug}/restore/partial`,{method:"POST",body:JSON.stringify(e)}),this.closeDialog()):this.hass.callApi("POST",`hassio/${(0,f.I)(this.hass.config.version,2021,9)?"backups":"snapshots"}/${this._backup.slug}/restore/partial`,e).then((()=>{this.closeDialog()}),(e=>{this._error=e.body.message}))):await(0,d.Ys)(this,{title:"Could not restore backup",text:`Restoring a backup is not possible right now because the system is in ${null===(o=this._dialogParams)||void 0===o?void 0:o.supervisor.info.state} state.`})}},{kind:"method",key:"_fullRestoreClicked",value:async function(e){var t,i,r,o;void 0===(null===(t=this._dialogParams)||void 0===t?void 0:t.supervisor)||"running"===(null===(i=this._dialogParams)||void 0===i?void 0:i.supervisor.info.state)?await(0,d.g7)(this,{title:"Are you sure you want to wipe your system and restore this backup?",confirmText:"restore",dismissText:"cancel"})&&(null!==(r=this._dialogParams)&&void 0!==r&&r.onboarding?((0,s.B)(this,"restoring"),fetch(`/api/hassio/backups/${this._backup.slug}/restore/full`,{method:"POST",body:JSON.stringify(e)}),this.closeDialog()):this.hass.callApi("POST",`hassio/${(0,f.I)(this.hass.config.version,2021,9)?"backups":"snapshots"}/${this._backup.slug}/restore/full`,e).then((()=>{this.closeDialog()}),(e=>{this._error=e.body.message}))):await(0,d.Ys)(this,{title:"Could not restore backup",text:`Restoring a backup is not possible right now because the system is in ${null===(o=this._dialogParams)||void 0===o?void 0:o.supervisor.info.state} state.`})}},{kind:"method",key:"_deleteClicked",value:async function(){await(0,d.g7)(this,{title:"Are you sure you want to delete this backup?",confirmText:"delete",dismissText:"cancel"})&&this.hass.callApi((0,f.I)(this.hass.config.version,2021,9)?"DELETE":"POST","hassio/"+((0,f.I)(this.hass.config.version,2021,9)?`backups/${this._backup.slug}`:`snapshots/${this._backup.slug}/remove`)).then((()=>{this._dialogParams.onDelete&&this._dialogParams.onDelete(),this.closeDialog()}),(e=>{this._error=e.body.message}))}},{kind:"method",key:"_downloadClicked",value:async function(){let e;try{e=await(0,n.iI)(this.hass,`/api/hassio/${(0,f.I)(this.hass.config.version,2021,9)?"backups":"snapshots"}/${this._backup.slug}/download`)}catch(e){return void await(0,d.Ys)(this,{text:(0,l.js)(e)})}if(window.location.href.includes("ui.nabu.casa")){if(!await(0,d.g7)(this,{title:"Potential slow download",text:"Downloading backups over the Nabu Casa URL will take some time, it is recomended to use your local URL instead, do you want to continue?",confirmText:"continue",dismissText:"cancel"}))return}(0,h.N)(e.path,`home_assistant_backup_${(0,a.l)(this._computeName)}.tar`)}},{kind:"get",key:"_computeName",value:function(){return this._backup?this._backup.name||this._backup.slug:"Unnamed backup"}}]}}),r.oi)}))},3447:(e,t,i)=>{i.d(t,{l:()=>r});const r=(e,t="_")=>{const i="àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;",r=`aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz${t}${t}${t}${t}${t}${t}`,o=new RegExp(i.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,t).replace(o,(e=>r.charAt(i.indexOf(e)))).replace(/&/g,`${t}and${t}`).replace(/[^\w-]+/g,"").replace(/-/g,t).replace(new RegExp(`(${t})\\1+`,"g"),"$1").replace(new RegExp(`^${t}+`),"").replace(new RegExp(`${t}+$`),"")}},2814:(e,t,i)=>{i.d(t,{iI:()=>r});location.protocol,location.host;const r=(e,t)=>e.callWS({type:"auth/sign_path",path:t})},5936:(e,t,i)=>{i.d(t,{N:()=>r});const r=(e,t="")=>{const i=document.createElement("a");i.target="_blank",i.href=e,i.download=t,document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click")),document.body.removeChild(i)}}}]);
|
`]}},{kind:"method",key:"_handleMenuAction",value:function(e){switch(e.detail.index){case 0:this._downloadClicked();break;case 1:this._deleteClicked()}}},{kind:"method",key:"_restoreClicked",value:async function(){const e=this._backupContent.backupDetails();this._restoringBackup=!0,"full"===this._backupContent.backupType?await this._fullRestoreClicked(e):await this._partialRestoreClicked(e),this._restoringBackup=!1}},{kind:"method",key:"_partialRestoreClicked",value:async function(e){var t,i,r,o;if(void 0===(null===(t=this._dialogParams)||void 0===t?void 0:t.supervisor)||"running"===(null===(i=this._dialogParams)||void 0===i?void 0:i.supervisor.info.state)){if(await(0,d.g7)(this,{title:"Are you sure you want partially to restore this backup?",confirmText:"restore",dismissText:"cancel"}))if(null!==(r=this._dialogParams)&&void 0!==r&&r.onboarding)(0,s.B)(this,"restoring"),await fetch(`/api/hassio/backups/${this._backup.slug}/restore/partial`,{method:"POST",body:JSON.stringify(e)}),this.closeDialog();else try{await this.hass.callApi("POST",`hassio/${(0,f.I)(this.hass.config.version,2021,9)?"backups":"snapshots"}/${this._backup.slug}/restore/partial`,e),this.closeDialog()}catch(e){this._error=e.body.message}}else await(0,d.Ys)(this,{title:"Could not restore backup",text:`Restoring a backup is not possible right now because the system is in ${null===(o=this._dialogParams)||void 0===o?void 0:o.supervisor.info.state} state.`})}},{kind:"method",key:"_fullRestoreClicked",value:async function(e){var t,i,r,o;void 0===(null===(t=this._dialogParams)||void 0===t?void 0:t.supervisor)||"running"===(null===(i=this._dialogParams)||void 0===i?void 0:i.supervisor.info.state)?await(0,d.g7)(this,{title:"Are you sure you want to wipe your system and restore this backup?",confirmText:"restore",dismissText:"cancel"})&&(null!==(r=this._dialogParams)&&void 0!==r&&r.onboarding?((0,s.B)(this,"restoring"),fetch(`/api/hassio/backups/${this._backup.slug}/restore/full`,{method:"POST",body:JSON.stringify(e)}),this.closeDialog()):this.hass.callApi("POST",`hassio/${(0,f.I)(this.hass.config.version,2021,9)?"backups":"snapshots"}/${this._backup.slug}/restore/full`,e).then((()=>{this.closeDialog()}),(e=>{this._error=e.body.message}))):await(0,d.Ys)(this,{title:"Could not restore backup",text:`Restoring a backup is not possible right now because the system is in ${null===(o=this._dialogParams)||void 0===o?void 0:o.supervisor.info.state} state.`})}},{kind:"method",key:"_deleteClicked",value:async function(){await(0,d.g7)(this,{title:"Are you sure you want to delete this backup?",confirmText:"delete",dismissText:"cancel"})&&this.hass.callApi((0,f.I)(this.hass.config.version,2021,9)?"DELETE":"POST","hassio/"+((0,f.I)(this.hass.config.version,2021,9)?`backups/${this._backup.slug}`:`snapshots/${this._backup.slug}/remove`)).then((()=>{this._dialogParams.onDelete&&this._dialogParams.onDelete(),this.closeDialog()}),(e=>{this._error=e.body.message}))}},{kind:"method",key:"_downloadClicked",value:async function(){let e;try{e=await(0,n.iI)(this.hass,`/api/hassio/${(0,f.I)(this.hass.config.version,2021,9)?"backups":"snapshots"}/${this._backup.slug}/download`)}catch(e){return void await(0,d.Ys)(this,{text:(0,l.js)(e)})}if(window.location.href.includes("ui.nabu.casa")){if(!await(0,d.g7)(this,{title:"Potential slow download",text:"Downloading backups over the Nabu Casa URL will take some time, it is recomended to use your local URL instead, do you want to continue?",confirmText:"continue",dismissText:"cancel"}))return}(0,h.N)(e.path,`home_assistant_backup_${(0,a.l)(this._computeName)}.tar`)}},{kind:"get",key:"_computeName",value:function(){return this._backup?this._backup.name||this._backup.slug:"Unnamed backup"}}]}}),r.oi)}))},3447:(e,t,i)=>{i.d(t,{l:()=>r});const r=(e,t="_")=>{const i="àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;",r=`aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz${t}${t}${t}${t}${t}${t}`,o=new RegExp(i.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,t).replace(o,(e=>r.charAt(i.indexOf(e)))).replace(/&/g,`${t}and${t}`).replace(/[^\w-]+/g,"").replace(/-/g,t).replace(new RegExp(`(${t})\\1+`,"g"),"$1").replace(new RegExp(`^${t}+`),"").replace(new RegExp(`${t}+$`),"")}},2814:(e,t,i)=>{i.d(t,{iI:()=>r});location.protocol,location.host;const r=(e,t)=>e.callWS({type:"auth/sign_path",path:t})},5936:(e,t,i)=>{i.d(t,{N:()=>r});const r=(e,t="")=>{const i=document.createElement("a");i.target="_blank",i.href=e,i.download=t,document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click")),document.body.removeChild(i)}}}]);
|
||||||
//# sourceMappingURL=1a587b90.js.map
|
//# sourceMappingURL=8bc74f44.js.map
|
BIN
supervisor/api/panel/frontend_latest/8bc74f44.js.gz
Normal file
BIN
supervisor/api/panel/frontend_latest/8bc74f44.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_latest/afd7bfba.js.gz
Normal file
BIN
supervisor/api/panel/frontend_latest/afd7bfba.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
66
supervisor/api/panel/frontend_latest/cdc55c4b.js
Normal file
66
supervisor/api/panel/frontend_latest/cdc55c4b.js
Normal file
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_latest/cdc55c4b.js.gz
Normal file
BIN
supervisor/api/panel/frontend_latest/cdc55c4b.js.gz
Normal file
Binary file not shown.
1
supervisor/api/panel/frontend_latest/cdc55c4b.js.map
Normal file
1
supervisor/api/panel/frontend_latest/cdc55c4b.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
supervisor/api/panel/frontend_latest/entrypoint.f358ba39.js.gz
Normal file
BIN
supervisor/api/panel/frontend_latest/entrypoint.f358ba39.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user