Compare commits

...

2389 Commits

Author SHA1 Message Date
dependabot[bot]
e4eaeb91cd Bump actions/cache from 4.2.3 to 4.2.4 (#6082)
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.3 to 4.2.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4.2.3...v4.2.4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 4.2.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-08 12:23:07 +02:00
dependabot[bot]
e61d88779d Bump ruff from 0.12.7 to 0.12.8 (#6081)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.12.7 to 0.12.8.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.12.7...0.12.8)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.12.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-08 12:22:55 +02:00
github-actions[bot]
0513ea0438 Update frontend to version 20250806.0 (#5810)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-07 11:10:34 +02:00
dependabot[bot]
030927dc01 Bump debugpy from 1.8.15 to 1.8.16 (#6078)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.8.15 to 1.8.16.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.8.15...v1.8.16)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-version: 1.8.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-07 09:40:19 +02:00
Stefan Agner
cad14bf46e Handle disks with non-existing SMART attributes (#6077)
Not all disks have all SMART attributes available, e.g. Sentry showed
devices with missing "wctemp". In practice, any SMART attribute could
be missing. Make sure we handle this gracefully.
2025-08-07 09:40:03 +02:00
Stefan Agner
5d851ad747 Ignore UTF-8 errors in addon docs (#6076)
Add-on documentation might not have valid UTF-8 encoding. Since this
is user provided content, we should not fail if it contains invalid
UTF-8 characters. Instead, we can replace them with a placeholder.
2025-08-07 09:39:53 +02:00
Stefan Agner
528032fb36 Avoid race condition on add-on installation (#6075)
The JobGroup concurrency decorator of the Addon class does not prevent
concurrent installation since the AddonManager creates a separate
object for each installation. Make sure only one add-on installation
is running at a time by using the JobGroup decorator on the
AddonManager install method instead.
2025-08-07 09:39:35 +02:00
Stefan Agner
3b093200e3 Improve JobGroup locking with external ownership tracking (#6074)
* Use context manager for Job concurrency control

* Allow to release lock outside of Job running context

* Improve JobGroup locking with external ownership tracking

Track lock ownership by job UUID instead of execution context. This
allows external lock release via job parameter.

* Fix acquire lock in nested Jobs

* Simplify nested lock tracking

* Simplify Job group lock acquisition logic

* Simplify by using helper methods

* Allow throttling with group concurrency

* Use Lock instead of Semaphore for job concurrency control

Use the same synchronization primitive (Lock) for job concurrency
control as used in job groups.

* Go back to lock ownership tracking with references

* Drop unused property `active_job_id`

* Drop unused property `can_acquire`

* Replace assert with cast
2025-08-07 00:14:58 +02:00
Stefan Agner
15ba1a3c94 Use path for actions/download-artifact to fix coverage report (#6073)
Use name and path parameters to explicitly download the coverage report
artifact. This fixes a behavioral change introduced with v5.0.0
ofactions/download-artifact.
2025-08-06 15:49:42 +02:00
Stefan Agner
8e4a87c751 Load Home Assistant OS component earlier (#6068)
Load the Home Assistant OS component earlier in the Supervisor
lifecycle to ensure that updater has board information available
when checking for updates. This makes sure that we have the latest
OS update information right on Supervisor start.
2025-08-06 10:53:30 +02:00
Mike Degatano
fdde95d849 Add an issue for disk lifetime >90% (#6069) 2025-08-06 10:40:48 +02:00
dependabot[bot]
65e5a36aa7 Bump time-machine from 2.16.0 to 2.17.0 (#6072)
Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.16.0 to 2.17.0.
- [Changelog](https://github.com/adamchainz/time-machine/blob/main/docs/changelog.rst)
- [Commits](https://github.com/adamchainz/time-machine/compare/2.16.0...2.17.0)

---
updated-dependencies:
- dependency-name: time-machine
  dependency-version: 2.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-06 10:32:47 +02:00
dependabot[bot]
bd62602cde Bump cryptography from 45.0.5 to 45.0.6 (#6071)
Bumps [cryptography](https://github.com/pyca/cryptography) from 45.0.5 to 45.0.6.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/45.0.5...45.0.6)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 45.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-06 10:32:33 +02:00
dependabot[bot]
f9bcc273f8 Bump actions/download-artifact from 4.3.0 to 5.0.0 (#6070)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.3.0 to 5.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.3.0...v5.0.0)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-06 10:32:14 +02:00
Mike Degatano
059b161f4f Use actual latest version of OS in os version check (#6067) 2025-08-05 22:23:23 +02:00
dependabot[bot]
f11eb6b35a Bump docker/login-action from 3.4.0 to 3.5.0 (#6066)
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 3.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-05 22:23:09 +02:00
Stefan Agner
9bee58a8b1 Migrate to JobConcurrency and JobThrottle parameters (#6065) 2025-08-05 13:24:44 +02:00
Mike Degatano
8a1e6b0895 Add unsupported reason os_version and evaluation (#6041)
* Add unsupported reason os_version and evaluation

* Order enum and add tests

* Apply suggestions from code review

* Apply suggestions from code review

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-08-05 13:23:42 +02:00
Stefan Agner
f150d1b287 Return optimistic life time estimate for eMMC storage (#6063)
This avoids that we display a 10% life time use for a brand new
eMMC storage. The values are estimates anyways, and there is a
separate value which represents life time completely used (100%).
2025-08-05 10:43:57 +02:00
dependabot[bot]
628a18c6b8 Bump coverage from 7.10.1 to 7.10.2 (#6062)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.10.1 to 7.10.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.10.1...7.10.2)

---
updated-dependencies:
- dependency-name: coverage
  dependency-version: 7.10.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-04 14:41:38 +02:00
dependabot[bot]
74e43411e5 Bump dbus-fast from 2.44.2 to 2.44.3 (#6061)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.44.2 to 2.44.3.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.44.2...v2.44.3)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-version: 2.44.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-04 14:41:25 +02:00
dependabot[bot]
e6b0d4144c Bump awesomeversion from 25.5.0 to 25.8.0 (#6060)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 25.5.0 to 25.8.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/25.5.0...25.8.0)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-version: 25.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-04 14:41:11 +02:00
Mike Degatano
033896480d Fix backup equal and add hash to objects with eq (#6059)
* Fix backup equal and add hash to objects with eq

* Add test for failed consolidate
2025-08-04 14:19:33 +02:00
dependabot[bot]
478e00c0fe Bump home-assistant/wheels from 2025.03.0 to 2025.07.0 (#6057)
Bumps [home-assistant/wheels](https://github.com/home-assistant/wheels) from 2025.03.0 to 2025.07.0.
- [Release notes](https://github.com/home-assistant/wheels/releases)
- [Commits](https://github.com/home-assistant/wheels/compare/2025.03.0...2025.07.0)

---
updated-dependencies:
- dependency-name: home-assistant/wheels
  dependency-version: 2025.07.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-04 14:17:42 +02:00
dependabot[bot]
6f2ba7d68c Bump mypy from 1.17.0 to 1.17.1 (#6058)
Bumps [mypy](https://github.com/python/mypy) from 1.17.0 to 1.17.1.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.17.0...v1.17.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-version: 1.17.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-04 14:17:13 +02:00
Mike Degatano
22afa60f55 Get lifetime info for NVMe devices (#6056)
* Get lifetime info for NVMe devices

* Fix lint and test issues

* Update tests/dbus_service_mocks/udisks2_manager.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-04 13:53:56 +02:00
Stefan Agner
9f2fda5dc7 Update to Alpine 3.22 (#6054)
Update the Supervisor base image to Alpine 3.22 for all architectures.
2025-08-04 09:50:27 +02:00
Stefan Agner
27b092aed0 Block OS updates when the system is unhealthy (#6053)
* Block OS updates when the system is unhealthy

In #6024 we mark a system as unhealthy when multiple OS installations
were found. The idea was to block OS updates in this case. However, it
turns out that the OS update job was not checking the system health
and thus allowed updates even when the system was marked as unhealthy.

This commit adds the `JobCondition.HEALTHY` condition to the OS update
job, ensuring that OS updates are only performed when the system is
healthy.

Users can force an OS update still by using
`ha jobs options --ignore-conditions healthy`.

* Add test for update of unhealthy system

---------

Co-authored-by: Jan Čermák <sairon@sairon.cz>
2025-07-31 11:23:57 +02:00
dependabot[bot]
3af13cb7e2 Bump sentry-sdk from 2.34.0 to 2.34.1 (#6052)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.34.0 to 2.34.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.34.0...2.34.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.34.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 10:43:49 +02:00
Stefan Agner
6871ea4b81 Split execution limit in concurrency and throttle parameters (#6013)
* Split execution limit in concurrency and throttle parameters

Currently the execution limit combines two ortogonal features: Limit
concurrency and throttle execution. This change separates the two
features, allowing for more flexible configuration of job execution.

Ultimately I want to get rid of the old limit parameter. But for ease
of review and migration, I'd like to do this in two steps: First
introduce the new parameters, and map the old limit parameters to the
new parameters. Then, in a second step, remove the old limit parameter
and migrate all users to the new concurrency and throttle parameters
as needed.

* Introduce common lock release method

* Fix THROTTLE_WAIT behavior

The concurrency QUEUE does not really QUEUE throttle limits.

* Add documentation for new concurrency/throttle Job options

* Handle group options for concurrency and throttle separately

* Fix GROUP_THROTTLE_WAIT concurrency setting

We need to use the QUEUE concurrency setting instead of GROUP_QUEUE
for the GROUP_THROTTLE_WAIT execution limit. Otherwise the
test_jobs_decorator.py::test_execution_limit_group_throttle_wait
test deadlocks.

The reason this deadlocks is because GROUP_QUEUE concurrency doesn't
really work because we only can release a group lock if the job is
actually running.

Or put differently, throttling isn't supported with GROUP_*
concurrency options.

* Prevent using any throttling with group concurrency

The group concurrency modes (reject and queue) are not compatible with
any throttling, since we currently can't unlock the group lock when
a job doesn't get started (which is the case when throttling is
applied).

* Fix commit in group rate limit

* Explain the deadlock issue with group locks in code

* Handle locking correctly on throttle limit exceptions

* Introduce pytest for new job decorator combinations
2025-07-30 22:12:14 +02:00
dependabot[bot]
cf77ab2290 Bump aiohttp from 3.12.14 to 3.12.15 (#6049)
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.12.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-30 14:34:14 +02:00
dependabot[bot]
ceeffa3284 Bump ruff from 0.12.5 to 0.12.7 (#6051)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.12.5 to 0.12.7.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.12.5...0.12.7)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.12.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-30 14:33:07 +02:00
dependabot[bot]
31f2f70cd9 Bump sentry-sdk from 2.33.2 to 2.34.0 (#6050)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.33.2 to 2.34.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.33.2...2.34.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.34.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-30 14:32:11 +02:00
Stefan Agner
deac85bddb Scrub WiFi fields from Sentry events (#6048)
Make sure WiFi fields are scrubbed from Sentry events to prevent
accidental exposure of sensitive information.
2025-07-29 17:42:43 +02:00
Stefan Agner
7dcf5ba631 Enable IPv6 for containers on new installations (#6029)
* Enable IPv6 by default for new installations

Enable IPv6 by default for new Supervisor installations. Let's also
make the `enable_ipv6` attribute nullable, so we can distinguish
between "not set" and "set to false".

* Add pytest

* Add log message that system restart is required for IPv6 changes

* Fix API pytest

* Create resolution center issue when reboot is required

* Order log after actual setter call
2025-07-29 15:59:03 +02:00
dependabot[bot]
a004830131 Bump orjson from 3.11.0 to 3.11.1 (#6045)
Bumps [orjson](https://github.com/ijl/orjson) from 3.11.0 to 3.11.1.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.11.0...3.11.1)

---
updated-dependencies:
- dependency-name: orjson
  dependency-version: 3.11.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-28 10:41:42 +02:00
dependabot[bot]
a8cc6c416d Bump coverage from 7.10.0 to 7.10.1 (#6044)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.10.0 to 7.10.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.10.0...7.10.1)

---
updated-dependencies:
- dependency-name: coverage
  dependency-version: 7.10.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-28 10:41:19 +02:00
dependabot[bot]
74b26642b0 Bump ruff from 0.12.4 to 0.12.5 (#6042)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-27 20:20:27 +02:00
dependabot[bot]
5e26ab5f4a Bump gitpython from 3.1.44 to 3.1.45 (#6039)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-27 20:14:24 +02:00
dependabot[bot]
a841cb8282 Bump coverage from 7.9.2 to 7.10.0 (#6043) 2025-07-27 10:31:48 +02:00
dependabot[bot]
3b1b03c8a7 Bump dbus-fast from 2.44.1 to 2.44.2 (#6038)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.44.1 to 2.44.2.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.44.1...v2.44.2)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-version: 2.44.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-23 16:06:19 -04:00
dependabot[bot]
680428f304 Bump sentry-sdk from 2.33.0 to 2.33.2 (#6037)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.33.0 to 2.33.2.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.33.0...2.33.2)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.33.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-23 12:44:35 -04:00
dependabot[bot]
f34128c37e Bump ruff from 0.12.3 to 0.12.4 (#6031)
---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.12.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-23 12:43:56 -04:00
dependabot[bot]
2ed0682b34 Bump sigstore/cosign-installer from 3.9.1 to 3.9.2 (#6032) 2025-07-18 10:00:58 +02:00
Stefan Agner
fbb0915ef8 Mark system as unhealthy if multiple OS installations are found (#6024)
* Add resolution check for duplicate OS installations

* Only create single issue/use separate unhealthy type

* Check MBR partition UUIDs as well

* Use partlabel

* Use generator to avoid code duplication

* Add list of devices, avoid unnecessary exception handling

* Run check only on HAOS

* Fix message formatting

* Fix and simplify pytests

* Fix UnhealthyReason sort order
2025-07-17 10:06:35 +02:00
Stefan Agner
780ae1e15c Check for duplicate data disks only when the OS is available (#6025)
* Check for duplicate data disks only when the OS is available

Supervised installations do not have a specific data disk, so only
check for duplicate data disks on Home Assistant OS.

* Enable OS for multiple data disks check test
2025-07-16 10:43:15 +02:00
dependabot[bot]
c617358855 Bump orjson from 3.10.18 to 3.11.0 (#6028)
Bumps [orjson](https://github.com/ijl/orjson) from 3.10.18 to 3.11.0.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.10.18...3.11.0)

---
updated-dependencies:
- dependency-name: orjson
  dependency-version: 3.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-16 09:24:34 +02:00
dependabot[bot]
b679c4f4d8 Bump sentry-sdk from 2.32.0 to 2.33.0 (#6027)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.32.0 to 2.33.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.32.0...2.33.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-16 09:20:28 +02:00
dependabot[bot]
c946c421f2 Bump debugpy from 1.8.14 to 1.8.15 (#6026)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.8.14 to 1.8.15.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.8.14...v1.8.15)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-version: 1.8.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-16 09:19:44 +02:00
dependabot[bot]
aeabf7ea25 Bump blockbuster from 1.5.24 to 1.5.25 (#6020)
Bumps [blockbuster](https://github.com/cbornet/blockbuster) from 1.5.24 to 1.5.25.
- [Release notes](https://github.com/cbornet/blockbuster/releases)
- [Commits](https://github.com/cbornet/blockbuster/commits/v1.5.25)

---
updated-dependencies:
- dependency-name: blockbuster
  dependency-version: 1.5.25
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-16 09:18:57 +02:00
dependabot[bot]
365b838abf Bump mypy from 1.16.1 to 1.17.0 (#6019)
Bumps [mypy](https://github.com/python/mypy) from 1.16.1 to 1.17.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.16.1...v1.17.0)

---
updated-dependencies:
- dependency-name: mypy
  dependency-version: 1.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-16 09:08:57 +02:00
Stefan Agner
99c040520e Drop ensure_builtin_repositories() (#6012)
* Drop ensure_builtin_repositories

With the new Repository classes we have the is_builtin property, so we
can easily make sure that built-ins are not removed. This allows us to
further cleanup the code by removing the ensure_builtin_repositories
function and the ALL_BUILTIN_REPOSITORIES constant.

* Make sure we add built-ins on load

* Reuse default set and avoid unnecessary copy

Reuse default set and avoid unnecessary copying during validation if
the default is not being used.
2025-07-14 22:19:06 +02:00
dependabot[bot]
eefe2f2e06 Bump aiohttp from 3.12.13 to 3.12.14 (#6014)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-14 11:43:55 +02:00
dependabot[bot]
a366e36b37 Bump ruff from 0.12.2 to 0.12.3 (#6016)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-14 11:19:08 +02:00
dependabot[bot]
27a2fde9e1 Bump astroid from 3.3.10 to 3.3.11 (#6017)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-14 11:18:54 +02:00
Stefan Agner
9a0f530a2f Add Supervisor connectivity check after DNS restart (#6005)
* Add Supervisor connectivity check after DNS restart

When the DNS plug-in got restarted, check Supervisor connectivity
in case the DNS plug-in configuration change influenced Supervisor
connectivity. This is helpful when a DHCP server gets started after
Home Assistant is up. In that case the network provided DNS server
(local DNS server) becomes available after the DNS plug-in restart.

Without this change, the Supervisor connectivity will remain false
until the a Job triggers a connectivity check, for example the
periodic update check (which causes a updater and store reload) by
Core.

* Fix pytest and add coverage for new functionality
2025-07-10 11:08:10 +02:00
Stefan Agner
baf9695cf7 Refactoring around add-on store Repository classes (#5990)
* Rename repository fixture to test_repository

Also don't remove the built-in repositories. The list was incomplete,
and tests don't seem to require that anymore.

* Get rid of StoreType

The type doesn't have much value, we have constant strings anyways.

* Introduce types.py

* Use slug to determine which repository urls to return

* Simplify BuiltinRepository enum

* Mock GitRepo load

* Improve URL handling and repository creation logic

* Refactor update_repositories

* Get rid of get_from_url

It is no longer used in production code.

* More refactoring

* Address pylint

* Introduce is_git_based property to Repository class

Return all git based URLs, including the Core repository.

* Revert "Introduce is_git_based property to Repository class"

This reverts commit dfd5ad79bf.

* Fold type.py into const.py

Align more with how Supervisor code is typically structured.

* Update supervisor/store/__init__.py

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Apply repository remove suggestion

* Fix tests

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2025-07-10 11:07:53 +02:00
Stefan Agner
7873c457d5 Small improvement to Copilot instructions (#6011) 2025-07-10 11:05:59 +02:00
Stefan Agner
cbc48c381f Return 401 Unauthorized when using json/url encoded auth fails (#5844)
When authentication using JSON payload or URL encoded payload fails,
use the generic HTTP response code 401 Unauthorized instead of 400
Bad Request.

This is a more appropriate response code for authentication errors
and is consistent with the behavior of other authentication methods.
2025-07-10 08:38:00 +02:00
Franck Nijhof
11e37011bd Add Task issue form (#6007) 2025-07-09 16:58:10 +02:00
Franck Nijhof
cfda559a90 Adjust feature request links in issue reporting (#6009) 2025-07-09 16:44:35 +02:00
Mike Degatano
806bd9f52c Apply store reload suggestion automatically on connectivity change (#6004)
* Apply store reload suggestion automatically on connectivity change

* Use sys_bus not coresys.bus

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-09 16:43:51 +02:00
Stefan Agner
953f7d01d7 Improve DNS plug-in restart (#5999)
* Improve DNS plug-in restart

Instead of simply go by PrimaryConnectioon change, use the DnsManager
Configuration property. This property is ultimately used to write the
DNS plug-in configuration, so it is really the relevant information
we pass on to the plug-in.

* Check for changes and restart DNS plugin

* Check for changes in plug-in DNS

Cache last local (NetworkManager) provided DNS servers. Check against
this DNS server list when deciding when to restart the DNS plug-in.

* Check connectivity unthrottled in certain situations

* Fix pytest

* Fix pytest

* Improve test coverage for DNS plugins restart functionality

* Apply suggestions from code review

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Debounce local DNS changes and event based connectivity checks

* Remove connection check logic

* Remove unthrottled connectivity check

* Fix delayed call

* Store restart task and cancel in case a restart is running

* Improve DNS configuration change tests

* Remove stale code

* Improve DNS plug-in tests, less mocking

* Cover multiple private functions at once

Improve tests around notify_locals_changed() to cover multiple
functions at once.

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2025-07-09 11:35:03 +02:00
Felipe Santos
381e719a0e Allow to force rebuild of add-ons (#6002) 2025-07-07 21:41:18 +02:00
Ruben van Dijk
296071067d Fix multiple set-cookie headers with addons ingress (#5996) 2025-07-07 19:27:39 +02:00
dependabot[bot]
8336537f51 Bump types-docker from 7.1.0.20250523 to 7.1.0.20250705 (#6003)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-07 10:00:26 +02:00
Stefan Agner
5c90a00263 Force reload of /etc/resolv.conf on WebSession init (#6000) 2025-07-05 12:18:02 +02:00
dependabot[bot]
1f2bf77784 Bump coverage from 7.9.1 to 7.9.2 (#5992)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-04 08:54:36 +02:00
dependabot[bot]
9aa4f381b8 Bump ruff from 0.12.1 to 0.12.2 (#5993)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-04 08:47:35 +02:00
Mike Degatano
ae036ceffe Don't backup uninstalled addons (#5988)
* Don't backup uninstalled addons

* Remove hash in backup
2025-07-04 07:05:53 +02:00
Stefan Agner
f0ea0d4a44 Add GitHub Copilot/Claude instruction (#5986)
* Add GitHub Copilot/Claude instruction

This adds an initial instruction file for GitHub Copilot and Claude
(CLAUDE.md symlinked to the same file).

* Add --ignore-missing-imports to mypy, add note to run pre-commit
2025-07-04 07:05:05 +02:00
Mike Degatano
abc44946bb Refactor addon git repo (#5987)
* Refactor Repository into setup with inheritance

* Remove subclasses of GitRepo
2025-07-03 13:53:52 +02:00
dependabot[bot]
3e20a0937d Bump cryptography from 45.0.4 to 45.0.5 (#5989)
Bumps [cryptography](https://github.com/pyca/cryptography) from 45.0.4 to 45.0.5.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/45.0.4...45.0.5)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 45.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-03 09:52:50 +02:00
Mike Degatano
6cebf52249 Store reset only deletes git cache after clone was successful (#5984)
* Store reset only deletes git cache after clone was successful

* Add test and fix fallback error handling

* Fix when lock is grabbed
2025-07-02 14:34:18 -04:00
Felipe Santos
bc57deb474 Use Docker BuildKit to build addons (#5974)
* Use Docker BuildKit to build addons

* Improve error message as suggested by CodeRabbit

* Fix container.remove() tests missing v=True

* Ignore squash rather than falling back to legacy builder

* Use version rather than tag to avoid confusion in run_command()

* Fix tests differently

* Use PropertyMock like other tests

* Restore position of fix_label fn

* Exempt addon builder image from unsupported checks

* Refactor tests

* Fix tests expecting wrong builder image

* Remove harcoded paths

* Fix tests

* Remove get_addon_host_path() function

* Use docker buildx build rather than docker build

Co-authored-by: Stefan Agner <stefan@agner.ch>

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-07-02 17:33:41 +02:00
Mike Degatano
38750d74a8 Refactor builtin repositories to enum (#5976) 2025-06-30 13:22:00 -04:00
Felipe Santos
d1c1a2d418 Fix docker.run_command() needing detach but not enforcing it (#5979)
* Fix `docker.run_command()` needing `detach` but not enforcing it

* Fix test
2025-06-30 16:09:19 +02:00
Felipe Santos
cf32f036c0 Fix docker_home_assistant_execute_command not honoring HA version (#5978)
* Fix `docker_home_assistant_execute_command` not honoring HA version

* Change variable name to image_with_tag

* Fix test
2025-06-30 16:08:05 +02:00
Felipe Santos
b8852872fe Remove anonymous volumes when removing containers (#5977)
* Remove anonymous volumes when removing containers

* Add tests for docker.run_command()
2025-06-30 13:31:41 +02:00
dependabot[bot]
779f47e25d Bump sentry-sdk from 2.31.0 to 2.32.0 (#5982)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 10:16:41 +02:00
dependabot[bot]
be8b36b560 Bump ruff from 0.12.0 to 0.12.1 (#5981)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-27 09:08:50 +02:00
dependabot[bot]
8378d434d4 Bump sentry-sdk from 2.30.0 to 2.31.0 (#5975)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.30.0 to 2.31.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.30.0...2.31.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-25 08:57:12 +02:00
Stefan Agner
0b79e09bc0 Add code documentation for Jobs decorator (#5965)
Add basic code documentation to the Jobs decorator.
2025-06-24 15:48:04 +02:00
Stefan Agner
d747a59696 Fix CLI/Observer access token property (#5973)
The access token token_validation() code in the security middleware
potentially accesses the access token property before the Supervisor
starts the CLI/Observer plugins, which leads to an KeyError when
trying to access the `access_token` property. This change ensures
that no key error is raised, but just None is returned.
2025-06-24 12:10:36 +02:00
Mike Degatano
3ee7c082ec Add mypy to ci and precommit (#5969)
* Add mypy to ci and precommit

* Run precommit mypy in venv

* Fix issues raised in latest version of mypy
2025-06-24 11:48:03 +02:00
dependabot[bot]
3f921e50b3 Bump getsentry/action-release from 3.1.2 to 3.2.0 (#5972)
Bumps [getsentry/action-release](https://github.com/getsentry/action-release) from 3.1.2 to 3.2.0.
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Changelog](https://github.com/getsentry/action-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/action-release/compare/v3.1.2...v3.2.0)

---
updated-dependencies:
- dependency-name: getsentry/action-release
  dependency-version: 3.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-24 10:08:27 +02:00
dependabot[bot]
0370320f75 Bump sigstore/cosign-installer from 3.9.0 to 3.9.1 (#5971)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.9.0 to 3.9.1.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/v3.9.0...v3.9.1)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-version: 3.9.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-24 10:08:19 +02:00
Stefan Agner
1e19e26ef3 Update request feature link (#5968)
Feature requests are now collected using the org wide GitHub Community.
Update the link accordingly.

While at it, also remove the unused ISSUE_TEMPLATE.md and align the
title to create issues with what is used in Home Assistant Core's
template.
2025-06-23 13:00:55 +02:00
Stefan Agner
e1a18eeba8 Use aiodns explicit close method (#5966) 2025-06-23 10:13:43 +02:00
Stefan Agner
b030879efd Rename detect-blocking-io API value to match other APIs (#5964)
* Rename detect-blocking-io API value to match other APIs

For the new detect-blocking-io option, use dashes instead of
underscores in `on-at-startup` for consistency with other API
endpoints.

This is a breaking change, but since the API is really new and not
really used yet, it is fairly safe to do so.

* Fix pytest
2025-06-20 12:52:12 +02:00
dependabot[bot]
dfa1602ac6 Bump getsentry/action-release from 3.1.1 to 3.1.2 (#5963)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-19 10:33:47 +02:00
dependabot[bot]
bbda943583 Bump urllib3 from 2.4.0 to 2.5.0 (#5962)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-19 10:33:33 +02:00
Mike Degatano
aea15b65b7 Fix mypy issues in store, utils and all other source files (#5957)
* Fix mypy issues in store module

* Fix mypy issues in utils module

* Fix mypy issues in all remaining source files

* Fix ingress user typeddict

* Fixes from feedback

* Fix mypy issues after installing docker-types
2025-06-18 12:40:12 -04:00
dependabot[bot]
5c04249e41 Bump pytest from 8.4.0 to 8.4.1 (#5960)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.4.0 to 8.4.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.4.0...8.4.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 8.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 15:43:22 +02:00
dependabot[bot]
456cec7ed1 Bump ruff from 0.11.13 to 0.12.0 (#5959)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.11.13 to 0.12.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.11.13...0.12.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.12.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 12:06:45 +02:00
dependabot[bot]
52a519e55c Bump sigstore/cosign-installer from 3.8.2 to 3.9.0 (#5958)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.8.2 to 3.9.0.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/v3.8.2...v3.9.0)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-version: 3.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 10:57:20 +02:00
Stefan Agner
fcb20d0ae8 Remove bug label from issue template (#5955)
Don't label new issues with the bug label by default. We started making
use of issue types, so if anything, this should be type "Bug". However,
we prefer to leave the type unspecified until the issue has been triaged.
2025-06-17 13:10:52 +02:00
Stefan Agner
9b3f2b17bd Remove AES cipher from backup (#5954)
AES cipher is no longer needed since Docker repository authentication
has been removed from backups in #5605.
2025-06-16 20:14:21 +02:00
Stefan Agner
3d026b9534 Expose machine ID (#5953)
Expose the unique machine ID of the local system via the Supervisor
API. This allows to identify a particular machine across reboots,
backup restores and updates. The machine ID is a stable identifier
that does not change unless the underlying hardware is changed or
the operating system is reinstalled.
2025-06-16 20:14:13 +02:00
Mike Degatano
0e8ace949a Fix mypy issues in plugins and resolution (#5946)
* Fix mypy issues in plugins

* Fix mypy issues in resolution module

* fix misses in resolution check

* Fix signatures on evaluate methods

* nitpick fix suggestions
2025-06-16 14:12:47 -04:00
Stefan Agner
1fe6f8ad99 Bump cosign to v2.4.3 (#5945)
Follow the builder bump of 2025.02.0 and use cosign v2.4.3 for
Supervisor too.
2025-06-16 20:12:27 +02:00
dependabot[bot]
9ef2352d12 Bump sentry-sdk from 2.29.1 to 2.30.0 (#5947)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.29.1 to 2.30.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.29.1...2.30.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.30.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 11:48:34 +02:00
dependabot[bot]
2543bcae29 Bump aiohttp from 3.12.12 to 3.12.13 (#5952)
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.12.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 11:48:20 +02:00
dependabot[bot]
ad9de9f73c Bump coverage from 7.9.0 to 7.9.1 (#5949)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.9.0 to 7.9.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.9.0...7.9.1)

---
updated-dependencies:
- dependency-name: coverage
  dependency-version: 7.9.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 10:26:18 +02:00
dependabot[bot]
a5556651ae Bump pytest-cov from 6.2.0 to 6.2.1 (#5948)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.2.0 to 6.2.1.
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.2.0...v6.2.1)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-version: 6.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 10:26:05 +02:00
dependabot[bot]
ac28deff6d Bump aiodns from 3.4.0 to 3.5.0 (#5951)
Bumps [aiodns](https://github.com/saghul/aiodns) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/saghul/aiodns/releases)
- [Changelog](https://github.com/aio-libs/aiodns/blob/master/ChangeLog)
- [Commits](https://github.com/saghul/aiodns/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: aiodns
  dependency-version: 3.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 10:06:18 +02:00
Mike Degatano
82ee4bc441 Fix mypy issues in misc, mounts and os modules (#5942)
* Fix mypy errors in misc and mounts

* Fix mypy issues in os module

* Fix typing of capture_exception

* avoid unnecessary property call

* Fixes from feedback
2025-06-12 18:06:57 -04:00
Stefan Agner
bdbd09733a Avoid aiodns resolver memory leak (#5941)
* Avoid aiodns resolver memory leak

In certain cases, the aiodns resolver can leak memory. This also
leads to Fatal `Python error… ffi.from_handle()`. This addresses
the issue by ensuring that the resolver is properly closed
when it is no longer needed.

* Address coderabbitai feedback

* Fix pytest

* Fix pytest
2025-06-12 11:32:53 +02:00
David Rapan
d5b5a328d7 feat: Add opt-in IPv6 for containers (#5879)
Configurable and w/ migrations between IPv4-Only and Dual-Stack

Signed-off-by: David Rapan <david@rapan.cz>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-06-12 11:32:24 +02:00
dependabot[bot]
52b24e177f Bump coverage from 7.8.2 to 7.9.0 (#5944)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.8.2 to 7.9.0.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.8.2...7.9.0)

---
updated-dependencies:
- dependency-name: coverage
  dependency-version: 7.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-12 09:27:56 +02:00
dependabot[bot]
e10c58c424 Bump pytest-cov from 6.1.1 to 6.2.0 (#5943)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.1.1 to 6.2.0.
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.1.1...v6.2.0)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-12 09:27:44 +02:00
Mike Degatano
9682870c2c Fix mypy issues in host and jobs (#5939)
* Fix mypy issues in host

* Fix mypy issues in job module

* Fix mypy issues introduced in previously fixed modules

* Apply suggestions from code review

Co-authored-by: Stefan Agner <stefan@agner.ch>

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-06-11 12:04:25 -04:00
Stefan Agner
fd0b894d6a Fix dynamic port pytest (#5940) 2025-06-11 15:10:31 +02:00
dependabot[bot]
697515b81f Bump aiohttp from 3.12.9 to 3.12.12 (#5937)
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.12.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-10 11:52:14 +02:00
dependabot[bot]
d912c234fa Bump requests from 2.32.3 to 2.32.4 (#5935)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-10 10:53:45 +02:00
dependabot[bot]
e8445ae8f2 Bump cryptography from 45.0.3 to 45.0.4 (#5936)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-10 09:23:40 +02:00
dependabot[bot]
6710439ce5 Bump ruff from 0.11.12 to 0.11.13 (#5932)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-10 00:41:04 -05:00
dependabot[bot]
95eec03c91 Bump aiohttp from 3.12.6 to 3.12.9 (#5930) 2025-06-05 07:43:55 +01:00
dependabot[bot]
9b686a2d9a Bump pytest from 8.3.5 to 8.4.0 (#5929)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-03 10:23:35 +02:00
dependabot[bot]
063d69da90 Bump aiohttp from 3.12.4 to 3.12.6 (#5928)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-31 12:35:37 -05:00
dependabot[bot]
baaf04981f Bump awesomeversion from 24.6.0 to 25.5.0 (#5926)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-31 01:23:53 -05:00
dependabot[bot]
bdb25a7ff8 Bump ruff from 0.11.11 to 0.11.12 (#5927)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-31 01:23:06 -05:00
Jan Čermák
ad2d6a3156 Revert "Do not backup add-on being uninstalled (#5917)" (#5925)
This reverts commit 63fde3b410.

This change introduced another more severe regression, causing all
add-ons that haven't been started since Supervisor startup to cause
errors during their backup. More sophisticated check would have to be
implemented to address edge cases during backups for non-existing
add-ons (or their config actually).

Fixes #5924
2025-05-29 17:32:51 +02:00
Stefan Agner
42f885595e Avoid early DNS plug-in start (#5922)
* Avoid early DNS plug-in start

A connectivity check can potentially be triggered before the DNS
plug-in is loaded. Avoid calling restart on the DNS plug-in before
it got initially loaded. This prevents starting before attaching.
The attaching makes sure that the DNS plug-in container is recreated
before the DNS plug-in is initially started, which is e.g. needed
by a potentially hassio network configuration change (e.g. the
migration required to enable/disable IPv6 on the hassio network,
see #5879).

* Mock DNS plug-in running
2025-05-29 11:49:19 +02:00
Stefan Agner
2a88cb9339 Improve Supervisor startup error handling (#5918)
Instead of starting a task in the background synchronously wait
for Supervisor start sequence to complete. This should be functional
equivalent, as we anyways would loop forever in the event loop just
afterwards.

The advantage is that we now can catch any exceptions during the
start sequence and report any errors with critical logging to report
those to Sentry, if enabled. It also avoids "Task exception was never
retrieved" errors. Reporting errors is especially important since we
can't use the asyncio Sentry integration (see #5729 for details).

Also handle early add-on start errors just like other add-on start
errors (make sure the finally block is executed as well). And finally,
register signal handlers synchronously. There is no real benefit in
doing them asynchronously, and it avoids a potential race condition.
2025-05-29 11:42:28 +02:00
Jan Čermák
4d1a5e2dc2 Use journal-gatewayd's new /boots endpoint to list boots (#5914)
* Use journal-gatewayd's new /boots endpoint to list boots

Current method we use for getting boots has several known downsides, for
example it can miss some incomplete boots and the performance might be
worse than what we could get by using Systemd directly. Systemd was
missing a method to get list boots through the journal-gatewayd but that
should be addressed by the new /boots endpoint added in [1] which
returns application/json-seq response containing all boots as reported
in `journalctl --list-boots`.

Implement Supervisor methods to parse this format and use the endpoint
at first, falling back to the old method if it fails.

[1] https://github.com/systemd/systemd/pull/37574

* Log info instead of warning when /boots is not present

Co-authored-by: Stefan Agner <stefan@agner.ch>

* Split records only by RS instead of LF in journal_boots_reader

* Strip only RS, json.loads is fine with whitespace

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-05-29 11:41:23 +02:00
dependabot[bot]
705e76abe3 Bump aiohttp from 3.12.2 to 3.12.4 (#5923)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-29 00:42:40 -05:00
Jan Čermák
7f54383147 Revert "Use s6-overlay read-only mode by default (#5906)" (#5921) 2025-05-27 20:00:22 +02:00
Stefan Agner
63fde3b410 Do not backup add-on being uninstalled (#5917) 2025-05-27 14:00:54 +02:00
dependabot[bot]
5285e60cd3 Bump setuptools from 80.8.0 to 80.9.0 (#5919)
Bumps [setuptools](https://github.com/pypa/setuptools) from 80.8.0 to 80.9.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v80.8.0...v80.9.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 80.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-27 12:13:06 +02:00
J. Nick Koston
2a1e32bb36 Bump aiohttp to 3.12.2 (#5915) 2025-05-27 09:03:34 +02:00
dependabot[bot]
a2251e0729 Bump cryptography from 45.0.2 to 45.0.3 (#5912)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-26 17:02:04 +02:00
dependabot[bot]
1efee641ba Bump coverage from 7.8.1 to 7.8.2 (#5913) 2025-05-26 08:41:06 +02:00
Stefan Agner
bbb8fa0b92 Ignore missing backup file on error (#5910)
When a backup error occurs, it might be that the backup file hasn't
been created yet, e.g. when there is no space or no permission on
the target backup directory. Deleting the backup file would fail
in this case. Use missing_ok instead to ignore a missing backup file
on delete.
2025-05-23 14:29:36 +02:00
Stefan Agner
7593f857e8 Fix add-on config parse messages (#5909)
With #5897 we renamed addon to addon_config and vis-versa. The log
messages were still using the previous variable names leading to
UnboundLocalError.

Fix the log messages to use the correct variable names.
2025-05-23 14:29:28 +02:00
Stefan Agner
87232cf1e4 Enable debug logging early (#5908)
Set logging level early in the bootstrap process so we can use debug
level messages in the early stages of the Supervisor.
2025-05-23 12:03:32 +02:00
dependabot[bot]
9e6a4d65cd Bump ruff from 0.11.10 to 0.11.11 (#5907)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.11.10 to 0.11.11.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.11.10...0.11.11)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.11.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-23 10:35:24 +02:00
Stefan Agner
c80fbd77c8 Use s6-overlay read-only mode by default (#5906)
To avoid accidential writes to the Supervisor root filesystem, we might
use the Docker read-only mode at one point. This is not yet the default,
but using s6-overlay with the read-only flag seems not to have any
downsides. So enable this by default.

To start Supervisor with read-only root file system teh following
arguments have to be used: `--read-only --tmpfs /run:exec`.
2025-05-22 17:30:42 +02:00
dependabot[bot]
a452969ffe Bump coverage from 7.8.0 to 7.8.1 (#5905)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.8.0 to 7.8.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.8.0...7.8.1)

---
updated-dependencies:
- dependency-name: coverage
  dependency-version: 7.8.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 09:45:52 +02:00
Stefan Agner
89fa5c9c7a Avoid initializing Blockbuster on Supervisor info call (#5901)
* Avoid initializing Blockbuster on Supervisor info call

Instead of creating an instance of Blockbuster to simply check if
Bluckbuster is enabled, use a global variable to store the instance
of Blockbuster and only initialize it when needed. This avoids
unnecessary initialization of Blockbuster when it is not required.

* Update supervisor/utils/blockbuster.py

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>

* Fix merge and rename singleton class to BlockBusterManager

* Fix pytest

---------

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>
2025-05-21 15:06:46 +02:00
Stefan Agner
73069b628e Bump pre-commit ruff to 0.11.10 (#5904)
Bump pre-commit ruff to 0.11.10 and address current issues.
2025-05-21 15:06:32 +02:00
Stefan Agner
8251b6c61c Process NetworkManager PrimaryConnection changes (#5903)
Process NetworkManager interface updates in case PrimaryConnection
changes. This makes sure that the /network/interface/default/info
endpoint can be used to get the IP address of the primary interface.
2025-05-21 13:50:46 +02:00
Stefan Agner
1faf529b42 Use add-on config timestamp to determine add-on update age (#5897)
* Use add-on config timestamp to determine add-on update age

Instead of using the current timestamp when loading the add-on config,
simply use the add-on config modification timestamp. This way, we can
get a timetsamp even when Supervisor got restarted. It also simplifies
the code a bit.

* Fix pytest

* Patch stat() instead of modifing fixture files
2025-05-21 13:46:20 +02:00
dependabot[bot]
86c016b35d Bump setuptools from 80.7.1 to 80.8.0 (#5902)
Bumps [setuptools](https://github.com/pypa/setuptools) from 80.7.1 to 80.8.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v80.7.1...v80.8.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 80.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 09:19:20 +02:00
Stefan Agner
4f35759fe3 Stop reading advanced logs on ConnectionError (#5900)
* Stop reading advanced logs on ConnectionError

If the client side connection closes with a `ConnectionError`, stop
reading the advanced logs.

This is very similar to ClientConnectionResetError which is easily
reproducable by having a log open and following in the browser and
then restaring Home Assistant. So far I wans't able to artificaially
reproduce the ConnectionError, but there are quite some reports on
Sentry so it seems to happen in real world.

* Warn on ConnectionError
2025-05-20 17:04:25 +02:00
David Rapan
3b575eedba Add IPv6 address generation mode & privacy extensions (#5892)
* feat: Add IPv6 address generation mode & privacy extensions

Signed-off-by: David Rapan <david@rapan.cz>

* Use NetworkManager fixture for settings init tests

This fixes the test by since the extended implementation now can read
the version of NetworkManager.

* Add pytest for addr_gen_mode

---------

Signed-off-by: David Rapan <david@rapan.cz>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-05-20 17:03:08 +02:00
Stefan Agner
6e6fe5ba39 Trigger auto-update through Core WebSocket call (#5896)
* Trigger auto-update through Core WebSocket call

Instead of auto-updating add-ons on Supervisor side trigger an update
through Core via a WebSocket command. This makes sure that the backup
is categorized correctly and all backup features like retention are
applied.

* Add pytest

* Fix pytest

* Fix pytest

* Fix pytest

* Fix pytest

* Fix pytest cleaner

* Set timestamp of add-on far into the past
2025-05-20 15:18:37 +02:00
Stefan Agner
b5a7e521ae Copy additional backup locations in jobs (#5890)
Instead of copying the backup in the main job, lets copy them in
separate job per location. This allows to use the same backup error
handling mechanism as for add-ons and folders.

This makes the stage introduced in #5784 somewhat redundant, but
before removing it, let's see if this approach works out.
2025-05-20 15:18:23 +02:00
Stefan Agner
bac7c21fe8 Fix container image detection for aarch64 (#5898) 2025-05-20 10:24:27 +02:00
dependabot[bot]
2eb9ec20d6 Bump sentry-sdk from 2.28.0 to 2.29.1 (#5899)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.28.0 to 2.29.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.28.0...2.29.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.29.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-20 09:14:42 +02:00
dependabot[bot]
406348c068 Bump cryptography from 44.0.3 to 45.0.2 (#5895)
Bumps [cryptography](https://github.com/pyca/cryptography) from 44.0.3 to 45.0.2.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/44.0.3...45.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 45.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-19 15:05:30 +02:00
dependabot[bot]
5e3f4e8ff3 Bump ruff from 0.11.9 to 0.11.10 (#5894)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-16 10:14:16 +02:00
dependabot[bot]
31a67bc642 Bump codecov/codecov-action from 5.4.2 to 5.4.3 (#5893)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-16 10:13:58 +02:00
Stefan Agner
d0d11db7b1 Harmonize folder and add-on backup error handling (#5885)
* Harmonize folder and add-on backup error handling

Align add-on and folder backup error handling in that in both cases
errors are recorded on the respective backup Jobs, but not raised to
the caller. This allows the backup to complete successfully even if
some add-ons or folders fail to back up.

Along with this, also record errors in the per-add-on and per-folder
backup jobs, as well as the add-on and folder root job.

And finally, align the exception handling to only catch expected
exceptions for add-ons too.

* Fix pytest
2025-05-15 10:14:35 +02:00
dependabot[bot]
cbf4b4e27e Bump setuptools from 80.4.0 to 80.7.1 (#5889)
Bumps [setuptools](https://github.com/pypa/setuptools) from 80.4.0 to 80.7.1.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v80.4.0...v80.7.1)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 80.7.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-15 09:44:02 +02:00
Stefan Agner
c855eaab52 Delete Backup files on error (#5880) 2025-05-13 20:51:16 +02:00
Stefan Agner
6bac751c4c Log DNS resolver initialization errors with critical severity (#5884)
To make sure we learn about DNS resolver initialization errors, lets
log them with critical severity. This was the original intention of
PR #5882.
2025-05-13 14:42:59 +02:00
Stefan Agner
da0ae75e8e Fallback to threaded resolver in case AsyncResolver fails (#5882)
In case the c-ares based AsyncResolver fails to initialize, let's
fallback to the threaded resolver. This would have helped for aiodns
3.3.0 issue when clients were unable to allocate more inotify watches.

This is fixed in aiodns 3.4.0, but we should still fallback to the
threaded resolver as a precautionary measure.
2025-05-13 12:37:35 +02:00
dependabot[bot]
154aeaee87 Bump sentry-sdk from 2.27.0 to 2.28.0 (#5881) 2025-05-13 08:20:44 +02:00
Stefan Agner
b9bbb99f37 Fix pytests to make them run in isolation (#5878) 2025-05-12 12:37:09 +02:00
dependabot[bot]
ff849ce692 Bump astroid from 3.3.9 to 3.3.10 (#5875)
Bumps [astroid](https://github.com/pylint-dev/astroid) from 3.3.9 to 3.3.10.
- [Release notes](https://github.com/pylint-dev/astroid/releases)
- [Changelog](https://github.com/pylint-dev/astroid/blob/main/ChangeLog)
- [Commits](https://github.com/pylint-dev/astroid/compare/v3.3.9...v3.3.10)

---
updated-dependencies:
- dependency-name: astroid
  dependency-version: 3.3.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-12 10:05:17 +02:00
dependabot[bot]
24456efb6b Bump setuptools from 80.3.1 to 80.4.0 (#5876)
Bumps [setuptools](https://github.com/pypa/setuptools) from 80.3.1 to 80.4.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v80.3.1...v80.4.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 80.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-12 10:05:01 +02:00
dependabot[bot]
0cd9d04e63 Bump ruff from 0.11.8 to 0.11.9 (#5877) 2025-05-12 09:19:32 +02:00
Stefan Agner
39bd20c0e7 Handle non-existing addon config dir (#5871)
* Handle non-existing addon config dir

Since users have access to the root of all add-on config directories,
they can delete the directory of an add-ons at any time. Hence we need
to handle gracefully if it doesn't exist anymore.

* Add pytest
2025-05-09 11:07:22 +02:00
dependabot[bot]
481bbc5be8 Bump aiodns from 3.3.0 to 3.4.0 (#5870)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-09 09:50:58 +02:00
Stefan Agner
36da382af3 Handle ClientPayloadError in advanced logging (#5869)
When the systemd-journal-gatewayd service is being shutdown while
Supervisor is still trying to read logs, aiohttp throws a
ClientPayloadError, presumably because we try to read until the next
linefeed, which aiohttp cannot satisfy anymore.

Simply catch the exception just like the connection reset errors
previously in #5358 and #5715.
2025-05-06 20:33:05 +02:00
Stefan Agner
85f8107b60 Recreate aiohttp ClientSession after DNS plug-in load (#5862)
* Recreate aiohttp ClientSession after DNS plug-in load

Create a temporary ClientSession early in case we need to load version
information from the internet. This doesn't use the final DNS setup
and hence might fail to load in certain situations since we don't have
the fallback mechanims in place yet. But if the DNS container image
is present, we'll continue the setup and load the DNS plug-in. We then
can recreate the ClientSession such that it uses the DNS plug-in.

This works around an issue with aiodns, which today doesn't reload
`resolv.conf` automatically when it changes. This lead to Supervisor
using the initial `resolv.conf` as created by Docker. It meant that
we did not use the DNS plug-in (and its fallback capabilities) in
Supervisor. Also it meant that changes to the DNS setup at runtime
did not propagate to the aiohttp ClientSession (as observed in #5332).

* Mock aiohttp.ClientSession for all tests

Currently in several places pytest actually uses the aiohttp
ClientSession and reaches out to the internet. This is not ideal
for unit tests and should be avoided.

This creates several new fixtures to aid this effort: The `websession`
fixture simply returns a mocked aiohttp.ClientSession, which can be
used whenever a function is tested which needs the global websession.

A separate new fixture to mock the connectivity check named
`supervisor_internet` since this is often used through the Job
decorator which require INTERNET_SYSTEM.

And the `mock_update_data` uses the already existing update json
test data from the fixture directory instead of loading the data
from the internet.

* Log ClientSession nameserver information

When recreating the aiohttp ClientSession, log information what
nameservers exactly are going to be used.

* Refuse ClientSession initialization when API is available

Previous attempts to reinitialize the ClientSession have shown
use of the ClientSession after it was closed due to API requets
being handled in parallel to the reinitialization (see #5851).
Make sure this is not possible by refusing to reinitialize the
ClientSession when the API is available.

* Fix pytests

Also sure we don't create aiohttp ClientSession objects unnecessarily.

* Apply suggestions from code review

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>

---------

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>
2025-05-06 16:23:40 +02:00
dependabot[bot]
2e44e6494f Bump pytest-timeout from 2.3.1 to 2.4.0 (#5868) 2025-05-06 09:00:11 +02:00
dependabot[bot]
cd1cc66c77 Bump cryptography from 44.0.2 to 44.0.3 (#5866)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 02:07:51 -05:00
dependabot[bot]
b76a1f58ea Bump setuptools from 80.1.0 to 80.3.1 (#5867)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 01:50:41 -05:00
dependabot[bot]
3fcd254d25 Bump pylint from 3.3.6 to 3.3.7 (#5865)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 01:49:50 -05:00
dependabot[bot]
3dff2abe65 Bump aiodns from 3.2.0 to 3.3.0 (#5864)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 01:07:22 -05:00
dependabot[bot]
ba91be1367 Bump ruff from 0.11.7 to 0.11.8 (#5863) 2025-05-02 09:40:45 +02:00
dependabot[bot]
25f93cd338 Bump setuptools from 80.0.1 to 80.1.0 (#5861)
Bumps [setuptools](https://github.com/pypa/setuptools) from 80.0.1 to 80.1.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v80.0.1...v80.1.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 80.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-01 11:07:40 +02:00
Stefan Agner
9b0044edd6 Avoid using host system socket for systemd journald tests (#5858)
Similar to #5825, make sure we mock the systemd journal gateway socket
for tests. This makes the test work on systems which have
systemd-journal-gatewayd installed.
2025-04-30 19:59:09 +02:00
Stefan Agner
9915c21243 Check local store repository for changes (#5845)
* Check local store repository for changes

Instead of simply assume that the local store repository got changed,
use mtime to check if there have been any changes to the local store.
This mimics a similar behavior to the git repository store updates.

Before this change, we end up in the updated repo code path, which
caused a re-read of all add-ons on every store reload, even though
nothing changed at all. Store reloads are triggered by Home Assistant
Core every 5 minutes.

* Fix pytest failure

Now that we actually only reload metadata if the local store changed
we have to fake the change as well to fix the store manager tests.

* Fix path cache update test for local store repository

* Take root directory into account/add pytest

* Rename utils/__init__.py tests to test_utils_init.py
2025-04-30 11:13:24 +02:00
dependabot[bot]
657cb56fb9 Bump orjson from 3.10.16 to 3.10.18 (#5855)
Bumps [orjson](https://github.com/ijl/orjson) from 3.10.16 to 3.10.18.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.10.16...3.10.18)

---
updated-dependencies:
- dependency-name: orjson
  dependency-version: 3.10.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-30 10:20:26 +02:00
dependabot[bot]
1b384cebc9 Bump setuptools from 80.0.0 to 80.0.1 (#5856)
Bumps [setuptools](https://github.com/pypa/setuptools) from 80.0.0 to 80.0.1.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v80.0.0...v80.0.1)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 80.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-30 10:20:17 +02:00
Jan Čermák
61089c3507 Bump uv to 0.6.17 (#5854) 2025-04-29 16:57:48 +02:00
Stefan Agner
bc9e3eb95b Fix race condition when removing add-on (#5850)
When uninstalling an add-on, we schedule a task to reload the ingress
tokens. This scheduled task typically ends up running right after
clearing the add-on data with `self.sys_addons.data.uninstall(self)`
(since this task is doing I/O, the race is rather deterministic).

Let's make sure we reload the ingress tokens at the end. Also simply
execute reloading synchrounsly since this is a rather quick operation
and makes sure that errors would get attributed to the right add-on
uninstall operation.
2025-04-29 16:14:33 +02:00
Stefan Agner
c1b45406d6 Improve backup upload location determination (#5848)
* Improve backup upload location determination

For local backup upload locations, check if the location is on the same
file system an thuse allows to move the backup file after upload. This
allows custom backup mounts. Currently there is no documented,
persistent way to create such mounts in with Home Assistant OS
installations, but since we might add local mounts in the future this
seems a worthwhile addition.

Fixes: #5837

* Fix pytests
2025-04-29 16:14:20 +02:00
Stefan Agner
8e714072c2 Avoid reading add-ons twice unnecessarily (#5846)
So far a store reload lead to a reload of all add-ons twice, usually
causing two messages in quick succession:
```
2025-04-25 17:01:05.058 INFO (MainThread) [supervisor.store] Loading add-ons from store: 91 all - 0 new - 0 remove
2025-04-25 17:01:05.058 INFO (MainThread) [supervisor.store] Loading add-ons from store: 91 all - 0 new - 0 remove
```

This is because when repository changes are detected, `reload()` calls
`load()` which then calls `update_repositories()` which ends up calling
`_read_addons()`, while `reload()` itself calls `_read_addons()` after
`load()` as well.

One way to fix this would be to simply remove the `_read_addons()` call
in `reload()`.

However, it seems the `update_repositories()` call (via `load()`)
is not necessary at all, as we don't add new store repositories in
`reload()`, and we already made sure the built-ins are present on
startup.

So simply call `data.update()` to update the store data cache, as it
was the case before #2225. There is no apparent reason documented why
`data.update()` was changed to a `load()` call. It might be to ensure
regularly that built-in repositories are still in the list of store
repositories. But this type of regular invariant check is often harmful
as it might hide bugs in other places.

Supervisor will still call `update_repositories()` in `load()` to
ensure all built-in repositories are present, just in case the local
configuration file got modified or corrupted.
2025-04-29 16:13:56 +02:00
Stefan Agner
88087046de Remove deprecated ruff rule S320 (#5847) 2025-04-29 12:58:09 +02:00
Stefan Agner
53393afe8d Revert "Recreate aiohttp session on connectivity check (#5332)" (#5851)
This reverts commit 1504278223.

It turns out that recreating the session can cause race conditions, e.g.
with API checks triggered by proxied requests running alongside. These
manifest in the following error:

AttributeError: 'NoneType' object has no attribute 'connect'
...
  File "supervisor/homeassistant/api.py", line 187, in check_api_state
    if state := await self.get_api_state():
  File "supervisor/homeassistant/api.py", line 171, in get_api_state
    data = await self.get_core_state()
  File "supervisor/homeassistant/api.py", line 145, in get_core_state
    return await self._get_json("api/core/state")
  File "supervisor/homeassistant/api.py", line 132, in _get_json
    async with self.make_request("get", path) as resp:
  File "contextlib.py", line 214, in __aenter__
    return await anext(self.gen)
  File "supervisor/homeassistant/api.py", line 106, in make_request
    async with getattr(self.sys_websession, method)(
  File "aiohttp/client.py", line 1425, in __aenter__
    self._resp: _RetType = await self._coro
  File "aiohttp/client.py", line 703, in _request
    conn = await self._connector.connect(

The only reason for the _connection in the aiohttp client to be None is
when close() gets called on the session. The only place this is being
done is the connectivity check.

So it seems that between fetching the session from the `sys_websession`
property) and actually using the connector, a connectivity check has been
run which then causes the above stack trace.

Let's not mess with the lifetime of the ClientSession object and simply
revert the change. Another solution for the original problem needs to be
found.
2025-04-28 23:48:47 +02:00
dependabot[bot]
4b5bcece64 Bump setuptools from 79.0.1 to 80.0.0 (#5849)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-28 02:47:57 -04:00
dependabot[bot]
0e7e4f8b42 Bump ruff from 0.11.6 to 0.11.7 (#5841)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.11.6 to 0.11.7.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.11.6...0.11.7)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.11.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-25 15:45:14 +02:00
Stefan Agner
9470f44840 Improve /auth API request sanitation (#5843)
* Add basic test coverage for /auth API

* Check /auth API is called from an add-on

Currently the /auth API is only available for add-ons. Return 403
for calls not originating from an add-on.

* Handle bad json in auth API

Use the API specific JSON load helper which raises an APIError. This
causes the API to return a 400 error instead of a 500 error when the
JSON is invalid.

* Avoid redefining name 'mock_check_login'

* Update tests/api/test_auth.py
2025-04-25 15:17:25 +02:00
dependabot[bot]
0e55e6e67b Bump sentry-sdk from 2.26.1 to 2.27.0 (#5842)
* Bump sentry-sdk from 2.26.1 to 2.27.0

Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.26.1 to 2.27.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.26.1...2.27.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.27.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Make use of new typing hints in filter.py

* Avoid creating unnecessary empty dict

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-04-25 11:40:17 +02:00
dependabot[bot]
6116425265 Bump actions/download-artifact from 4.2.1 to 4.3.0 (#5840)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-25 09:01:23 +02:00
Stefan Agner
de497cdc19 Add dedicated version update refresh for main components (#5833)
* Add dedicated update information reload

Currently we have the /refresh_updates endpoint which updates the main
component versions (Core, OS, Supervisor, Plug-ins) and the add-on
store at the same time. This combined update causes more update
information reloads than necessary.

To allow fine grained update refresh control introduce a new endpoint
/reload_updates which asks Supervisor to only update main component
versions (learned through the version json files).

The /store/reload endpoint already allows to update the add-on store
separately.

* Add pytest

* Update supervisor/api/__init__.py
2025-04-24 15:46:18 +02:00
dependabot[bot]
88b41e80bb Bump actions/setup-python from 5.5.0 to 5.6.0 (#5836)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-23 21:04:49 -10:00
dependabot[bot]
876afdb26e Bump setuptools from 79.0.0 to 79.0.1 (#5835)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-23 21:04:32 -10:00
dependabot[bot]
9d062c8ed0 Bump sigstore/cosign-installer from 3.8.1 to 3.8.2 (#5832)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.8.1 to 3.8.2.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/v3.8.1...v3.8.2)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-version: 3.8.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-23 10:40:41 +02:00
Stefan Agner
122b73202b Unify Supervisor event message functions (#5831)
* Unify Supervisor event message functions

Unify functions which send WebSocket messages of type
"supervisor/event". This deduplicates code and hopefully avoids further
diversication in the future.

While at it, remove unused HomeAssistantWSNotSupported exception. It
seems the only place this exception is used got removed in #3317.

* Test message delivery during shutdown states
2025-04-23 10:40:25 +02:00
Stefan Agner
5d07dd2c42 Add country to Supervisor info (#5826)
Similar to timezone also add country information to the Supervisor
info. This is useful to set country specific configurations such as
Wireless radio regulatory setting. This is also useful for add-ons
which need country information but only have hassio API access.
2025-04-22 16:18:23 +02:00
Jan Čermák
adfb433f57 Intercept host logs Range header for Systemd v256+ compatibility (#5827)
Since Systemd v256 the Range header must not end with a trailing colon.
We relied on this undocumented feature when following logs, and the
frontend or CLI may still use it in requests. To fix the requests
failing with new Systemd version, intercept the header and fill in the
num_entries to maximum possible value, which avoids the journal-gatewayd
returning the response prematurely and also works on older Systemd
versions.

The journal-gatewayd would still return response if follow flag is used
along with num_entries, but this behavior is unchanged and would be
better fixed in the backend.

Link: https://github.com/systemd/systemd/issues/37172
2025-04-22 09:05:49 +02:00
dependabot[bot]
198af54d1e Bump aiohttp from 3.11.16 to 3.11.18 (#5830)
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.11.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 09:02:14 +02:00
dependabot[bot]
c3e63a5669 Bump setuptools from 78.1.0 to 79.0.0 (#5829) 2025-04-21 20:29:21 +02:00
dependabot[bot]
8f27958e20 Bump ruff from 0.11.5 to 0.11.6 (#5828)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-17 21:43:49 -10:00
Stefan Agner
6fad7d14e1 Avoid using host system socket for logs tests (#5825)
Make sure we mock the systemd journal gateway socket for tests. This
makes the test work on systems which have systemd-journal-gatewayd
installed.
2025-04-17 16:23:34 +02:00
dependabot[bot]
f7317134e3 Bump sentry-sdk from 2.26.0 to 2.26.1 (#5824)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-16 09:20:46 +02:00
dependabot[bot]
9d8db27701 Bump sentry-sdk from 2.25.1 to 2.26.0 (#5822)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.25.1 to 2.26.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.25.1...2.26.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.26.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-16 08:38:36 +02:00
dependabot[bot]
7da3a34304 Bump codecov/codecov-action from 5.4.0 to 5.4.2 (#5823) 2025-04-15 08:25:45 +02:00
Stefan Agner
d413e0dcb9 Drop typing-extensions from requirements (#5821)
The dependency typing-extensions has been added with #3848, but not
used much. With the update to Python 3.11 in #4666 the necessary types
are now available from the Python standard library, making
typing-extensions unused. Remove the now unnecessary typing-extensions
from the dependencies.
2025-04-11 10:40:24 +02:00
dependabot[bot]
542ab0411c Bump typing-extensions from 4.13.1 to 4.13.2 (#5817)
Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.13.1 to 4.13.2.
- [Release notes](https://github.com/python/typing_extensions/releases)
- [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/python/typing_extensions/compare/4.13.1...4.13.2)

---
updated-dependencies:
- dependency-name: typing-extensions
  dependency-version: 4.13.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 09:45:33 +02:00
dependabot[bot]
999789f7ce Bump ruff from 0.11.4 to 0.11.5 (#5818)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.11.4 to 0.11.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.11.4...0.11.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.11.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 09:31:52 +02:00
dependabot[bot]
de105f8cb7 Bump debugpy from 1.8.13 to 1.8.14 (#5819)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.8.13 to 1.8.14.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.8.13...v1.8.14)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-version: 1.8.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 09:31:38 +02:00
dependabot[bot]
b37b0ff744 Bump urllib3 from 2.3.0 to 2.4.0 (#5820)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.3.0...2.4.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 09:31:25 +02:00
dependabot[bot]
db330ab58a Update wheel requirement from ~=0.45.0 to ~=0.46.1 (#5816)
Updates the requirements on [wheel](https://github.com/pypa/wheel) to permit the latest version.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.45.0...0.46.1)

---
updated-dependencies:
- dependency-name: wheel
  dependency-version: 0.46.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-09 09:47:43 +02:00
Mike Degatano
4a00caa2e8 Fix mypy issues in docker, hardware and homeassistant modules (#5805)
* Fix mypy issues in docker and hardware modules

* Fix mypy issues in homeassistant module

* Fix async_send_command typing

* Fixes from feedback
2025-04-08 12:52:58 -04:00
Stefan Agner
59a7e9519d Fix root path requests (#5815)
* Fix root path requests

Since #5759 we've tried to access the path explicitly. However, this
raises KeyError exception when trying to access the proxied root path
(e.g. http://supervisor/core/api/). Before #5759 get was used, which
lead to no exception, but instead inserted a `None` into the path.

It seems aiohttp doesn't provide a path when the root is accessed. So
simply convert this to no path as well by setting path to an empty
string.

* Add rudimentary pytest for regular proxy requets
2025-04-07 11:09:45 +02:00
dependabot[bot]
dedf5df5ad Bump ruff from 0.11.3 to 0.11.4 (#5814)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.11.3 to 0.11.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.11.3...0.11.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.11.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 09:47:12 +02:00
dependabot[bot]
d09b686269 Bump pytest-cov from 6.1.0 to 6.1.1 (#5813)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.1.0 to 6.1.1.
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.1.0...v6.1.1)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-version: 6.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 09:24:59 +02:00
dependabot[bot]
9b8f03fa00 Bump dbus-fast from 2.44.0 to 2.44.1 (#5807)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.44.0 to 2.44.1.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.44.0...v2.44.1)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-version: 2.44.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-04 09:37:09 +02:00
dependabot[bot]
2a3d0fdf61 Bump sentry-sdk from 2.25.0 to 2.25.1 (#5804)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.25.0 to 2.25.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.25.0...2.25.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.25.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-04 09:18:35 +02:00
dependabot[bot]
eaae40718b Bump ruff from 0.11.2 to 0.11.3 (#5809)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.11.2 to 0.11.3.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.11.2...0.11.3)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.11.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-04 09:08:08 +02:00
dependabot[bot]
5a88128cec Bump typing-extensions from 4.12.2 to 4.13.1 (#5808)
Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.12.2 to 4.13.1.
- [Release notes](https://github.com/python/typing_extensions/releases)
- [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/python/typing_extensions/compare/4.12.2...4.13.1)

---
updated-dependencies:
- dependency-name: typing-extensions
  dependency-version: 4.13.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-04 08:52:39 +02:00
github-actions[bot]
62b3259d9c Update frontend to version 20250401.0 (#5687)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-02 10:46:50 +02:00
dependabot[bot]
5e05af26a8 Bump dbus-fast from 2.43.0 to 2.44.0 (#5800)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.43.0 to 2.44.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.43.0...v2.44.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-02 10:36:31 +02:00
dependabot[bot]
c5186101d3 Bump pytest-cov from 6.0.0 to 6.1.0 (#5799)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.0.0 to 6.1.0.
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.0.0...v6.1.0)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-02 09:26:00 +02:00
dependabot[bot]
86cf083902 Bump aiohttp from 3.11.15 to 3.11.16 (#5801)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.11.15 to 3.11.16.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.11.15...v3.11.16)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-02 09:25:43 +02:00
Mike Degatano
5c1f7ed18d Switch iter_chunked to iter_chunks (#5798)
* Switch iter_chunked to iter_any

* iter_chunks not iter_any
2025-04-01 21:49:33 +02:00
dependabot[bot]
d051cbcafb Bump aiohttp from 3.11.14 to 3.11.15 (#5795)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.11.14 to 3.11.15.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.11.14...v3.11.15)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.11.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-01 11:31:00 +02:00
dependabot[bot]
798af687cf Bump sentry-sdk from 2.24.1 to 2.25.0 (#5796)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.24.1 to 2.25.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.24.1...2.25.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.25.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-01 10:13:01 +02:00
Mike Degatano
01a682cfaa Fix mypy issues in backups and dbus (#5792)
* Fix mypy issues in backups module

* Fix mypy issues in dbus module

* Fix mypy issues in api after rebase

* TypedDict to dataclass and other small fixes

* Finish fixing mypy errors in dbus

* local_where must exist

* Fix references to name in tests
2025-03-31 17:03:54 -04:00
dependabot[bot]
67b9a44160 Bump coverage from 7.7.1 to 7.8.0 (#5793) 2025-03-30 21:05:11 -10:00
Stefan Agner
8fe17d9270 Improve Home Assistant Core WebSocket proxy implementation (#5790)
* Improve Home Assistant Core WebSocket proxy implementation

This change removes unnecessary task creation for every WebSocket
message and instead creates just two tasks, one for each direction.
This improves performance by about factor of 3 when measuring 1000
WebSocket requests to Core (from ~530ms to ~160ms).

While at it, also handle all WebSocket message related to closing the
WebSocket and report all other errors as warnings instead of just info.

* Improve logging and error handling

* Add WS client error test case

* Use asyncio.gather directly

* Use asyncio.wait to handle exceptions gracefully

* Drop cancellation handling and correctly wait for the other proxy task
2025-03-28 10:35:49 +01:00
Jan Čermák
0a684bdb12 Add API for swap configuration (#5770)
* Add API for swap configuration

Add HTTP API for swap size and swappiness to /os/config/swap. Individual
options can be set in JSON and are calling the DBus API added in OS
Agent 1.7.x, available since OS 15.0. Check for presence of OS of the
required version and return 404 if the criteria are not met.

* Fix type hints and reboot_required logic

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Fix formatting after adding suggestions from GH

* Address @mdegat01 review comments

- Improve swap options validation
- Add swap to the 'all' property of dbus agent
- Use APINotFound with reason instead of HTTPNotFound
- Reorder API routes

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-03-27 17:53:46 +01:00
Mike Degatano
9222a3c9c0 Report stage with error in jobs (#5784)
* Report stage with error in jobs

* Copy doesn't lose track of the successful copies

* Add stage to errors in api output test

* revert unneessary change to import

* Add tests for a bit more coverage of copy_additional_locations
2025-03-27 10:07:06 -04:00
Jan Čermák
92cadb4c55 Fix /supervisor/reload after refactoring (#5791)
As discussed in [1], refactoring in #5759 changed signature of the
reload method and CLI now gets unexpected schema when `ha su reload` is
called. Change the method to return None as before and add a test for a
proper body content.

[1] https://github.com/home-assistant/supervisor/pull/5759/files#diff-1b4ed26f31e52ff5fe53efdc695eebacb1e46411f23cce58295591b2b20cd3faR238
2025-03-27 10:03:57 -04:00
Mike Degatano
8b3bf547d7 Skip corrupt registry files in backups (#5789) 2025-03-27 10:32:28 +01:00
Stefan Agner
81fc15d6ac Handle unexpected WebSocket messages during auth (#5788)
* Handle unexpected WebSocket messages during auth

When an add-on does not respond or closes the WebSocket connection
during the authentication phase Supervisor does not handle errors
gracefully. Simply log such unexpected authentication to avoid
unnecessary stack traces in the log and make such cases no longer
appear on Sentry.

* Add pytest

* Introduce a timeout of 10s
2025-03-26 22:13:59 +01:00
Stefan Agner
63b507a589 Rate limit D-Bus errors (#5787)
It seems that some systems continously run into D-Bus errors
overwhelming the system itself but also generating lots of errors on
Sentry. Rate limit D-Bus errors to 3 for every message every 30s.
2025-03-26 17:02:58 +01:00
dependabot[bot]
af9b1e5b1e Bump orjson from 3.10.12 to 3.10.16 (#5783)
Bumps [orjson](https://github.com/ijl/orjson) from 3.10.12 to 3.10.16.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.10.12...3.10.16)

---
updated-dependencies:
- dependency-name: orjson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-26 09:36:12 +01:00
dependabot[bot]
062103ae24 Bump setuptools from 78.0.2 to 78.1.0 (#5785) 2025-03-26 07:33:50 +01:00
dependabot[bot]
48807a65dd Bump home-assistant/wheels from 2025.02.0 to 2025.03.0 (#5786) 2025-03-26 07:33:15 +01:00
Mike Degatano
0636e49fe2 Enable mypy part 1 (addons and api) (#5759)
* Fix mypy issues in addons

* Fix mypy issues in api

* fix docstring

* Brackets instead of get with default
2025-03-25 15:06:35 -04:00
dependabot[bot]
543d6efec4 Bump sentry-sdk from 2.24.0 to 2.24.1 (#5781)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.24.0 to 2.24.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.24.0...2.24.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-25 10:28:34 +01:00
Mike Degatano
80f7f07341 Add blockbuster option to API (#5746)
* Add blockbuster option to API

* cache not lru_cache
2025-03-25 09:40:43 +01:00
dependabot[bot]
ec721c41c1 Bump actions/setup-python from 5.4.0 to 5.5.0 (#5780)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.4.0 to 5.5.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.4.0...v5.5.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-25 08:23:24 +01:00
dependabot[bot]
03ca32ced4 Bump setuptools from 77.0.3 to 78.0.2 (#5782) 2025-03-25 07:48:51 +01:00
Jan Čermák
cb16a34401 Remove WipeDevice method from OS Agent DBus mock (#5744)
WipeDevice method was dropped from OS Agent code in [1]. Remove it from
the mock class to sync with the current API. There is no usage of
WipeDevice in the Supervisor codebase, only ScheduleWipeDevice is
called.

[1] https://github.com/home-assistant/os-agent/pull/225
2025-03-24 15:09:01 +01:00
dependabot[bot]
d756fd7e14 Bump dbus-fast from 2.39.6 to 2.43.0 (#5777)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.39.6 to 2.43.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.39.6...v2.43.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 11:07:01 +01:00
dependabot[bot]
c559bd47c3 Bump sentry-sdk from 2.23.1 to 2.24.0 (#5778) 2025-03-24 07:36:50 +01:00
dependabot[bot]
a2b3427be9 Bump ruff from 0.11.1 to 0.11.2 (#5779) 2025-03-24 07:28:40 +01:00
dependabot[bot]
6a2d7bad03 Bump coverage from 7.7.0 to 7.7.1 (#5776) 2025-03-24 07:23:53 +01:00
dependabot[bot]
cfdefbf043 Bump home-assistant/builder from 2025.02.0 to 2025.03.0 (#5774)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2025.02.0 to 2025.03.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2025.02.0...2025.03.0)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 21:43:41 +01:00
dependabot[bot]
d7e3dc41ff Bump actions/download-artifact from 4.2.0 to 4.2.1 (#5769)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.2.0...v4.2.1)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2025-03-21 21:28:03 +01:00
dependabot[bot]
9afb50242b Bump setuptools from 77.0.1 to 77.0.3 (#5772)
Bumps [setuptools](https://github.com/pypa/setuptools) from 77.0.1 to 77.0.3.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v77.0.1...v77.0.3)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2025-03-21 21:27:44 +01:00
dependabot[bot]
52b02d1235 Bump actions/upload-artifact from 4.6.1 to 4.6.2 (#5767)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.6.1...v4.6.2)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 21:07:23 +01:00
dependabot[bot]
84bc72d485 Bump ruff from 0.11.0 to 0.11.1 (#5771)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.11.0 to 0.11.1.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.11.0...0.11.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 21:01:54 +01:00
dependabot[bot]
bd772bb28a Bump pylint from 3.3.4 to 3.3.6 (#5773)
Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.4 to 3.3.6.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.4...v3.3.6)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 20:59:17 +01:00
dependabot[bot]
fd2c7c3cc3 Bump getsentry/action-release from 3.1.0 to 3.1.1 (#5775) 2025-03-21 07:38:27 +01:00
dependabot[bot]
a7f139d3e1 Bump setuptools from 76.1.0 to 77.0.1 (#5766)
Bumps [setuptools](https://github.com/pypa/setuptools) from 76.1.0 to 77.0.1.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v76.1.0...v77.0.1)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-20 11:31:11 +01:00
dependabot[bot]
8a45e0fd85 Bump blockbuster from 1.5.23 to 1.5.24 (#5764)
Bumps [blockbuster](https://github.com/cbornet/blockbuster) from 1.5.23 to 1.5.24.
- [Release notes](https://github.com/cbornet/blockbuster/releases)
- [Commits](https://github.com/cbornet/blockbuster/commits)

---
updated-dependencies:
- dependency-name: blockbuster
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-20 11:08:57 +01:00
dependabot[bot]
52290b485b Bump actions/cache from 4.2.2 to 4.2.3 (#5768) 2025-03-20 08:19:33 +01:00
dependabot[bot]
525d0fd8ea Bump pre-commit from 4.1.0 to 4.2.0 (#5765) 2025-03-19 08:27:43 +01:00
dependabot[bot]
40c83f4c1e Bump actions/download-artifact from 4.1.9 to 4.2.0 (#5763) 2025-03-19 07:34:25 +01:00
dependabot[bot]
99088ad880 Bump sentry-sdk from 2.22.0 to 2.23.1 (#5760)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.22.0 to 2.23.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.22.0...2.23.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-18 13:43:53 +01:00
dependabot[bot]
37c077205a Bump setuptools from 76.0.0 to 76.1.0 (#5761)
Bumps [setuptools](https://github.com/pypa/setuptools) from 76.0.0 to 76.1.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v76.0.0...v76.1.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-18 12:01:03 +01:00
dependabot[bot]
ac5f9dcb59 Bump coverage from 7.6.12 to 7.7.0 (#5755) 2025-03-17 08:40:30 +01:00
dependabot[bot]
6a9269c052 Bump ruff from 0.10.0 to 0.11.0 (#5757) 2025-03-17 08:28:29 +01:00
dependabot[bot]
de615bfc1d Bump docker/login-action from 3.3.0 to 3.4.0 (#5758) 2025-03-17 08:12:38 +01:00
dependabot[bot]
3ee639b133 Bump aiohttp from 3.11.13 to 3.11.14 (#5754)
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-16 20:40:31 -10:00
dependabot[bot]
632e569347 Bump dbus-fast from 2.39.5 to 2.39.6 (#5756)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.39.5 to 2.39.6.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.39.5...v2.39.6)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-16 20:40:23 -10:00
Mike Degatano
cc74831113 Fix none error in mapping wireless fields (#5749) 2025-03-14 11:18:52 +01:00
dependabot[bot]
78c6868ad3 Bump dbus-fast from 2.39.3 to 2.39.5 (#5752)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.39.3 to 2.39.5.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.39.3...v2.39.5)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 10:06:44 +01:00
dependabot[bot]
f5f6e8b659 Bump ruff from 0.9.10 to 0.10.0 (#5751)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.9.10 to 0.10.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.9.10...0.10.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 09:50:13 +01:00
dependabot[bot]
c91a815cca Bump attrs from 25.2.0 to 25.3.0 (#5750)
Bumps [attrs](https://github.com/sponsors/hynek) from 25.2.0 to 25.3.0.
- [Commits](https://github.com/sponsors/hynek/commits)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 09:45:04 +01:00
dependabot[bot]
1efe01c21f Bump dbus-fast from 2.37.0 to 2.39.3 (#5736)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.37.0 to 2.39.3.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.37.0...v2.39.3)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 14:36:35 -04:00
dependabot[bot]
c54ff06e0f Bump attrs from 25.1.0 to 25.2.0 (#5748)
Bumps [attrs](https://github.com/sponsors/hynek) from 25.1.0 to 25.2.0.
- [Commits](https://github.com/sponsors/hynek/commits)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 16:41:48 +01:00
Mike Degatano
5facf4e790 Fix logging error for invalid password for backup (#5747)
* Fix logging error for invalid password for backup

* Improved test
2025-03-12 15:21:10 -04:00
Wendelin
34752466d5 Remove release assets tarball on frontend update (#5743)
* Remove release assets tarball on frontend update

* Fix path to the removed tarball

---------

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>
2025-03-12 10:10:27 +01:00
dependabot[bot]
20ea71f7ff Bump astroid from 3.3.8 to 3.3.9 (#5742)
Bumps [astroid](https://github.com/pylint-dev/astroid) from 3.3.8 to 3.3.9.
- [Release notes](https://github.com/pylint-dev/astroid/releases)
- [Changelog](https://github.com/pylint-dev/astroid/blob/main/ChangeLog)
- [Commits](https://github.com/pylint-dev/astroid/compare/v3.3.8...v3.3.9)

---
updated-dependencies:
- dependency-name: astroid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 10:53:54 +01:00
dependabot[bot]
ac27e3ac0d Bump ruff from 0.9.9 to 0.9.10 (#5741)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.9.9 to 0.9.10.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.9.9...0.9.10)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 09:15:24 +01:00
dependabot[bot]
b31e3ce234 Bump setuptools from 75.8.2 to 76.0.0 (#5740)
Bumps [setuptools](https://github.com/pypa/setuptools) from 75.8.2 to 76.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v75.8.2...v76.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 09:12:38 +01:00
Mike Degatano
e1c9c8b786 Finish out effort of adding and enabling blockbuster in tests (#5735)
* Finish out effort of adding and enabling blockbuster

* Skip getting addon file size until securetar fixed

* Fix test for devcontainer and blocking I/O

* Fix docker fixture and load_config to post_init
2025-03-07 13:29:24 +01:00
dependabot[bot]
23e03a95f4 Bump getsentry/action-release from 3.0.0 to 3.1.0 (#5737)
Bumps [getsentry/action-release](https://github.com/getsentry/action-release) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Changelog](https://github.com/getsentry/action-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/action-release/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: getsentry/action-release
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-07 13:12:33 +01:00
Stefan Agner
a2b8df0a6a Use Sentry helper function to report warnings (#5734)
* Use Sentry helper function to report warnings

Don't use Sentry directly but the existing helper function.

* Add pytest that Sentry is by default off

* Address ruff

* Address ruff
2025-03-06 23:45:48 +01:00
Mike Degatano
6ef4f3cc67 Add blockbuster library and find I/O from unit tests (#5731)
* Add blockbuster library and find I/O from unit tests

* Fix lint and test issue

* Fixes from feedback

* Avoid modifying webapp object in executor

* Split su options validation and only validate timezone on change
2025-03-06 16:40:13 -05:00
dependabot[bot]
1fb4d1cc11 Bump dbus-fast from 2.35.1 to 2.37.0 (#5733)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.35.1 to 2.37.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.35.1...v2.37.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-06 12:21:13 +01:00
dependabot[bot]
65b1729314 Bump jinja2 from 3.1.5 to 3.1.6 (#5732)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.5 to 3.1.6.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.5...3.1.6)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-06 09:44:59 +01:00
Stefan Agner
c7e3d86e2d Revert "Enable Sentry asyncio integration (#5685)" (#5729)
This essentially reverts PR #5685.

The Sentry `AsyncioIntegration` replaces the asyncio task factory with
its instrumentalized version, which reports all execeptions which
aren't handled *within* a task to Sentry.

However, we quite often run tasks and handle exceptions outside, e.g.
this commen pattern (example from `MountManager` `reload()``):

```python
results = await asyncio.gather(
    *[mount.update() for mount in mounts], return_exceptions=True
)
... create resolution issues from results with exceptions ...
```

Here, asyncio.gather() uses ensure_future(), which converts the
co-routines to tasks. These Sentry instrumented tasks will then report
exceptions to Sentry, even though we handle exceptions gracefully.

So the `AsyncioIntegration` doesn't work for our use case, and causes
unnecessary noise in Sentry. Disable it again.
2025-03-05 12:31:30 +01:00
dependabot[bot]
5d06ebe430 Bump dbus-fast from 2.34.0 to 2.35.1 (#5728)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.34.0 to 2.35.1.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.34.0...v2.35.1)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-05 09:06:01 +01:00
dependabot[bot]
5aba616ba4 Bump debugpy from 1.8.12 to 1.8.13 (#5727)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.8.12 to 1.8.13.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.8.12...v1.8.13)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-05 09:05:52 +01:00
Mike Degatano
767f435090 Call core post init (#5725) 2025-03-05 09:05:23 +01:00
Stefan Agner
26024053ed Fix add-on store repository getting removed without internet (#5717)
* Fix add-on store repository getting removed without internet

Currently, when a git command error happens in `pull()`, we declare
the repository as corrupt. Subsequent system autofix runs then execute
the reset resolution, which essentially removes the git repository from
the system.

In situations where the Internet fails right between the last
Supervisor connectivity check and the add-on store repository update
(the connectivity checks are throttled to once every 10 minutes while
connectivity is considered good), or if the outage is only partial
(e.g. reaching connectivity check works but the store repository is not
reachable), this leads to a git command error which declares the
repository as corrupt just as well, and ultimately leads to the removal
of the add-on store repository from the local system.

Run a git ls-remote first, which is used as an extra connectivity check.
This will also avoid removing the repository if Internet connectivity
works but the git provider is temporary down or not reachable.

That said, it will also fail if the repository is no longer present.
But this case needs extra handling anyways.

* Run git ls-remote in executor
2025-03-04 21:09:46 +01:00
Mike Degatano
324b059970 Move write of core state to executor (#5720) 2025-03-04 17:49:53 +01:00
Stefan Agner
76e916a07e Make sure to close file stream after backup upload (#5723)
* Make sure to close file stream after backup upload

Currently the file stream does not get closed before importing the file
stream. It seems the test case didn't catch that, presumably because
it is a race condition if the bytes get flushed to disk or not.

Properly close the stream before continue handling the file.

* Close file stream in executor

* Add comment about closing twice is fine
2025-03-04 16:11:25 +01:00
Mike Degatano
582b128ad9 Finish migrating read_text to executor (#5698)
* Move read_text to executor

* switch to async_capture_exception

* Finish moving read_text to executor

* Cover read_bytes and some write_text calls as well

* Fix await issues

* Fix format_message
2025-03-04 11:45:44 +01:00
dependabot[bot]
c01d788c4c Bump getsentry/action-release from 1.10.4 to 3.0.0 (#5721)
Bumps [getsentry/action-release](https://github.com/getsentry/action-release) from 1.10.4 to 3.0.0.
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Changelog](https://github.com/getsentry/action-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/action-release/compare/v1.10.4...v3.0.0)

---
updated-dependencies:
- dependency-name: getsentry/action-release
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 11:44:44 +01:00
Jan Čermák
8fb66bcf18 Stop streaming logs when client closes connection (#5722)
When connection is closed by the client, the journal_logs_reader
generator still returns new lines, trying to write each one of them to
the closed transport. With debug logging enabled, this can end up in an
endless loop. To fix that, break out of the loop immediately after the
connection is reset.
2025-03-04 10:08:44 +01:00
Stefan Agner
fdd96ae21c Fix add-on repair log message (#5719) 2025-03-03 18:49:24 -05:00
Stefan Agner
1355ef192d Exclude non-Supervisor Server Error codes from Sentry reporting (#5718)
* Exclude non-Supervisor Server Error codes from Sentry reporting

Exclude status codes 502 Bad Gateway and 503 Service Unavailable from
Sentry aiohttp integration. These are returned by Supervisor itself
when acting as a proxy for Home Assistant Core. These aren't errors of
Supervisor.

* ruff check
2025-03-03 23:10:59 +01:00
Stefan Agner
f8bab20728 Replace non-unicode characters for add-on static files (#5712)
* Replace non-unicode characters for add-on static files

Add-on documentation and changelog get read and returned as text file.
However, in case the original author used non-unicode characters, or
the file corrupted, loading currently fails with an UnicodeDecodeError.

Let's just use the built-in replace error handling of Python, so they
appear for the user as  non-unicode characters by replacing them with
the official unicode replacement character "�".

* Remove superflous parameter for binary files

* ruff format

* Add pytests
2025-03-03 20:14:39 +01:00
Stefan Agner
9a3702bc1a Avoid loading add-on store repositories too early (#5716)
When initially loading the store manager, update_repositories makes
sure that all repositories are actually present. If they are for some
reason corrupted or content is missing, we currently still trying
to load them which leads to an unnecessary warning:

```
2025-03-03 11:55:54.324 WARNING (SyncWorker_1) [supervisor.store.data] No repository information exists at /data/addons/git/a0d7b954
...
2025-03-03 11:55:54.343 INFO (MainThread) [supervisor.store.git] Cloning add-on https://github.com/hassio-addons/repository repository
```

Since update_repositories always loads the data, simply remove the
superfluous earlier loading attempt.

While at it, also improve the cloning/update log messages to make it
clear what repository is cloned/updated.
2025-03-03 19:01:47 +01:00
Jan Čermák
a7c6699f6a Only log all ClientConnectionResets when returning logs (#5715)
* Suppress all ClientConnectionReset when returning logs

In #5358 we started suppressing ClientConnectionReset when logs are
returned from the Journal Gateway and the client ends connection
unexpectedly. The connection can be closed also when the headers are
returned, so ignore also that error.

Refs #5606

* Log ClientConnectionResetError as DEBUG instead of suppressing it
2025-03-03 13:51:40 +01:00
dependabot[bot]
fa7626f83a Bump cryptography from 44.0.1 to 44.0.2 (#5709)
Bumps [cryptography](https://github.com/pyca/cryptography) from 44.0.1 to 44.0.2.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/44.0.1...44.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 13:48:42 +01:00
dependabot[bot]
84b265a2e0 Bump pytest from 8.3.4 to 8.3.5 (#5710) 2025-03-03 08:25:11 +01:00
dependabot[bot]
debcafa962 Bump ruff from 0.9.8 to 0.9.9 (#5711) 2025-03-03 08:13:55 +01:00
dependabot[bot]
4634ef82c6 Bump home-assistant/wheels from 2024.11.0 to 2025.02.0 (#5708) 2025-03-03 07:15:55 +01:00
Mike Degatano
5b18fb6b12 No executor task in sentry call when not initialized (#5703) 2025-03-01 10:46:11 -05:00
Stefan Agner
d42ec12ae8 Fix cloning of add-on store repository (#5701)
* Fix cloning of add-on store repository

Since #5669, the add-on store reset no longer deletes the root
directory. However, if the root directory is not present, the current
code no longer invokes cloning, instead tries to load the git
repository directly.

With this change, the code clones whenever there is no .git directory,
which works for both cases.

* Fix pytest
2025-03-01 16:17:07 +01:00
Mike Degatano
86133f8ecd Move read_text to executor (#5688)
* Move read_text to executor

* Fix issues found by coderabbit

* formated to formatted

* switch to async_capture_exception

* Find and replace got one too many

* Update patch mock to async_capture_exception

* Drop Sentry capture from format_message

The error handling got introduced in #2052, however, #2100 essentially
makes sure there will never be a byte object passed to this function.
And even if, the Sentry aiohttp plug-in will properly catch such an
exception.

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-03-01 16:02:43 +01:00
Stefan Agner
12c951f62d Fix tests in devcontainer by removing resolution center (#5702)
Since #5696 we don't need to load the resolution center early. In fact,
with #5686 this is even problematic for pytests in devcontainer, since
the Supervisor Core state is valid and this causes AppArmor evaluations
to run (and fail).

Actually, #5696 removed the resolution center. #5686 brought it
accidentally back. This was seemingly a merge error.
2025-03-01 16:00:49 +01:00
Stefan Agner
fcb3e2eb55 Update Supervisor bug form (#5700)
Update Supervisor bug form to reflect today's naming in the frontend.
2025-03-01 13:06:44 +01:00
Stefan Agner
176e511180 Capture warnings and report to sentry (#5697)
By default, warnings are simply printed to stderr. This makes them
easy to miss in the log. Capture warnings and user Python logger to log
them with warning level.

Also, if the message is an instance of Exception (which it typically
is), report the warning to Sentry. This is e.g. useful for asyncio
RuntimeWarning warnings "coroutine was never awaited".
2025-02-28 21:28:40 +01:00
Stefan Agner
696dcf6149 Initialize Supervisor Core state in constructor (#5686)
* Initialize Supervisor Core state in constructor

Make sure the Supervisor Core state is set to a value early on. This
makes sure that the state is always of type CoreState, and makes sure
that any use of the state can rely on it being an actual value from the
CoreState enum.

This fixes Sentry filter during early startup, where the state
previously was None. Because of that, the Sentry filter tried to
collect more Context, which lead to an exception and not reporting
errors.

* Fix pytest

It seems that with initializing the state early, the pytest actually
runs a system evaluation with:
Starting system evaluation with state initialize

Before it did that with:
Starting system evaluation with state None

It detects that the container runs as privileged, and declares the
system as unhealthy.

It is unclear to me why coresys.core.healthy was checked in this
context, it doesn't seem useful. Just remove the check, and validate
the state through the getter instead.

* Update supervisor/core.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Make sure Supervisor container is privileged in pytest

With the Supervisor Core state being valid now, some evaluations
now actually run when loading the resolution center. This leads to
Supervisor getting declared unhealthy due to not running in a privileged
container under pytest.

Fake the host container to be privileged to make evaluations not
causing the system to be declared unhealthy under pytest.

* Avoid writing actual Supervisor run state file

With the Supervisor Core state being valid from the very start, we end
up writing a state everytime.

Instead of actually writing a state file, simply validate the the
necessary calls are being made. This is more conform to typical unit
tests and avoids writing a file for every test.

* Extend WebSocket client fixture and use it consistently

Extend the ha_ws_client WebSocket client fixture to set Supervisor Core
into run state and clear all pending messages.

Currently only some tests use the ha_ws_client WebSocket client fixture.
Use it consistently for all tests.

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-02-28 18:01:55 +01:00
Stefan Agner
8030b346e0 Load resolution evaluation, check and fixups early (#5696)
* Load resolution evaluation, check and fixups early

Before #5652, these modules were loaded in the constructor, hence early
in `initialize_coresys()`. Moving them late actually exposed an issue
where NetworkManager connectivity setter couldn't get the
`connectivity_check` evaluation, leading to an exception early in
bootstrap.

Technically, it might be safe to load the resolution modules only in
`Core.connect()`, however then we'd have to load them separately for
pytest. Let's go conservative and load them the same place where they
got loaded before #5652.

* Load resolution modules in a single executor call

* Fix pytest
2025-02-28 16:59:22 +01:00
Stefan Agner
53d97ce0c6 Improve plug-in update error message (#5695)
The current error message does not share any information about the
underlying problem why updating failed. Print the error to the logs.
2025-02-28 09:34:35 -05:00
Stefan Agner
77523f7bec Avoid space in update link of frontend update PR (#5694)
A newline is converted to a space as per YAML folding rules. The space
breaks markdown parsing of the link. Use a single line for the target
version link.
2025-02-28 13:13:11 +01:00
Stefan Agner
f4d69f1811 Make advanced logs error test work in all test environments (#5692)
When developing/testing in a Supervised environment, the
systemd-journal-gatewayd socket is actually available. Mock the
socket Path file to make the test independent of the pytest
environment.
2025-02-28 12:59:20 +01:00
Stefan Agner
cf5a0dc548 Add body with update information to frontend update prs (#5691)
Overwrite the default body with useful version update information and
a link to the new release.

Also rename the title and use lower caps for local shell variables.
2025-02-28 11:57:30 +01:00
dependabot[bot]
a8cc3ae6ef Bump actions/cache from 4.2.1 to 4.2.2 (#5690)
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-28 10:21:43 +01:00
Stefan Agner
362bd8fd21 Enable Sentry asyncio integration (#5685)
Enable the Sentry asyncio integration. This makes sure that exception
in non-awaited tasks get reported to sentry.

While at it, use partial instead of lambda for the filter function.
2025-02-28 09:57:11 +01:00
Mike Degatano
2274de969f File open calls to executor (#5678) 2025-02-28 09:56:59 +01:00
dependabot[bot]
dfed251c7a Bump ruff from 0.9.7 to 0.9.8 (#5689)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.9.7 to 0.9.8.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.9.7...0.9.8)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-28 09:33:00 +01:00
Mike Degatano
151d4bdd73 Temporary directory to executor (#5673)
* Move temporary directory usage to executor

* Use temp_folder.name in Path constructor
2025-02-27 17:58:55 +01:00
Stefan Agner
c5d4ebcd48 Correctly handle aiohttp requests in Sentry reporting (#5681)
* Correctly handle aiohttp requests

The request header seems to be a dictionary in current Sentry SDK.
The previous code actually failed with an exception when trying to
unpack the header. However, it seems that Exceptions are not handled
or printed in this filter function, so those issues were simply
swallowed.

The new code has been tested to correctly sanitize and report issues
during aiohttp requests.

* Fix pytests
2025-02-27 15:54:51 +01:00
Stefan Agner
0ad559adcd Add more context to Sentry reports early during startup (#5682)
* Initialize machine information before Sentry

* Set user and machine for all reports

Now that we initialize machine earlier we can report user and machine
for all events, even before Supervisor is completely initialized.

Also use the new tag format which is a dictionary.

Note that it seems that with the current Sentry SDK version the
AioHttpIntegration no longer sets the URL as a tag. So sanitation is
no longer reuqired.

* Update pytests
2025-02-27 15:45:11 +01:00
Stefan Agner
39f5b91f12 Use await for all FileConfiguration calls (#5683)
Some calls got missed in PR #5652. Update all calls to await the
save_data() coroutine.
2025-02-27 15:38:57 +01:00
dependabot[bot]
ddee79d209 Bump codecov/codecov-action from 5.3.1 to 5.4.0 (#5680)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.3.1 to 5.4.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.3.1...v5.4.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 09:04:24 +01:00
dependabot[bot]
ff111253d5 Bump setuptools from 75.8.1 to 75.8.2 (#5679)
Bumps [setuptools](https://github.com/pypa/setuptools) from 75.8.1 to 75.8.2.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v75.8.1...v75.8.2)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 09:04:03 +01:00
Mike Degatano
31193abb7b FileConfiguration uses executor for I/O (#5652)
* FileConfiguration uses executor for I/O

* Fix credentials tests

* Remove migrate_system_env as its very deprecated
2025-02-26 19:11:11 +01:00
Stefan Agner
ae266e1692 Improve Supervisor restart detection message (#5672)
The word "reboot" is usually used when a operating system is restarted.
The current log message could be interpreted that the Supervisor
detected an operating system reboot.

Use restart to make it clear that the Supervisor detected a restart of
itself.
2025-02-26 13:10:40 -05:00
dependabot[bot]
c315a15816 Bump securetar from 2025.2.0 to 2025.2.1 (#5671)
* Bump securetar from 2025.2.0 to 2025.2.1

Bumps [securetar](https://github.com/pvizeli/securetar) from 2025.2.0 to 2025.2.1.
- [Release notes](https://github.com/pvizeli/securetar/releases)
- [Commits](https://github.com/pvizeli/securetar/compare/2025.2.0...2025.2.1)

---
updated-dependencies:
- dependency-name: securetar
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Handle new AddFileError where atomic_contents_add is used

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-02-26 09:30:22 -05:00
dependabot[bot]
3bd732147c Bump actions/download-artifact from 4.1.8 to 4.1.9 (#5675)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-26 08:51:39 +01:00
dependabot[bot]
ddbde93a6d Bump setuptools from 75.8.0 to 75.8.1 (#5676)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-26 08:51:16 +01:00
dependabot[bot]
6db11a8ade Bump home-assistant/builder from 2024.08.2 to 2025.02.0 (#5674)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-26 08:46:38 +01:00
Stefan Agner
42e78408a7 Fix add-on store reset (#5669)
Make sure that add-on store resets do not delete the root folder. This
is important so that successive reset attempts do not fail (the
directory passed to `remove_folder` must exist, otherwise find fails
with an non-zero exit code).

While at it, handle find errors properly and report errors as critical.
2025-02-25 17:11:34 +01:00
Stefan Agner
15e8940c7f Improve D-Bus timeout error handling (#5664)
* Improve D-Bus timeout error handling

Typically D-Bus timeouts are related to systemd activation timing out
after 25s. The current dbus-fast timeout of 10s is well below that
so we never get the actual D-Bus error. This increases the dbus-fast
timeout to 30s, which will make sure we wait long enought to get the
actual D-Bus error from the broker.

Note that this should not slow down a typical system, since we tried
three times each waiting for 10s. With the new error handling typically
we'll end up waiting 25s and then receive the actual D-Bus error. There
is no point in waiting for multiple D-Bus/systemd caused timeouts.

* Create D-Bus TimedOut exception
2025-02-25 17:11:23 +01:00
dependabot[bot]
644ec45ded Bump aiohttp from 3.11.12 to 3.11.13 (#5665)
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 12:02:45 +01:00
Stefan Agner
a8d2743f56 Define CPU architecture to fix armhf builds (#5670) 2025-02-25 11:36:35 +01:00
dependabot[bot]
0acef4a6e6 Bump dbus-fast from 2.33.0 to 2.34.0 (#5666)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 09:15:24 +01:00
Stefan Agner
5733db94aa Revert "Fix add-on store reset"
This reverts commit da8c6cf111.
2025-02-25 09:10:27 +01:00
Stefan Agner
da8c6cf111 Fix add-on store reset
Make sure that add-on store resets do not delete the root folder. This
is important so that successive reset attempts do not fail (the
directory passed to `remove_folder` must exist, otherwise find fails
with an non-zero exit code).

While at it, handle find errors properly and report errors as critical.
2025-02-25 09:02:09 +01:00
Stefan Agner
802ee25a8b Build Python wheels for Python 3.13 (#5667) 2025-02-25 08:48:07 +01:00
Stefan Agner
ce8b107f1e Handle OS errors on backup create (#5662)
* Handle permission error on backup create

Make sure we handle (write) permission errors when creating a backup.

* Introduce BackupFileExistError and BackupPermissionError exceptions

* Make error messages a bit more uniform

* Drop use of exclusive mode

SecureTar does not handle exclusive mode nicely. Drop use of it for now.
2025-02-24 21:34:23 +01:00
Stefan Agner
32936e5de0 Handle non-zero subprocess exits (#5660)
With PR #5634 (which had the goal to remove I/O in event loop for backup
operations) the semantics of `remove_folder` changed slightly: Non-zero
exits of subprocesses were no longer handled, but lead to a
CalledProcessError.

Now to restore the semantics of `remove_folder` we should simply log an
error. However, this semantic change actually uncovered a potential
problem in deployed systems: There are 34 users on beta channel which
regularly seem to run `FixupStoreExecuteReset`, and with the semantic
change we see those errors in Sentry.

An obvious problem could be no storage. But in a quick test that would
not execute the repair in first place since the fixup has the job
condition `FREE_SPACE` set. So the problem is likely elsewhere.

With this change, we log the stderr of find, while still raising the
exception. With that we should get more context in Sentry to see what
could be the underlying error.
2025-02-24 12:30:39 +01:00
dependabot[bot]
c35746c3e1 Bump actions/upload-artifact from 4.6.0 to 4.6.1 (#5659) 2025-02-24 08:33:31 +01:00
dependabot[bot]
392dd9f904 Bump zlib-fast from 0.2.0 to 0.2.1 (#5658) 2025-02-24 08:31:37 +01:00
github-actions[bot]
d8f792950b Autoupdate frontend to version 20250221.0 (#5616)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-22 21:44:20 +01:00
dependabot[bot]
1f6cdc3018 Bump sigstore/cosign-installer from 3.8.0 to 3.8.1 (#5654)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-21 19:36:11 +01:00
dependabot[bot]
616f1903b7 Bump ruff from 0.9.6 to 0.9.7 (#5653) 2025-02-21 14:50:51 +01:00
Stefan Agner
997a51fc42 Remove I/O in event loop for add-on backup and restore (#5649)
* Remove I/O in event loop for add-on backup and restore

Remove I/O in event loop for add-on backup and restore operations. On
backup, this moves the add-on shutdown before metadata is stored in the
backup, which slightly lenghens the time the add-on is actually stopped.

However, the biggest contributor here is likely adding the image
itself if it is a local backup. However, since that is the minority of
cases, I've opted for simplicity over optimizing for this case.

* Use partial to explicitly bind arguments
2025-02-21 00:24:36 +01:00
dependabot[bot]
cda6325be4 Bump actions/cache from 4.2.0 to 4.2.1 (#5650) 2025-02-20 09:07:48 +01:00
Stefan Agner
c8cc6fe003 Remove I/O in event loop for Home Assistant Core backup (#5648)
* Remove I/O in event loop for Home Assistant Core backup

The Home Assistant Core backup still contains some I/O in the event
loop. Move all I/O into the executor.

* Update supervisor/homeassistant/module.py

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2025-02-19 20:11:37 +01:00
Stefan Agner
34939cfe52 Remove I/O in event loop for backup load, import and remove (#5647)
* Avoid IO in event loop when removing backup

* Refactor backup size calculation

Currently size is lazy loaded when required via properties. This
however is blocking the async event loop.

Backup sizes don't change. Instead of lazy loading the size of a backup
simply determine it on loading/after creation.

* Fix tests for backup size change

* Avoid IO in event loop when loading backups

* Avoid IO in event loop when importing a backup
2025-02-19 16:00:17 +01:00
Stefan Agner
37bc703bbb Disable uv cache when creating container image (#5646)
We don't intent to run uv again, so the cache is not really useful.
The cache directory size is around 80MB, however, the files are mostly
hardlinks to the original files in `/usr/local/lib/python3.13/site-packages`
so the actual saving is much smaller.
2025-02-19 10:45:22 +01:00
Stefan Agner
5f8e41b441 Capture errors correctly while copying backups (#5644)
Make sure we correctly capture errors while copying backups by using
the current job instance.
2025-02-19 09:12:36 +01:00
Stefan Agner
606db3585c Remove I/O in event loop for backup create and restore operations (#5634)
* Remove I/O from backup create() function

* Move mount check into exectutor thread

* Remove I/O from backup open() function

* Remove I/O from _folder_save()

* Refactor remove_folder and remove_folder_with_excludes

Make remove_folder and remove_folder_with_excludes synchronous
functions which need to be run in an executor thread to be safely used
in asyncio. This makes them better composable with other I/O operations
like checking for file existence etc.

* Fix logger typo

* Use return values for functions running in an exectutor

* Move location check into a separate function

* Fix extract
2025-02-18 20:59:09 +01:00
Robert Resch
4054749eb2 Use uv to install supervisor (#5642) 2025-02-18 14:54:23 -05:00
Robert Resch
ad5827d33f Bump uv to 0.6.1 (#5641)
* Bump uv to 0.6.0

* Bump uv to 0.6.1
2025-02-18 19:26:36 +01:00
Jan Čermák
249464e928 Generate Python bytecode for site-packages during build (#5640)
Since transition from pip to uv in #5152, Supervisor container doesn't
contain bytecode for site-packages anymore, and because our AppArmor
profile denies mkdir operations, the compiled *.pyc files are never
created. Enable uv --compile option to opt for the same behavior as pip
had, to fix of the AA errors and the potential penalty of compilation on
every import.
2025-02-18 18:44:37 +01:00
dependabot[bot]
3bc55c054a Bump sentry-sdk from 2.21.0 to 2.22.0 (#5638)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.21.0 to 2.22.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.21.0...2.22.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-18 12:28:17 +01:00
Stefan Agner
4c108eea64 Always validate Backup before restoring (#5632)
* Validate Backup always before restoring

Since #5519 we check the encryption password early in restore case.
This has the side effect that we check the file existance early too.
However, in the non-encryption case, the file is not checked early.

This PR changes the behavior to always validate the backup file before
restoring, ensuring both encryption and non-encryption cases are
handled consistently.

In particular, the last case of test_restore_immediate_errors actually
validates that behavior. That test should actually have failed so far.
But it seems that because we validate the backup shortly after freeze
anyways, the exception still got raised early enough.

A simply `await asyncio.sleep(10)` right after the freeze makes the
test case fail. With this change, the test works consistently.

* Address pylint

* Fix backup_manager tests

* Drop warning message
2025-02-14 18:19:35 +01:00
Stefan Agner
9b2dbd634d Avoid exception when handling closed WebSocket connection (#5630)
When delivering multiple messages to Core, and the first fails with a
connection error, the second message will also fail with the same error.
But at this point the connection is already clsoed, which leads to an
exception in the exception handler. Avoid this compunding error by
checking if the connection is still exists before trying to close.

Fixes: #5629
2025-02-14 13:12:56 +01:00
dependabot[bot]
2cb2a48184 Bump securetar from 2025.1.4 to 2025.2.0 (#5628)
Bumps [securetar](https://github.com/pvizeli/securetar) from 2025.1.4 to 2025.2.0.
- [Release notes](https://github.com/pvizeli/securetar/releases)
- [Commits](https://github.com/pvizeli/securetar/compare/2025.1.4...2025.2.0)

---
updated-dependencies:
- dependency-name: securetar
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-14 11:05:21 +01:00
dependabot[bot]
ed5a0b511e Bump sentry-sdk from 2.20.0 to 2.21.0 (#5625)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.20.0 to 2.21.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.20.0...2.21.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-13 10:32:49 +01:00
dependabot[bot]
1475dcb50b Bump cryptography from 44.0.0 to 44.0.1 (#5621)
Bumps [cryptography](https://github.com/pyca/cryptography) from 44.0.0 to 44.0.1.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/44.0.0...44.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2025-02-12 13:43:01 +01:00
dependabot[bot]
5cd7f6fd84 Bump coverage from 7.6.11 to 7.6.12 (#5622) 2025-02-12 08:04:09 +01:00
Mike Degatano
52cc17fa3f Delay initial version fetch until there is connectivity (#5603)
* Delay inital version fetch until there is connectivity

* Add test

* Only mock get not whole websession object

* drive delayed fetch off of supervisor connectivity not host

* Fix test to not rely on sleep guessing to track tasks

* Use fixture to remove job throttle temporarily
2025-02-11 13:22:33 +01:00
dependabot[bot]
fa6949f4e4 Bump getsentry/action-release from 1.10.2 to 1.10.4 (#5619)
Bumps [getsentry/action-release](https://github.com/getsentry/action-release) from 1.10.2 to 1.10.4.
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Changelog](https://github.com/getsentry/action-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/action-release/compare/v1.10.2...v1.10.4)

---
updated-dependencies:
- dependency-name: getsentry/action-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-11 11:39:24 +01:00
dependabot[bot]
63a4cee770 Bump ruff from 0.9.5 to 0.9.6 (#5618) 2025-02-11 07:48:02 +01:00
dependabot[bot]
7aed0c1b0d Bump getsentry/action-release from 1.10.1 to 1.10.2 (#5615) 2025-02-10 07:57:30 +01:00
dependabot[bot]
de592a6ef4 Bump coverage from 7.6.10 to 7.6.11 (#5614) 2025-02-10 07:57:14 +01:00
dependabot[bot]
ff7086c0d0 Bump getsentry/action-release from 1.9.0 to 1.10.1 (#5611)
Bumps [getsentry/action-release](https://github.com/getsentry/action-release) from 1.9.0 to 1.10.1.
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Changelog](https://github.com/getsentry/action-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/action-release/compare/v1.9.0...v1.10.1)

---
updated-dependencies:
- dependency-name: getsentry/action-release
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-07 11:30:45 +01:00
dependabot[bot]
ef0352ecd6 Bump ruff from 0.9.4 to 0.9.5 (#5612) 2025-02-07 09:18:45 +01:00
Stefan Agner
7348745049 Print the exact reason if the WebSocket event to Core fails (#5609)
* Print the exact reason if the WebSocket event to Core fails

* Improve error at backup end too, fix tests

* Fix text

* Address ruff check issue
2025-02-06 18:17:46 +01:00
github-actions[bot]
2078044062 Autoupdate frontend to version 20250205.0 (#5543)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-06 17:34:18 +01:00
Stefan Agner
d254937590 Drop Docker config from Supervisor backup (#5605)
* Drop Docker config from Supervisor backup

The Docker config is part of the main backup metadata. Because we
consolidate encrypted and unencrypted backups today, this leads to
potential bugs when restoring a backup.

* Drop obsolete encrypt/decrypt functions

* Drop unused Backup Job stage
2025-02-06 11:15:56 +01:00
dependabot[bot]
9a8e52d1fc Bump aiohttp from 3.11.11 to 3.11.12 (#5608)
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-06 09:37:03 +01:00
dependabot[bot]
6e7fac5493 Bump dbus-fast from 2.32.0 to 2.33.0 (#5607)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.32.0 to 2.33.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.32.0...v2.33.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-06 09:28:19 +01:00
Mike Degatano
129a37a1f4 Prevent race condition with location reload and backups list (#5602) 2025-02-05 14:24:37 +01:00
dependabot[bot]
01382e774e Bump sigstore/cosign-installer from 3.7.0 to 3.8.0 (#5604)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.7.0 to 3.8.0.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/v3.7.0...v3.8.0)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-05 09:16:40 +01:00
Stefan Agner
9164d35615 Fix restoring unencrypted backup in corner case (#5600)
* Fix restoring unencrypted backup in corner case

If a backup has a encrypted and unencrypted location, and the encrypted
location is beeing restored first, the encryption key is still cached.
When the user restores the unencrypted backup next, it will fail because
the Supervisor tries to use encryption key still.

* Add integration test for restoring backups with and without encryption

* Rename _validate_location_password to _set_location_password

* Reload backup metadata from restore location

* Revert "Reload backup metadata from restore location"

This reverts commit 9b47a1cfe9.

* Make pytest work/punt the ball on docker config restore issue

* Address pylint error
2025-02-04 17:53:22 +01:00
Stefan Agner
58df65541c Handle non-existing file in Backup password check too (#5599)
* Handle non-existing file in Backup password check too

Make sure we handle a non-existing backup file also when validating
the password.

* Update supervisor/backups/manager.py

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Add test case and fix password check when multiple locations

* Mock default backup unprotected by default

Instead of setting the protected property which we might not use
everywhere, simply mock the default backup to be unprotected.

* Fix mock of protected backup

* Introduce test for validate_password

Testing showed that validate_password doesn't return anything. Extend
tests to cover this case and fix the actual code.

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2025-02-04 11:23:05 +01:00
Mike Degatano
4c04f364a3 Use full match in homeassistant backup excludes (#5597) 2025-02-03 13:47:12 +01:00
Mike Degatano
7f39538231 Update cache if a backup file is missing (#5596)
* Update cache if a backup file is missing

* Remove references to single file reload
2025-02-03 13:46:57 +01:00
dependabot[bot]
be98e0c0f4 Bump dbus-fast from 2.30.2 to 2.32.0 (#5598)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.30.2 to 2.32.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.30.2...v2.32.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-03 09:29:59 +01:00
Stefan Agner
9491b1ff89 Avoid reordering add-on repositories on Backup load (#5595)
* Avoid reordering add-on repositories on Backup load

The `ensure_builtin_repositories` function uses a set to deduplicate
items, which sometimes led to a change of order in elements. This is
problematic when deduplicating Backups.

Simply avoid mangling the list of add-on repositories on load. Instead
rely on `update_repositories` which uses the same function to ensure
built-in repositories when loading the store configuration and restoring
a backup file.

* Update tests

* ruff format

* ruff check

* ruff check fixes

* ruff format

* Update tests/store/test_validate.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Simplify test

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-01-31 12:10:47 -05:00
Stefan Agner
30cbb039d0 Handle non-existing backup file (#5590)
* Make the API return 404 for non-existing backup files

* Introduce BackupFileNotFoundError exception

* Return 404 on full restore as well

* Fix remaining API tests

* Improve error handling in delete

* Fix pytest

* Fix tests and change error handling to agreed logic

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2025-01-31 14:27:24 +01:00
Jan Čermák
1aabca9489 Make sure the oldest boot ID is included in the boot list (#5591)
If the system is running for a long time, or the logging is particularly
chatty, the Systemd journal message we use to detect boot will be
rotated out of the journal. Currently we only handled it if there was
one boot, but we usually always missed the oldest boot if there were
more boots.

Adjust the method for getting boot IDs to always get the very first log
line in the journal instead of the last one, and make sure its boot ID
is included in the list.
2025-01-31 11:55:05 +01:00
Stefan Agner
28a87db515 Avoid test failure by not checking exact size of backup (#5594)
* Avoid test failure by not checking exact size of backup

This is a workaround for the fact that the backup size is not exactly
the same every time. This is due to the fact that the inner gziped tar
file can vary in size due to difference in json file (key order) and
potentially also different field values (UUID, backup slug).

It seems that sorting the keys makes the actual difference today, but
this has runtime overhead and might not catch all cases.

Simply check if size property is there and a number bigger than 0
instead.

* Fix pytest
2025-01-31 11:30:43 +01:00
dependabot[bot]
05b648629f Bump ruff from 0.9.3 to 0.9.4 (#5592)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.9.3 to 0.9.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.9.3...0.9.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-31 08:27:43 +01:00
dependabot[bot]
d1d8446480 Bump pylint from 3.3.3 to 3.3.4 (#5586) 2025-01-29 08:17:18 +01:00
Mike Degatano
8b897ba537 Fix bug when uploading backup to a mount (#5585) 2025-01-28 18:30:37 +01:00
Mike Degatano
c8f1b222c0 Add sizes per location and support .local (#5581) 2025-01-28 11:41:51 +01:00
dependabot[bot]
257e2ceb82 Bump actions/setup-python from 5.3.0 to 5.4.0 (#5583)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.3.0...v5.4.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-28 11:36:24 +01:00
dependabot[bot]
67a27cae40 Bump securetar from 2025.1.3 to 2025.1.4 (#5582)
Bumps [securetar](https://github.com/pvizeli/securetar) from 2025.1.3 to 2025.1.4.
- [Release notes](https://github.com/pvizeli/securetar/releases)
- [Commits](https://github.com/pvizeli/securetar/compare/2025.1.3...2025.1.4)

---
updated-dependencies:
- dependency-name: securetar
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-28 11:35:28 +01:00
Stefan Agner
8ff9c08e82 Support systemd-journal-gatewayd using a TCP socket (#5576) 2025-01-27 13:57:59 +01:00
Stefan Agner
1b0aa30881 Extend backup upload API with file name parameter (#5568)
* Extend backup upload API with file name parameter

Add a query parameter which allows to specify the file name on upload.
All locations will store the backup with the same file name.

* ruff format

* Update tests to cover bad filename

* Fix ruff check error

* Drop unnecessary logging
2025-01-27 10:01:29 +01:00
dependabot[bot]
2a8d2d2b48 Bump codecov/codecov-action from 5.3.0 to 5.3.1 (#5580)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.3.0 to 5.3.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.3.0...v5.3.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 09:07:39 +01:00
dependabot[bot]
44bd787276 Bump attrs from 24.3.0 to 25.1.0 (#5579)
Bumps [attrs](https://github.com/sponsors/hynek) from 24.3.0 to 25.1.0.
- [Commits](https://github.com/sponsors/hynek/commits)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 09:07:21 +01:00
Stefan Agner
690f1c07a7 Use version which is treated CalVer by AwesomeVersion (#5572)
* Use version which is treated CalVer by AwesomeVersion

The current dev version `99.9.9dev` is treated as unkown version type
by AwesomeVersion. This prevents the version from comparing with
actual Supervisor versions, e.g. from an exsiting backup file.

Make the development version a valid CalVer version so development
versions can handle non-development backups.

* Bump to year 9999
2025-01-24 09:59:50 +01:00
dependabot[bot]
8e185a8413 Bump pytest-aiohttp from 1.0.5 to 1.1.0 (#5573)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-24 08:34:21 +01:00
dependabot[bot]
1f7df73964 Bump codecov/codecov-action from 5.2.0 to 5.3.0 (#5575)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-24 08:34:05 +01:00
dependabot[bot]
a10afc45b1 Bump ruff from 0.9.2 to 0.9.3 (#5574) 2025-01-24 07:30:28 +01:00
Mike Degatano
61a2101d8a Backup protected status can vary per location (#5569)
* Backup protected status can vary per location

* Fix test_backup_remove_error test

* Update supervisor/backups/backup.py

* Add Docker registry configuration to backup metadata

* Make use of backup location fixture

* Address pylint

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-01-23 15:05:35 -05:00
Stefan Agner
088832c253 Extend backup API with file name field (#5567)
* Extend backup API with file name field

Allow to specify a backup file name when creating a backup. This allows
for user friendly backup file names. If none is specified, the current
behavior remains (backup file name is the backup slug).

* Check passed file name using regex

* Use custom filename on download only if backup file name is backup slug

* ruff format

* Remove path from location for download file name
2025-01-23 15:24:47 +01:00
dependabot[bot]
a545b680b3 Bump codecov/codecov-action from 5.1.2 to 5.2.0 (#5571)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-23 08:52:49 +01:00
dependabot[bot]
805017eabf Bump dbus-fast from 2.28.0 to 2.30.2 (#5562)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.28.0 to 2.30.2.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.28.0...v2.30.2)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-21 12:06:41 +01:00
Stefan Agner
b7412b0679 Update Python to 3.13 (#5564)
* Bump Supervisor to Python 3.13

* Update ruff configuration to 0.9.1

Adjust pyproject.toml for ruff 0.9.1. Also make sure that latest version
of ruff is used in pre-commit.

* Set default configuration for pytest-asyncio

* Run ruff check

* Drop deprecated decorator no_type_check_decorator

The upstream PR (https://github.com/python/cpython/issues/106309) says
this never got really implemented by type checkers.

* Bump devcontainer to latest release
2025-01-21 11:57:30 +01:00
dependabot[bot]
fff3bfd01e Bump pre-commit from 4.0.1 to 4.1.0 (#5566) 2025-01-21 07:40:07 +01:00
dependabot[bot]
5f165a79ba Bump actions/stale from 9.0.0 to 9.1.0 (#5565) 2025-01-21 07:39:51 +01:00
dependabot[bot]
0d3acd1aca Bump release-drafter/release-drafter from 6.0.0 to 6.1.0 (#5563) 2025-01-20 08:09:23 +01:00
dependabot[bot]
463f196472 Bump securetar from 2024.11.0 to 2025.1.3 (#5553)
* Bump securetar from 2024.11.0 to 2025.1.3

Bumps [securetar](https://github.com/pvizeli/securetar) from 2024.11.0 to 2025.1.3.
- [Release notes](https://github.com/pvizeli/securetar/releases)
- [Commits](https://github.com/pvizeli/securetar/compare/2024.11.0...2025.1.3)

---
updated-dependencies:
- dependency-name: securetar
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Use file_filter and add test for addon backup_exclude

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2025-01-17 11:18:55 +01:00
dependabot[bot]
52d5df6778 Bump ruff from 0.9.1 to 0.9.2 (#5558)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 08:28:19 +01:00
dependabot[bot]
ce75c85e65 Bump debugpy from 1.8.11 to 1.8.12 (#5559) 2025-01-17 07:42:59 +01:00
puddly
12fd61142d Trigger rescan on device remove (#5447) 2025-01-16 18:16:47 +01:00
Mike Degatano
0073227785 Add env on core restart due to restore (#5548)
* Add env on core restart due to restore

* Move is_restore to backup manager
2025-01-16 18:15:06 +01:00
Stefan Agner
89a215cc1f Revert "Bump dbus-fast from 2.28.0 to 2.29.0 (#5551)" (#5555)
This reverts commit da6bdfa795.
2025-01-16 12:51:16 +01:00
Stefan Agner
b2aece8208 Revert "Bump orjson from 3.10.12 to 3.10.13 (#5514)" (#5554)
This reverts commit dbd37d6575.
2025-01-16 11:35:48 +01:00
Mike Degatano
600bf91c4f Sort jobs by creation in API (#5545)
* Sort jobs by creation in API

* Fix tests missing new field

* Fix sorting logic around child jobs
2025-01-16 09:51:44 +01:00
dependabot[bot]
da6bdfa795 Bump dbus-fast from 2.28.0 to 2.29.0 (#5551)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.28.0 to 2.29.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.28.0...v2.29.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-16 09:51:29 +01:00
dependabot[bot]
5d4894a1ba Bump getsentry/action-release from 1.8.0 to 1.9.0 (#5552)
Bumps [getsentry/action-release](https://github.com/getsentry/action-release) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Changelog](https://github.com/getsentry/action-release/blob/master/docs/publishing-a-release.md)
- [Commits](https://github.com/getsentry/action-release/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: getsentry/action-release
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-16 09:51:03 +01:00
Stefan Agner
d4c047bd01 Add tun to static device list in hardware manager (#5547)
Some devices are provided by kernel modules which potentially get loaded
later at startup. Those are not listed by udev, and hence add-ons do
not get permissions for these types of devices as long as the kernel
module is not loaded.

Typically, such devices are created by the kmod-static-nodes.service
systemd service. Ideally, we would read the output of that service and
add those specifically. However, there are very few devices which
use static nodes, and we actually only really interested in tun. So
let's simply add this static node in case udev does not list it already.
2025-01-15 09:56:32 +01:00
dependabot[bot]
6183b9719c Bump sentry-sdk from 2.19.2 to 2.20.0 (#5549)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.19.2 to 2.20.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.19.2...2.20.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-15 09:54:07 +01:00
Alexander Akhmetov
f02d67ee47 Add support for CAP_CHECKPOINT_RESTORE privileges (#5426) 2025-01-14 11:28:36 +01:00
Stefan Agner
bd156ebb53 Add X-Accel-Buffering to disable buffers in proxies (#5544) 2025-01-14 10:42:41 +01:00
Wendelin
b07236b544 Add frontend auto update workflow (#5501)
* Remove git submodule

* Add frontend auto update workflow

* Update .github/workflows/update_frontend.yml

Co-authored-by: Stefan Agner <stefan@agner.ch>

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2025-01-13 12:35:54 +01:00
dependabot[bot]
5928a31fc4 Bump dbus-fast from 2.24.4 to 2.28.0 (#5532)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.24.4 to 2.28.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.24.4...v2.28.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 11:38:46 +01:00
dependabot[bot]
3a71ea7003 Bump ruff from 0.9.0 to 0.9.1 (#5542)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.9.0...0.9.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 11:38:12 +01:00
dependabot[bot]
96900b1f1b Bump actions/upload-artifact from 4.5.0 to 4.6.0 (#5534)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-11 13:28:31 +01:00
dependabot[bot]
65b39661a6 Bump getsentry/action-release from 1.7.0 to 1.8.0 (#5535)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-11 13:27:24 +01:00
dependabot[bot]
18251ae8ae Bump ruff from 0.8.6 to 0.9.0 (#5538) 2025-01-11 13:06:45 +01:00
dependabot[bot]
c418e0ea76 Bump setuptools from 75.7.0 to 75.8.0 (#5536) 2025-01-11 12:33:30 +01:00
dependabot[bot]
74b009ccd7 Bump ruff from 0.8.5 to 0.8.6 (#5528)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-06 12:18:44 +01:00
dependabot[bot]
d2631bf398 Bump setuptools from 75.6.0 to 75.7.0 (#5529) 2025-01-06 08:12:21 +01:00
dependabot[bot]
c62358d851 Bump ruff from 0.8.4 to 0.8.5 (#5522)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-03 10:19:05 +01:00
dependabot[bot]
e3af04701a Bump gitpython from 3.1.43 to 3.1.44 (#5523)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-03 09:54:05 +01:00
Stefan Agner
c2f6e319f2 Check password early on backup restore (#5519)
Introduce a validate password method which only peaks into the archive
to validate the password before starting the actual restore process.
This makes sure that a wrong password returns an error even when
restoring the backup in background.
2024-12-31 13:58:12 +01:00
Stefan Agner
61b37877be Avoid lingering tasks when using background backup tasks (#5518)
When a backup tasks is run in background, but actually has an error
early the secondary event task to release the callee is lingering around
still, ultimately leading to a "Task was destroyed but it is pending!"
asyncio error.

Make sure we cancel the event task in case the backup returns early.
2024-12-31 13:16:18 +01:00
Stefan Agner
e72c5a037b Drop dead folder restore code (#5517)
The inner function _folder_restore has been converted to a Job with
PR #4802. The inner function is no longer used. Drop this dead code.
2024-12-31 13:16:04 +01:00
Stefan Agner
578383411c Fix backup remove for alternate locations (#5515)
Currently the API converts backup locations on network mounts to
the Supervisor's Mount representation. However, the locations stored
in the backup representations is a dictionary with the location
string as key.

Make sure to use the backup location string to validate the remove
requests. This fixes removing backups from network storage mounts.
2024-12-30 14:18:11 +01:00
dependabot[bot]
dbd37d6575 Bump orjson from 3.10.12 to 3.10.13 (#5514)
Bumps [orjson](https://github.com/ijl/orjson) from 3.10.12 to 3.10.13.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.10.12...3.10.13)

---
updated-dependencies:
- dependency-name: orjson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-30 11:16:25 +01:00
dependabot[bot]
c7cf1e7593 Bump pulsectl from 24.11.0 to 24.12.0 (#5512)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 24.11.0 to 24.12.0.
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/compare/24.11.0...24.12.0)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-30 09:28:16 +01:00
dependabot[bot]
c06fb069ab Bump coverage from 7.6.9 to 7.6.10 (#5513) 2024-12-27 08:03:29 +01:00
dependabot[bot]
b6c2259bd7 Bump pylint from 3.3.2 to 3.3.3 (#5511)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 09:00:09 +01:00
dependabot[bot]
d0b7cc8ab3 Bump astroid from 3.3.7 to 3.3.8 (#5510) 2024-12-24 08:18:42 +01:00
dependabot[bot]
0f77021bcc Bump astroid from 3.3.6 to 3.3.7 (#5507)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-12-23 14:26:07 +01:00
dependabot[bot]
b44e6d8cd3 Bump urllib3 from 2.2.3 to 2.3.0 (#5504)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.3 to 2.3.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.3...2.3.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-23 12:40:52 +01:00
dependabot[bot]
dfe9e94f87 Bump jinja2 from 3.1.4 to 3.1.5 (#5503)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.4...3.1.5)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-23 12:40:38 +01:00
Stefan Agner
53ccc5249a Add astroid to pytest requirements (#5506) 2024-12-23 12:27:49 +01:00
dependabot[bot]
5993818c16 Bump ruff from 0.8.3 to 0.8.4 (#5500)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-20 10:23:28 +01:00
dependabot[bot]
a631dea01a Bump codecov/codecov-action from 5.1.1 to 5.1.2 (#5499)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-19 18:40:22 +01:00
J. Nick Koston
c5b85b2831 Bump aiohttp to 3.11.11 (#5498)
changelog: https://github.com/aio-libs/aiohttp/compare/v3.11.10...v3.11.11

https://github.com/aio-libs/aiohttp/releases/tag/v3.11.11
2024-12-18 23:14:36 +01:00
Stefan Agner
3c1920e4e1 Bump frontend to 20241127.8 release (#5495) 2024-12-18 15:54:40 +01:00
dependabot[bot]
ca6ae7f4ce Bump actions/upload-artifact from 4.4.3 to 4.5.0 (#5494) 2024-12-18 07:45:01 +01:00
dependabot[bot]
031ad0dbe6 Bump attrs from 24.2.0 to 24.3.0 (#5492)
Bumps [attrs](https://github.com/sponsors/hynek) from 24.2.0 to 24.3.0.
- [Commits](https://github.com/sponsors/hynek/commits)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-17 14:11:40 +01:00
Mike Degatano
d8101ddba8 Use status 404 in more places when appropriate (#5480) 2024-12-17 11:18:32 +01:00
Mike Degatano
de68868788 Restore backup from specific location (#5491) 2024-12-17 11:09:32 +01:00
Mike Degatano
90590ae2de Add all addons flag to partial backups (#5490) 2024-12-16 18:25:58 +01:00
dependabot[bot]
5e6bef7189 Bump debugpy from 1.8.9 to 1.8.11 (#5488) 2024-12-16 07:27:26 +01:00
dependabot[bot]
7ab5555087 Bump ruff from 0.8.2 to 0.8.3 (#5483)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 09:22:18 +01:00
Mike Degatano
02ceb713ea Add location to backup download and remove APIs (#5482) 2024-12-12 19:44:40 +01:00
Mike Degatano
774aef74e8 Backup not found returns 404 instead of 400 (#5479) 2024-12-10 22:30:07 +01:00
dependabot[bot]
045454b597 Bump ciso8601 from 2.3.1 to 2.3.2 (#5478)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-10 08:24:28 +01:00
Mike Degatano
829193fe84 Support CGroup v2 on Supervised with manual restarts (#5419) 2024-12-09 15:09:54 +01:00
Mike Degatano
1f893117cc Fix backup consolidate and upload duplicate (#5472) 2024-12-09 10:03:49 +01:00
dependabot[bot]
9008009727 Bump sentry-sdk from 2.19.1 to 2.19.2 (#5476)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 08:27:33 +01:00
dependabot[bot]
3bf3bffabf Bump coverage from 7.6.8 to 7.6.9 (#5475)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 08:17:26 +01:00
Mike Degatano
d44e995aed Add size in bytes to backups (#5473) 2024-12-07 10:27:23 +01:00
dependabot[bot]
5a22599b93 Bump orjson from 3.10.7 to 3.10.12 (#5449)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-06 21:19:14 +01:00
dependabot[bot]
ae60e947f3 Bump sentry-sdk from 2.19.0 to 2.19.1 (#5467)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-06 11:51:27 -06:00
dependabot[bot]
8115fd98bc Bump ruff from 0.8.1 to 0.8.2 (#5468)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-06 11:51:11 -06:00
dependabot[bot]
3201061ada Bump codecov/codecov-action from 5.0.7 to 5.1.1 (#5470) 2024-12-06 08:22:42 +01:00
dependabot[bot]
b68caecbce Bump actions/cache from 4.1.2 to 4.2.0 (#5469) 2024-12-06 08:22:16 +01:00
J. Nick Koston
5e780293c7 Bump aiohttp to 3.11.10 (#5466)
changelog: https://github.com/aio-libs/aiohttp/compare/v3.11.9...v3.11.10
2024-12-05 23:44:19 -05:00
Mike Degatano
6e32144e9a Fix and extend cloud backup support (#5464)
* Fix and extend cloud backup support

* Clean up task for cloud backup and remove by location

* Args to kwargs on backup methods

* Fix backup remove error test and typing clean up
2024-12-05 00:07:04 -05:00
dependabot[bot]
9b52fee0a3 Bump aiohttp from 3.11.8 to 3.11.9 (#5461)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-02 14:43:08 +01:00
dependabot[bot]
7af4b17430 Bump cryptography from 43.0.3 to 44.0.0 (#5456)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-02 13:15:27 +01:00
dependabot[bot]
4195c0fb33 Bump pytest from 8.3.3 to 8.3.4 (#5462) 2024-12-02 08:42:13 +01:00
dependabot[bot]
8fe1cfbb20 Bump coverage from 7.6.7 to 7.6.8 (#5451) 2024-12-02 08:41:58 +01:00
dependabot[bot]
623c532c9e Bump pylint from 3.3.1 to 3.3.2 (#5460) 2024-12-02 08:05:04 +01:00
dependabot[bot]
3a904383af Bump ruff from 0.8.0 to 0.8.1 (#5459)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-01 16:47:50 -06:00
dependabot[bot]
28299affef Bump aiohttp from 3.11.7 to 3.11.8 (#5457) 2024-11-28 07:35:49 +01:00
Mike Degatano
11ca772ada Disable backup complete ws message (#5452) 2024-11-26 09:08:12 +01:00
Mike Degatano
42e704d563 Fix flaky backup test (#5453) 2024-11-26 00:47:00 +01:00
dependabot[bot]
ec7241c0fd Bump ruff from 0.7.4 to 0.8.0 (#5450)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.4 to 0.8.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.7.4...0.8.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-25 08:51:31 +01:00
Mike Degatano
d11d59dd92 Add null check on user path in mounts (#5446) 2024-11-22 09:54:21 -05:00
dependabot[bot]
7a55f58a5f Bump debugpy from 1.8.8 to 1.8.9 (#5444)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-22 08:55:42 +01:00
dependabot[bot]
0b5b5f7fd4 Bump sentry-sdk from 2.18.0 to 2.19.0 (#5443)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-22 08:52:40 +01:00
dependabot[bot]
56f3d384d6 Bump aiohttp from 3.11.6 to 3.11.7 (#5442)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-22 08:43:45 +01:00
dependabot[bot]
29117bb90b Bump securetar from 2024.2.1 to 2024.11.0 (#5445)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-22 08:43:26 +01:00
Mike Degatano
5519f6a53b Add support for cloud backups in Core (#5438)
* Add support for cloud backups in Core

* Test cases and small fixes identified

* Add test for partial reload no file failure
2024-11-21 18:14:20 -05:00
dependabot[bot]
a45d507bee Bump setuptools from 75.5.0 to 75.6.0 (#5440)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-21 08:12:18 +01:00
dependabot[bot]
0a663b5c27 Bump codecov/codecov-action from 5.0.4 to 5.0.7 (#5441)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-21 08:06:37 +01:00
dependabot[bot]
0f1fed525c Bump aiohttp from 3.11.4 to 3.11.6 (#5436)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-20 09:06:59 +01:00
dependabot[bot]
209cddc843 Bump codecov/codecov-action from 5.0.2 to 5.0.4 (#5437)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-20 08:45:11 +01:00
dependabot[bot]
4e0de93096 Bump aiohttp from 3.11.2 to 3.11.4 (#5434)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 08:26:46 +01:00
dependabot[bot]
3b6c5d5d33 Bump ruff from 0.7.3 to 0.7.4 (#5428)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 08:57:09 +01:00
dependabot[bot]
0843971e95 Bump dbus-fast from 2.24.3 to 2.24.4 (#5430)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 08:56:01 +01:00
dependabot[bot]
12d7496cd1 Bump codecov/codecov-action from 5.0.0 to 5.0.2 (#5427)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 08:55:35 +01:00
dependabot[bot]
ed34348c80 Bump coverage from 7.6.5 to 7.6.7 (#5429) 2024-11-18 07:59:39 +01:00
dependabot[bot]
fefb83558a Bump aiohttp from 3.10.11 to 3.11.2 (#5421)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-15 10:33:11 +01:00
dependabot[bot]
93a0ae4030 Bump coverage from 7.6.4 to 7.6.5 (#5424)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-15 09:44:08 +01:00
dependabot[bot]
5394cff296 Bump codecov/codecov-action from 4.6.0 to 5.0.0 (#5422)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-15 09:40:59 +01:00
dependabot[bot]
ca3e6da943 Bump setuptools from 75.4.0 to 75.5.0 (#5417)
Bumps [setuptools](https://github.com/pypa/setuptools) from 75.4.0 to 75.5.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v75.4.0...v75.5.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-14 09:43:19 -05:00
Mike Degatano
756a5f8836 Increase time between update checks (#5413) 2024-11-14 09:42:03 +01:00
Mike Degatano
a8e7bb670e Remove unhealthy after failed update on startup (#5412) 2024-11-14 09:41:47 +01:00
J. Nick Koston
687d7652a0 Bump aiohttp to 3.10.11 (#5414) 2024-11-13 19:28:02 +01:00
dependabot[bot]
9f414ee9da Bump setuptools from 75.3.0 to 75.4.0 (#5411) 2024-11-12 07:13:53 +01:00
dependabot[bot]
67c2f8eb83 Bump ruff from 0.7.2 to 0.7.3 (#5403) 2024-11-11 08:13:57 +01:00
dependabot[bot]
c033d5ce8d Bump home-assistant/wheels from 2024.07.1 to 2024.11.0 (#5404) 2024-11-11 08:12:22 +01:00
dependabot[bot]
fd056f3840 Update wheel requirement from ~=0.40.0 to ~=0.45.0 (#5402) 2024-11-11 07:21:31 +01:00
dependabot[bot]
e3488b8a08 Bump debugpy from 1.8.7 to 1.8.8 (#5400)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-08 08:43:41 +01:00
Mike Degatano
e1e5d3a8f2 Create addon boot failed issue for repair (#5397)
* Create addon boot failed issue for repair

* MDont make new objects for contains checks
2024-11-07 13:39:15 -05:00
Wendelin
473662e56d Bump frontend 2024.11.07 (#5399) 2024-11-07 16:46:32 +01:00
Wendelin
b29bc23487 Bump frontend 2024.11.06.1 (#5394) 2024-11-06 14:13:30 +01:00
Wendelin
54817ef562 Bump frontend 2024.11.06 (#5393) 2024-11-06 11:21:22 +01:00
dependabot[bot]
dd8abf738e Bump sentry-sdk from 2.17.0 to 2.18.0 (#5392)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.17.0 to 2.18.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.17.0...2.18.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 08:15:18 +01:00
Mike Degatano
55e58d39d9 Add fallback for boot IDs query (#5391) 2024-11-05 08:01:46 +01:00
Wendelin
ac5ce4cc9e Bump frontend 2024.11.04.2 (#5390) 2024-11-04 12:07:37 -05:00
dependabot[bot]
2525467a2e Bump pulsectl from 24.8.0 to 24.11.0 (#5388)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 24.8.0 to 24.11.0.
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-04 08:23:15 +00:00
Wendelin
81066aab83 Bump frontend 2024.11.04 (#5383)
* Bump frontend 2024.10.31

* Bump frontend 2024.11.04
2024-11-04 08:21:27 +00:00
dependabot[bot]
93f4b24e72 Bump ruff from 0.7.1 to 0.7.2 (#5386) 2024-11-04 09:00:36 +01:00
Mike Degatano
9a07ff7fc4 Update supervisor immediately on new version (#5375)
* Update supervisor immediately on new version

* Switch reload updater task
2024-10-30 12:12:43 -04:00
dependabot[bot]
1a278f2590 Bump setuptools from 75.2.0 to 75.3.0 (#5379)
Bumps [setuptools](https://github.com/pypa/setuptools) from 75.2.0 to 75.3.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v75.2.0...v75.3.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-30 10:47:46 -04:00
dependabot[bot]
93472ed6dd Bump pytest-cov from 5.0.0 to 6.0.0 (#5378)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 5.0.0 to 6.0.0.
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v5.0.0...v6.0.0)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-30 10:47:19 -04:00
dependabot[bot]
dcaf2653b8 Bump colorlog from 6.8.2 to 6.9.0 (#5377)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 6.8.2 to 6.9.0.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v6.8.2...v6.9.0)

---
updated-dependencies:
- dependency-name: colorlog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-30 10:46:47 -04:00
Wendelin
0714d7845a Bump frontend 2024.10.29 (#5374)
* Bump frontend 2024.10

* Bump frontend 2024.10.29
2024-10-30 08:29:57 -04:00
dependabot[bot]
8f2269d871 Bump ruff from 0.7.0 to 0.7.1 (#5371)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-25 15:20:45 +02:00
dependabot[bot]
c7487e004d Bump actions/setup-python from 5.2.0 to 5.3.0 (#5372)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-25 14:53:08 +02:00
dependabot[bot]
09d3edf526 Bump actions/checkout from 4.2.1 to 4.2.2 (#5370) 2024-10-24 08:19:46 +02:00
dependabot[bot]
9c99bf368f Bump actions/cache from 4.1.1 to 4.1.2 (#5366)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-23 08:40:18 +02:00
Jan Čermák
6f196c9dea Suppress ClientConnectionResetError when returning logs (#5358)
When client requests (or more often follows) some busy logs and closes
the connection while the StreamWriter tries to write into it, an
exception is raised. This should be harmless, and unless there's another
way to handle this gracefully (I'm not aware of), then it should be safe
to ignore the exception in this context.
2024-10-21 10:11:22 +02:00
dependabot[bot]
fcac17f335 Bump coverage from 7.6.3 to 7.6.4 (#5365)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 09:04:55 +02:00
dependabot[bot]
f5a026cdd8 Bump cryptography from 43.0.1 to 43.0.3 (#5364)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 09:02:50 +02:00
dependabot[bot]
c6488c1ee3 Bump ruff from 0.6.9 to 0.7.0 (#5359)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-18 08:41:51 +02:00
dependabot[bot]
f47d0d2867 Bump sentry-sdk from 2.16.0 to 2.17.0 (#5360)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-18 08:39:06 +02:00
dependabot[bot]
96df335b36 Bump setuptools from 75.1.0 to 75.2.0 (#5357)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-17 08:29:15 +02:00
Jan Čermák
cc9a931baa Fix Supervisor log fallback for the /follow endpoint (#5354)
When an error occurs when streaming Supervisor logs, the fallback method
receives the follow kwarg as well, which is invalid for the Docker log
handler:

 TypeError: APISupervisor.logs() got an unexpected keyword argument 'follow'

The exception is still printed to the logs but with all the extra noise
caused by this error. Removing the argument makes the stack trace more
comprehensible and the fallback actually works as desired.
2024-10-16 09:04:24 +02:00
dependabot[bot]
95c638991d Bump coverage from 7.6.2 to 7.6.3 (#5351) 2024-10-14 08:16:23 +02:00
Stefan Agner
e2ada42001 Fix log follow mode without range header (#5347) 2024-10-11 19:54:53 +02:00
dependabot[bot]
22e50b4ace Bump aiohttp from 3.10.9 to 3.10.10 (#5345)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-11 10:31:09 +02:00
dependabot[bot]
334484de7f Bump debugpy from 1.8.6 to 1.8.7 (#5346)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-11 10:12:26 +02:00
Stefan Agner
180a7c3990 Throttle connectivity check on connectivity issue (#5342)
* Throttle connectivity check on connectivity issue

If Supervisor detects a connectivity issue, currenlty every function
which requires internet get delayed by 10s due to the connectivity
check. This especially slows down initial startup when there are
connectivity issues. It is unlikely to resolve immeaditly, so throttle
the connectivity check to check every 30s.

* Fix pytest

* Reset throttle in test and refactor helper

* CodeRabbit suggestion

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2024-10-10 22:57:16 +02:00
dependabot[bot]
d5f33de808 Bump coverage from 7.6.1 to 7.6.2 (#5344)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.1 to 7.6.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.6.1...7.6.2)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-10 09:46:41 +02:00
dependabot[bot]
6539f0df6f Bump actions/upload-artifact from 4.4.2 to 4.4.3 (#5343)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.4.2 to 4.4.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.4.2...v4.4.3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-10 09:46:18 +02:00
Stefan Agner
1504278223 Recreate aiohttp session on connectivity check (#5332)
It seems to actually get a proper connectivity check run, we need a new
vanilla ClientSession() object.
2024-10-09 21:41:46 +02:00
Jan Čermák
9f3767b23d Return cursor of the first host logs entry via headers (#5333)
* Return cursor of the first host logs entry via headers

Return first entry's cursor via custom `X-First-Cursor` header that can
be consumed by the client and used for continual requesting of the
historic logs. Once the first fetch returns data, the cursor can be
supplied as the first argument to the Range header in another call,
fetching accurate slice of the journal with the previous log entries
using the `Range: entries=cursor[[:num_skip]:num_entries]` syntax.

Let's say we fetch logs with the Range header `entries=:-19:20` (to
fetch very last 20 lines of the logs, see below why not
`entries:-20:20`) and we get `cursor50` as the reply (the actual value
will be much more complex and with no guaranteed format). To fetch
previous slice of the logs, we use `entries=cursor50:-20:20`, which
would return 20 lines previous to `cursor50` and `cursor30` in the
cursor header. This way we can go all the way back to the history.

One problem with the cursor is that it's not possible to determine when
the negative num_skip points beyond the first log entry. In that case
the client either needs to know what the first entry is (via
`entries=:0:1`) or can iterate naively and stop once two subsequent
requests return the same first cursor.

Another caveat, even though it's unlikely it will be hit in real usage,
is that it's not possible to fetch the last line only - if no cursor is
provided, negative num_skip argument is needed, and in that case we're
pointing one record back from the current cursor, which is the previous
record. The least we can return without knowing any cursor is thus
`entries=👎2` (where the `2` can be omitted, however with
`entries=👎1` we would lose the last line). This also explains why
different `num_skip` and `num_entries` must be used for the first fetch.

* Fix typo (fallback->callback)

* Refactor journal_logs_reader to always return the cursor

* Update tests for new cursor handling
2024-10-09 20:27:29 +02:00
Jan Čermák
e0d7985369 Fix number of lines returned with host logs' query argument (#5334)
If no cursor is specified and negative num_skip is used, we're pointing
one record back from the last one, so host logs always returned 101
lines as the default. This was also the case of the lines query argument
that used the number directly as num_skip. Instead of doing that, point
N-1 records to the back and then get N records. Handle 1 record and
invalid numbers silently to avoid the need for error handling in
unpractical edge cases.
2024-10-09 20:27:18 +02:00
Stefan Agner
2968a5717c Update DNS plug-in on network change (#5331)
* Update DNS plug-in on network change

Restart the DNS plug-in when the primary network changes network
changes. This makes sure any potential host OS DNS configuration
changes get picked up by the DNS plug-in as well.

* Add a test case

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2024-10-09 20:16:36 +02:00
Matheson Steplock
e2b25fe7ce Drop support for Debian 11 Bullseye (#5335) 2024-10-09 12:18:45 +02:00
dependabot[bot]
8601f5c49a Bump sentry-sdk from 2.15.0 to 2.16.0 (#5338)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.15.0 to 2.16.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.15.0...2.16.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 11:19:47 +02:00
dependabot[bot]
42279461e0 Bump pre-commit from 4.0.0 to 4.0.1 (#5337)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v4.0.0...v4.0.1)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 11:19:31 +02:00
dependabot[bot]
409447d6ca Bump actions/cache from 4.1.0 to 4.1.1 (#5340)
Bumps [actions/cache](https://github.com/actions/cache) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 11:19:02 +02:00
dependabot[bot]
5b313db49d Bump time-machine from 2.15.0 to 2.16.0 (#5336)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 09:27:57 +02:00
dependabot[bot]
d64618600d Bump actions/upload-artifact from 4.4.1 to 4.4.2 (#5339)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 09:26:23 +02:00
dependabot[bot]
1ee01b1d5e Bump actions/checkout from 4.2.0 to 4.2.1 (#5329)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 09:04:52 +02:00
dependabot[bot]
af590202c3 Bump actions/upload-artifact from 4.4.0 to 4.4.1 (#5330)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 09:04:36 +02:00
dependabot[bot]
12ca2fb624 Bump ruff from 0.6.8 to 0.6.9 (#5326)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 09:22:50 +02:00
dependabot[bot]
ea95f83742 Bump dbus-fast from 2.24.2 to 2.24.3 (#5328)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 09:18:12 +02:00
dependabot[bot]
e4d4da601c Bump aiohttp from 3.10.8 to 3.10.9 (#5327)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 09:01:00 +02:00
dependabot[bot]
0582f6fd39 Bump pre-commit from 3.8.0 to 4.0.0 (#5325)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 08:45:43 +02:00
dependabot[bot]
f254af8326 Bump actions/cache from 4.0.2 to 4.1.0 (#5323)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 08:40:52 +02:00
dependabot[bot]
3333770246 Bump sigstore/cosign-installer from 3.6.0 to 3.7.0 (#5324)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 08:37:08 +02:00
Stefan Agner
ee5ded29ac Allow Supervisor token authentication from landing page (#5321)
The landing page provides the Supervisor token as authentication, so
consider the landingpage as new enough too.
2024-10-03 18:17:13 +02:00
dependabot[bot]
f530db98ff Bump cpe from 1.3.0 to 1.3.1 (#5320)
* Bump cpe from 1.3.0 to 1.3.1

Bumps [cpe](https://github.com/nilp0inter/cpe) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/nilp0inter/cpe/releases)
- [Changelog](https://github.com/nilp0inter/cpe/blob/main/NEWS.txt)
- [Commits](https://github.com/nilp0inter/cpe/compare/v1.3.0...v1.3.1)

---
updated-dependencies:
- dependency-name: cpe
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Revert "Suppress SyntaxWarning from CPE until fixed (#5227)"

This reverts commit c95df56e8d.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-10-03 18:08:19 +02:00
dependabot[bot]
911f9d661f Bump sentry-sdk from 2.14.0 to 2.15.0 (#5319)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 09:55:24 +02:00
dependabot[bot]
9935eac146 Bump codecov/codecov-action from 4.5.0 to 4.6.0 (#5318)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 08:25:59 +02:00
Darren Griffin
eae2c9e221 Add OHF logo to README (#5316) 2024-09-30 18:42:08 +02:00
Paulus Schoutsen
1a67fe8a83 Exclude Text-to-Speech cache from backups (#5313) 2024-09-30 08:41:18 +02:00
J. Nick Koston
3af565267b Bump aiohttp to 3.10.8 (#5314) 2024-09-30 08:40:31 +02:00
dependabot[bot]
d09460a971 Bump ruff from 0.6.7 to 0.6.8 (#5312)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.7 to 0.6.8.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.7...0.6.8)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-27 09:22:38 +02:00
dependabot[bot]
c65329442a Bump actions/checkout from 4.1.7 to 4.2.0 (#5310)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.7...v4.2.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-26 09:13:30 +02:00
dependabot[bot]
48430dfa28 Bump pylint from 3.3.0 to 3.3.1 (#5311)
Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-26 09:13:00 +02:00
dependabot[bot]
70e2de372d Bump debugpy from 1.8.5 to 1.8.6 (#5309)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.8.5 to 1.8.6.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.8.5...v1.8.6)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-25 17:58:41 +02:00
dependabot[bot]
75784480ab Bump pylint from 3.2.7 to 3.3.0 (#5306)
* Bump pylint from 3.2.7 to 3.3.0

Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.7 to 3.3.0.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.7...v3.3.0)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Set positional arguments limit to 10

This makes the current codebase pass with pylint 3.3.0 while still
warning in case many positional arguments are used.

* Move to design section

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-09-25 17:57:55 +02:00
J. Nick Koston
8a70ba841d Bump aiohttp to 3.10.6 (#5308) 2024-09-24 22:28:00 +02:00
dependabot[bot]
77733829d7 Bump ruff from 0.6.6 to 0.6.7 (#5307)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 09:46:50 +02:00
dependabot[bot]
d4b67f1946 Bump ruff from 0.6.5 to 0.6.6 (#5305) 2024-09-20 09:40:55 +02:00
dependabot[bot]
51ab138bb1 Bump setuptools from 75.0.0 to 75.1.0 (#5303)
Bumps [setuptools](https://github.com/pypa/setuptools) from 75.0.0 to 75.1.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v75.0.0...v75.1.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-17 09:20:42 +02:00
dependabot[bot]
b81413c8b2 Bump ruff from 0.6.4 to 0.6.5 (#5301)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.4 to 0.6.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.4...0.6.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 10:52:19 +02:00
dependabot[bot]
2ec33c6ef3 Bump setuptools from 74.1.2 to 75.0.0 (#5302)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 08:57:28 +02:00
dependabot[bot]
68b2c38c7c Bump urllib3 from 2.2.2 to 2.2.3 (#5299)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.2...2.2.3)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-13 10:50:19 +02:00
Stefan Agner
1ca22799d1 Improve WiFi settings error handling (#5293)
* Improve WiFi settings error handling

Currently, the frontend potentially provides no WiFi settings dictionary
but still tries to update other (IP address) settings on the interface.
This leads to a stack trace since network manager is not able to fetch
the WiFi settings from the settings dictionary. Simply fill out what
we can and let NetworkManager provide an error.

Also allow to disable a network interface which has no configuration.
This avoids an error when switching to auto and back to disabled then
press save on a new wireless network interface.

* Add debug message when already disabled

* Add pytest for incomplete WiFi settings as psoted by frontend

Simulate the frontend posting no WiFi settings. Make sure the Supervisor
handles this gracefully.
2024-09-11 17:53:36 +02:00
dependabot[bot]
549dddcb11 Bump pytest from 8.3.2 to 8.3.3 (#5297) 2024-09-11 09:19:44 +02:00
dependabot[bot]
131af90469 Bump sentry-sdk from 2.13.0 to 2.14.0 (#5296)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.13.0 to 2.14.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.13.0...2.14.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 12:55:35 +02:00
dependabot[bot]
c7c39da7c6 Bump ruff from 0.6.3 to 0.6.4 (#5294)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.3 to 0.6.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.3...0.6.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 09:09:51 +02:00
dependabot[bot]
8310c426f0 Bump dbus-fast from 2.24.0 to 2.24.2 (#5295)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.24.0 to 2.24.2.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.24.0...v2.24.2)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 09:09:39 +02:00
dependabot[bot]
bb8f91e39a Bump orjson from 3.9.15 to 3.10.7 (#5238)
Bumps [orjson](https://github.com/ijl/orjson) from 3.9.15 to 3.10.7.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.9.15...3.10.7)

---
updated-dependencies:
- dependency-name: orjson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 10:42:45 +02:00
dependabot[bot]
a359b9a3d5 Bump actions/upload-artifact from 4.3.6 to 4.4.0 (#5284)
* Bump actions/upload-artifact from 4.3.6 to 4.4.0

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.6 to 4.4.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.3.6...v4.4.0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Explicitly include hidden files

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-09-05 10:38:27 +02:00
dependabot[bot]
e130ebad1f Bump setuptools from 74.0.0 to 74.1.2 (#5291)
Bumps [setuptools](https://github.com/pypa/setuptools) from 74.0.0 to 74.1.2.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v74.0.0...v74.1.2)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 09:19:37 +02:00
Stefan Agner
f5b996b66c Make network API replace IP/WiFi settings (#5283)
* Allow to set user DNS through API with auto mode

Currently it is only possible to set DNS servers when in static mode.
However, there are use cases to set DNS servers when in auto mode as
well, e.g. if no local DNS server is provided by the DHCP, or the provided
DNS turns out to be non-working.

* Fix use separate data structure for IP configuration fallout

Make sure gateway is correctly converted to the internal IP
representation. Fix type info.

* Overwrite WiFi settings completely too

* Add test for DNS configuration

* Run ruff format

* ruff format

* Use schema validation as source for API defaults

Instead of using replace() simply set the API defaults in the API
schema.

* Revert "Use schema validation as source for API defaults"

This reverts commit 885506fd37.

* Use explicit dataclass initialization

This avoid the unnecessary replaces from before. It also makes it more
obvious that this part of the API doesn't patch existing settings.
2024-09-05 09:19:13 +02:00
Jan Čermák
05e0c7c3ab Add "lines" and "verbose" query parameters for advanced logs (#5287)
Since headers are clumsy considering the Core proxy between the frontend
and Supervisor, add a way to adjust number of lines and verbose log
format using query parameters as well. If both query parameters and
headers are supplied, prefer the former, as it's more prominent when
reading through the request logs.
2024-09-04 16:11:37 +02:00
dependabot[bot]
6c1203e4bf Bump cryptography from 43.0.0 to 43.0.1 (#5289)
Bumps [cryptography](https://github.com/pyca/cryptography) from 43.0.0 to 43.0.1.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/43.0.0...43.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-04 08:42:43 +02:00
dependabot[bot]
5fbcaa8edd Bump pylint from 3.2.6 to 3.2.7 (#5285)
Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.6 to 3.2.7.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.6...v3.2.7)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 09:51:35 +02:00
Stefan Agner
00d217b5f7 Make IPv4 and IPv6 parse errors raise an API error (#5282)
* Make IPv4 and IPv6 parse errors raise an API error

Currently, IP address parsing errors lead to an execption which is not
handled by the `api_validate()` call. By using concrete IPv4 and IPv6
types and `vol.Coerce()` parsing errors are properly handled.

* ruff format

* ruff check
2024-08-30 18:20:20 +02:00
Stefan Agner
c0e35376f3 Improve connection settings tests (#5278)
* Improve connection settings fixture

Make the connection settings fixture behave more closely to the actual
NetworkManager. The behavior has been tested with NetworkManager 1.42.4
(Debian 12) and 1.44.2 (HAOS 13.1). This likely behaves similar in older
versions too.

* Introduce separate skeleton and settings for wireless

Instead of having a combined network settings object which has
Ethernet and Wirless settings, create a separate settings object for
wireless.

* Handle addresses/address-data property like NetworkManager

* Address ruff check

* Improve network API test

Add a test which changes from "static" to "auto". Validate that settings
are updated accordingly. Specifically, today this does clear the DNS
setting (by not providing the property).

* ruff format

* ruff check

* Complete TEST_INTERFACE rename

* Add partial network update as test case
2024-08-30 16:07:04 +02:00
Mike Degatano
2be84e1282 Keep shared images on update (#5268)
* Test stub for keeping shared images after update

* Keep shared images on addon update

* ImageNotFound should only skip the one image not all

* Fix tests and nonetype error

* Normalize logic between two cleanup methods
2024-08-30 15:29:13 +02:00
Jan Čermák
08f10c96ef Persist currently selected slot on successful boot (#5276)
When boot slot is selected manually in GRUB, the system boots into this
slot and marks it as good. However, the boot order is not changed, so in
the next boot (after an explicit or unexpected reboot) HAOS returns to
the version in the other slot. This might be confusing because if the
system has been running for some time, the user can forget they have
changed the boot slot to fix issue they had.

This gets more confusing if the "other" boot slot is selected manually
three times in a row. Let's say we have ORDER="A B". This means that
every time GRUB starts, it wants to boot slot A. If the slot B is
selected instead, only A_TRY is incremented, system boots into slot B
and marks slot B as good (B_OK=1, B_TRY=0). On another boot, this
repeats, yet A_TRY is incremented again. Until it reaches 3, the slot A
would be always chosen automatically, only after that it would boot to
slot B, presuming slot A is dead. The ORDER variable will be still
unchanged though.

This commit only makes sure that when the system is marked as healthy,
the slot is both marked as good AND active, updating the ORDER variable
as well. Because the X_TRY counter is incremented by GRUB, if we want
the other slot not to be marked as bad, we need to adjust the logic in
OS's grub.cfg as well, because Supervisor can't know whether it's
apppropriate to change other slot's state or not.

I also took the courtesy to adjust the logging a bit, to include the
stack trace in the error log if marking the slot fails somehow.
2024-08-30 15:18:44 +02:00
dependabot[bot]
12f8ccdf02 Bump ruff from 0.6.2 to 0.6.3 (#5280)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.2 to 0.6.3.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.2...0.6.3)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-30 10:13:08 +02:00
dependabot[bot]
d63e78cf34 Bump deepmerge from 1.1.1 to 2.0 (#5279)
Bumps [deepmerge](https://github.com/toumorokoshi/deepmerge) from 1.1.1 to 2.0.
- [Release notes](https://github.com/toumorokoshi/deepmerge/releases)
- [Commits](https://github.com/toumorokoshi/deepmerge/compare/v1.1.1...v2.0)

---
updated-dependencies:
- dependency-name: deepmerge
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-30 10:12:50 +02:00
dependabot[bot]
65d97ca924 Bump actions/setup-python from 5.1.1 to 5.2.0 (#5281)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.1 to 5.2.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.1.1...v5.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-30 10:11:57 +02:00
dependabot[bot]
5770cafea9 Bump setuptools from 73.0.1 to 74.0.0 (#5277)
Bumps [setuptools](https://github.com/pypa/setuptools) from 73.0.1 to 74.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v73.0.1...v74.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-28 09:32:19 +02:00
Mike Degatano
0177cd9528 Add manual_only option to addon boot config (#5272)
* Add manual_forced option to addon boot config

* Include client library in pull request template

* Add boot_config to api output so frontend can use it

* `manual_forced` to `manual_only`
2024-08-27 17:59:52 +02:00
dependabot[bot]
91a8fae9b5 Bump dbus-fast from 2.23.0 to 2.24.0 (#5274)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.23.0 to 2.24.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.23.0...v2.24.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-27 08:49:24 +02:00
dependabot[bot]
f16a4ce3ef Bump pulsectl from 24.4.0 to 24.8.0 (#5273)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 24.4.0 to 24.8.0.
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-27 08:49:11 +02:00
dependabot[bot]
306f63c75b Bump ruff from 0.6.1 to 0.6.2 (#5269) 2024-08-24 06:54:34 +02:00
Stefan Agner
2a0312318d Use single quotes in f-strings (#5267)
Instead of using double quotes in f-strings use single quotes. This
works with Python 3.11 too. We don't use Python 3.11 anymore, but is
useful when running pytest on Debian bookworm natively, which comes
with Python 3.11.
2024-08-23 16:16:08 +02:00
Stefan Agner
695a23a454 Minimize D-Bus requirements for tests (#5265)
This PR minimizes the D-Bus requirements for tests. It does this by
using dbus-daemon directly instead of dbus-launch. The latter is meant
for graphical applications and therefor has X11 dependencies. It also
leaves the D-Bus daemon running after the tests are done. This will
accumulate dbus-daemon processes over time which is not ideal.

I've also considered using dbus-run-session since it is meant to launch
processes with a private D-Bus session. For Python tests one could
launch it like so:
dbus-run-session -- python3 -m pytest ...

Then `DBUS_SESSION_BUS_ADDRESS` would be used automatically by the
`MessageBus` class. However, to keep the current behavior of the tests,
launching the D-Bus daemon manually is the better option.
2024-08-22 19:04:34 +02:00
dependabot[bot]
7366673eea Bump sentry-sdk from 2.10.0 to 2.13.0 (#5246)
* Bump sentry-sdk from 2.10.0 to 2.13.0

Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.10.0 to 2.13.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.10.0...2.13.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Replace deprecated apis with new ones

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2024-08-22 10:04:32 +02:00
dependabot[bot]
53fa0fe215 Bump dbus-fast from 2.22.1 to 2.23.0 (#5264)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.22.1 to 2.23.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.22.1...v2.23.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-22 10:00:50 +02:00
Stefan Agner
1ba621be60 Use separate data structure for IP configuration (#5262)
* Use separate data structure for IP configuration

So far we use the same IpConfig data structure to represent the users
IP setting and the currently applied IP configuration.

This commit separates the two in IpConfig (for the currently applied
IP configuration) and IpSetting (representing the user provided IP
setting).

* Use custom string constants for connection settings

Use separate string constants for all connection settings. This makes
it easier to search where a particular NetworkManager connection
setting is used.

* Use Python typing for IpAddress in IpProperties

* Address pytest issue
2024-08-22 08:08:55 +02:00
Stefan Agner
5117364625 Bump cosign to v2.4.0 (#5263)
Follow the builder bump of 2024.08.2 and use cosign v2.4.0 for
Supervisor too.
2024-08-21 14:30:12 -04:00
Mike Degatano
986b92aee4 Keep shared images on addon uninstall (#5259)
* Keep shared images on addon uninstall

* Add missing step for mocking new addon in store
2024-08-21 11:14:57 +02:00
dependabot[bot]
12d26b05af Bump setuptools from 73.0.0 to 73.0.1 (#5261)
Bumps [setuptools](https://github.com/pypa/setuptools) from 73.0.0 to 73.0.1.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v73.0.0...v73.0.1)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-21 09:50:02 +02:00
dependabot[bot]
e6c9704505 Bump home-assistant/builder from 2024.08.1 to 2024.08.2 (#5260)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2024.08.1 to 2024.08.2.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2024.08.1...2024.08.2)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-21 09:38:59 +02:00
Stefan Agner
8ab396d77c Improve and extend error handling on D-Bus connect (#5245)
* Improve and extend error handling on D-Bus connect

Avoid initializing the Supervisor board since it does not support the
Properties interface (see https://github.com/home-assistant/os-agent/issues/206).

This prevents the following somewhat confusing warning:
  No OS-Agent support on the host. Some Host functions have been disabled.

The OS Agent is actually installed on the host, it is just a single
object which caused issues. No functionalty was actually lost, as the
Supervisor board object has no features currently, and all other
interfaces got properly initialized still (thanks to gather()).

Print warnings more fine graned so it is clear which object exactly
causes an issue. Also print a log message on the lowest layer when an
error occures on calling D-Bus. This allows to easier track the actual
D-Bus error source.

Fixes: #5241

* Fix tests

* Use local variable

* Avoid stack trace when board support fails to load

* Fix tests

* Use override mechanism to disable Properties support

Instead of disable loading of Supervised entirly override initialization
to prevent loading the Properties interface.

* Revert "Fix tests"

This reverts commit 1e3c491ace.
2024-08-20 17:55:53 +02:00
dependabot[bot]
8438448843 Bump aiohttp from 3.10.4 to 3.10.5 (#5255)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.10.4 to 3.10.5.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.10.4...v3.10.5)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-20 11:23:27 +02:00
dependabot[bot]
362edb9a61 Bump setuptools from 72.2.0 to 73.0.0 (#5256)
Bumps [setuptools](https://github.com/pypa/setuptools) from 72.2.0 to 73.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v72.2.0...v73.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-20 11:22:42 +02:00
dependabot[bot]
1ff53e1853 Bump ruff from 0.6.0 to 0.6.1 (#5254)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.0 to 0.6.1.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.0...0.6.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 14:02:32 +02:00
dependabot[bot]
cfd28dbb5c Bump aiohttp from 3.10.3 to 3.10.4 (#5253)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.10.3 to 3.10.4.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.10.3...v3.10.4)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 13:38:08 +02:00
dependabot[bot]
cbec558289 Bump ruff from 0.5.7 to 0.6.0 (#5252)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.5.7 to 0.6.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.5.7...0.6.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-16 08:40:24 +02:00
dependabot[bot]
ca3a2937d0 Bump home-assistant/builder from 2024.03.5 to 2024.08.1 (#5250)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-15 09:31:33 +02:00
dependabot[bot]
3e67fc12c5 Bump setuptools from 72.1.0 to 72.2.0 (#5247)
Bumps [setuptools](https://github.com/pypa/setuptools) from 72.1.0 to 72.2.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v72.1.0...v72.2.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-14 11:01:30 +02:00
Stefan Agner
f6faa18409 Bump pre-commit ruff to 0.5.7 and reformat (#5242)
It seems that the codebase is not formatted with the latest ruff
version. This PR reformats the codebase with ruff 0.5.7.
2024-08-13 20:53:56 +02:00
dependabot[bot]
21ae2c2e54 Bump cpe from 1.2.1 to 1.3.0 (#5243)
Bumps [cpe](https://github.com/nilp0inter/cpe) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/nilp0inter/cpe/releases)
- [Changelog](https://github.com/nilp0inter/cpe/blob/develop/NEWS.txt)
- [Commits](https://github.com/nilp0inter/cpe/compare/v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: cpe
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 16:09:20 +02:00
Mike Degatano
eb3986bea2 Allow core to mark addons as system managed (#5145)
* Allow core to mark addons as system managed

* System managed options only settable by Home Assistant
2024-08-13 15:14:42 +02:00
dependabot[bot]
5d6738ced8 Bump aiohttp from 3.10.2 to 3.10.3 (#5240)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 09:05:42 +02:00
dependabot[bot]
2f2fecddf2 Bump pyyaml from 6.0.1 to 6.0.2 (#5230)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/main/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/6.0.1...6.0.2)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-09 12:15:48 +02:00
dependabot[bot]
218ba3601e Bump orjson from 3.9.15 to 3.10.6 (#5169)
Bumps [orjson](https://github.com/ijl/orjson) from 3.9.15 to 3.10.6.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.9.15...3.10.6)

---
updated-dependencies:
- dependency-name: orjson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-09 11:12:27 +02:00
J. Nick Koston
4c3f60c44b Bump aiohttp to 3.10.2, drop aiohttp-fast-url-dispatcher (#5236)
aiohttp-fast-url-dispatcher is not needed for 3.10.x

changelog: https://github.com/aio-libs/aiohttp/compare/v3.9.5...v3.10.2
2024-08-09 10:44:29 +02:00
dependabot[bot]
cb85e5e464 Bump ruff from 0.5.6 to 0.5.7 (#5237)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.5.6 to 0.5.7.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.5.6...0.5.7)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-09 10:41:30 +02:00
dependabot[bot]
5b46235872 Bump time-machine from 2.14.2 to 2.15.0 (#5229)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-08 09:05:56 +02:00
dependabot[bot]
70f675ac82 Bump sigstore/cosign-installer from 3.5.0 to 3.6.0 (#5234)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-08 08:53:54 +02:00
dependabot[bot]
bf0c714ea4 Bump attrs from 24.1.0 to 24.2.0 (#5231)
Bumps [attrs](https://github.com/sponsors/hynek) from 24.1.0 to 24.2.0.
- [Commits](https://github.com/sponsors/hynek/commits)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-07 15:38:43 +02:00
Mike Degatano
c95df56e8d Suppress SyntaxWarning from CPE until fixed (#5227) 2024-08-07 15:37:30 +02:00
dependabot[bot]
5f3d851954 Bump actions/upload-artifact from 4.3.5 to 4.3.6 (#5232)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-07 09:05:38 +02:00
dependabot[bot]
10c69dcdae Bump ruff from 0.5.5 to 0.5.6 (#5221)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.5.5...0.5.6)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 09:10:52 +02:00
dependabot[bot]
bdd81ce3a9 Bump debugpy from 1.8.2 to 1.8.5 (#5225)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.8.2 to 1.8.5.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.8.2...v1.8.5)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 08:38:52 +02:00
Mike Degatano
17ee234be4 Fix resp may be undefined end_backup issue (#5224) 2024-08-05 17:02:11 +02:00
dependabot[bot]
61034dfa7b Bump attrs from 23.2.0 to 24.1.0 (#5219)
Bumps [attrs](https://github.com/sponsors/hynek) from 23.2.0 to 24.1.0.
- [Commits](https://github.com/sponsors/hynek/commits)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 09:41:21 +02:00
dependabot[bot]
185cd362fb Bump coverage from 7.6.0 to 7.6.1 (#5222)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.0 to 7.6.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.6.0...7.6.1)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 09:38:06 +02:00
dependabot[bot]
e2ca357774 Bump dirhash from 0.4.1 to 0.5.0 (#5223)
Bumps [dirhash](https://github.com/andhus/dirhash-python) from 0.4.1 to 0.5.0.
- [Release notes](https://github.com/andhus/dirhash-python/releases)
- [Changelog](https://github.com/andhus/dirhash-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/andhus/dirhash-python/compare/v0.4.1...v0.5.0)

---
updated-dependencies:
- dependency-name: dirhash
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 09:37:40 +02:00
dependabot[bot]
3dea7fc4e8 Bump actions/upload-artifact from 4.3.4 to 4.3.5 (#5217) 2024-08-05 08:36:00 +02:00
dependabot[bot]
01ba591bc9 Bump setuptools from 72.0.0 to 72.1.0 (#5212)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30 10:12:58 +02:00
dependabot[bot]
640b7d46e3 Bump ruff from 0.5.4 to 0.5.5 (#5208)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 12:01:43 +02:00
dependabot[bot]
d6560c51ee Bump pre-commit from 3.7.1 to 3.8.0 (#5210)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 11:39:50 +02:00
dependabot[bot]
3e9b1938c6 Bump pytest from 8.3.1 to 8.3.2 (#5207)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.1 to 8.3.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.1...8.3.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 11:26:14 +02:00
dependabot[bot]
44ce8de71f Bump setuptools from 71.1.0 to 72.0.0 (#5211)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 11:08:13 +02:00
Mike Degatano
0bbd15bfda Restrict stopping core during migrations with force option (#5205) 2024-07-25 17:14:45 +02:00
Mike Degatano
591b9a4d87 Stop backup if pre backup failed in Core (#5203)
* Stop backup if pre backup failed in Core

* Fix API tests

* Partial backup in ci since there's no Home assistant

* Add ssl folder to partial backup

* Allow backups when Home Assistant is not running

* Undo change to skip db test
2024-07-25 17:08:43 +02:00
Mike Degatano
5ee7d16687 Add hard-coded image fallback for plugins for offline start (#5204) 2024-07-25 13:45:38 +02:00
Erik Montnemery
4ab4350c58 Add support for offline DB migration (#5202)
* Add support for offline DB migration

* Format code
2024-07-23 15:27:16 -04:00
dependabot[bot]
4ea7133fa8 Bump docker/login-action from 3.2.0 to 3.3.0 (#5201)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 09:22:20 +02:00
dependabot[bot]
627d67f9d0 Bump cryptography from 42.0.8 to 43.0.0 (#5199)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 11:59:07 +02:00
dependabot[bot]
eb37655598 Bump pylint from 3.2.5 to 3.2.6 (#5198)
Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.5 to 3.2.6.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.5...v3.2.6)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:07:15 +02:00
dependabot[bot]
19b62dd0d4 Bump pytest from 8.2.2 to 8.3.1 (#5197)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:04:13 +02:00
dependabot[bot]
b2ad1ceea3 Bump sentry-sdk from 2.9.0 to 2.10.0 (#5188)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:03:25 +02:00
dependabot[bot]
c1545b5b78 Bump ruff from 0.5.3 to 0.5.4 (#5196)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.5.3 to 0.5.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.5.3...0.5.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 09:45:47 +02:00
dependabot[bot]
2c2f04ba85 Bump setuptools from 71.0.3 to 71.1.0 (#5200)
Bumps [setuptools](https://github.com/pypa/setuptools) from 71.0.3 to 71.1.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v71.0.3...v71.1.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 09:45:31 +02:00
Andrew Leech
77e7bf51b7 Only read wifi strength from active connections. (#5184) 2024-07-19 12:36:25 +02:00
Mike Degatano
a42d71dcef Small cleanup to pyproject.toml (#5191) 2024-07-19 09:09:13 +02:00
dependabot[bot]
1ff0432f4d Bump ruff from 0.5.2 to 0.5.3 (#5192)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-19 09:07:06 +02:00
dependabot[bot]
54afd6e1c8 Bump setuptools from 71.0.1 to 71.0.3 (#5193)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-19 09:06:43 +02:00
dependabot[bot]
458c493a74 Bump ruff from 0.5.1 to 0.5.2 (#5186)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 08:52:23 +02:00
dependabot[bot]
8ac8ecb17e Bump setuptools from 70.3.0 to 71.0.1 (#5190)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 08:51:36 +02:00
Mike Degatano
eac167067e Ignore false positive no-member error (#5189) 2024-07-18 08:43:59 +02:00
Mike Degatano
aa7f4aafeb Migrate supervisor devcontainer from pip to uv (#5170) 2024-07-12 10:26:45 +02:00
dependabot[bot]
d2183fa12b Bump coverage from 7.5.4 to 7.6.0 (#5185)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.4 to 7.6.0.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.5.4...7.6.0)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-12 10:25:20 +02:00
dependabot[bot]
928f32bb4f Bump sentry-sdk from 2.8.0 to 2.9.0 (#5183)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-11 08:57:33 +02:00
dependabot[bot]
cbe21303c4 Bump actions/setup-python from 5.1.0 to 5.1.1 (#5182)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.1.0...v5.1.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-11 08:17:35 +02:00
dependabot[bot]
94987c04b8 Bump setuptools from 70.2.0 to 70.3.0 (#5181)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 08:37:23 +02:00
dependabot[bot]
d4ba46a846 Bump home-assistant/wheels from 2024.01.0 to 2024.07.1 (#5178)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 08:29:09 +02:00
dependabot[bot]
1a22d83895 Bump sentry-sdk from 2.7.1 to 2.8.0 (#5179)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 08:27:46 +02:00
dependabot[bot]
6b73bf5c28 Bump aiohttp-fast-url-dispatcher from 0.3.0 to 0.3.1 (#5175) 2024-07-08 08:41:48 +02:00
dependabot[bot]
c9c9451c36 Bump ruff from 0.5.0 to 0.5.1 (#5176) 2024-07-08 08:39:34 +02:00
dependabot[bot]
1882d448ea Bump actions/download-artifact from 4.1.7 to 4.1.8 (#5174) 2024-07-08 08:35:57 +02:00
dependabot[bot]
2f11c9c9e3 Bump actions/upload-artifact from 4.3.3 to 4.3.4 (#5173) 2024-07-08 08:34:07 +02:00
Mike Degatano
02bdc4b555 Use uv instead of pip in Supervisor (#5152)
* Migrate supervisor image from pip to uv

* Set python paths

* Put in i386 conditional to match core

* Semicolons within if statements
2024-07-03 11:51:16 -04:00
dependabot[bot]
1a1ee50d9d Bump voluptuous from 0.15.1 to 0.15.2 (#5168)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 09:57:11 +02:00
dependabot[bot]
50dc09d1a9 Bump setuptools from 70.1.1 to 70.2.0 (#5167)
Bumps [setuptools](https://github.com/pypa/setuptools) from 70.1.1 to 70.2.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v70.1.1...v70.2.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 09:29:38 +02:00
dependabot[bot]
130efd340c Bump time-machine from 2.14.1 to 2.14.2 (#5165)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 08:47:00 +02:00
dependabot[bot]
00bc13c049 Bump pylint from 3.2.4 to 3.2.5 (#5166)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 08:43:39 +02:00
dependabot[bot]
3caad67f61 Bump sentry-sdk from 2.7.0 to 2.7.1 (#5164)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-30 15:27:42 +02:00
dependabot[bot]
13783f0d4a Bump ruff from 0.4.10 to 0.5.0 (#5163)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-28 08:39:34 +02:00
dependabot[bot]
eae97ba3f4 Bump pylint from 3.2.3 to 3.2.4 (#5160)
Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.3...v3.2.4)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-27 09:05:11 +02:00
dependabot[bot]
134dad7357 Bump sentry-sdk from 2.6.0 to 2.7.0 (#5161)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.6.0...2.7.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-27 09:04:42 +02:00
dependabot[bot]
1c4d2e8dec Bump voluptuous from 0.15.0 to 0.15.1 (#5162)
Bumps [voluptuous](https://github.com/alecthomas/voluptuous) from 0.15.0 to 0.15.1.
- [Release notes](https://github.com/alecthomas/voluptuous/releases)
- [Changelog](https://github.com/alecthomas/voluptuous/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alecthomas/voluptuous/compare/0.15.0...0.15.1)

---
updated-dependencies:
- dependency-name: voluptuous
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-27 08:48:44 +02:00
dependabot[bot]
f2d7be3aac Bump dbus-fast from 2.21.3 to 2.22.1 (#5159)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 09:26:21 +02:00
dependabot[bot]
d06edb2dd6 Bump debugpy from 1.8.1 to 1.8.2 (#5158)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 08:50:33 +02:00
dependabot[bot]
7fa15b334a Bump setuptools from 70.1.0 to 70.1.1 (#5156)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 08:35:34 +02:00
Mike Degatano
ffb4e2d6d7 Bump Supervisor to Alpine 3.20 (#5151) 2024-06-25 08:37:10 +02:00
dependabot[bot]
bd8047ae9c Bump awesomeversion from 24.2.0 to 24.6.0 (#5153)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 08:25:24 +02:00
Mike Degatano
49bc0624af Ignore dns-data field in network settings update (#5147) 2024-06-24 15:47:58 -04:00
dependabot[bot]
5e1d764eb3 Bump coverage from 7.5.3 to 7.5.4 (#5150)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 08:41:30 +02:00
dependabot[bot]
0064d93d75 Bump dirhash from 0.4.0 to 0.4.1 (#5149)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 08:40:15 +02:00
dependabot[bot]
5a838ecfe7 Bump voluptuous from 0.14.2 to 0.15.0 (#5148)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 08:36:04 +02:00
Pascal Vizeli
c37b5effd7 Add music assistant to the builtin repositories (#5128)
* Add music assistant to the builtin repositories

* Fix tests

* Fix tests some more

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-06-21 12:17:21 +02:00
dependabot[bot]
ca7f3e8acb Bump ruff from 0.4.9 to 0.4.10 (#5143)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-21 09:27:10 +02:00
Stefan Agner
b0cdb91d5e Fix uninstall of add-on on fixup (#5142) 2024-06-21 08:54:46 +02:00
Mike Degatano
4829eb8ae1 Await uninstall of addon in fixup (#5141) 2024-06-20 21:50:45 +02:00
Mike Degatano
1bb814b793 Home Assistant watchdog attempts safe mode after max fails (#5124)
* Home Assistant watchdog attempts safe mode after max fails

* Remove duplicate line

* Refactor and logging change from feedback

* Update supervisor/misc/tasks.py

* Fix log text check in test

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-06-20 21:50:29 +02:00
dependabot[bot]
918fcb7d62 Bump sentry-sdk from 2.5.1 to 2.6.0 (#5140)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-20 11:39:26 +02:00
dependabot[bot]
bbfd899564 Bump setuptools from 70.0.0 to 70.1.0 (#5139)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-20 09:11:45 +02:00
dependabot[bot]
12c4d9da87 Bump urllib3 from 2.2.1 to 2.2.2 (#5138)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 07:52:04 +02:00
dependabot[bot]
6b4fd9b6b8 Bump ruff from 0.4.8 to 0.4.9 (#5137)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.8 to 0.4.9.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.4.8...v0.4.9)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 09:05:58 +02:00
dependabot[bot]
07c22f4a60 Bump codecov/codecov-action from 4.4.1 to 4.5.0 (#5136)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-14 09:27:41 +02:00
dependabot[bot]
252e1e2ac0 Bump actions/checkout from 4.1.6 to 4.1.7 (#5134)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.6...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 09:17:05 +02:00
dependabot[bot]
b684c8673e Bump sentry-sdk from 2.5.0 to 2.5.1 (#5130)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.5.0...2.5.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 09:01:06 +02:00
dependabot[bot]
547f42439d Bump typing-extensions from 4.12.1 to 4.12.2 (#5129)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 08:49:42 +02:00
dependabot[bot]
c51ceb000f Bump sentry-sdk from 2.4.0 to 2.5.0 (#5126)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-07 09:19:18 +02:00
dependabot[bot]
4cbede1bc8 Bump pylint from 3.2.2 to 3.2.3 (#5127)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-07 09:01:27 +02:00
dependabot[bot]
5eac8c7780 Bump ruff from 0.4.7 to 0.4.8 (#5125)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.7 to 0.4.8.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.4.7...v0.4.8)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-06 08:37:25 +02:00
Mike Degatano
ab78d87304 Add safe mode option to core rebuild (#5120)
* Add safe mode option to core rebuild

* Adding logging for increased traceability
2024-06-05 15:44:07 -04:00
dependabot[bot]
09166e3867 Bump cryptography from 42.0.7 to 42.0.8 (#5121)
Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.7 to 42.0.8.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.7...42.0.8)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-05 15:38:13 -04:00
dependabot[bot]
8a5c813cdd Bump sentry-sdk from 2.3.1 to 2.4.0 (#5123)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.3.1...2.4.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-05 15:37:41 -04:00
dependabot[bot]
4200622f43 Bump pytest from 8.2.1 to 8.2.2 (#5122)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-05 08:43:01 +02:00
Mike Degatano
c4452a85b4 Fix addon in wrong state after restore (#5111)
* Fix addon in wrong state after restore

* Do not stop docker monitor for a shutdown
2024-06-04 16:17:43 +02:00
Mike Degatano
e57de4a3c1 Add uninstall addon suggestion to detached_addon_removed (#5105) 2024-06-03 10:38:34 -04:00
dependabot[bot]
9fd2c91c55 Bump ruff from 0.4.6 to 0.4.7 (#5116)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 10:29:23 +02:00
dependabot[bot]
fbd70013a8 Bump typing-extensions from 4.12.0 to 4.12.1 (#5117)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 09:54:10 +02:00
dependabot[bot]
8d18f3e66e Bump requests from 2.32.2 to 2.32.3 (#5115)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-30 08:52:20 +02:00
Richard P
5f5754e860 Add Exception handling when processing udev devices (#5088)
* Add Exception handling to UDEV reading and parsing

Khadas VIM4 UDEV returns something that python crapps its pants about. The exception just allows it to continue.

* Add an exception print

Added an exception print for the times things go bad.

* Split exception handling

The exception is not fatal when parsing error happens on one node. print it and continue.

* cleanups

* swapped functions

device.device_node   function bails very badly!  It raises no exceptions to the top but complains and errors

* Update supervisor/hardware/manager.py

Co-authored-by: Stefan Agner <stefan@agner.ch>

* Update supervisor/hardware/manager.py

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2024-05-29 15:33:15 -04:00
dependabot[bot]
974c882b9a Bump docker/login-action from 3.1.0 to 3.2.0 (#5114)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 08:50:25 +02:00
dependabot[bot]
a9ea90096b Bump ruff from 0.4.5 to 0.4.6 (#5113)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 08:26:23 +02:00
dependabot[bot]
45c72c426e Bump coverage from 7.5.2 to 7.5.3 (#5112)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 08:26:10 +02:00
dependabot[bot]
4e5b75fe19 Bump coverage from 7.5.1 to 7.5.2 (#5109)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 08:37:29 +02:00
dependabot[bot]
3cd617e68f --- (#5099)
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 09:33:15 +02:00
dependabot[bot]
ddff02f73b Bump docker from 7.0.0 to 7.1.0 (#5106)
Bumps [docker](https://github.com/docker/docker-py) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/7.0.0...7.1.0)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 08:52:21 +02:00
dependabot[bot]
b59347b3d3 Bump typing-extensions from 4.11.0 to 4.12.0 (#5107)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 08:32:48 +02:00
dependabot[bot]
1dc769076f Bump sentry-sdk from 2.2.1 to 2.3.1 (#5108)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 08:25:53 +02:00
Mike Degatano
f150a19c0f Create issue for detached addons (#5084)
* Create issue for detached addons

* Separate issues into missing and removed
2024-05-23 09:36:59 +02:00
dependabot[bot]
c4bc1e3824 Bump ruff from 0.4.4 to 0.4.5 (#5103)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 08:33:52 +02:00
Mike Degatano
eca99b69db Max retries for auto applying addon image fixup (#5051)
* Max retries for auto applying addon image fixup

* Update supervisor/resolution/fixups/addon_execute_repair.py

Co-authored-by: Stefan Agner <stefan@agner.ch>

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-05-22 11:54:02 +02:00
dependabot[bot]
043af72847 Bump setuptools from 69.5.1 to 70.0.0 (#5100)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 09:33:26 +02:00
dependabot[bot]
05c7b6c639 Bump sentry-sdk from 2.2.0 to 2.2.1 (#5101)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 08:16:31 +02:00
dependabot[bot]
3385c99f1f --- (#5095)
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 17:06:19 +02:00
dependabot[bot]
895117f857 --- (#5094)
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 17:05:23 +02:00
dependabot[bot]
9e3135e2de --- (#5093)
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 17:05:00 +02:00
Stefan Agner
9a1c517437 Pin Python requets package (#5097)
Make sure Python requests package is pinned to a known version. This is
required by docker-py for instance. This fixes current CI builds.
2024-05-21 14:52:24 +02:00
Mike Degatano
c0c0c4b7ad Fix doc and changelog API response for orphaned addons (#5082)
* Fix doc and changelog API response for orphaned addons

* Use correct terminology in tests
2024-05-21 09:02:01 +02:00
dependabot[bot]
be6e39fed0 Bump pylint from 3.1.1 to 3.2.1 (#5090)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 09:30:42 +02:00
dependabot[bot]
b384921ee0 Bump pytest from 8.2.0 to 8.2.1 (#5089)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 09:29:26 +02:00
dependabot[bot]
0d05a6eae3 Bump sentry-sdk from 2.1.1 to 2.2.0 (#5085)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 15:19:01 +02:00
dependabot[bot]
430aef68c6 Bump actions/checkout from 4.1.5 to 4.1.6 (#5086)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 10:40:37 +02:00
Stefan Agner
eac6070e12 Don't process hardware events when landing page is running (#5079) 2024-05-15 08:56:37 +02:00
dependabot[bot]
6693b7c2e6 Bump codecov/codecov-action from 4.3.1 to 4.4.0 (#5080)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-15 08:49:07 +02:00
dependabot[bot]
7898c3e433 Bump pylint from 3.1.0 to 3.1.1 (#5078)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 10:11:19 +02:00
dependabot[bot]
420ecd064e Bump pyudev from 0.24.1 to 0.24.3 (#5074)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 09:29:49 +02:00
dependabot[bot]
4289be53f8 Bump pre-commit from 3.7.0 to 3.7.1 (#5075)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 09:14:14 +02:00
dependabot[bot]
29b41b564e Bump ruff from 0.4.3 to 0.4.4 (#5072)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.4.3...v0.4.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-10 12:48:18 +02:00
dependabot[bot]
998eb69583 Bump dbus-fast from 2.21.1 to 2.21.2 (#5071)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.21.1 to 2.21.2.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.21.1...v2.21.2)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-10 12:48:09 +02:00
Stefan Agner
8ebc097ff4 Revert "Bump orjson from 3.9.15 to 3.10.3 (#5057)" (#5068)
This reverts commit 71e91328f1.

It is not proven that the segfaults seen in Core are resolved. Since
we are shipping a bugfix release, conservatively revert back to 3.9.15.
2024-05-07 16:02:34 +02:00
Mike Degatano
c05984ca49 Fix no changelog API response (#5064)
* Fix no changelog API response

* Add comment reasoning HTTP 200 for no changelog

Co-authored-by: Stefan Agner <stefan@agner.ch>

* Apply suggestions from code review

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>

---------

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>
Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-05-07 10:41:16 +02:00
dependabot[bot]
1a700c3013 Bump sentry-sdk from 2.0.1 to 2.1.1 (#5067)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.0.1 to 2.1.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.0.1...2.1.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 10:17:12 +02:00
dependabot[bot]
a9c92cdec8 Bump cryptography from 42.0.6 to 42.0.7 (#5066)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 09:23:56 +02:00
dependabot[bot]
da8b938d5b Bump actions/checkout from 4.1.4 to 4.1.5 (#5065) 2024-05-07 08:26:00 +02:00
dependabot[bot]
71e91328f1 Bump orjson from 3.9.15 to 3.10.3 (#5057)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 22:46:12 +02:00
dependabot[bot]
6356be4c52 Bump jinja2 from 3.1.3 to 3.1.4 (#5061)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.3...3.1.4)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 11:14:01 +02:00
dependabot[bot]
e26e5440b6 Bump ruff from 0.4.2 to 0.4.3 (#5060)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.2 to 0.4.3.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.4.2...v0.4.3)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 11:13:04 +02:00
dependabot[bot]
fecfbd1a3e Bump coverage from 7.5.0 to 7.5.1 (#5059)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.0 to 7.5.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.5.0...7.5.1)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 11:12:49 +02:00
dependabot[bot]
c00d6dfc76 Bump cryptography from 42.0.5 to 42.0.6 (#5058) 2024-05-06 10:00:57 +02:00
dependabot[bot]
85be66d90d Bump codecov/codecov-action from 4.3.0 to 4.3.1 (#5054)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 09:02:54 +02:00
Mike Degatano
1ac506b391 Skip udisks listener on failure to connect (#5049) 2024-05-01 10:50:48 +02:00
dependabot[bot]
f7738b77de Bump pytest from 8.1.1 to 8.2.0 (#5046)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.2.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.1.1...8.2.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 15:55:34 -04:00
Mike Degatano
824037bb7d Bump pytest-asyncio to 0.23.6 (#5048) 2024-04-30 15:46:44 -04:00
Stefan Agner
221292ad14 Mark issues in FixupBase abstract (#5033)
Since #5024 all fixups have an associated issue. Generally, it is
generally better to have an issue for every fixup so that things
can be mapped to repairs in Core easily. Let's mark the issues property
as abstract to indicate subclasses are required to implement it.
2024-04-29 16:24:58 -04:00
dependabot[bot]
16f8c75e9f Bump sentry-sdk from 1.45.0 to 2.0.1 (#5047)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 17:33:36 +02:00
dependabot[bot]
90a37079f1 Bump ruff from 0.4.1 to 0.4.2 (#5043)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-26 10:07:04 +02:00
J. Nick Koston
798092af5e Revert orjson to 3.9.15 due to segmentation faults (#5041)
https://github.com/ijl/orjson/issues/479
2024-04-25 17:48:48 +02:00
Jan Čermák
2a622a929d Limit reporting of errors in Supervisor logs fallback (#5040)
We do not need to capture HostNotSupported errors to Sentry. The only
possible code path this error might come from is where the Journal
Gateway Daemon socket is unavailable, which is already reported as an
"Unsupported system" repair.
2024-04-25 10:44:21 +02:00
dependabot[bot]
ca8eeaa68c Bump actions/download-artifact from 4.1.6 to 4.1.7 (#5039)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.1.6...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 09:25:11 +02:00
dependabot[bot]
d1b8ac1249 Bump actions/checkout from 4.1.3 to 4.1.4 (#5038)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.3...v4.1.4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 09:15:34 +02:00
dependabot[bot]
3f629c4d60 Bump coverage from 7.4.4 to 7.5.0 (#5037)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-24 09:52:18 +02:00
dependabot[bot]
3fa910e68b Bump actions/download-artifact from 4.1.5 to 4.1.6 (#5034)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.5 to 4.1.6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.1.5...v4.1.6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 09:06:04 +02:00
dependabot[bot]
e3cf2989c9 Bump actions/upload-artifact from 4.3.2 to 4.3.3 (#5035)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.2 to 4.3.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.3.2...v4.3.3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 09:05:50 +02:00
dependabot[bot]
136b2f402d Bump dirhash from 0.3.0 to 0.4.0 (#5036)
Bumps [dirhash](https://github.com/andhus/dirhash-python) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/andhus/dirhash-python/releases)
- [Changelog](https://github.com/andhus/dirhash-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/andhus/dirhash-python/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: dirhash
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 09:05:06 +02:00
Mike Degatano
8d18d2d9c6 Use signals to recognize new disks immediately (#5023)
* Use signals to recognize new disks immediately

* Add test for disabled data disk issue

* Add mock of UDisks2 base service to test

* Apply suggestions from code review

* Shutdown manager first to avoid potential race conditions

* Update tests/dbus_service_mocks/udisks2.py

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>
2024-04-22 16:35:03 +02:00
Mike Degatano
f18213361a Add issues field to create full backup suggestion (#5024) 2024-04-22 09:58:22 +02:00
Jan Čermák
18d9d32bca Fix Supervisor logs fallback (#5022)
Supervisor logs fallback in get_supervisor_logs didn't work properly
because the exception was caught in api_process_raw instead. This was
not discovered in tests because the side effect raised OSError, which
isn't handled there.

To address that, I split the advanced_logs to two functions, one being a
wrapped API handler, one being plain function returning response without
any additional error handling. The tests now check for both cases of
errors (HassioError and random generic Python error).

Refs #5021
2024-04-22 09:42:12 +02:00
dependabot[bot]
1246e429c9 Bump ruff from 0.4.0 to 0.4.1 (#5032)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 09:14:49 +02:00
dependabot[bot]
77bc46bc37 Bump actions/checkout from 4.1.2 to 4.1.3 (#5031)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 08:50:53 +02:00
dependabot[bot]
ce16963c94 Bump actions/upload-artifact from 4.3.1 to 4.3.2 (#5025)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.1 to 4.3.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.3.1...v4.3.2)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 09:41:14 +02:00
dependabot[bot]
a70e8cfe58 Bump actions/download-artifact from 4.1.4 to 4.1.5 (#5026)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.1.4...v4.1.5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 09:41:06 +02:00
dependabot[bot]
ba922a1aaa Bump ruff from 0.3.7 to 0.4.0 (#5027)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.7 to 0.4.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.3.7...v0.4.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 09:40:19 +02:00
dependabot[bot]
b09230a884 Bump aiohttp from 3.9.4 to 3.9.5 (#5020)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.4 to 3.9.5.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.9.4...v3.9.5)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 09:01:18 +02:00
dependabot[bot]
f1cb9ca08e Bump orjson from 3.9.15 to 3.10.1 (#5019)
Bumps [orjson](https://github.com/ijl/orjson) from 3.9.15 to 3.10.1.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.9.15...3.10.1)

---
updated-dependencies:
- dependency-name: orjson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 08:59:30 +02:00
Mike Degatano
06513e88c6 Allow restarting core in safe mode (#5017) 2024-04-17 08:54:56 +02:00
dependabot[bot]
b4a79bd068 Bump setuptools from 69.2.0 to 69.5.1 (#5018) 2024-04-15 08:58:39 +02:00
Mike Degatano
dfd8fe84e0 Mount manager reload mounts all failed mounts (#5014)
* Mount manager reload mounts all failed mounts

* Remove invalid part of mount manager reload test
2024-04-12 12:02:29 +02:00
J. Nick Koston
4857c2e243 Bump aiohttp to 3.9.4 (#4899) 2024-04-12 08:51:07 +02:00
dependabot[bot]
7d384f6160 Bump ruff from 0.3.5 to 0.3.7 (#5015)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-12 08:45:52 +02:00
Mike Degatano
672a7621f9 Adopt a disabled data disk (#5010) 2024-04-11 13:53:19 -04:00
Mike Degatano
f0e2fb3f57 Addon load should not fail due to docker error (#5011) 2024-04-11 15:06:57 +02:00
dependabot[bot]
8c3a520512 Bump sentry-sdk from 1.44.1 to 1.45.0 (#5012)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.44.1 to 1.45.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.44.1...1.45.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 08:56:48 +02:00
dependabot[bot]
22e50d56db Bump sigstore/cosign-installer from 3.4.0 to 3.5.0 (#5013)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 08:55:50 +02:00
Mike Degatano
a0735f3585 Allow adoption of existing data disk (#4991)
* Allow adoption of existing data disk

* Fix existing tests

* Add test cases and fix image issues

* Fix addon build test

* Run checks during setup not startup

* Addon load mimics plugin and HA load for docker part

* Default image accessible in except
2024-04-10 11:36:18 +02:00
Mike Degatano
50a2e8fde3 Allow adoption of existing data disk (#4991)
* Allow adoption of existing data disk

* Fix existing tests

* Add test cases and fix image issues

* Fix addon build test

* Run checks during setup not startup

* Addon load mimics plugin and HA load for docker part

* Default image accessible in except
2024-04-10 10:25:22 +02:00
dependabot[bot]
55ed63cc79 Bump dirhash from 0.2.1 to 0.3.0 (#5006)
Bumps [dirhash](https://github.com/andhus/dirhash-python) from 0.2.1 to 0.3.0.
- [Release notes](https://github.com/andhus/dirhash-python/releases)
- [Changelog](https://github.com/andhus/dirhash-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/andhus/dirhash-python/compare/v0.2.1...v0.3.0)

---
updated-dependencies:
- dependency-name: dirhash
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 09:28:28 +02:00
dependabot[bot]
97e9dfff3f Bump codecov/codecov-action from 4.2.0 to 4.3.0 (#5007)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 09:26:36 +02:00
dependabot[bot]
501c9579fb Bump pulsectl from 23.5.2 to 24.4.0 (#5003)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 23.5.2 to 24.4.0.
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 10:06:44 +02:00
dependabot[bot]
f9aedadee6 Bump typing-extensions from 4.10.0 to 4.11.0 (#5002)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 08:52:23 +02:00
Stefan Agner
c3c17b2bc3 Increase DNS timeout for CoreDNS users (#5000)
* Increase DNS timeout for CoreDNS users

CoreDNS forward plug-in fails in ~6s, then fallback triggers.
However, the default timeout of glibc and musl is 5s. Increase
default timeout to make sure CoreDNS fallback is working
on first query.

* Pass option as list
2024-04-05 09:40:57 +02:00
Jan Čermák
a894c4589e Use Systemd Journal API for all logs endpoints in API (#4972)
* Use Systemd Journal API for all logs endpoints in API

Replace all logs endpoints using container logs with wrapped
advanced_logs function, adding possibility to get logs from previous
boots and following the logs. Supervisor logs are an excetion where
Docker logs are still used - in case an exception is raised while
accessing the Systemd logs, they're used as fallback - otherwise we
wouldn't have an easy way to see what went wrong.

* Refactor testing of advanced logs endpoints to a common method

* Send error while fetching Supervisor logs to Sentry; minor cleanup

* Properly handle errors and use consistent content type in logs endpoints

* Replace api_process_custom with reworked api_process_raw per @mdegat01 suggestion
2024-04-04 12:09:08 +02:00
dependabot[bot]
56a8a1b5a1 Bump sentry-sdk from 1.44.0 to 1.44.1 (#4999)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.44.0 to 1.44.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.44.0...1.44.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 09:12:48 +02:00
dependabot[bot]
be3f7a6c37 Bump codecov/codecov-action from 4.1.1 to 4.2.0 (#4998)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.1.1 to 4.2.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4.1.1...v4.2.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 08:43:36 +02:00
Jan Čermák
906e400ab7 Fix submounts of /dev being read-only with Docker 25+ (#4997)
As described in #4996, Docker 25+ changes made sub-mounts of the /dev
filesystem to be mounted read-only. Revert to the previous behavior by
adjusting the ReadOnlyNonRecursive option. Cleaner way would be to
upstream support for setting this option via Mount class arguments, so
this change is meant to be rather a hotfix for the issue. Even better
approach would be mounting /dev non-recursively, and taking care of
creating all necessary filesystems when creating containers in
Supervisor.
2024-04-02 21:07:53 +02:00
Stefan Agner
a9265afd4c Format NetworkManager connection name correctly for VLANs (#4986)
* Format NetworkManager connection name correctly for VLANs

Make sure NetworkManager connections are named correctly for VLANs
as well (<interface-name>.<vlan-id>).

* Avoid extending VLAN configuration name
2024-04-02 21:07:39 +02:00
Stefan Agner
d26058ac80 Update base images to 3.12-alpine3.19 (#4995) 2024-04-02 12:25:32 +02:00
dependabot[bot]
ebd1f30606 Bump ruff from 0.3.4 to 0.3.5 (#4994)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.4 to 0.3.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.3.4...v0.3.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-02 08:38:36 +02:00
dependabot[bot]
c78e077649 Bump gitpython from 3.1.42 to 3.1.43 (#4993)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.42 to 3.1.43.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.42...3.1.43)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-02 08:36:40 +02:00
dependabot[bot]
07619223b0 Bump aiodns from 3.1.1 to 3.2.0 (#4992)
Bumps [aiodns](https://github.com/saghul/aiodns) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/saghul/aiodns/releases)
- [Changelog](https://github.com/saghul/aiodns/blob/master/ChangeLog)
- [Commits](https://github.com/saghul/aiodns/compare/v3.1.1...v3.2.0)

---
updated-dependencies:
- dependency-name: aiodns
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-02 08:36:22 +02:00
dependabot[bot]
25c326ec6c Bump sentry-sdk from 1.43.0 to 1.44.0 (#4990)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-29 08:26:41 +01:00
dependabot[bot]
df167b94c2 Bump codecov/codecov-action from 4.1.0 to 4.1.1 (#4984)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-27 08:33:54 +01:00
dependabot[bot]
3730908881 Bump actions/setup-python from 5.0.0 to 5.1.0 (#4983)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-27 08:00:28 +01:00
dependabot[bot]
975dc1bc11 Bump ruff from 0.3.3 to 0.3.4 (#4975)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 11:33:17 +01:00
dependabot[bot]
31409f0c32 Bump time-machine from 2.14.0 to 2.14.1 (#4981)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-03-25 09:47:47 +01:00
dependabot[bot]
b19273227b Bump pytest-cov from 4.1.0 to 5.0.0 (#4980)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 09:45:36 +01:00
dependabot[bot]
f89179fb03 Bump pre-commit from 3.6.2 to 3.7.0 (#4979) 2024-03-25 09:02:43 +01:00
Mike Degatano
90c971f9f1 Unsupported if wrong image used on virtualization (#4968)
* Unsupported if wrong image used on virtualization

* Add generic-aarch64 as supported image

* Add virtualization field to API

* Change startup to setup in check
2024-03-21 18:08:48 +01:00
Jan Čermák
d685780a4a Fix IncompleteReadError happening sometimes when reading Systemd logs (#4974)
Sometimes an empty line is returned from readuntil when EOF is reached,
which seems to be caused by a race of the EOF check in the loop and
later check in readuntil. With this fix, I am not able to reproduce the
issue anymore.
2024-03-21 15:58:53 +01:00
dependabot[bot]
b6bc8b7b7c Bump sentry-sdk from 1.42.0 to 1.43.0 (#4973)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.42.0...1.43.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-20 22:49:15 +01:00
dependabot[bot]
92daba898f Bump actions/cache from 4.0.1 to 4.0.2 (#4969)
Bumps [actions/cache](https://github.com/actions/cache) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4.0.1...v4.0.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-20 17:16:45 +01:00
Mike Degatano
138843591e Bump cosign to v2.2.3 and builder to 2024.03.5 (#4971)
* Bump cosign to v2.2.3 and builder to 2024.03.4

* Bump builder to 2024.03.5

* Bump other builder action to 2024.03.5
2024-03-20 17:00:12 +01:00
Jan Čermák
0814552b2a Use Journal Export Format for host (advanced) logs (#4963)
* Use Journal Export Format for host (advanced) logs

Add methods for handling Journal Export Format and use it for fetching
of host logs. This is foundation for colored streaming logs for other
endpoints as well.

* Make pylint happier - remove extra pass statement

* Rewrite journal gateway tests to mock ClientResponse's StreamReader

* Handle connection refused error when connecting to journal-gatewayd

* Use SYSTEMD_JOURNAL_GATEWAYD_SOCKET global path also for connection

* Use parsing algorithm suggested by @agners in review

* Fix timestamps in formatting, always use UTC for now

* Add tests for Accept header in host logs

* Apply suggestions from @agners

Co-authored-by: Stefan Agner <stefan@agner.ch>

* Bail out of parsing earlier if field is not in required fields

* Fix parsing issue discovered in the wild and add test case

* Make verbose formatter more tolerant

* Use some bytes' native functions for some minor optimizations

* Move MalformedBinaryEntryError to exceptions module, add test for it

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-03-20 09:00:45 +01:00
Mike Degatano
0e0fadd72d Fix some expected boot slot fields are optional (#4964)
* Fix some expected boot slot fields are optional

* Move stuff around to make pylint happy
2024-03-18 18:30:10 +01:00
dependabot[bot]
5426bd4392 Bump ruff from 0.3.2 to 0.3.3 (#4966)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.2 to 0.3.3.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.3.2...v0.3.3)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 08:29:33 +01:00
James Ross
3520a65099 Restore lost continue statement (#4965)
Commit 140b769a42 separated the `continue` from its block, so this puts it back
2024-03-17 21:16:54 -04:00
Stefan Agner
b15a5c2c87 Add full year and milliseconds to log timestamp (#4954)
This synchronizes log timestamps with how Home Assistant Core formats
them: Using the full 4 digit year and milliseconds precision.

See also https://github.com/home-assistant/core/pull/74518.
2024-03-15 17:50:01 +01:00
Mike Degatano
a8af04ff82 Cache existence of addon paths (#4944)
* Cache existence of addon paths

* Always update submodules

* Switch to an always cached model

* Cache on store addon only

* Fix tests

* refresh_cache to refresh_path_cache

* Fix name change in test

* Move logic into StoreManager
2024-03-15 16:43:26 +01:00
Mike Degatano
2148de45a0 Allow client to change boot slot via API (#4945)
* Allow client to change boot slot via API

* Wrap call to rauc in job that checks for OS

* Reboot after changing the active boot slot

* Add test cases and clean up

* BootName to BootSlot

* Fix test

* Rename boot_name to boot_slot

* Fix tests after field change
2024-03-15 10:36:37 -04:00
dependabot[bot]
c4143dacee Bump coverage from 7.4.3 to 7.4.4 (#4962) 2024-03-15 08:38:29 +01:00
dependabot[bot]
a8025e77b3 Bump setuptools from 69.1.1 to 69.2.0 (#4958)
Bumps [setuptools](https://github.com/pypa/setuptools) from 69.1.1 to 69.2.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v69.1.1...v69.2.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 09:39:45 +01:00
dependabot[bot]
dd1e76be93 Bump docker/login-action from 3.0.0 to 3.1.0 (#4957)
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 09:06:03 +01:00
dependabot[bot]
36f997959a Bump sentry-sdk from 1.41.0 to 1.42.0 (#4959)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.41.0 to 1.42.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.41.0...1.42.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 09:05:38 +01:00
dependabot[bot]
c1faed163a Bump actions/checkout from 4.1.1 to 4.1.2 (#4956)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-13 10:37:12 +01:00
Mike Degatano
9ca927dbe7 Watchdog does not start core before supervisor (#4955) 2024-03-13 09:08:27 +01:00
dependabot[bot]
02c6011818 Bump ruff from 0.3.1 to 0.3.2 (#4951)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.1 to 0.3.2.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.3.1...v0.3.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 10:06:41 +01:00
dependabot[bot]
2e96b16396 Bump pytest from 8.1.0 to 8.1.1 (#4952)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.0 to 8.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.1.0...8.1.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 09:40:54 +01:00
dependabot[bot]
53b8de6c1c Bump sentry-sdk from 1.40.6 to 1.41.0 (#4950)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-08 13:49:50 +01:00
dependabot[bot]
daea9f893c Bump pytest-timeout from 2.2.0 to 2.3.1 (#4949)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-08 11:45:20 +01:00
dependabot[bot]
d1b5b1734c Bump ruff from 0.3.0 to 0.3.1 (#4946)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.3.0...v0.3.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-07 09:13:37 +01:00
Mike Degatano
74a5899626 Remove discovery config validation from supervisor (#4937)
* Remove discovery config validation from supervisor

* Remove invalid test

* Change validation to require a dictionary for compatibility
2024-03-05 16:25:15 +01:00
Mike Degatano
202ebf6d4e Set core timeout from S6_SERVICES_GRACETIME (#4938) 2024-03-04 11:14:51 -05:00
Mike Degatano
2c7b417e25 APIForbidden should result in 403 status (#4943) 2024-03-04 11:09:17 -05:00
Stefan Agner
bb5e138134 Proxy WebSocket close messages as well (#4942)
We can "proxy" WebSocket close messages just as well as any
other WebSocket message. This avoids an error print in the Supervisor
logs whenever any one side of the connection closes.
2024-03-04 10:31:27 -05:00
dependabot[bot]
3a2c3e2f84 Bump pytest from 8.0.2 to 8.1.0 (#4941)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.2 to 8.1.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.0.2...8.1.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 10:56:41 +01:00
dependabot[bot]
d5be0c34ac Bump actions/download-artifact from 4.1.3 to 4.1.4 (#4939)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.3 to 4.1.4.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.1.3...v4.1.4)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 10:56:26 +01:00
dependabot[bot]
ea5431ef2b Bump time-machine from 2.13.0 to 2.14.0 (#4940)
Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.13.0 to 2.14.0.
- [Changelog](https://github.com/adamchainz/time-machine/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/adamchainz/time-machine/compare/2.13.0...2.14.0)

---
updated-dependencies:
- dependency-name: time-machine
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 10:56:12 +01:00
dependabot[bot]
9c4cdcd11f Bump ruff from 0.2.2 to 0.3.0 (#4935)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.2 to 0.3.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.2.2...v0.3.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 09:57:31 +01:00
dependabot[bot]
e5ef6333e4 Bump actions/cache from 4.0.0 to 4.0.1 (#4936)
Bumps [actions/cache](https://github.com/actions/cache) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4.0.0...v4.0.1)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 09:57:05 +01:00
Mike Degatano
98779a48b1 Fix check used for addon auto update (#4933)
* Fix check used for addon auto update

* Move timedelta to other side

Co-authored-by: Stefan Agner <stefan@agner.ch>

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-02-29 11:22:21 -05:00
Mike Degatano
9d4848ee77 Add an admin only device wipe API (#4934)
* Add an admin only device wipe API

* Fix pylint issue
2024-02-29 10:29:52 -05:00
Mike Degatano
5126820619 Allow removing addon config on uninstall (#4913) 2024-02-29 10:24:51 -05:00
Mike Degatano
8b5c808e8c Allow listing of HA users via admin CLI (#4912)
* Allow listing of HA users via admin CLI

* Filter out system generated users and fields
2024-02-28 13:30:37 -05:00
dependabot[bot]
9c75996c40 Bump pytest from 8.0.1 to 8.0.2 (#4931)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.0.1...8.0.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-28 11:16:39 +01:00
dependabot[bot]
d524778e42 Bump sentry-sdk from 1.40.5 to 1.40.6 (#4930)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.40.5 to 1.40.6.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.40.5...1.40.6)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-28 11:16:24 +01:00
dependabot[bot]
52d4bc660e Bump codecov/codecov-action from 4.0.2 to 4.1.0 (#4927)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.0.2 to 4.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4.0.2...v4.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-27 09:59:01 +01:00
dependabot[bot]
8884696a6c Bump actions/download-artifact from 4.1.2 to 4.1.3 (#4926)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.1.2...v4.1.3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-27 09:58:21 +01:00
dependabot[bot]
d493ccde28 Bump pytest from 7.4.4 to 8.0.1 (#4901)
* Bump pytest from 7.4.4 to 8.0.1

Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.4 to 8.0.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.4...8.0.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update pytest-asyncio to 0.23.5

* Set scope to function on fixture

* Unthrottle by patching last call to prevent carryover

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2024-02-27 09:57:44 +01:00
J. Nick Koston
1ececaaaa2 Bump securetar to 2024.2.1 (#4925) 2024-02-26 10:47:47 -10:00
dependabot[bot]
91b48ad432 Bump pylint from 3.0.3 to 3.1.0 (#4921)
Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.0.3 to 3.1.0.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v3.0.3...v3.1.0)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:02:23 -05:00
dependabot[bot]
f3fe40a19f Bump codecov/codecov-action from 4.0.1 to 4.0.2 (#4923)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4.0.1...v4.0.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 10:22:43 -05:00
dependabot[bot]
cf4b29c425 Bump orjson from 3.9.14 to 3.9.15 (#4922)
Bumps [orjson](https://github.com/ijl/orjson) from 3.9.14 to 3.9.15.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.9.14...3.9.15)

---
updated-dependencies:
- dependency-name: orjson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 10:22:17 -05:00
dependabot[bot]
4344e14a9d Bump coverage from 7.4.1 to 7.4.3 (#4920)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.1 to 7.4.3.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.4.1...7.4.3)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 10:18:32 -05:00
dependabot[bot]
df935ec423 Bump typing-extensions from 4.9.0 to 4.10.0 (#4919)
Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.9.0 to 4.10.0.
- [Release notes](https://github.com/python/typing_extensions/releases)
- [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/python/typing_extensions/commits)

---
updated-dependencies:
- dependency-name: typing-extensions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 10:18:02 -05:00
dependabot[bot]
e7f9f7504e Bump setuptools from 69.1.0 to 69.1.1 (#4918)
Bumps [setuptools](https://github.com/pypa/setuptools) from 69.1.0 to 69.1.1.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v69.1.0...v69.1.1)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 10:15:20 -05:00
dependabot[bot]
5721b2353a Bump cryptography from 42.0.3 to 42.0.5 (#4917)
Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.3 to 42.0.5.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.3...42.0.5)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 10:14:50 -05:00
Mike Degatano
c9de846d0e Fix missing apis from addons with manager role (#4908)
* Allow mount control from addons with manager role

* Allow available_updates and refresh_updates too
2024-02-21 11:36:29 -05:00
dependabot[bot]
a598108c26 Bump sentry-sdk from 1.40.4 to 1.40.5 (#4905)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.40.4 to 1.40.5.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.40.4...1.40.5)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-20 09:19:15 +01:00
dependabot[bot]
5467aa399d Bump ruff from 0.2.1 to 0.2.2 (#4904)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.2.1...v0.2.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 10:37:44 +01:00
dependabot[bot]
da052b074a Bump urllib3 from 2.2.0 to 2.2.1 (#4903) 2024-02-19 08:07:18 +01:00
dependabot[bot]
90c035edd0 Bump pre-commit from 3.6.1 to 3.6.2 (#4902) 2024-02-19 07:52:18 +01:00
dependabot[bot]
fc4eb44a24 Bump cryptography from 42.0.2 to 42.0.3 (#4895)
Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.2 to 42.0.3.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.2...42.0.3)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-16 22:10:43 +01:00
Stefan Agner
a71111b378 Fix autoupdate time compare (#4897)
* Fix autoupdate time compare

Make sure both timestamps are UTC, otherwise Python complains with:
TypeError: can't compare offset-naive and offset-aware datetimes

* Use correect attribute

---------

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2024-02-16 15:40:54 +01:00
dependabot[bot]
52e0c7e484 Bump gitpython from 3.1.41 to 3.1.42 (#4894)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-16 15:31:31 +01:00
Stefan Agner
e32970f191 Fix new complaint by ruff 0.2.1 (#4898) 2024-02-16 14:35:31 +01:00
dependabot[bot]
897cc36017 Bump sentry-sdk from 1.40.3 to 1.40.4 (#4891)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.40.3 to 1.40.4.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.40.3...1.40.4)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-14 09:24:58 +01:00
dependabot[bot]
d79c575860 Bump orjson from 3.9.13 to 3.9.14 (#4890)
Bumps [orjson](https://github.com/ijl/orjson) from 3.9.13 to 3.9.14.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.9.13...3.9.14)

---
updated-dependencies:
- dependency-name: orjson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-14 09:24:52 +01:00
J. Nick Koston
1f19f84edd Create backups files without having to copy inner tarballs (#4884)
* Create backups files without having to copy inner tarballs

needs https://github.com/pvizeli/securetar/pull/33

* fix writing json

* fix writing json

* fixes

* fixes

* ensure cleaned up

* need ./

* fix type

* Bump securetar to 2024.2.0

changelog: https://github.com/pvizeli/securetar/compare/2023.12.0...2024.2.0

* backup file is now created sooner

* reorder so comment still makes sense
2024-02-14 09:24:43 +01:00
dependabot[bot]
27c37b8b84 Bump ruff from 0.1.14 to 0.2.1 (#4877)
* Bump ruff from 0.1.14 to 0.2.1

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.1.14 to 0.2.1.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.1.14...v0.2.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2024-02-14 09:11:26 +01:00
J. Nick Koston
06a5dd3153 Bump securetar to 2024.2.0 (#4888) 2024-02-12 19:34:04 +01:00
Mike Degatano
b5bf270d22 Mount status checks look at connection (#4882)
* Mount status checks look at connection

* Fix tests and refactor to fixture

* Fix test
2024-02-12 17:32:54 +01:00
dependabot[bot]
8e71d69a64 Bump setuptools from 69.0.3 to 69.1.0 (#4885) 2024-02-12 08:31:08 +01:00
dependabot[bot]
06edb6f8a8 Bump pre-commit from 3.6.0 to 3.6.1 (#4887) 2024-02-12 08:20:35 +01:00
dependabot[bot]
dca82ec0a1 Bump sentry-sdk from 1.40.2 to 1.40.3 (#4886) 2024-02-12 08:20:00 +01:00
dependabot[bot]
9c82ce4103 Bump debugpy from 1.8.0 to 1.8.1 (#4881)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-09 08:14:07 +01:00
dependabot[bot]
8a23a9eb1b Bump sentry-sdk from 1.40.1 to 1.40.2 (#4880) 2024-02-08 07:25:48 +01:00
dependabot[bot]
e1b7e515df Bump sentry-sdk from 1.40.0 to 1.40.1 (#4879)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 08:19:23 +01:00
dependabot[bot]
c8ff335ed7 Bump awesomeversion from 23.11.0 to 24.2.0 (#4878)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 07:54:04 +01:00
dependabot[bot]
5736da8ab7 Bump actions/download-artifact from 4.1.1 to 4.1.2 (#4876)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.1.1...v4.1.2)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 08:59:19 +01:00
dependabot[bot]
060bba4dce Bump actions/upload-artifact from 4.3.0 to 4.3.1 (#4875)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.3.0...v4.3.1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 08:59:06 +01:00
Mike Degatano
4c573991d2 Improve error handling when mounts fail (#4872) 2024-02-05 16:24:53 -05:00
Mike Degatano
7fd6dce55f Migrate to Ruff for lint and format (#4852)
* Migrate to Ruff for lint and format

* Fix pylint issues

* DBus property sets into normal awaitable methods

* Fix tests relying on separate tasks in connect

* Fixes from feedback
2024-02-05 11:37:39 -05:00
dependabot[bot]
1861d756e9 Bump voluptuous from 0.14.1 to 0.14.2 (#4874)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 08:49:14 +01:00
dependabot[bot]
c36c041f5e Bump orjson from 3.9.12 to 3.9.13 (#4873)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 08:45:23 +01:00
dependabot[bot]
c3d877bdd2 Bump cryptography from 42.0.1 to 42.0.2 (#4860)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 11:11:50 +01:00
dependabot[bot]
1242030d4a Bump codecov/codecov-action from 3.1.6 to 4.0.1 (#4869)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 08:50:53 +01:00
dependabot[bot]
1626e74608 Bump release-drafter/release-drafter from 5.25.0 to 6.0.0 (#4868)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 08:50:38 +01:00
dependabot[bot]
b1b913777f Bump sigstore/cosign-installer from 3.3.0 to 3.4.0 (#4864)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-01 08:53:35 +01:00
Stefan Agner
190894010c Reset failed API call counter on successful API call (#4862)
* Reset failed API call counter on successful API call

Make sure to reset the failed API call counter after a successful
API call. While at it also update the log messages a bit to make it
clearer what the problem is exactly.

* Address pytest changes
2024-01-31 11:41:21 -05:00
Stefan Agner
765265723c Explicitly log when API requests timeout (#4861)
Currently a timeout leads to a log entry which simply states:
"Error on call http://172.30.32.1:8123/api/core/state: ". From this,
it is not immeaditly clear what the problem is. This commit adds
a log entry which explicitly states that the request timed out.
2024-01-31 10:17:24 -05:00
dependabot[bot]
7e20502379 Bump urllib3 from 2.1.0 to 2.2.0 (#4859)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.1.0...2.2.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-31 10:13:34 -05:00
dependabot[bot]
366fc30e9d Bump sentry-sdk from 1.39.2 to 1.40.0 (#4858)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.39.2 to 1.40.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.39.2...1.40.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-31 10:11:11 -05:00
dependabot[bot]
aa91788a69 Bump codecov/codecov-action from 3.1.5 to 3.1.6 (#4857)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-31 08:09:52 +01:00
J. Nick Koston
375789b019 Use orjson encoder for websocket messages (#4854)
I missed that these need to have dumps passed
2024-01-30 09:00:27 -05:00
Mike Degatano
140b769a42 Auto updates to new version delay for 24 hours (#4838) 2024-01-30 08:58:28 -05:00
Mike Degatano
88d718271d Fix serialization issue adding error to job (#4853) 2024-01-30 12:21:02 +01:00
dependabot[bot]
6ed26cdd1f Bump aiohttp from 3.9.2 to 3.9.3 (#4855)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-29 21:36:01 -10:00
J. Nick Koston
d1851fa607 Significantly speed up creating backups with isal via zlib-fast (#4843) 2024-01-29 10:25:43 -10:00
dependabot[bot]
e846157c52 Bump aiohttp from 3.9.1 to 3.9.2 (#4848)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.1 to 3.9.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.9.1...v3.9.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-29 14:35:54 -05:00
dependabot[bot]
e190bb4c1a Bump colorlog from 6.8.0 to 6.8.2 (#4846)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-29 08:53:39 +01:00
dependabot[bot]
137fbe7acd Bump coverage from 7.4.0 to 7.4.1 (#4849) 2024-01-29 08:28:43 +01:00
dependabot[bot]
9ccdb2ae3a Bump cryptography from 41.0.7 to 42.0.1 (#4837)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-28 20:54:01 +01:00
dependabot[bot]
f5f7515744 Bump codecov/codecov-action from 3.1.4 to 3.1.5 (#4840)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-28 20:36:45 +01:00
Mike Degatano
ddadbec7e3 Addon devs can block auto update for breaking versions (#4832) 2024-01-26 08:08:03 +01:00
dependabot[bot]
d24543e103 Bump actions/upload-artifact from 4.2.0 to 4.3.0 (#4835)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-24 08:29:27 +01:00
Mike Degatano
f80c4c9565 Fix bootstrap log typo (#4833) 2024-01-23 17:34:43 -10:00
Mike Degatano
480b383782 Add background option to backup APIs (#4802)
* Add background option to backup APIs

* Fix decorator tests

* Working error handling, initial test cases

* Change to schedule_job and always return job id

* Add tests

* Reorder call at/later args

* Validation errors return immediately in background

* None is invalid option for background

* Must pop the background option from body
2024-01-22 12:09:15 -05:00
dependabot[bot]
d3efd4c24b Bump orjson from 3.9.10 to 3.9.12 (#4825)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-19 08:44:12 +01:00
dependabot[bot]
67a0acffa2 Bump actions/upload-artifact from 4.1.0 to 4.2.0 (#4824) 2024-01-19 07:38:07 +01:00
dependabot[bot]
41b07da399 Bump dbus-fast from 2.21.0 to 2.21.1 (#4822)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-17 08:20:06 +01:00
dependabot[bot]
a6ce55d5b5 Bump actions/cache from 3.3.3 to 4.0.0 (#4821) 2024-01-17 07:24:40 +01:00
Stefan Agner
98c01fe1b3 Fix add-on rebuild with ingress (#4819) 2024-01-15 07:53:25 -10:00
dependabot[bot]
51df986222 Bump actions/upload-artifact from 4.0.0 to 4.1.0 (#4818)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-15 09:15:27 +01:00
J. Nick Koston
9c625f93a5 Fix dirhash failing to import pkg_resources (#4817) 2024-01-14 11:20:35 +01:00
dependabot[bot]
7101d47e2e Bump getsentry/action-release from 1.6.0 to 1.7.0 (#4805)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-14 11:13:21 +01:00
J. Nick Koston
eb85be2770 Improve json performance by porting core orjson utils (#4816)
* Improve json performance by porting core orjson utils

* port relevant tests

* pylint

* add test for read_json_file

* add test for read_json_file

* remove workaround for core issue we do not have here

---------

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2024-01-13 19:19:01 +01:00
Mike Degatano
2da27937a5 Update python to 3.12 (#4815)
* Update python to 3.12

* Fix tests and deprecations

* Fix other references to 3.11

* build.json doesn't exist
2024-01-13 16:35:07 +01:00
dependabot[bot]
2a29b801a4 Bump jinja2 from 3.1.2 to 3.1.3 (#4810)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-12 09:52:44 +01:00
dependabot[bot]
57e65714b0 Bump actions/download-artifact from 4.1.0 to 4.1.1 (#4809)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-12 09:35:09 +01:00
dependabot[bot]
0ae40cb51c Bump gitpython from 3.1.40 to 3.1.41 (#4808)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-12 09:31:31 +01:00
dependabot[bot]
ddd195dfc6 Bump sentry-sdk from 1.39.1 to 1.39.2 (#4811)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-12 09:29:34 +01:00
dependabot[bot]
54b9f23ec5 Bump actions/cache from 3.3.2 to 3.3.3 (#4813)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-12 09:25:51 +01:00
dependabot[bot]
242dd3e626 Bump home-assistant/wheels from 2023.10.5 to 2024.01.0 (#4804) 2024-01-08 08:16:11 +01:00
dependabot[bot]
1b8acb5b60 Bump home-assistant/builder from 2023.12.0 to 2024.01.0 (#4800)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-05 08:19:40 +01:00
dependabot[bot]
a7ab96ab12 Bump flake8 from 6.1.0 to 7.0.0 (#4799)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-05 08:18:05 +01:00
dependabot[bot]
06ab11cf87 Bump attrs from 23.1.0 to 23.2.0 (#4793)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 16:57:05 +01:00
dependabot[bot]
1410a1b06e Bump pytest from 7.4.3 to 7.4.4 (#4792) 2024-01-01 14:55:37 +01:00
Mike Degatano
5baf19f7a3 Migrate to pyproject.toml where possible (#4770)
* Migrate to pyproject.toml where possible

* Share requirements and fix version import

* Fix issues with timezone in tests
2023-12-29 11:46:01 +01:00
Mike Degatano
6c66a7ba17 Improve error handling in backup restore (#4791) 2023-12-29 11:45:50 +01:00
dependabot[bot]
37b6e09475 Bump coverage from 7.3.4 to 7.4.0 (#4790)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.3.4 to 7.4.0.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.3.4...7.4.0)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-28 09:22:22 +01:00
Jeff Oakley
e08c8ca26d Add support for setting target path in map config (#4694)
* Added support for setting addon target path in map config

* Updated addon target path mapping to use dataclass

* Added check before adding string folder maps

* Moved enum to addon/const, updated map_volumes logic, fixed test

* Removed log used for debugging

* Use more readable approach to determine addon_config_used

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Use cleaner approach for checking volume config

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Use dict syntax and ATTR_TYPE

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Use coerce for validating mapping type

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Default read_only to true in schema

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Use ATTR_TYPE and ATTR_READ_ONLY instead of static strings

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Use constants instead of in-line strings

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Correct type for path

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Added read_only and path constants

* Fixed small syntax error and added includes for constants

* Simplify logic for handling string and dict entries in map config

* Use ATTR_PATH instead of inline string

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* Add missing ATTR_PATH reference

* Moved FolderMapping dataclass to data.py

* Fix edge case where "data" map type is used but optional path is not set

* Move FolderMapping dataclass to configuration.py to prevent circular reference

---------

Co-authored-by: Jeff Oakley <jeff.oakley@LearningCircleSoftware.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2023-12-27 15:14:23 -05:00
dependabot[bot]
2c09e7929f Bump black from 23.12.0 to 23.12.1 (#4788) 2023-12-26 08:30:35 +01:00
Stefan Agner
3e760f0d85 Always pass explicit architecture of installed add-ons (#4786)
* Pass architecture of installed add-on on update

When using multi-architecture container images, the architecture of the
add-on is not passed to Docker in all cases. This causes the
architecture of the Supervisor container to be used, which potentially
is not supported by the add-on in question.

This commit passes the architecture of the add-on to Docker, so that
the correct image is pulled.

* Call update with architecture

* Also pass architecture on add-on restore

* Fix pytest
2023-12-21 16:52:25 -05:00
Mike Degatano
3cc6bd19ad Mark system as unhealthy on OSError Bad message errors (#4750)
* Bad message error marks system as unhealthy

* Finish adding test cases for changes

* Rename test file for uniqueness

* bad_message to oserror_bad_message

* Omit some checks and check for network mounts
2023-12-21 18:05:29 +01:00
Mike Degatano
b7ddfba71d Set max reanimation attempts on HA watchdog (#4784) 2023-12-21 16:44:39 +01:00
dependabot[bot]
32f21d208f Bump coverage from 7.3.3 to 7.3.4 (#4785)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.3.3 to 7.3.4.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.3.3...7.3.4)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-21 09:01:49 +01:00
Jan Čermák
ed7edd9fe0 Adjust "retry in ..." log messages to avoid confusion (#4783)
As shown in home-assistant/operating-system#3007, error messages printed
to logs when container installation fails can cause some confusion,
because they are sometimes printed to the log on the landing page.
Adjust all wordings of "retry in" to "retrying in" to make it obvious
this happens automatically.
2023-12-20 18:34:42 +01:00
Stefan Agner
fd3c995c7c Fix WiFi WEP configuration (#4781)
It seems that the values for auth-alg and key-mgmt got mixed up.
Trying to safe a WEP configuration currently leads to the error:
23-12-19 10:56:37 ERROR (MainThread) [supervisor.host.network] Can't create config and activate wlan0: 802-11-wireless-security.key-mgmt: 'open' is not a valid value for the property
2023-12-19 13:53:51 +01:00
dependabot[bot]
c0d1a2d53b Bump actions/download-artifact from 4.0.0 to 4.1.0 (#4780)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-19 08:59:43 +01:00
dependabot[bot]
76bc3015a7 Bump deepmerge from 1.1.0 to 1.1.1 (#4779)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-19 08:45:48 +01:00
dependabot[bot]
ad2896243b Bump sentry-sdk from 1.39.0 to 1.39.1 (#4774)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-18 15:45:05 +01:00
dependabot[bot]
d0dcded42d Bump actions/download-artifact from 3 to 4 (#4777)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-12-15 08:27:10 +01:00
dependabot[bot]
a0dfa01287 Bump actions/upload-artifact from 3.1.3 to 4.0.0 (#4776)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-15 08:12:31 +01:00
dependabot[bot]
4ec5c90180 Bump coverage from 7.3.2 to 7.3.3 (#4775) 2023-12-15 07:25:10 +01:00
dependabot[bot]
a0c813bfc1 Bump securetar from 2023.3.0 to 2023.12.0 (#4771)
Bumps [securetar](https://github.com/pvizeli/securetar) from 2023.3.0 to 2023.12.0.
- [Release notes](https://github.com/pvizeli/securetar/releases)
- [Commits](https://github.com/pvizeli/securetar/compare/2023.3.0...2023.12.0)

---
updated-dependencies:
- dependency-name: securetar
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 10:05:08 -05:00
dependabot[bot]
5f7b3a7087 Bump sentry-sdk from 1.38.0 to 1.39.0 (#4766)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-13 08:17:19 +01:00
dependabot[bot]
6426f02a2c Bump black from 23.11.0 to 23.12.0 (#4767)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-13 08:17:01 +01:00
Stefan Agner
7fef92c480 Fix fallback to non-SSL whoami call (#4751)
* Fix fallback to non-SSL whoami call

In case of an exception "data" is not set leading to an error:
cannot access local variable 'data' where it is not associated with a value

Make sure to fallback to the non-SSL whoami call properly.

* Add pytests

* Ignore protected access in pytests

* Add test when system time is behind by more than 3 days

* Fix test_adjust_system_datetime_if_time_behind test and cleanup
2023-12-12 15:24:46 -05:00
Mike Degatano
c64744dedf Refactor addons init to addons manager (#4760)
Co-authored-by: Stefan Agner <stefan@agner.ch>
2023-12-12 09:36:05 +01:00
dependabot[bot]
72a2088931 Bump dbus-fast from 2.20.0 to 2.21.0 (#4761)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.20.0 to 2.21.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.20.0...v2.21.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 08:46:05 +01:00
dependabot[bot]
db54556b0f Bump docker from 6.1.3 to 7.0.0 (#4756)
Bumps [docker](https://github.com/docker/docker-py) from 6.1.3 to 7.0.0.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/6.1.3...7.0.0)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 08:45:57 +01:00
dependabot[bot]
a2653d8462 Bump sigstore/cosign-installer from 3.2.0 to 3.3.0 (#4764)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 08:18:58 +01:00
dependabot[bot]
ef778238f6 Bump home-assistant/builder from 2023.09.0 to 2023.12.0 (#4763)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 08:18:19 +01:00
dependabot[bot]
4cc0ddc35d Bump pylint from 3.0.2 to 3.0.3 (#4762) 2023-12-12 07:31:55 +01:00
Stefan Agner
a0429179a0 Add Raspberry Pi 5 (#4757) 2023-12-11 11:14:04 +01:00
dependabot[bot]
5cfb45c668 Bump pre-commit from 3.5.0 to 3.6.0 (#4754) 2023-12-11 08:05:17 +01:00
dependabot[bot]
a53b7041f5 Bump typing-extensions from 4.8.0 to 4.9.0 (#4755) 2023-12-11 07:50:37 +01:00
dependabot[bot]
f534fae293 Bump actions/stale from 8.0.0 to 9.0.0 (#4752)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-08 08:50:38 +01:00
dependabot[bot]
f7cbd968d2 Bump getsentry/action-release from 1.4.1 to 1.6.0 (#4747)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-07 09:23:08 +01:00
dependabot[bot]
844d76290c Bump actions/setup-python from 4.8.0 to 5.0.0 (#4748) 2023-12-07 08:09:32 +01:00
Stefan Agner
8c8122eee0 Fix pre-commit GitHub Action cache (#4746)
Currently pre-commit caching seems not to work properly: There is
no cache stored according to GitHub Action tab, and the Prepare
Python dependencies job shows the following warning:
Warning: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.

This seems to be similar to what have been observed and solved in
Home Assistant Core with https://github.com/home-assistant/core/pull/46696.
Use PRE_COMMIT_CACHE instead of PRE_COMMIT_HOME as well.
2023-12-06 11:30:57 +01:00
Stefan Agner
d63f0d5e0b Address GitHub action deprecation warnings (#4745)
* Remove deprecated set-output from GitHub actions

* Replace get-changed-files GitHub action

The GitHub action jitterbit/get-changed-files@v1 seems abandoned.
Use masesgroup/retrieve-changed-files@v3.0.0 which can be used as
a drop in replacement.
2023-12-06 10:47:08 +01:00
Stefan Agner
96f4ba5d25 Check/get ingress port on add-on load (#4744)
Instead of setting the ingress port on install, make sure to set
the port when the add-on gets loaded (on Supervisor startup and
before installation). This is necessary since the dynamic ingress
ports are not stored as part of the add-on data storage themself
but in the ingress data store. So on every Supervisor start the
port needs to be transferred to the add-on model.

Note that we still need to check the port on add-on update since
the add-on potentially added (dynamic) ingress on update. Same
applies to add-on restore (the restored version might use a dynamic
ingress port).
2023-12-06 10:46:47 +01:00
dependabot[bot]
72e64676da Bump actions/setup-python from 4.7.1 to 4.8.0 (#4743) 2023-12-06 07:23:17 +01:00
Stefan Agner
883e54f989 Make check_port an async function (#4677)
* Make check_port asyncio

This requires to change the ingress_port property to a async method.

* Avoid using wait_for

* Add missing async

* Really await

* Set dynamic ingress port on add-on installation/update

* Fix pytest issue

* Rename async_check_port back to check_port

* Raise RuntimeError in case port is not set

* Make sure port gets set on add-on restore

* Drop unnecessary async

* Simplify check_port by using asyncio.get_running_loop()
2023-12-05 15:49:35 -05:00
dependabot[bot]
c2d4be3304 Bump dbus-fast from 2.15.0 to 2.20.0 (#4741)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.15.0 to 2.20.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.15.0...v2.20.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-04 14:41:18 +01:00
dependabot[bot]
de737ddb91 Bump colorlog from 6.7.0 to 6.8.0 (#4739)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-04 08:54:58 +01:00
Stefan Agner
11ec6dd9ac Wait until mount unit is deactivated on unmount (#4733)
* Wait until mount unit is deactivated on unmount

The current code does not wait until the (bind) mount unit has been
actually deactivated (state "inactive"). This is especially problematic
when restoring a backup, where we deactivate all bind mounts before
restoring the target folder. Before the tarball is actually restored,
we delete all contents of the target folder. This lead to the situation
where the "rm -rf" command got executed before the bind mount actually
got unmounted.

The current code polls the state using an exponentially increasing
delay. Wait up to 30s for the bind mount to actually deactivate.

* Fix function name

* Fix missing await

* Address pytest errors

Change state of systemd unit according to use cases. Note that this
is currently rather fragile, and ideally we should have a smarter
mock service instead.

* Fix pylint

* Fix remaining

* Check transition fo failed as well

* Used alternative mocking mechanism

* Remove state lists in test_manager

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-12-01 00:35:15 +01:00
dependabot[bot]
df7541e397 Bump sentry-sdk from 1.37.1 to 1.38.0 (#4737) 2023-11-30 07:36:12 +01:00
Erik Montnemery
95ac53d780 Bump core shutdown timeout for new pre-stopping core state (#4736)
* Bump core shutdown timeout

* Clarify comment

* Update tests
2023-11-28 15:03:25 -05:00
dependabot[bot]
e8c4b32a65 Bump cryptography from 41.0.5 to 41.0.7 (#4734)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-28 20:51:17 +01:00
dependabot[bot]
eca535c978 Bump aiohttp-fast-url-dispatcher from 0.1.1 to 0.3.0 (#4735)
Bumps [aiohttp-fast-url-dispatcher](https://github.com/bdraco/aiohttp-fast-url-dispatcher) from 0.1.1 to 0.3.0.
- [Release notes](https://github.com/bdraco/aiohttp-fast-url-dispatcher/releases)
- [Changelog](https://github.com/bdraco/aiohttp-fast-url-dispatcher/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bdraco/aiohttp-fast-url-dispatcher/compare/v0.1.1...v0.3.0)

---
updated-dependencies:
- dependency-name: aiohttp-fast-url-dispatcher
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-28 11:54:35 +01:00
Stefan Agner
9088810b49 Improve D-Bus error handling for NetworkManager (#4720)
* Improve D-Bus error handling for NetworkManager

There are quite some errors captured which are related by seemingly a
suddenly missing NetworkManager. Errors appear as:
23-11-21 17:42:50 ERROR (MainThread) [supervisor.dbus.network] Error while processing /org/freedesktop/NetworkManager/Devices/10: Remote peer disconnected
...
23-11-21 17:42:50 ERROR (MainThread) [supervisor.dbus.network] Error while processing /org/freedesktop/NetworkManager/Devices/35: The name is not activatable

Both errors seem to already happen at introspection time, however
the current code doesn't converts these errors to Supervisor issues.
This PR uses the already existing `DBus.from_dbus_error()`.

Furthermore this adds a new Exception `DBusNoReplyError` for the
`ErrorType.NO_REPLY` (or `org.freedesktop.DBus.Error.NoReply` in
D-Bus terms, which is the type of the first of the two issues above).

And finally it separates the `ErrorType.SERVICE_UNKNOWN` (or
`org.freedesktop.DBus.Error.ServiceUnknown` in D-Bus terms, which is
the second of the above issue) from `DBusInterfaceError` into a new
`DBusServiceUnkownError`.

This allows to handle errors more specifically.

To avoid too much churn, all instances where `DBusInterfaceError`
got handled, we are now also handling `DBusServiceUnkownError`.

The `DBusNoReplyError` and `DBusServiceUnkownError` appear when
the NetworkManager service stops or crashes. Instead of retrying
every interface we know, just give up if one of these issues appear.
This should significantly lower error messages users are seeing
and Sentry events.

* Remove unnecessary statement

* Fix pytests

* Make sure error strings are compared correctly

* Fix typo/remove unnecessary pylint exception

* Fix DBusError typing

* Add pytest for from_dbus_error

* Revert "Make sure error strings are compared correctly"

This reverts commit 10dc2e4c3887532921414b4291fe3987186db408.

* Add test cases

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-11-27 23:32:11 +01:00
dependabot[bot]
172a7053ed Bump dbus-fast from 2.14.0 to 2.15.0 (#4724)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-27 17:58:53 +01:00
Stefan Agner
3d5bd2adef Use find to delete files recursively (#4732)
* Use find to delete files recursively

Instead of using rm -rf use find to delete files recursively. This
has the added benefit that we do not need to rely on shell expansion.

In particular, shell expansion caused the --one-file-system flag to
not work as intended: The idea was that the content of a (left-over)
bind mounted directory would not get deleted. However, since shell
expansion passed the directory to rm, rm happily deleted also files in
that bind mounted directory.

* Pass arguments correctly

* Fix argument order and stderr output

* Improve error handling

Log with exception level if there is an OS level error. Decode the
stderr output correctly.

* Remove unnecessary newline
2023-11-27 11:36:30 -05:00
J. Nick Koston
cb03d039f4 Bump aiohttp to 3.9.1 (#4729)
* Revert "Revert "Bump aiohttp to 3.9.0 (#4714)" (#4722)"

This reverts commit c0868d9dac.

* Bump aiohttp to 3.9.1

changelog: https://github.com/aio-libs/aiohttp/compare/v3.8.6...v3.9.1

The issues that caused us to revert 3.9.0 have been fixed
2023-11-27 13:44:54 +01:00
dependabot[bot]
bb31b1bc6e Bump sentry-sdk from 1.36.0 to 1.37.1 (#4730) 2023-11-27 07:42:31 +01:00
dependabot[bot]
727532858e Bump dessant/lock-threads from 5.0.0 to 5.0.1 (#4723) 2023-11-23 08:21:15 +01:00
J. Nick Koston
c0868d9dac Revert "Bump aiohttp to 3.9.0 (#4714)" (#4722)
This reverts commit f8f51740c1.
2023-11-22 14:27:00 +01:00
dependabot[bot]
ce26e1dac6 Bump sentry-sdk from 1.35.0 to 1.36.0 (#4721)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-22 10:15:02 +01:00
Mike Degatano
c74f87ca12 Fix ingress session cleanup (#4719) 2023-11-21 11:56:01 -05:00
dependabot[bot]
043111b91c Bump urllib3 from 2.0.7 to 2.1.0 (#4707)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.0.7 to 2.1.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.0.7...2.1.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-21 10:59:43 -05:00
J. Nick Koston
5c579e557c Port core async safe logging to supervisor (#4716)
fixes #4715
2023-11-20 20:33:36 +01:00
J. Nick Koston
f8f51740c1 Bump aiohttp to 3.9.0 (#4714)
* Bump aiohttp to 3.9.0

changelog: https://github.com/aio-libs/aiohttp/compare/v3.8.6...v3.9.0

* DeprecationWarning: shutdown_timeout should be set on BaseRunner
2023-11-20 20:31:16 +01:00
dependabot[bot]
176b63df52 Bump voluptuous from 0.14.0 to 0.14.1 (#4717)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-20 08:38:29 +01:00
dependabot[bot]
e1979357a5 Bump aiohttp-fast-url-dispatcher from 0.1.0 to 0.1.1 (#4713)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-17 12:59:54 +01:00
Paulus Schoutsen
030527a4f2 Use aiohttp-fast-url-dispatcher to avoid linear searching to route urls (#4705)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-11-16 16:52:31 -05:00
J. Nick Koston
cca74da1f3 Ensure empty body responses never generate an invalid chunked response (#4710) 2023-11-15 11:44:36 +01:00
Stefan Agner
928aff342f Address pytest warnings (#4695) 2023-11-15 10:45:36 +01:00
dependabot[bot]
60a97235df Bump sentry-sdk from 1.34.0 to 1.35.0 (#4708)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-14 17:11:07 +01:00
dependabot[bot]
c77779cf9d Bump dessant/lock-threads from 4.0.1 to 5.0.0 (#4706)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-14 17:08:55 +01:00
Stefan Agner
9351796ba8 Avoid empty newlines in Supervisor logs (#4698) 2023-11-13 20:12:17 +01:00
Franck Nijhof
bef0f023d4 Revert "Revert Home Assistant configuration to /config" (#4702) 2023-11-13 20:11:04 +01:00
dependabot[bot]
3116f183f5 Bump voluptuous from 0.13.1 to 0.14.0 (#4701)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 10:29:25 +01:00
Stefan Agner
16b71a22d1 Revert Home Assistant configuration to /config (#4697)
* Revert Home Assistant configuration to `/config`

With the new add-on config feature the intention is to provide a good
location for add-on specific configurations. Currently, add-ons such
as Node RED or ESPHome use the Home Assistant config directory because
this location is accessible to the user (via Samba VSCode add-on etc.).

To make it clear to add-on developer that the new intention is to use
add-on specific config, the implementation now bind mounts the add-on
configuration directory to `/config`. And since some add-ons still need
access to the Home Assistant configuration, its config folder is mounted
to `/homeassistant` under the new scheme.

However, users do know the path `/config`, and edit things e.g. through
the SSH or VS Code add-on. Also `/config` is still the
directory from inside the Core container.

For SSH/VS Code add-on we could work around using a symlink, but that
only works as long as these add-ons don't have a add-on config
themselfs.

This all has very high confusion potential, for not much gain. The
renaming is mainly "developer friendly", but not really user friendly.

Let's minimize potential confusion, and keep things where they are.
The Home Assistant config directory stays at `/config, in all cases,
everwhere.

Map the new add-on configuration directory to `/addon_config`.

* Adjust tests/comments
2023-11-11 13:41:56 +01:00
Stefan Agner
5f4581042c Don't remove add-on conifg on add-on removal (#4696) 2023-11-11 13:23:35 +01:00
dependabot[bot]
6976a4cf2e Bump dbus-fast from 2.12.0 to 2.14.0 (#4688)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.12.0 to 2.14.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.12.0...v2.14.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-11 12:02:55 +01:00
J. Nick Koston
68d86b3b7b Small speed up to arch is_supported (#4674)
* Small speed up to arch is_supported

* update tests

* mocking

* mocking
2023-11-11 11:58:16 +01:00
Stefan Agner
d7d34d36c8 Create add-on config folder on add-on start (#4690) 2023-11-10 19:55:48 +01:00
Stefan Agner
68da328cc5 Warn users only when old config is actually used (#4691) 2023-11-10 19:37:02 +01:00
J. Nick Koston
78870186d7 Use content-type fast path for common case (#4685)
This is a port of https://github.com/home-assistant/core/pull/103477
from core
2023-11-10 14:31:01 +01:00
Stefan Agner
d634273b48 Add log entries of level INFO to Sentry breadcrumbs (#4676) 2023-11-08 12:59:19 +01:00
dependabot[bot]
2d970eee02 Bump cryptography from 41.0.4 to 41.0.5 (#4649)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-08 10:26:17 +01:00
dependabot[bot]
1f0ea3c6f7 Bump awesomeversion from 23.8.0 to 23.11.0 (#4680)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-08 10:12:03 +01:00
dependabot[bot]
d736913f7f Bump black from 23.10.1 to 23.11.0 (#4682)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-08 10:11:43 +01:00
dependabot[bot]
3e95a9d282 Bump sigstore/cosign-installer from 3.1.2 to 3.2.0 (#4679)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.1.2 to 3.2.0.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/v3.1.2...v3.2.0)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-08 09:37:55 +01:00
J. Nick Koston
7cd7259992 Cache common version checks (#4673)
* Cache common version checks

We check core version quite frequently in the code, and its a bit expensive to do
all the comparsions everywhere. Since its mostly the same check happening over and
over we can cache it

* Cache common version checks

We check core version quite frequently in the code, and its a bit expensive to do
all the comparsions everywhere. Since its mostly the same check happening over and
over we can cache it

* fix import
2023-11-07 16:14:09 -05:00
Mike Degatano
87385cf28e Fix saving ingress data on supervisor shutdown (#4672)
* Fix saving ingress data on supervisor shutdown

* Fix ci issues
2023-11-07 13:07:16 -05:00
dependabot[bot]
3a00c94325 Bump dbus-fast from 2.11.1 to 2.12.0 (#4641)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.11.1 to 2.12.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.11.1...v2.12.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 10:57:52 -05:00
Stefan Agner
38d5d2307f Bump tooling to target Python version 3.11 (#4666) 2023-11-03 12:02:55 +01:00
Stefan Agner
a0c12e7228 Update devcontainer.json to use the new format (#4665) 2023-11-03 12:01:48 +01:00
dependabot[bot]
b6625ad909 Bump sentry-sdk from 1.33.1 to 1.34.0 (#4667)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-03 12:01:05 +01:00
Stefan Agner
6f01341055 Fix Home Assistant Core API check (#4663)
* Fix Home Assistant Core API check

* Remove check_api_state mock to improve test coverage
2023-11-02 13:21:54 +01:00
Stefan Agner
6762a4153a Revert "Revert "Update base images to 3.11-alpine3.18 (#4639)" (#4646)" (#4657)
This reverts commit 7c576da32c.

With the AppArmor profile updated Supervisor on Alpine 3.18 should work
fine now.
2023-11-02 11:29:15 +01:00
Mike Degatano
31200df89f Addon methods interfacing with docker are job groups (#4659)
* Addon methods interfacing with docker are job groups

* Add test for install
2023-11-02 11:28:48 +01:00
dependabot[bot]
18e422ca77 Bump sentry-sdk from 1.32.0 to 1.33.1 (#4660)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.32.0 to 1.33.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.32.0...1.33.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 16:02:58 -04:00
dependabot[bot]
1b362716e3 Bump ciso8601 from 2.3.0 to 2.3.1 (#4656)
Bumps [ciso8601](https://github.com/closeio/ciso8601) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/closeio/ciso8601/releases)
- [Changelog](https://github.com/closeio/ciso8601/blob/master/CHANGELOG.md)
- [Commits](https://github.com/closeio/ciso8601/compare/v2.3.0...v2.3.1)

---
updated-dependencies:
- dependency-name: ciso8601
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 16:02:24 -04:00
Stefan Agner
1e49129197 Use longer timeouts for API checks before trigger a rollback (#4658)
* Don't check if Core is running to trigger rollback

Currently we check for Core API access and that the state is running. If
this is not fulfilled within 5 minutes, we rollback to the previous
version.

It can take quite a while until Home Assistant Core is in state running.
In fact, after going through bootstrap, it can theoretically take
indefinitely (as in there is no timeout from Core side).

So to trigger rollback, rather than check the state to be running, just
check if the API is accessible in this case. This prevents spurious
rollbacks.

* Check Core status with and timeout after a longer time

Instead of checking the Core API just for response, do check the
state. Use a timeout which is long enough to cover all stages and
other timeouts during Core startup.

* Introduce get_api_state and better status messages

* Update supervisor/homeassistant/api.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Add successful start test

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2023-11-01 16:01:38 -04:00
Mike Degatano
a8f818fca5 Don't remove folder itself on restore (#4654)
* Don't remove folder itself on restore

* Allow dirs exist on copytree
2023-10-30 08:42:23 +01:00
Mike Degatano
0f600da096 Add a public config folder per addon (#4650)
* Add a public config folder per addon

* Finish addon_configs map option

* Rename map values and add addon_config
2023-10-27 15:43:57 +02:00
Mike Degatano
b04efe4eac Remove folder only deletes from current filesystem (#4653) 2023-10-26 16:55:42 -04:00
Joakim Plate
7361d39231 Catch unicode decode errors (#4651)
Yaml loader did not catch unicode decode errors as json loader did.

Related to: https://github.com/home-assistant/core/issues/102818
2023-10-26 09:27:05 +02:00
dependabot[bot]
059c0df16c Bump pytest from 7.4.2 to 7.4.3 (#4648)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-25 11:51:06 +02:00
dependabot[bot]
6f6b849335 Bump black from 23.10.0 to 23.10.1 (#4647)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-24 08:43:00 +02:00
Stefan Agner
a390500309 Reload Pulseaudio modules on hardware change (#4638)
* Reload Pulseaudio modules on hardware change

In the past the audio plug-in restarted Pulseaudio on hardware change.
This broke with the s6 updates. However, it also turns out that this is
quite racy: The Supervisor reloads audio data much too quickly, when
Supervisor isn't restarted yet.

Instead, let's reload the relevant modules from Supervisor itself.

This works well with a USB microphone on Home Assistant Green.

Related change: https://github.com/home-assistant/plugin-audio/pull/153

* Fix linter issue
2023-10-23 15:57:57 -04:00
Stefan Agner
7c576da32c Revert "Update base images to 3.11-alpine3.18 (#4639)" (#4646)
This reverts commit b1010c3c61.

It seems that the git version deployed with the latest Alpine doesn't
play nice with Supervisor. Specifically it leads to "fatal: cannot exec
'remote-https': Permission denied" errors.
2023-10-23 15:48:50 -04:00
dependabot[bot]
6d021c1659 Bump pylint from 3.0.1 to 3.0.2 (#4645)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 08:59:44 +02:00
Mike Degatano
37c1c89d44 Remove race with watchdog during backup, restore and update (#4635)
* Remove race with watchdog during backup, restore and update

* Fix pylint issues and test

* Stop after image pull during update

* Add test for max failed attempts for plugin watchdog
2023-10-19 22:01:56 -04:00
Mike Degatano
010043f116 Don't warn for removing unstarted jobs (#4632) 2023-10-19 17:35:16 +02:00
Franck Nijhof
b1010c3c61 Update base images to 3.11-alpine3.18 (#4639)
* Update base images to 3.11-alpine3.18

* Adjust hadolint
2023-10-19 10:53:58 +02:00
dependabot[bot]
7f0204bfc3 Bump gitpython from 3.1.38 to 3.1.40 (#4642)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-19 08:54:58 +02:00
dependabot[bot]
a508cc5efd Bump home-assistant/wheels from 2023.10.4 to 2023.10.5 (#4640)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-19 08:46:18 +02:00
dependabot[bot]
65c90696d5 Bump urllib3 from 2.0.6 to 2.0.7 (#4634)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-18 14:34:40 +02:00
dependabot[bot]
b9f47898d6 Bump actions/checkout from 4.1.0 to 4.1.1 (#4636)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-18 12:30:48 +02:00
dependabot[bot]
26f554e46a Bump black from 23.9.1 to 23.10.0 (#4637)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-18 12:30:24 +02:00
Mike Degatano
b57889c84f Use UUID for setting parent interface in vlans (#4633)
* Use UUID for setting parent interface in vlans

* Fix vlan test using interface name
2023-10-17 16:38:27 -04:00
Mike Degatano
77fd1b4017 Capture exception if image is missing on run (#4621)
* Retry run if image missing and handle fixup

* Fix lint and run error test

* Remove retry and just capture exception
2023-10-17 13:55:12 +02:00
dependabot[bot]
ab6745bc99 Bump gitpython from 3.1.37 to 3.1.38 (#4630)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.37 to 3.1.38.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.37...3.1.38)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 13:54:59 +02:00
dependabot[bot]
a5ea3cae72 Bump aiodns from 3.1.0 to 3.1.1 (#4629)
Bumps [aiodns](https://github.com/saghul/aiodns) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/saghul/aiodns/releases)
- [Changelog](https://github.com/saghul/aiodns/blob/master/ChangeLog)
- [Commits](https://github.com/saghul/aiodns/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: aiodns
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 13:54:23 +02:00
dependabot[bot]
8bcd1b4efd Bump release-drafter/release-drafter from 5.24.0 to 5.25.0 (#4631)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 12:26:37 +02:00
Mike Degatano
a24657e565 Handle get users API returning None (#4628)
* Handle get users API returning None

* Skip throttle during test
2023-10-16 21:54:50 +02:00
dependabot[bot]
b7721420fa Bump pre-commit from 3.4.0 to 3.5.0 (#4627)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-16 09:25:35 +02:00
Erwin Douna
6c564fe4fd Fixing multiple typos (#4626) 2023-10-15 22:27:51 +02:00
Mike Degatano
012bfd7e6c Support proxy of binary messages from addons to HA (#4605)
* Support proxy of binary messages from addons to HA

* Added tests for proxy

* Move instantiation into init

* Mock close method on server

* Add invalid auth test and remove auth mock
2023-10-14 18:07:49 +02:00
dependabot[bot]
a70f81aa01 Bump sentry-sdk from 1.31.0 to 1.32.0 (#4623)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-12 09:12:23 +02:00
Mike Degatano
1376a38de5 Eliminate possible addon data race condition during update (#4619)
* Eliminate possible addon data race condition during update

* Fix pylint error

* Use Self type instead of quotes
2023-10-11 12:22:04 -04:00
Mike Degatano
1827ecda65 Call save data after removing mount in fixup (#4620) 2023-10-11 18:18:30 +02:00
Mike Degatano
994c981228 Allow home assistant backups to exclude database (#4591)
* Allow home assistant backups to exclude database

* Tweak

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>

---------

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2023-10-11 08:52:19 +02:00
dependabot[bot]
5bbfbf44ae Bump aiodns from 3.0.0 to 3.1.0 (#4613)
Bumps [aiodns](https://github.com/saghul/aiodns) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/saghul/aiodns/releases)
- [Changelog](https://github.com/saghul/aiodns/blob/master/ChangeLog)
- [Commits](https://github.com/saghul/aiodns/compare/aiodns-3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: aiodns
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 12:11:09 +02:00
Mike Degatano
ace58ba735 Unstarted jobs should always be cleaned up (#4604) 2023-10-09 11:57:04 +02:00
dependabot[bot]
f9840306a0 Bump pyupgrade from 3.14.0 to 3.15.0 (#4614)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-10-09 08:59:37 +02:00
dependabot[bot]
322b3bbb4e Bump pytest-timeout from 2.1.0 to 2.2.0 (#4615)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 08:33:55 +02:00
dependabot[bot]
501318f468 Bump aiohttp from 3.8.5 to 3.8.6 (#4612)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 08:31:23 +02:00
dependabot[bot]
0234f38b23 Bump home-assistant/wheels from 2023.10.1 to 2023.10.4 (#4616)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 08:30:43 +02:00
dependabot[bot]
8743e0072f Bump pylint from 3.0.0 to 3.0.1 (#4608)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-06 09:05:12 +02:00
dependabot[bot]
a79e06afa7 Bump dbus-fast from 2.10.0 to 2.11.1 (#4603)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.10.0 to 2.11.1.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.10.0...v2.11.1)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-05 15:50:34 -04:00
Mike Degatano
682b8e0535 Core API check during startup can timeout (#4595)
* Core API check during startup can timeout

* Use a more specific exception so caller can differentiate
2023-10-04 18:54:42 +02:00
Mike Degatano
d70aa5f9a9 JobGroups check active job to determine if in progress (#4602) 2023-10-04 18:53:10 +02:00
Chris Carini
1c815dcad1 Remove all PyPi classifiers as this package is not published to PyPi (#4574)
* Update PyPi classifier to Python 3.11

* remove all classifiers

* Update setup.py

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-10-03 16:22:12 -04:00
dependabot[bot]
afa467a32b Bump pyupgrade from 3.13.0 to 3.14.0 (#4599)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.13.0 to 3.14.0.
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.13.0...v3.14.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 13:35:10 -04:00
dependabot[bot]
274218d48e Bump pylint from 2.17.7 to 3.0.0 (#4600)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 19:32:18 +02:00
dependabot[bot]
7e73df26ab Bump coverage from 7.3.1 to 7.3.2 (#4598)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 19:29:46 +02:00
dependabot[bot]
ef8fc80c95 Bump actions/setup-python from 4.7.0 to 4.7.1 (#4597)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 08:51:10 +02:00
dependabot[bot]
05c39144e3 Bump urllib3 from 2.0.5 to 2.0.6 (#4596)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 08:18:08 +02:00
dependabot[bot]
f5cd35af47 Bump pylint from 2.17.6 to 2.17.7 (#4594)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-02 08:56:07 +02:00
dependabot[bot]
c69ecdafd0 Bump home-assistant/wheels from 2023.09.1 to 2023.10.1 (#4593)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-02 08:50:39 +02:00
Mike Degatano
fa90c247ec Correct /store/addons api output (#4589) 2023-09-29 09:17:39 -04:00
Mike Degatano
0cd7bd47bb Skip watchdog API test on landingpage (#4588)
* Skip watchdog API test on landingpage

* Skip check from task
2023-09-29 09:17:22 -04:00
dependabot[bot]
36d48d19fc Bump dbus-fast from 2.2.0 to 2.10.0 (#4583)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.2.0 to 2.10.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.2.0...v2.10.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 16:46:18 -04:00
Mike Degatano
9322b68d47 Change User LED to System Health LED (#4586) 2023-09-26 14:54:41 -04:00
dependabot[bot]
e11ff64b15 Bump pyupgrade from 3.10.1 to 3.13.0 (#4581)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.10.1 to 3.13.0.
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.13.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 14:36:00 -04:00
dependabot[bot]
3776dabfcf Bump cryptography from 41.0.3 to 41.0.4 (#4571)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 20:23:31 +02:00
dependabot[bot]
d4e5831f0f Bump gitpython from 3.1.36 to 3.1.37 (#4582)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 13:42:59 +02:00
dependabot[bot]
7b3b478e88 Bump pylint from 2.17.5 to 2.17.6 (#4584)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 09:41:08 +02:00
Chris Carini
f5afe13e91 Fix typos in docstrings (#4546)
* [typo] `Assitant` -> `Assistant`

* [typo] `an` -> `a`
2023-09-26 09:21:57 +02:00
dependabot[bot]
49ce468d83 Bump home-assistant/wheels from 2023.04.0 to 2023.09.1 (#4580)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-25 11:12:20 +02:00
dependabot[bot]
b26551c812 Bump home-assistant/builder from 2023.08.0 to 2023.09.0 (#4579)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-25 11:11:20 +02:00
dependabot[bot]
394ba580d2 Bump actions/checkout from 4.0.0 to 4.1.0 (#4578)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-25 10:53:19 +02:00
dependabot[bot]
2f7a54f5fd Bump urllib3 from 2.0.4 to 2.0.5 (#4572)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-21 11:04:19 +02:00
dependabot[bot]
360e085926 Bump time-machine from 2.12.0 to 2.13.0 (#4569)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-20 11:50:01 +02:00
dependabot[bot]
042921925d Bump typing-extensions from 4.7.1 to 4.8.0 (#4566)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-19 17:44:22 +02:00
Mike Degatano
dcf024387b Network backups skip free space check (#4563) 2023-09-19 16:28:39 +02:00
Mike Degatano
e1232bc9e7 Add support for green LEDs to API (#4556)
* Add support for green LEDs to API

* Save board config in supervisor and post on start

* Ignore no-value-for-parameter in validate
2023-09-14 09:27:12 -04:00
dependabot[bot]
d96598b5dd Bump sentry-sdk from 1.30.0 to 1.31.0 (#4562)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-14 09:03:51 +02:00
dependabot[bot]
2605f85668 Bump debugpy from 1.7.0 to 1.8.0 (#4559)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 08:57:38 +02:00
Mike Degatano
2c8e6ca0cd Switch from ruamel.yaml to pyyaml (#4555)
* Switch from ruamel.yaml to pyyaml

* Use CLoader and CDumper when available
2023-09-13 08:57:01 +02:00
Mike Degatano
0225f574be Only tell HA to refresh ingress on restore on change (#4552)
* Only tell HA to refresh ingress on restore on change

* Fix test expecting ingress change

* Assume ingress_panel is false for new addons
2023-09-13 08:50:32 +02:00
dependabot[bot]
34090bf2eb Bump docker/login-action from 2.2.0 to 3.0.0 (#4558)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 08:41:52 +02:00
Mike Degatano
5ae585ce13 Unmount mounts before backup restore (#4557) 2023-09-12 18:56:24 -04:00
dependabot[bot]
2bb10a32d7 Bump gitpython from 3.1.35 to 3.1.36 (#4553)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 10:22:55 +02:00
dependabot[bot]
435743dd2c Bump dbus-fast from 1.94.1 to 2.2.0 (#4550)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.94.1 to 2.2.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.94.1...v2.2.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-11 14:00:54 -04:00
dependabot[bot]
98589fba6d Bump black from 23.7.0 to 23.9.1 (#4549)
Bumps [black](https://github.com/psf/black) from 23.7.0 to 23.9.1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/23.7.0...23.9.1)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-11 12:43:50 -04:00
Mike Degatano
32da679e02 Ingress does not break when username missing (#4551) 2023-09-11 10:42:31 -04:00
Mike Degatano
44daffc65b Add freeze/thaw apis for external snapshots (#4538)
* Add freeze/thaw apis for external backups

* Error when thaw called before freeze

* Timeout must be > 0
2023-09-09 10:54:19 +02:00
Mike Degatano
0aafda1477 Mount names cannot include non-alphanumerics (#4545) 2023-09-09 10:54:04 +02:00
dependabot[bot]
60604e33b9 Bump debugpy from 1.6.7 to 1.7.0 (#4542)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.6.7 to 1.7.0.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.6.7...v1.7.0)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-08 10:34:20 -04:00
dependabot[bot]
98268b377a Bump pytest from 7.4.1 to 7.4.2 (#4541)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.1 to 7.4.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.1...7.4.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-08 10:33:23 -04:00
dependabot[bot]
de54979471 Bump brotli from 1.0.9 to 1.1.0 (#4540)
Bumps [brotli](https://github.com/google/brotli) from 1.0.9 to 1.1.0.
- [Release notes](https://github.com/google/brotli/releases)
- [Changelog](https://github.com/google/brotli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/brotli/compare/v1.0.9...v1.1.0)

---
updated-dependencies:
- dependency-name: brotli
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-08 10:32:45 -04:00
dependabot[bot]
ee6e339587 Bump pytest-aiohttp from 1.0.4 to 1.0.5 (#4535)
Bumps [pytest-aiohttp](https://github.com/aio-libs/pytest-aiohttp) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/aio-libs/pytest-aiohttp/releases)
- [Changelog](https://github.com/aio-libs/pytest-aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/pytest-aiohttp/compare/v1.0.4...v1.0.5)

---
updated-dependencies:
- dependency-name: pytest-aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-08 10:21:11 -04:00
dependabot[bot]
c16cf89318 Bump coverage from 7.3.0 to 7.3.1 (#4534)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.3.0 to 7.3.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.3.0...7.3.1)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-08 10:04:31 -04:00
dependabot[bot]
c66cb7423e Bump actions/cache from 3.3.1 to 3.3.2 (#4544)
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.3.1...v3.3.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-08 09:37:38 -04:00
dependabot[bot]
f5bd95a519 Bump actions/upload-artifact from 3.1.2 to 3.1.3 (#4532)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3.1.2...v3.1.3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-08 09:27:49 -04:00
dependabot[bot]
500f9ec1c1 Bump gitpython from 3.1.34 to 3.1.35 (#4539)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.34 to 3.1.35.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.34...3.1.35)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-08 09:19:54 -04:00
dependabot[bot]
a4713d4a1e Bump actions/checkout from 3.6.0 to 4.0.0 (#4527)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.6.0...v4.0.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 15:35:10 -04:00
dependabot[bot]
04452dfb1a Bump pytest from 7.4.0 to 7.4.1 (#4523)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.0 to 7.4.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.0...7.4.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 14:58:56 -04:00
dependabot[bot]
69d09851d9 Bump pre-commit from 3.3.3 to 3.4.0 (#4522)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.3.3 to 3.4.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v3.3.3...v3.4.0)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 12:54:42 -04:00
Mike Degatano
1b649fe5cd Use newer StrEnum and IntEnum over Enum (#4521)
* Use newer StrEnum and IntEnum over Enum

* Fix validation issue and remove unnecessary .value calls

---------

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2023-09-06 12:21:04 -04:00
dependabot[bot]
38572a5a86 Bump gitpython from 3.1.32 to 3.1.34 (#4524)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.32 to 3.1.34.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.32...3.1.34)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 12:19:01 -04:00
dependabot[bot]
f5f51169e6 Bump sigstore/cosign-installer from 3.1.1 to 3.1.2 (#4525)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/v3.1.1...v3.1.2)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 11:55:41 +02:00
Mike Degatano
07c2178ae1 Add jobs to docker supervisor and use group wait (#4520) 2023-09-03 18:22:17 +02:00
Mike Degatano
f30d21361f Skip unnecessary mounts and privileges for landingpage (#4518)
* Skip unnecessary mounts for landingpage

* Remove privileged and cgroup rules from landingpage
2023-09-03 18:21:35 +02:00
Mike Degatano
6adb4fbcf7 Update store data in one task to prevent races (#4519)
* Update store data in one task to prevent races

* Always return a dictionary
2023-09-03 18:20:26 +02:00
dependabot[bot]
d73962bd7d Bump faust-cchardet from 2.1.18 to 2.1.19 (#4484)
Bumps [faust-cchardet](https://github.com/faust-streaming/cChardet) from 2.1.18 to 2.1.19.
- [Release notes](https://github.com/faust-streaming/cChardet/releases)
- [Changelog](https://github.com/faust-streaming/cChardet/blob/master/CHANGES.rst)
- [Commits](https://github.com/faust-streaming/cChardet/compare/v2.1.18...v2.1.19)

---
updated-dependencies:
- dependency-name: faust-cchardet
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-01 11:18:51 +02:00
Mike Degatano
f4b43739da Skip plugin update on startup if supervisor out of date (#4515) 2023-09-01 11:18:22 +02:00
Mike Degatano
4838b280ad List current job tree in api (#4514) 2023-08-31 10:01:42 +02:00
Mike Degatano
f93b753c03 Backup and restore track progress in job (#4503)
* Backup and restore track progress in job

* Change to stage only updates and fix tests

* Leave HA alone if it wasn't restored

* skip check HA stage message when we don't check

* Change to helper to get current job

* Fix tests

* Mark jobs as internal to skip notifying HA
2023-08-30 16:01:03 -04:00
dependabot[bot]
de06361cb0 Bump dbus-fast from 1.93.0 to 1.94.1 (#4511)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.93.0 to 1.94.1.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.93.0...v1.94.1)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 15:48:27 -04:00
dependabot[bot]
15ce48c8aa Bump sentry-sdk from 1.29.2 to 1.30.0 (#4513)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.29.2 to 1.30.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.29.2...1.30.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 15:28:51 -04:00
dependabot[bot]
38758d05a8 Bump actions/checkout from 3.5.3 to 3.6.0 (#4508)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-25 09:54:14 +02:00
Mike Degatano
a79fa14ee7 Don't notify listeners on CoreState.CLOSE (#4506) 2023-08-25 07:22:49 +02:00
Pascal Vizeli
1eb95b4d33 Remove old add-on state refresh (#4504) 2023-08-24 11:04:31 -04:00
dependabot[bot]
d04e47f5b3 Bump dbus-fast from 1.92.0 to 1.93.0 (#4501)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.92.0 to 1.93.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.92.0...v1.93.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-23 17:12:49 -04:00
Mike Degatano
dad5118f21 Use dataclasses asdict for dataclasses (#4502) 2023-08-22 17:50:48 -04:00
Florian Bachmann
acc0e5c989 Allows the supervisor to send a session's user to addon with header X-Remote-User (#4152)
* Working draft for x-remote-user

* Renames prop to remote_user

* Allows to set in addon description whether it requests the username

* Fixes addon-options schema

* Sends user ID instead of username to addons

* Adds tests

* Removes configurability of remote-user forwarding

* Update const.py

* Also adds username header

* Fetches full user info object from homeassistant

* Cleaner validation and dataclasses

* Fixes linting

* Fixes linting

* Tries to fix test

* Updates tests

* Updates tests

* Updates tests

* Updates tests

* Updates tests

* Updates tests

* Updates tests

* Updates tests

* Resolves PR comments

* Linting

* Fixes tests

* Update const.py

* Removes header keys if not required

* Moves ignoring user ID headers if no session_data is given

* simplify

* fix lint with new job

---------

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2023-08-22 10:11:13 +02:00
dependabot[bot]
204fcdf479 Bump dbus-fast from 1.91.2 to 1.92.0 (#4500)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.91.2 to 1.92.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.91.2...v1.92.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 11:03:02 +02:00
Mike Degatano
93ba8a3574 Add job names and references everywhere (#4495)
* Add job names and references everywhere

* Remove group names check and switch to const

* Ensure unique job names in decorator tests
2023-08-21 09:15:37 +02:00
dependabot[bot]
f2f9e3b514 Bump dbus-fast from 1.86.0 to 1.91.2 (#4485)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.86.0 to 1.91.2.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.86.0...v1.91.2)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-15 10:32:27 -04:00
Mike Degatano
61288559b3 Always stop the addon before restoring it (#4492)
* Always stop the addon before restoring it

* patch ingress refresh to avoid timeout
2023-08-15 13:08:45 +02:00
dependabot[bot]
bd2c99a455 Bump awesomeversion from 23.5.0 to 23.8.0 (#4494)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-15 10:38:43 +02:00
dependabot[bot]
1937348b24 Bump time-machine from 2.11.0 to 2.12.0 (#4493)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-15 09:55:26 +02:00
dependabot[bot]
b7b2fae325 Bump coverage from 7.2.7 to 7.3.0 (#4491)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-14 09:49:04 +02:00
dependabot[bot]
11115923b2 Bump async-timeout from 4.0.2 to 4.0.3 (#4488)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 12:13:28 +02:00
dependabot[bot]
295133d2e9 Bump home-assistant/builder from 2023.06.1 to 2023.08.0 (#4489)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 10:23:47 +02:00
Mike Degatano
3018b851c8 Missing an await in addon data (#4487) 2023-08-10 16:31:43 -04:00
Mike Degatano
222c3fd485 Address addon storage race condition (#4481)
* Address addon storage race condition

* Add some error test cases
2023-08-10 15:24:43 -04:00
Stefan Agner
9650fd2ba1 Extend container image name validator (#4480)
* Extend container image name validator

The current validator allows certain invalid names (e.g. upper
case), but disallows valid cases (such as ttl.sh/myimage).
Improve the container image validator to support more valid
options and at the same time disallow some of the invalid
options.

Note that this is not a complete/perfect validation still. A much
much more sophisticated regex would be necessary to be 100% accurate.
Also we format the string and replace {machine}/{arch} using Python
format strings. In that regard the image format in Supervisor deviates
from the Docker/OCI container image name format.

* Use an actual invalid image name in config validation
2023-08-10 12:58:33 -04:00
Stefan Agner
c88fd9a7d9 Add Home Assistant Green (#4486) 2023-08-10 17:31:37 +02:00
Mike Degatano
1611beccd1 Add job group execution limit option (#4457)
* Add job group execution limit option

* Fix pylint issues

* Assign variable before usage

* Cleanup jobs when done

* Remove isinstance check for performance

* Explicitly raise from None

* Add some more documentation info
2023-08-08 16:49:17 -04:00
Mike Degatano
71077fb0f7 Fallback on interface name if path is missing (#4479) 2023-08-07 20:53:25 -04:00
dependabot[bot]
9647fba98f Bump cryptography from 41.0.2 to 41.0.3 (#4468)
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.2 to 41.0.3.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.2...41.0.3)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-04 17:50:46 -04:00
Mike Degatano
86f004e45a Use udev path instead of mac or name for nm match (#4476) 2023-08-04 17:39:35 -04:00
Mike Degatano
a98334ede8 Cancel startup wait task on addon uninstallation (#4475)
* Cancel startup wait task on addon uninstallation

* Await startup task instead

* Suppress cancelled error
2023-08-04 16:28:44 -04:00
dependabot[bot]
e19c2d6805 Bump aiohttp from 3.8.4 to 3.8.5 (#4467)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.4 to 3.8.5.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/v3.8.5/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.8.4...v3.8.5)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-03 11:01:58 -04:00
dependabot[bot]
847736dab8 Bump sentry-sdk from 1.29.0 to 1.29.2 (#4470)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 09:24:42 +02:00
Mike Degatano
45f930ab21 Revert "Bump aiohttp from 3.8.4 to 3.8.5 (#4448)" (#4466)
This reverts commit b8178414a4.
2023-08-01 17:37:34 -04:00
dependabot[bot]
6ea54f1ddb Bump sentry-sdk from 1.28.1 to 1.29.0 (#4464)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-01 10:14:38 +02:00
Mike Degatano
81ce0a60f6 Missing an await on dns.write_hosts call (#4463) 2023-07-31 23:29:40 +02:00
dependabot[bot]
bf5d839c22 Bump flake8 from 6.0.0 to 6.1.0 (#4461)
Bumps [flake8](https://github.com/pycqa/flake8) from 6.0.0 to 6.1.0.
- [Commits](https://github.com/pycqa/flake8/compare/6.0.0...6.1.0)

---
updated-dependencies:
- dependency-name: flake8
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-31 10:49:04 -04:00
dependabot[bot]
fc385cfac0 Bump pyupgrade from 3.9.0 to 3.10.1 (#4460)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.9.0 to 3.10.1.
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.9.0...v3.10.1)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-31 10:22:21 -04:00
dependabot[bot]
12d55b8411 Bump pylint from 2.17.4 to 2.17.5 (#4456)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-27 09:01:16 +02:00
Mike Degatano
e60af93e2b List discovery only includes healthy addons (#4451)
Co-authored-by: Stefan Agner <stefan@agner.ch>
2023-07-22 23:27:42 +02:00
Mike Degatano
1691f0eac7 Temporary operations for backups take place in destination folder (#4452) 2023-07-21 22:49:31 -04:00
Mike Degatano
be4a6a1564 Allow discovery messages for unknown services with a warning (#4449)
* Allow discovery messages for unknown services with a warning

* Log at warning level and skip sentry report
2023-07-21 15:05:51 -04:00
J. Nick Koston
24c5613a50 Switch to using the get core state api call to check if the API is up (#4445)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-07-20 13:43:44 +02:00
J. Nick Koston
5266927bf7 Avoid check_api_state in websocket _can_send if we are already connected (#4446) 2023-07-20 11:20:02 +02:00
dependabot[bot]
4bd2000174 Bump urllib3 from 2.0.3 to 2.0.4 (#4447)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-20 11:14:27 +02:00
dependabot[bot]
b8178414a4 Bump aiohttp from 3.8.4 to 3.8.5 (#4448)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-20 11:02:15 +02:00
J. Nick Koston
f9bc2f5993 Increase core websocket proxy maximum message size to 64MiB (#4443) 2023-07-19 20:02:42 +02:00
Mike Degatano
f1a72ee418 Include interface name in match-device settings (#4444) 2023-07-19 10:15:59 +02:00
dependabot[bot]
b19dcef5b7 Bump cryptography from 41.0.1 to 41.0.2 (#4434)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-18 21:58:35 +02:00
Mike Degatano
1f92ab42ca Reduce executor code for docker (#4438)
* Reduce executor code for docker

* Fix pylint errors and move import/export image

* Fix test and a couple other risky executor calls

* Fix dataclass and return

* Fix test case and add one for corrupt docker

* Add some coverage

* Undo changes to docker manager startup
2023-07-18 11:39:39 -04:00
dependabot[bot]
1f940a04fd Bump actions/setup-python from 4.6.1 to 4.7.0 (#4439)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-17 09:30:20 +02:00
dependabot[bot]
f771eaab5f Bump sentry-sdk from 1.28.0 to 1.28.1 (#4440)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-17 09:22:26 +02:00
dependabot[bot]
d1379a8154 Bump black from 23.3.0 to 23.7.0 (#4433)
Bumps [black](https://github.com/psf/black) from 23.3.0 to 23.7.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/23.3.0...23.7.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-13 15:27:00 -04:00
dependabot[bot]
e488f02557 Bump gitpython from 3.1.31 to 3.1.32 (#4435)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.31 to 3.1.32.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.31...3.1.32)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 13:55:17 +02:00
dependabot[bot]
f11cc86254 Bump time-machine from 2.10.0 to 2.11.0 (#4432)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 13:27:46 +02:00
dependabot[bot]
175667bfe8 Bump sentry-sdk from 1.27.1 to 1.28.0 (#4436)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 08:46:39 +02:00
dependabot[bot]
0a0f14ddea Bump pyupgrade from 3.8.0 to 3.9.0 (#4430)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.8.0 to 3.9.0.
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.8.0...v3.9.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 08:54:19 +02:00
dependabot[bot]
9e08677ade Bump sentry-sdk from 1.27.0 to 1.27.1 (#4427)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 14:23:02 +02:00
Mike Degatano
abbf8b9b65 Identify network interfaces by mac over name (#4416)
* Identify network interfaces by mac over name

* Refactor long if statement into method
2023-07-06 16:26:19 -04:00
Mike Degatano
96d5fc244e Separate startup event from update check event (#4425)
* Separate startup event from update check event

* Add a queue for messages sent during startup
2023-07-06 12:45:37 -04:00
dependabot[bot]
3b38047fd4 Bump pyupgrade from 3.7.0 to 3.8.0 (#4418)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.7.0 to 3.8.0.
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.7.0...v3.8.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-06 10:07:25 -04:00
dependabot[bot]
48e9e1c4f9 Bump sentry-sdk from 1.26.0 to 1.27.0 (#4422)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-05 10:49:32 +02:00
Bram Kragten
355961a1eb Update frontend (#4423) 2023-07-05 10:16:49 +02:00
Bram Kragten
e68190b6b6 Bump frontend (#4420) 2023-07-04 10:21:32 +02:00
dependabot[bot]
e7cc7e971f Bump typing-extensions from 4.7.0 to 4.7.1 (#4419)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-03 09:17:50 +02:00
dependabot[bot]
ee027eb510 Bump release-drafter/release-drafter from 5.23.0 to 5.24.0 (#4412)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.23.0 to 5.24.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.23.0...v5.24.0)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-29 20:54:55 -04:00
dependabot[bot]
a584300bf3 Bump typing-extensions from 4.6.3 to 4.7.0 (#4413)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-29 11:07:30 +02:00
dependabot[bot]
16e1f839d7 Bump sigstore/cosign-installer from 3.1.0 to 3.1.1 (#4410)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-28 09:17:24 +02:00
Mike Degatano
c2123f0903 Ensure addon.start always returns coroutine (#4409) 2023-06-27 19:43:49 +02:00
Mike Degatano
9fbeb2a769 Add support for apparmor channels (#4408) 2023-06-27 19:12:42 +02:00
dependabot[bot]
3e0723ec24 Bump sigstore/cosign-installer from 3.0.5 to 3.1.0 (#4407)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-27 10:17:53 +02:00
Pascal Vizeli
3e5f1d96b5 Fix Tag (#4406) 2023-06-26 18:49:13 +02:00
dependabot[bot]
be87082502 Bump home-assistant/builder from 2023.06.0 to 2023.06.1 (#4404)
* Bump home-assistant/builder from 2023.06.0 to 2023.06.1

Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2023.06.0 to 2023.06.1.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2023.06.0...2023.06.1)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Support cosign & ditch Codenotary

* use curl

* Not using docker.io anymore

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2023-06-26 18:17:55 +02:00
dependabot[bot]
f997e51249 Bump pytest from 7.3.2 to 7.4.0 (#4405)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-26 12:00:01 +02:00
dependabot[bot]
456316fdd4 Bump sentry-sdk from 1.25.1 to 1.26.0 (#4401)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-23 16:57:36 +02:00
Mike Degatano
9a7d547394 Allow all characters in mount credentials (#4399)
* Allow all characters in mount credentials

* Fix permissions on credential files

* Fix pylint issue
2023-06-22 15:55:13 -04:00
Mike Degatano
d3031e2eae Use noserverino option in cifs mounts (#4398) 2023-06-21 18:49:03 +02:00
Joakim Sørensen
35bd66119a Allow specifying CIFS version (#4395)
* Allow specifying cifs_version

* cifs_version -> version
2023-06-21 12:08:56 -04:00
dependabot[bot]
9be3b47e0e Bump pyupgrade from 3.6.0 to 3.7.0 (#4393)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.6.0 to 3.7.0.
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.6.0...v3.7.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-20 10:37:34 -04:00
Joakim Sørensen
4bed8c1327 Allow mounting CIFS as guest (#4384) 2023-06-20 10:20:06 -04:00
Mike Degatano
254ec2d1af Addon startup waits for healthy (#4376)
* Addon startup waits for healthy

* fix import for pylint

* wait_for to 5 in tests

* Adjust tests to simplify async tasks

* Remove wait_boot time from addons.boot tests

* Eliminate async task race conditions in tests
2023-06-20 10:13:15 -04:00
dependabot[bot]
e4ee3e4226 Bump time-machine from 2.9.0 to 2.10.0 (#4394)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 09:40:42 +02:00
Joakim Sørensen
65545e7218 Bump frontend to 3be601a3 (#4382) 2023-06-16 14:02:41 +02:00
Joakim Sørensen
8b4e8e9804 Add backup location to info/list API calls (#4346)
* Add backup location to info/list API calls

* Requested adjustments
2023-06-15 16:00:37 +02:00
cociweb
5d1ef34f17 Fix propagation mode of mounts to allow Ha-Core to start (#4374)
* Fix propagation mode of mounts to allow Ha-Core to start

Change the mount propagation mode from SLAVE to RSLAVE in case of /media and /share

* Check /share and /media to use RSLAVE as a propagation mode of mount

* Fix mount propagation mode of /share and /media

* Check /share and /media for rslave propagation mode
2023-06-14 17:40:46 -04:00
Matheson Steplock
9504eff889 Support Debian Bookworm (#4377) 2023-06-14 20:31:30 +02:00
dependabot[bot]
d5828a6815 Bump pre-commit from 3.3.2 to 3.3.3 (#4380)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-14 11:13:00 +02:00
dependabot[bot]
488f246f75 Bump urllib3 from 1.26.15 to 2.0.3 (#4351)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.15 to 2.0.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.15...2.0.3)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-13 16:43:53 -04:00
dependabot[bot]
000d4ec78a Bump pyupgrade from 3.4.0 to 3.6.0 (#4372)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.4.0 to 3.6.0.
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.4.0...v3.6.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-13 16:18:54 -04:00
Stefan Agner
6c0415163b Fix Audio mounts for Add-ons (#4379) 2023-06-13 12:30:58 +02:00
dependabot[bot]
0205cbb78b Bump dessant/lock-threads from 4.0.0 to 4.0.1 (#4378)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-13 10:35:16 +02:00
dependabot[bot]
72db559adc Bump home-assistant/builder from 2023.03.0 to 2023.06.0 (#4369)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 14:51:35 +02:00
dependabot[bot]
a57c145870 Bump actions/checkout from 3.5.2 to 3.5.3 (#4370)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 12:04:44 +02:00
dependabot[bot]
759fd1077a Bump pytest from 7.3.1 to 7.3.2 (#4371)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 11:51:05 +02:00
dependabot[bot]
fb90e6d07e Bump sentry-sdk from 1.25.0 to 1.25.1 (#4350)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-08 11:04:23 +02:00
dependabot[bot]
86d17acd83 Bump docker/login-action from 2.1.0 to 2.2.0 (#4349)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-08 10:52:47 +02:00
Mike Degatano
6eb8de02eb Set CRYPTOGRAPHY_OPENSSL_NO_LEGACY for OpenSSL3 (#4342) 2023-06-05 12:07:57 -04:00
Mike Degatano
f4df298cb3 Exit reload early if no mounts (#4338)
* Exit reload early if no mounts

* Formatting
2023-06-05 10:40:16 -04:00
dependabot[bot]
9800955646 Bump sentry-sdk from 1.24.0 to 1.25.0 (#4340)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 13:52:39 +02:00
dependabot[bot]
1706d14c9c Bump cryptography from 41.0.0 to 41.0.1 (#4336)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 13:47:44 +02:00
dependabot[bot]
cf68d9fd19 Bump docker from 6.1.2 to 6.1.3 (#4335)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-02 09:20:21 +02:00
dependabot[bot]
6f2f8e88a6 Bump typing-extensions from 4.6.2 to 4.6.3 (#4334)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-02 09:19:39 +02:00
Mike Degatano
c896b60410 Fix asyncio.wait in supervisor.reload (#4333)
* Fix asyncio.wait in supervisor.reload

* Unwrap to prevent throttling across tests
2023-06-01 18:38:42 -04:00
Joakim Sørensen
0200c72db1 Bump the frontend to efa02c30 (#4332) 2023-06-01 16:49:30 +02:00
dependabot[bot]
fe5705b35b Bump cryptography from 40.0.2 to 41.0.0 (#4324)
Bumps [cryptography](https://github.com/pyca/cryptography) from 40.0.2 to 41.0.0.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/40.0.2...41.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-31 14:06:18 -04:00
Mike Degatano
3c3846240d Protect backup manager from setup failures for mount down (#4327) 2023-05-31 11:51:52 -04:00
Mike Degatano
b86a6d292f Null check for meta in meta_mounts (#4326) 2023-05-31 10:50:28 -04:00
dependabot[bot]
1feda7d89f Bump pulsectl from 23.5.1 to 23.5.2 (#4306)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 23.5.1 to 23.5.2.
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 17:30:39 -04:00
Mike Degatano
73d795e05e Improve handling of NFS mounts and backup manager errors (#4323) 2023-05-30 17:29:51 -04:00
Mike Degatano
e449205863 Add share to docker config issue (#4322) 2023-05-30 15:36:06 -04:00
Mike Degatano
841f68c175 Make issue for problem with config for containers (#4317)
* Make issue for problem with config for containers

* Mount propagation in tests

* Fixes from rebase and feedback
2023-05-30 13:25:38 -04:00
Joakim Sørensen
0df19cee91 Bump frontend to e0c1f988 (#4320)
* Bump frontend to 0ab7934c

* Bump frontend to e0c1f988
2023-05-30 14:20:03 +02:00
Joakim Sørensen
d3f490bcc3 Adjust regex to allow woff2 files to be served (#4321) 2023-05-30 13:08:26 +02:00
dependabot[bot]
0fda5f6c4b Bump coverage from 7.2.6 to 7.2.7 (#4319)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:35:55 +02:00
Mike Degatano
e984797f3c Support share mounts (#4318) 2023-05-29 11:40:03 +02:00
dependabot[bot]
334bcf48fb Bump typing-extensions from 4.6.1 to 4.6.2 (#4316)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-26 09:23:28 +02:00
dependabot[bot]
73f3627ebd Bump actions/setup-python from 4.6.0 to 4.6.1 (#4314)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-25 09:33:29 +02:00
dependabot[bot]
0adf2864b4 Bump pytest-cov from 4.0.0 to 4.1.0 (#4315)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-25 09:32:46 +02:00
Joakim Sørensen
f542c8e790 Bump frontend to 9111f58e (#4313) 2023-05-24 10:27:06 -04:00
Mike Degatano
a7c1693911 Set bind propagation mode for media (#4308)
* Set bind propagation mode for media

* Add some test cases
2023-05-24 09:12:35 -04:00
Joakim Sørensen
bb497c0c9f Add missing default_backup_mount to mount config (#4312) 2023-05-24 12:01:47 +02:00
dependabot[bot]
95eee712a3 Bump typing-extensions from 4.6.0 to 4.6.1 (#4309)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-24 11:08:08 +02:00
dependabot[bot]
6aeac271fa Bump sentry-sdk from 1.23.1 to 1.24.0 (#4311)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-24 10:33:48 +02:00
dependabot[bot]
1204852893 Bump coverage from 7.2.5 to 7.2.6 (#4310)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-24 10:23:31 +02:00
Mike Degatano
f6c3bdb6a8 Add mount to supported features (#4301)
* Add mount to supported features

* Typo in enable

* Fix places mocking os available without version

* Increase resilence of problematic repeat task test
2023-05-23 14:00:15 +02:00
dependabot[bot]
fbb2776277 Bump typing-extensions from 4.5.0 to 4.6.0 (#4305)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 10:02:41 +02:00
Mike Degatano
5ced4e2f3b Update to python 3.11 (#4296) 2023-05-22 19:12:34 +02:00
dependabot[bot]
61a7e6a87d Bump awesomeversion from 22.9.0 to 23.5.0 (#4303)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-22 09:52:19 +02:00
Felipe Santos
88d25fc14e Add support for CAP_BPF and CAP_PERFMON privileges (#4259)
Co-authored-by: Stefan Agner <stefan@agner.ch>
2023-05-21 15:19:05 +02:00
dependabot[bot]
b5233cd398 Bump pre-commit from 3.3.1 to 3.3.2 (#4300)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-20 20:26:57 +02:00
dependabot[bot]
109b8b47a0 Bump sentry-sdk from 1.23.0 to 1.23.1 (#4299)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-20 14:39:13 +02:00
Mike Degatano
c5566f40ca Fix devcontainer workspace and use env (#4302) 2023-05-18 15:23:12 -04:00
dependabot[bot]
9dd5d89458 Bump docker from 6.0.1 to 6.1.2 (#4292)
Bumps [docker](https://github.com/docker/docker-py) from 6.0.1 to 6.1.2.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/6.0.1...6.1.2)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-18 15:16:42 -04:00
dependabot[bot]
c6f31ce73f Bump pylint from 2.17.3 to 2.17.4 (#4284)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.17.3 to 2.17.4.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.17.3...v2.17.4)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-18 14:11:01 -04:00
dependabot[bot]
da9787bb58 Bump pulsectl from 22.3.2 to 23.5.1 (#4283)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 22.3.2 to 23.5.1.
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-17 13:00:39 -04:00
dependabot[bot]
4254b80c0a Bump dbus-fast from 1.84.2 to 1.86.0 (#4279)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.84.2 to 1.86.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.84.2...v1.86.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-17 12:34:11 -04:00
Mike Degatano
b4fd5b28f6 Use backup mounts (#4289)
* Add support for backup mounts

* Fix tests

* Allow backups to local when there's a default location
2023-05-16 14:08:22 -04:00
dependabot[bot]
6a95f97ec9 Bump pyudev from 0.24.0 to 0.24.1 (#4258)
Bumps [pyudev](https://github.com/pyudev/pyudev) from 0.24.0 to 0.24.1.
- [Release notes](https://github.com/pyudev/pyudev/releases)
- [Changelog](https://github.com/pyudev/pyudev/blob/master/CHANGES.rst)
- [Commits](https://github.com/pyudev/pyudev/compare/v0.24.0...v0.24.1)

---
updated-dependencies:
- dependency-name: pyudev
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 13:19:16 -04:00
dependabot[bot]
fc171b674e Bump codecov/codecov-action from 3.1.3 to 3.1.4 (#4294)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 12:50:16 +02:00
dependabot[bot]
17f5ff1cb1 Bump sentry-sdk from 1.22.2 to 1.23.0 (#4295)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 10:24:03 +02:00
Bram Kragten
b017fed329 Bump frontend to d46201ebd (#4288) 2023-05-15 23:00:44 +02:00
dependabot[bot]
4c69c7206e Bump pyupgrade from 3.3.2 to 3.4.0 (#4285)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-05-09 13:22:58 +02:00
dependabot[bot]
caf094815f Bump sentry-sdk from 1.22.1 to 1.22.2 (#4286)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-09 10:03:09 +02:00
dependabot[bot]
4043503940 Bump sentry-sdk from 1.21.0 to 1.22.1 (#4281)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-08 09:22:53 +02:00
dependabot[bot]
4cd80c4228 Bump pre-commit from 3.3.0 to 3.3.1 (#4277)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-04 19:11:01 +02:00
dependabot[bot]
7fd38da403 Bump pre-commit from 3.2.2 to 3.3.0 (#4275)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-02 11:43:39 +02:00
Mike Degatano
7688e1b9cb Fix bind mounting and remove on create failure (#4274)
* Fix bind mounting and remove on create failure

* Fix test and make update fully fail on dbus error
2023-05-02 08:33:01 +02:00
dependabot[bot]
61202db8b2 Bump coverage from 7.2.3 to 7.2.5 (#4270)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-01 09:17:21 +02:00
Mike Degatano
34c394c3d1 Add support for network mounts (#4269)
* Add support for network mounts

* Handle backups and save data

* fix pylint issues
2023-05-01 08:45:52 +02:00
dependabot[bot]
ebe9c32092 Bump pyupgrade from 3.3.1 to 3.3.2 (#4261)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-04-29 13:33:22 +02:00
dependabot[bot]
2108b218d8 Bump sentry-sdk from 1.20.0 to 1.21.0 (#4263)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-26 09:25:02 +02:00
dependabot[bot]
b85b5041b4 Bump pylint from 2.17.2 to 2.17.3 (#4262)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-25 09:45:00 +02:00
dependabot[bot]
7c29c56b9a Bump home-assistant/wheels from 2022.10.1 to 2023.04.0 (#4254)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-22 15:30:15 +02:00
dependabot[bot]
207ae8ae4f Bump actions/setup-python from 4.5.0 to 4.6.0 (#4256)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-21 10:48:49 +02:00
dependabot[bot]
c13531e9e3 Bump codecov/codecov-action from 3.1.2 to 3.1.3 (#4255)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-21 10:10:56 +02:00
dependabot[bot]
0373030cb2 Bump getsentry/action-release from 1.4.0 to 1.4.1 (#4253)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-21 10:09:12 +02:00
Franck Nijhof
9635c70f2b Add support for NET_RAW privileges (#4242) 2023-04-20 11:03:08 -04:00
dependabot[bot]
ff54c5268c Bump attrs from 22.2.0 to 23.1.0 (#4244)
Bumps [attrs](https://github.com/python-attrs/attrs) from 22.2.0 to 23.1.0.
- [Release notes](https://github.com/python-attrs/attrs/releases)
- [Changelog](https://github.com/python-attrs/attrs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/python-attrs/attrs/compare/22.2.0...23.1.0)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-20 10:57:23 -04:00
dependabot[bot]
c7141caa12 Bump sentry-sdk from 1.19.1 to 1.20.0 (#4250)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-20 12:49:58 +02:00
dependabot[bot]
d0bf2aa817 Bump getsentry/action-release from 1.3.1 to 1.4.0 (#4249)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-20 10:53:30 +02:00
Franck Nijhof
ed2f57f3ca Add Wyoming Protocol add-on/integration discovery (#4248)
* Add Wyoming Protocol add-on/integration discovery

* Use URIs instead

* Use unix socket in bad test

* Address pylint warning
2023-04-19 11:35:05 -04:00
J. Nick Koston
744cd4ea39 Speed up backups by increasing buffer size (#4229)
* Speed up backups by increasing buffer size

This is the same change as https://github.com/home-assistant/core/pull/90613
but for supervisor

If the backup takes too long, core will release the lock on the database
and the backup will be no good

2fc34e7cce/homeassistant/components/recorder/core.py (L926)

cpython uses copyfileobj under the hood for fast copies but the default buffer size is quite low which increases the amount of time in python code when copying the sqlite database. As this is the usually the bulk of the backup, increasing the buffer can help reduce the backup time quite a bit.

Ideally this would all use sendfile under the hood as it would shift nearly all the burden out of userspace but tarfile doesn't currently try that 4664a7cf68/Lib/shutil.py (L106)

related:
In testing (non encrypted) improvement was at least as good as https://github.com/python/cpython/issues/71386

* add the const
2023-04-19 14:01:44 +02:00
dependabot[bot]
b3ca08f2c2 Bump cryptography from 40.0.1 to 40.0.2 (#4245)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-17 13:40:19 +02:00
dependabot[bot]
afbafe44f9 Bump pytest from 7.3.0 to 7.3.1 (#4243)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-17 09:24:39 +02:00
Joakim Sørensen
a54e0a8401 Bump frontend to 3a1fff81 (#4241) 2023-04-14 09:07:42 -04:00
dependabot[bot]
df336dd493 Bump actions/checkout from 3.5.0 to 3.5.2 (#4240)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-13 19:35:10 +02:00
dependabot[bot]
778134f096 Bump debugpy from 1.6.6 to 1.6.7 (#4230)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.6.6 to 1.6.7.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.6.6...v1.6.7)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-12 14:01:37 -04:00
Mike Degatano
dc4a753fe3 Add start transient unit dbus method (#4237) 2023-04-12 13:08:02 -04:00
Mike Degatano
f5b6feec77 Remove codecov package (#4238) 2023-04-12 13:07:46 -04:00
dependabot[bot]
08c40dfe98 Bump sentry-sdk from 1.18.0 to 1.19.1 (#4231)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.18.0 to 1.19.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.18.0...1.19.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-12 12:27:56 -04:00
dependabot[bot]
98110a26d4 Bump pylint from 2.17.1 to 2.17.2 (#4226)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-12 13:26:41 +02:00
dependabot[bot]
610b0e9adc Bump codecov/codecov-action from 3.1.1 to 3.1.2 (#4236)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-12 10:05:29 +02:00
dependabot[bot]
be39275cd0 Bump pre-commit from 3.2.1 to 3.2.2 (#4227)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-11 09:58:15 +02:00
dependabot[bot]
0c7fc10147 Bump coverage from 7.2.2 to 7.2.3 (#4233)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-11 08:49:30 +02:00
dependabot[bot]
6dd9b573fd Bump pytest from 7.2.2 to 7.3.0 (#4235)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-11 08:11:47 +02:00
Stefan Agner
2c2f1afc48 Support checkout directory which are not name supervisor (#4223)
VSCode by default bind mounts the project dir into /workspace. Our
scripts assume the Supervisor repository at /workspace/supervisor, but
there is no guarnatee for that with VSCode default behavior. Explicitly
mount it to /workspace/supervisor so we can safely make that assumption
in our devcontainer scripts.
2023-04-03 14:44:59 -04:00
Mike Degatano
8cf71ffa81 Issue changed messages include suggestions (#4225)
* Issue changed messages include suggestions

* Fix test so ordering of suggestions doesn't matter
2023-04-03 14:00:01 -04:00
dependabot[bot]
1123101c87 Bump securetar from 2022.2.0 to 2023.3.0 (#4224)
Bumps [securetar](https://github.com/pvizeli/securetar) from 2022.2.0 to 2023.3.0.
- [Release notes](https://github.com/pvizeli/securetar/releases)
- [Commits](https://github.com/pvizeli/securetar/compare/2022.02.0...2023.3.0)

---
updated-dependencies:
- dependency-name: securetar
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 12:29:18 -04:00
dependabot[bot]
5adddc97e3 Bump black from 23.1.0 to 23.3.0 (#4214)
Bumps [black](https://github.com/psf/black) from 23.1.0 to 23.3.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/23.1.0...23.3.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 11:48:12 -04:00
dependabot[bot]
d09f35f079 Bump cryptography from 39.0.2 to 40.0.1 (#4210)
Bumps [cryptography](https://github.com/pyca/cryptography) from 39.0.2 to 40.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/39.0.2...40.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 11:32:19 -04:00
dependabot[bot]
9a3459434f Bump sentry-sdk from 1.17.0 to 1.18.0 (#4213)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.17.0...1.18.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 10:46:17 -04:00
Mike Degatano
fce0d2aaed Prevent multiple data disks with name hassos-data-external (#4222)
* Prevent multiple data disks with name hassos-data-external

* Fix pylint issues

* Do rename before format
2023-04-01 08:40:19 +02:00
Mike Degatano
842e550dda Create issue for multiple data disks detected (#4218) 2023-03-31 11:31:39 -04:00
Mike Degatano
c9ee76f1d3 Strip null character off udisks2 paths (#4215)
* Strip null character off udisks2 paths

* Fix circular import
2023-03-31 10:23:30 -04:00
Stefan Agner
852771fbcf Ignore non-existing data disk (#4221) 2023-03-31 10:20:25 -04:00
Pascal Vizeli
de1f3555b1 Disable codenotary until rework of cosign (#4217)
* Disable codenotary until rework of cosign

* Skip code notary tests

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-03-31 11:11:29 +02:00
Mike Degatano
c0b75edfb7 Format data disk in Supervisor instead of OS Agent (#4212)
* Supervisor formats data disk instead of os agent

* Fix issues occurring during tests

* Can't migrate if target is too small
2023-03-30 14:15:07 -04:00
Mike Degatano
a3204f4ebd Use Udisks2 for available data disks (#4202)
* Use Udisks2 for available data disks

* pylint issues
2023-03-27 12:09:16 -04:00
dependabot[bot]
84e4d70a37 Bump pylint from 2.15.10 to 2.17.1 (#4204)
* Bump pylint from 2.15.10 to 2.17.1

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.10 to 2.17.1.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.15.10...v2.17.1)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix new pylint issues

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-03-27 12:08:40 -04:00
Mike Degatano
cede47e95c Increase middleware range 2023-03-27 12:08:01 -04:00
dependabot[bot]
75b3ebec7c Bump actions/stale from 7.0.0 to 8.0.0 (#4203)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 10:20:30 +02:00
dependabot[bot]
b707a468d2 Bump pre-commit from 3.2.0 to 3.2.1 (#4209)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 09:31:13 +02:00
dependabot[bot]
4e41255a57 Bump actions/checkout from 3.4.0 to 3.5.0 (#4206)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-26 10:56:13 +02:00
dependabot[bot]
3ceec044a8 Bump dbus-fast from 1.84.1 to 1.84.2 (#4153)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.84.1 to 1.84.2.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.84.1...v1.84.2)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-21 14:47:19 -04:00
Mike Degatano
3646ae070e Increase middleware range 2023-03-21 14:35:23 -04:00
Mike Degatano
a6caccd845 Use session dbus mocks for all tests (#4198)
* Use session dbus mocks for all tests

* func instead of fn for pylint
2023-03-21 07:30:31 +01:00
dependabot[bot]
c6ddc8e427 Bump coverage from 7.2.1 to 7.2.2 (#4193)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 10:07:02 +01:00
dependabot[bot]
8bfd07d66b Bump pre-commit from 3.1.1 to 3.2.0 (#4197)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 09:30:47 +01:00
dependabot[bot]
d764f00580 Bump sentry-sdk from 1.16.0 to 1.17.0 (#4192)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.16.0...1.17.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-17 16:19:27 -04:00
Mike Degatano
d9b86fa2ab Use session dbus for udisks2 tests (#4194)
* Use session dbus for udisks2 tests

* Don't redefine type
2023-03-17 20:56:34 +01:00
Mike Degatano
0ddce4d9bc Use session dbus for network tests (#4191)
* Use session dbus for network tests

* Don't use session dbus for coresys yet
2023-03-17 14:26:41 +01:00
dependabot[bot]
8386b5cb3a Bump actions/checkout from 3.3.0 to 3.4.0 (#4189)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-16 09:46:13 +01:00
Mike Degatano
8fc036874a Improve addon slug validation (#4188) 2023-03-14 08:38:12 +01:00
Mike Degatano
2a625defc0 Use session dbus for os agent tests (#4180) 2023-03-14 08:32:25 +01:00
dependabot[bot]
3f1e72d69f Bump urllib3 from 1.26.14 to 1.26.15 (#4186)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-13 11:32:18 +01:00
dependabot[bot]
42374a3a3f Bump actions/cache from 3.3.0 to 3.3.1 (#4185)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-13 08:52:23 +01:00
dependabot[bot]
2adebd9da6 Bump home-assistant/builder from 2022.11.0 to 2023.03.0 (#4182)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-10 09:34:36 +01:00
dependabot[bot]
3b2c75fbd7 Bump actions/cache from 3.2.5 to 3.3.0 (#4181)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-10 09:29:17 +01:00
dependabot[bot]
19f6e12936 Bump coverage from 7.1.0 to 7.2.1 (#4162)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.1.0 to 7.2.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.1.0...7.2.1)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-10 00:14:09 -05:00
dependabot[bot]
abe59ab1e5 Bump release-drafter/release-drafter from 5.22.0 to 5.23.0 (#4154)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.22.0 to 5.23.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.22.0...v5.23.0)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-09 23:47:19 -05:00
dependabot[bot]
79d8db6015 Bump getsentry/action-release from 1.2.1 to 1.3.1 (#4169)
Bumps [getsentry/action-release](https://github.com/getsentry/action-release) from 1.2.1 to 1.3.1.
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Commits](https://github.com/getsentry/action-release/compare/v1.2.1...v1.3.1)

---
updated-dependencies:
- dependency-name: getsentry/action-release
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-09 17:28:09 -05:00
dependabot[bot]
1b317f5e92 Bump pre-commit from 3.0.4 to 3.1.1 (#4164)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.0.4 to 3.1.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v3.0.4...v3.1.1)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-09 17:27:23 -05:00
dependabot[bot]
c262a39c11 Bump sentry-sdk from 1.15.0 to 1.16.0 (#4163)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.15.0...1.16.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-09 17:24:33 -05:00
dependabot[bot]
6ee86ee062 Bump typing-extensions from 4.3.0 to 4.5.0 (#4147)
Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.3.0 to 4.5.0.
- [Release notes](https://github.com/python/typing_extensions/releases)
- [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/python/typing_extensions/compare/4.3.0...4.5.0)

---
updated-dependencies:
- dependency-name: typing-extensions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-09 16:48:58 -05:00
dependabot[bot]
b3a869429f Bump pytest from 7.2.1 to 7.2.2 (#4170)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.2.1 to 7.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.2.1...7.2.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-09 16:21:04 -05:00
Stefan Agner
e4e9dee02c Add ODROID-M1 (#4177) 2023-03-09 16:20:19 -05:00
Joakim Sørensen
2887934dbe Bump frontend to 9602c686 (#4179) 2023-03-09 16:19:33 -05:00
Mike Degatano
daeec266cc Mock services on session dbus in tests (#4160)
* Mock services on session dbus in tests

* methods emit prop changes for testing
2023-03-08 11:10:24 +01:00
Mike Degatano
3887fcfc93 Test discovery message deleted on uninstall (#4174)
* Test discovery message deleted on uninstall

* Test data is correct since core looks at it
2023-03-08 11:08:55 +01:00
dependabot[bot]
ab83c51910 Bump cryptography from 39.0.1 to 39.0.2 (#4167)
Bumps [cryptography](https://github.com/pyca/cryptography) from 39.0.1 to 39.0.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/39.0.1...39.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-07 09:27:43 +01:00
Pascal Vizeli
2ae2d0e107 Performance tweaks middleware
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
2023-03-07 08:14:53 +00:00
dependabot[bot]
613ef9010a Bump gitpython from 3.1.30 to 3.1.31 (#4151)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.30 to 3.1.31.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.30...3.1.31)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2023-03-03 11:14:14 +01:00
Joakim Sørensen
675bea7835 Bump frontend to 84affcce (#4168) 2023-03-03 11:10:12 +01:00
Pascal Vizeli
3d74e07c5e Backport core api filter (#4165) 2023-03-01 08:52:19 +01:00
Pascal Vizeli
692d34a13c Handle OSError / Filesystem corruptions (#4127)
* Handle OSError / Filesystem corruptions

* Fix tests
2023-02-28 19:57:05 +01:00
Pascal Vizeli
440379680e Fix CI Supervisor version for tests (#4144)
* Install dbus applications for CI tests

* Update const.py

* fix tests

* Fix test references to DEV version

* sudo apt-get

* Update builder.yml

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-02-27 22:07:37 +01:00
Mike Degatano
165af46f54 Fix udisks2 standard options constant (#4145) 2023-02-15 17:03:41 +01:00
Raman Gupta
4c2d729646 Add udisks2 dbus support (#3848)
* Add udisks2 dbus support

* assert mountpoints

* Comment

* Add reference links

* docstring

* fix type

* fix type

* add typing extensions as import

* isort

* additional changes

* Simplify classes and conversions, fix bugs

* More simplification

* Fix imports

* fix pip

* Add additional properties and fix requirements

* fix tests maybe

* Handle optionality of certain configuration details

* black

* connect to devices before returning them

* Refactor for latest dbus work

* Not .items

* fix mountpoints logic

* use variants

* Use variants for options too

* isort

* Switch to dbus fast

* Move import to parent

* Add some fixture data

* Add another fixture and reduce the block devices list

* Implement changes discussed with mike

* Add property fixtures

* update object path

* Fix get_block_devices call

* Tests and refactor to minimize dbus reconnects

* Call super init in DBusInterfaceProxy

* Fix permissions on introspection files

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-02-15 08:17:29 +01:00
dependabot[bot]
8ffd227849 Bump dbus-fast from 1.84.0 to 1.84.1 (#4141)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.84.0 to 1.84.1.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.84.0...v1.84.1)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-14 13:33:14 +01:00
dependabot[bot]
64c5ba1635 Bump aiohttp from 3.8.3 to 3.8.4 (#4138)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.3 to 3.8.4.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.8.3...v3.8.4)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-13 13:28:56 +01:00
dependabot[bot]
37a247160e Bump actions/cache from 3.2.4 to 3.2.5 (#4137)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-10 09:25:31 +01:00
Stefan Agner
919f1e9149 Add host UTS namespace support for Add-Ons (#3596)
* Add host UTS namespace support for Add-Ons

Using the UTS host namespace is useful when running a mDNS responder
which learns the hostname from the gethostname syscall. This way the
add-on can use the system's hostname without further doing.

* Check host_uts default

* Adjust Security rating if host UTS mode and CAP_ADMIN is set

* Don't add hostname to DNS server if UTS namespace is disabled

* Simplify hostname logic

* Update supervisor/docker/addon.py

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-02-09 17:26:10 -05:00
dependabot[bot]
d73d8d00f0 Bump sentry-sdk from 1.14.0 to 1.15.0 (#4135)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.14.0...1.15.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-08 11:05:41 -05:00
dependabot[bot]
09c699a2fe Bump cryptography from 39.0.0 to 39.0.1 (#4134)
Bumps [cryptography](https://github.com/pyca/cryptography) from 39.0.0 to 39.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/39.0.0...39.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-08 10:26:29 -05:00
dependabot[bot]
cb992762d1 Bump pre-commit from 3.0.3 to 3.0.4 (#4132)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-06 17:01:09 +01:00
dependabot[bot]
8f0cec10d5 Bump pre-commit from 3.0.2 to 3.0.3 (#4128)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v3.0.2...v3.0.3)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-02 12:21:57 +01:00
dependabot[bot]
4a0e17f050 Bump black from 22.12.0 to 23.1.0 (#4126)
* Bump black from 22.12.0 to 23.1.0

Bumps [black](https://github.com/psf/black) from 22.12.0 to 23.1.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.12.0...23.1.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump black in precommit

* reformat with new black version

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-02-01 16:41:46 -05:00
dependabot[bot]
b4c74404e3 Bump actions/cache from 3.2.3 to 3.2.4 (#4124)
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.2.3...v3.2.4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-01 15:15:54 -05:00
dependabot[bot]
649091f3bd Bump pre-commit from 3.0.1 to 3.0.2 (#4122)
* Bump pre-commit from 3.0.1 to 3.0.2

Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump isort

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-02-01 14:49:05 -05:00
dependabot[bot]
a27be5d621 Bump pre-commit from 3.0.0 to 3.0.1 (#4120)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-27 10:58:25 +01:00
dependabot[bot]
939eb81581 Bump flake8-docstrings from 1.6.0 to 1.7.0 (#4119)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-26 18:44:50 +01:00
dependabot[bot]
ee1daa0b35 Bump coverage from 7.0.5 to 7.1.0 (#4117)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-25 10:25:22 +01:00
dependabot[bot]
242c05a19b Bump sentry-sdk from 1.13.0 to 1.14.0 (#4112)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.13.0...1.14.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 13:10:30 -05:00
Mike Degatano
9024085712 Don't log error for addon unavailable (#4115) 2023-01-24 18:41:00 +01:00
dependabot[bot]
e0abb98aaf Bump debugpy from 1.6.5 to 1.6.6 (#4113)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 09:03:01 +01:00
dependabot[bot]
4ffa628a6e Bump pre-commit from 2.21.0 to 3.0.0 (#4114)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 08:32:28 +01:00
Mike Degatano
417ee418f2 Handle UnicodeDecodeError (#4110) 2023-01-21 17:59:55 +01:00
Mike Degatano
0f79ba5a3d AppArmor tests and fix profile name in flag (#4109) 2023-01-20 23:19:33 +01:00
n0toose
47fd849319 Fix AppArmor name-related exceptions (#4078)
- 'Too many' is misleading if there are no profiles.
- profiles just returns set() -- using profile_file should be more correct.
2023-01-18 15:04:27 -05:00
dependabot[bot]
99e0eab958 Bump dbus-fast from 1.74.0 to 1.84.0 (#4094)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.74.0 to 1.84.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.74.0...v1.84.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-18 13:47:23 -05:00
dependabot[bot]
0a753c55ca Bump cryptography from 38.0.4 to 39.0.0 (#4077)
Bumps [cryptography](https://github.com/pyca/cryptography) from 38.0.4 to 39.0.0.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/38.0.4...39.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-18 12:16:10 +01:00
Mike Degatano
72d81e43dd Allow all job conditions to be ignored (#4107)
* Allow all job conditions to be ignored

* Clear features cache in test

* patch out OS Agent supported feature
2023-01-18 12:14:12 +01:00
dependabot[bot]
83e5359bd2 Bump pydocstyle from 6.2.3 to 6.3.0 (#4108)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-18 09:27:22 +01:00
dependabot[bot]
51875bdcd5 Bump pytest from 7.2.0 to 7.2.1 (#4104)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 08:15:33 +01:00
dependabot[bot]
ecabf9dea7 Bump actions/setup-python from 4.4.0 to 4.5.0 (#4100)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-13 08:54:59 +01:00
dependabot[bot]
c1954f4426 Bump sentry-sdk from 1.12.1 to 1.13.0 (#4101)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-13 08:54:22 +01:00
Mike Degatano
0991f52100 sys_capture_exception to capture_exception (#4095) 2023-01-12 17:47:08 +01:00
Mike Degatano
fed4a05003 Clarify message when addon unavailable (#4098) 2023-01-12 17:46:40 +01:00
dependabot[bot]
089635f4d3 Bump coverage from 7.0.4 to 7.0.5 (#4099)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-11 08:55:02 +01:00
dependabot[bot]
15fa8de05c Bump pylint from 2.15.9 to 2.15.10 (#4096)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-10 11:27:47 +01:00
dependabot[bot]
8fc91f5288 Bump pydocstyle from 6.2.2 to 6.2.3 (#4092)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-09 12:01:29 +01:00
dependabot[bot]
4461192fa7 Bump actions/cache from 3.2.2 to 3.2.3 (#4091)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 11:28:54 +01:00
dependabot[bot]
2fe7c0dce6 Bump actions/upload-artifact from 3.1.1 to 3.1.2 (#4090)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 10:30:52 +01:00
dependabot[bot]
e2e11faf18 Bump coverage from 7.0.3 to 7.0.4 (#4093)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 10:30:36 +01:00
dependabot[bot]
fcbef6b78b Bump debugpy from 1.6.4 to 1.6.5 (#4088)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-06 10:36:31 +01:00
dependabot[bot]
10810fb1b9 Bump actions/checkout from 3.2.0 to 3.3.0 (#4087)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-06 08:39:18 +01:00
Franck Nijhof
92408bb893 Add support for ESPHome dashboard discovery (#4084) 2023-01-05 19:58:55 +01:00
dependabot[bot]
61fc01915f Bump pydocstyle from 6.2.0 to 6.2.2 (#4082)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-05 18:53:10 +01:00
dependabot[bot]
fea60c57a2 Bump coverage from 7.0.2 to 7.0.3 (#4083)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-04 10:34:31 +01:00
dependabot[bot]
c1ac6c0432 Bump pydocstyle from 6.1.1 to 6.2.0 (#4081)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-03 12:33:30 +01:00
dependabot[bot]
64ca530e66 Bump coverage from 7.0.1 to 7.0.2 (#4080)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-03 11:13:26 +01:00
dependabot[bot]
08f290ca10 Bump release-drafter/release-drafter from 5.21.1 to 5.22.0 (#4079)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-03 10:54:51 +01:00
dependabot[bot]
03849258eb Bump time-machine from 2.8.2 to 2.9.0 (#4076)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-02 10:37:57 +01:00
dependabot[bot]
32d0d84c53 Bump gitpython from 3.1.29 to 3.1.30 (#4074)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-30 20:16:51 +01:00
dependabot[bot]
83265c4dc5 Bump attrs from 22.1.0 to 22.2.0 (#4062)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-29 15:46:05 +01:00
dependabot[bot]
a9cbeb21c9 Bump cryptography from 38.0.3 to 38.0.4 (#4028)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-29 14:36:58 +01:00
dependabot[bot]
1af4a362c2 Bump ciso8601 from 2.2.0 to 2.3.0 (#4063)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-29 12:39:02 +01:00
dependabot[bot]
b9e2cfad4d Bump flake8 from 5.0.4 to 6.0.0 (#4020)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-12-29 11:52:14 +01:00
dependabot[bot]
726ded70d3 Bump sentry-sdk from 1.11.1 to 1.12.1 (#4057)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-29 11:02:53 +01:00
dependabot[bot]
ac56f1511f Bump pyupgrade from 3.2.2 to 3.3.1 (#4041)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-12-29 10:46:40 +01:00
dependabot[bot]
3d7d52a62b Bump black from 22.10.0 to 22.12.0 (#4049)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-12-29 10:44:06 +01:00
dependabot[bot]
941e1f5c91 Bump debugpy from 1.6.3 to 1.6.4 (#4030)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-29 10:19:34 +01:00
dependabot[bot]
1a2b13018a Bump pre-commit from 2.20.0 to 2.21.0 (#4071)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-28 11:38:08 +01:00
dependabot[bot]
da721f455e Bump actions/cache from 3.2.1 to 3.2.2 (#4070)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-28 11:37:03 +01:00
dependabot[bot]
4e91db10a9 Bump coverage from 7.0.0 to 7.0.1 (#4068)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-27 08:27:47 +01:00
dependabot[bot]
ba9bcd9e57 Bump actions/cache from 3.2.0 to 3.2.1 (#4066)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-27 08:26:53 +01:00
dependabot[bot]
c193c91fe7 Bump actions/setup-python from 4.3.1 to 4.4.0 (#4064)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-23 12:52:03 +01:00
dependabot[bot]
bdde24ae9e Bump actions/cache from 3.0.11 to 3.2.0 (#4061)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-22 08:21:19 +01:00
dependabot[bot]
b56995be27 Bump actions/stale from 6.0.1 to 7.0.0 (#4059)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-21 08:25:12 +01:00
Stefan Agner
1f7199cf00 Add OTBR discovery (#4040)
* Add OTBR discovery

* Fix typo

* Move constants to correct file

* Drop Web Service port

* Use existing port constant
2022-12-19 14:05:15 +01:00
dependabot[bot]
e48e024bb3 Bump pylint from 2.15.6 to 2.15.9 (#4055)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-19 10:28:19 +01:00
dependabot[bot]
02c181c1ff Bump coverage from 6.5.0 to 7.0.0 (#4056)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-19 09:09:49 +01:00
Joakim Sørensen
70cf6cc0d9 Bump frontend to 5cabf1d0 (#4051) 2022-12-13 12:22:48 +01:00
Sergio Oller
9abf38f285 Do not let aiohttp add a Content-Type header (#4038)
* Do not let aiohttp add a Content-Type header

aiohttp adds a Content-Type header by default, as well as other headers.

This may usually be convenient, but it breaks APIs that explicitly ask for no content type header, for instance on post requests with an empty body.

Since ingress is proxying the requests from the browser to the add-on, it should avoid modifying them.

I only skip this header auto generation because it actually breaks the Adguard add-on.

- https://github.com/hassio-addons/addon-adguard-home/issues/359

I haven't tested this yet.

* Use headers constant
2022-12-13 09:46:10 +01:00
dependabot[bot]
54dfba1faa Bump actions/checkout from 3.1.0 to 3.2.0 (#4050)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 08:33:45 +01:00
dependabot[bot]
ed778f09ee Bump actions/setup-python from 4.3.0 to 4.3.1 (#4043)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-09 13:54:24 +01:00
Stefan Agner
b044095e57 Prevent multiple primary interfaces (#4046) 2022-12-09 12:56:52 +01:00
dependabot[bot]
c41f13bf18 Bump dessant/lock-threads from 3.0.0 to 4.0.0 (#4036)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 09:47:37 +01:00
Pascal Vizeli
2ddb5ca53f Support arch specific dockerfiles (#4022) 2022-11-28 09:09:22 +01:00
dependabot[bot]
fad75810ab Bump home-assistant/builder from 2022.09.0 to 2022.11.0 (#4026)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-25 08:00:34 +01:00
dependabot[bot]
4d9e30adef Bump sentry-sdk from 1.11.0 to 1.11.1 (#4017)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-23 10:03:43 +01:00
dependabot[bot]
80a6171692 Bump pylint from 2.15.5 to 2.15.6 (#4013)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 09:06:26 +01:00
dependabot[bot]
815669e6e3 Bump sentry-sdk from 1.10.1 to 1.11.0 (#4001)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.10.1 to 1.11.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.10.1...1.11.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-11-15 16:25:42 -05:00
Mike Degatano
a8133f0640 Jobs reset saves data (#4007) 2022-11-15 22:21:45 +01:00
Pascal Vizeli
2809f23391 Make dbus-fast calls more robust (#4005)
* Make dbus-fast calls more robust

* Handle all exceptions and add test

* DBus minimal can't return commands list

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-11-15 22:19:38 +01:00
Martin Hjelmare
348fb56cb5 Add matter discovery (#4002) 2022-11-15 15:07:56 +01:00
dependabot[bot]
4afbedfa3d Bump dbus-fast from 1.73.0 to 1.74.0 (#4000)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.73.0 to 1.74.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.73.0...v1.74.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-11-15 09:45:26 +01:00
Mike Degatano
8d495aa437 Call dbus with string value not enum (#3996)
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-11-15 09:28:40 +01:00
Mike Degatano
9559ac06b9 Update pre-commit (#3997) 2022-11-15 09:10:16 +01:00
dependabot[bot]
e80d882395 Bump dbus-fast from 1.61.1 to 1.73.0 (#3995)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.61.1 to 1.73.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.61.1...v1.73.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-14 11:13:34 -05:00
Mike Degatano
14fcda5d78 Sentry only loaded when diagnostics on (#3993)
* Sentry only loaded when diagnostics on

* Logging when sentry is closed
2022-11-13 21:23:52 +01:00
dependabot[bot]
14cd261b76 Bump pyupgrade from 3.2.1 to 3.2.2 (#3994)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.2.1...v3.2.2)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-11 08:50:43 -05:00
dependabot[bot]
783395a27d Bump pyupgrade from 3.2.0 to 3.2.1 (#3992)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.2.0...v3.2.1)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-10 12:55:48 -05:00
dependabot[bot]
a2dffe595e Bump pyupgrade from 3.1.0 to 3.2.0 (#3979)
* Bump pyupgrade from 3.1.0 to 3.2.0

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

* Fixing pyupgrade

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-11-08 19:38:55 +01:00
Mike Degatano
a0b28ebb97 Use CPE name for boards (#3990)
* Use CPE name for boards

* Simplify test
2022-11-08 09:12:52 +01:00
dependabot[bot]
89de909020 Bump getsentry/action-release from 1.2.0 to 1.2.1 (#3986)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-07 16:03:16 +01:00
Mike Degatano
672b220f69 Add boards APIs (#3984)
* Add boards APIs

* Move boards to agent
2022-11-04 08:22:24 +01:00
dependabot[bot]
d59625e5b8 Bump dbus-fast from 1.49.0 to 1.61.1 (#3982)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.49.0 to 1.61.1.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.49.0...v1.61.1)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-03 17:38:34 -04:00
dependabot[bot]
2947e8e8e9 Bump cryptography from 38.0.1 to 38.0.3 (#3983)
Bumps [cryptography](https://github.com/pyca/cryptography) from 38.0.1 to 38.0.3.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/38.0.1...38.0.3)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-03 10:28:07 -04:00
Mike Degatano
5f04e4fb6a Fix addon image changed on update (#3971) 2022-11-03 14:21:57 +01:00
dependabot[bot]
4c5d54b7a3 Bump docker from 6.0.0 to 6.0.1 (#3985)
Bumps [docker](https://github.com/docker/docker-py) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/6.0.0...6.0.1)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-03 08:30:16 +01:00
dependabot[bot]
30932a83f8 Bump dbus-fast from 1.48.0 to 1.49.0 (#3975)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-27 09:58:07 +02:00
Mike Degatano
1df0a5db2a Make host log endpoints cli friendly (#3974)
* Make host log endpoints cli friendly

* Remove blank identifiers
2022-10-27 08:48:15 +02:00
dependabot[bot]
9affa5316c Bump pytest from 7.1.3 to 7.2.0 (#3972)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-26 10:00:44 +02:00
dependabot[bot]
a13c8d86b9 Bump deepmerge from 1.0.1 to 1.1.0 (#3970)
Bumps [deepmerge](https://github.com/toumorokoshi/deepmerge) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/toumorokoshi/deepmerge/releases)
- [Commits](https://github.com/toumorokoshi/deepmerge/compare/v1.0.1...v1.1.0)

---
updated-dependencies:
- dependency-name: deepmerge
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-25 15:23:20 -04:00
Joakim Sørensen
80248dc36d Bump forntend to 5bb95388 (#3968) 2022-10-25 15:17:53 +02:00
dependabot[bot]
2ad122ec18 Bump pylint from 2.15.4 to 2.15.5 (#3966)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-24 14:24:57 +02:00
dependabot[bot]
d7ec3646f9 Bump actions/upload-artifact from 3.1.0 to 3.1.1 (#3963)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-24 14:24:09 +02:00
dependabot[bot]
030e1a92f3 Bump home-assistant/wheels from 2022.06.7 to 2022.10.1 (#3964)
Bumps [home-assistant/wheels](https://github.com/home-assistant/wheels) from 2022.06.7 to 2022.10.1.
- [Release notes](https://github.com/home-assistant/wheels/releases)
- [Commits](https://github.com/home-assistant/wheels/compare/2022.06.7...2022.10.1)

---
updated-dependencies:
- dependency-name: home-assistant/wheels
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-24 10:03:08 +02:00
dependabot[bot]
3cf999b306 Bump sentry-sdk from 1.10.0 to 1.10.1 (#3965)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.10.0...1.10.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-24 10:02:54 +02:00
dependabot[bot]
2d2926f7ff Bump dbus-fast from 1.47.0 to 1.48.0 (#3962)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.47.0 to 1.48.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.47.0...v1.48.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-21 14:39:50 -04:00
dependabot[bot]
23ba0ad6a5 Bump sentry-sdk from 1.9.10 to 1.10.0 (#3961)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.10 to 1.10.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.9.10...1.10.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-21 13:17:37 -04:00
dependabot[bot]
38fffb7641 Bump dbus-fast from 1.41.0 to 1.47.0 (#3959)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.41.0 to 1.47.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.41.0...v1.47.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-20 13:20:00 -04:00
dependabot[bot]
03eda30e20 Bump release-drafter/release-drafter from 5.21.0 to 5.21.1 (#3957)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-18 17:38:29 +02:00
Joakim Sørensen
10c87d5a39 Add action concurrency (#3956) 2022-10-17 08:04:38 +02:00
Mike Degatano
7a0c4c5060 Unsupported check for journal gateway (#3950) 2022-10-16 11:07:31 +02:00
Mike Degatano
5d2b5bada7 Events when unhealthy/unsupported changes (#3951)
* Events when unhealthy/unsupported changes

* called_once_with to called_once
2022-10-16 11:07:15 +02:00
Mike Degatano
bde5c938a7 Ignore veth changes (#3955)
* Reduce log noise for unmanaged interfaces

* Ignore signals with veth changes only

* Fix test and add one
2022-10-16 11:06:35 +02:00
dependabot[bot]
34afcef4f1 Bump actions/cache from 3.0.10 to 3.0.11 (#3952)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-14 10:11:15 +02:00
Stefan Agner
2ebb405871 Add enhanced logging REST endpoints using systemd-journal-gatewayd (#3291)
* Add enhanced logging REST endpoints using systemd-journal-gatewayd

Add /host/logs/entries and /host/logs/{identifier}/entries to expose log
entries from systemd-journald running on the host. Use
systemd-journal-gatewayd which exposes the logs to the Supervisor via
Unix socket.

Current two query string parameters are allowed: "boot" and "follow".
The first will only return logs since last boot. The second will keep
the HTTP request open and send new log entries as they get added to the
systemd-journal.

* Allow Range header

Forward the Range header to systemd-journal-gatewayd. This allows to
select only a certain amount of log data. The Range header is a standard
header to select only partial amount of data. However, the "entries="
prefix is custom for systemd-journal-gatewayd, denoting that the numbers
following represent log entries (as opposed to bytes or other metrics).

* Avoid connecting if systemd-journal-gatewayd is not available

* Use path for all options

* Add pytests

* Address pylint issues

* Boot ID offsets and slug to identifier

* Fix tests

* API refactor from feedback

* fix tests and add identifiers

* stop isort and pylint fighting

* fix tests

* Update default log identifiers

* Only modify /host/logs endpoints

* Fix bad import

* Load log caches asynchronously at startup

* Allow task to complete in fixture

* Boot IDs and identifiers loaded on demand

* Add suggested identifiers

* Fix tests around boot ids

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-10-13 11:40:11 -04:00
Joakim Sørensen
1f7c067c90 Job conditions take a list (#3949) 2022-10-13 09:59:06 -04:00
Joakim Sørensen
9da4ea20a9 Add unhealthy reasons to block message (#3948) 2022-10-13 09:28:30 -04:00
dependabot[bot]
767c2bd91a Bump docker/login-action from 2.0.0 to 2.1.0 (#3946)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-13 09:33:00 +02:00
Mike Degatano
7c1f03932e Fix host reload test (#3945) 2022-10-12 15:46:51 -04:00
dependabot[bot]
f3d1904e28 Bump dbus-fast from 1.24.0 to 1.41.0 (#3939)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.24.0 to 1.41.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.24.0...v1.41.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-11 11:57:51 -04:00
dependabot[bot]
9cc87cabcd Bump gitpython from 3.1.28 to 3.1.29 (#3937)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.28 to 3.1.29.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.28...3.1.29)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-11 11:30:28 -04:00
dependabot[bot]
18299cf274 Bump pylint from 2.15.3 to 2.15.4 (#3936)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.3 to 2.15.4.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.15.3...v2.15.4)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-11 11:29:46 -04:00
dependabot[bot]
261c2431c6 Bump pyupgrade from 3.0.0 to 3.1.0 (#3938)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-11 14:14:10 +02:00
dependabot[bot]
d36fc938b8 Bump actions/setup-python from 4.2.0 to 4.3.0 (#3935)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-11 14:14:00 +02:00
dependabot[bot]
dc0430f677 Bump actions/stale from 6.0.0 to 6.0.1 (#3933)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-10 12:33:24 +02:00
Mike Degatano
1e2dc93158 Ask for system information in bug reports (#3932)
* Ask for system information in bug reports

* Ask for diagnostics not versions
2022-10-07 13:01:22 -04:00
dependabot[bot]
69a33777a7 Bump gitpython from 3.1.27 to 3.1.28 (#3930)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.27 to 3.1.28.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.27...3.1.28)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-07 11:47:03 -04:00
dependabot[bot]
57f0c9af1b Bump black from 22.8.0 to 22.10.0 (#3931)
Bumps [black](https://github.com/psf/black) from 22.8.0 to 22.10.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.8.0...22.10.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-07 11:46:24 -04:00
dependabot[bot]
14d26ad9aa Bump actions/checkout from 3.0.2 to 3.1.0 (#3927)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.0.2 to 3.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.0.2...v3.1.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-05 10:33:03 -04:00
Mike Degatano
b36316416b Fix property change debug log (#3926) 2022-10-05 09:40:59 +02:00
dependabot[bot]
c634cc1f34 Bump dbus-fast from 1.17.0 to 1.24.0 (#3921)
* Bump dbus-fast from 1.17.0 to 1.23.0

Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.17.0 to 1.23.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.17.0...v1.23.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump to 1.24.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-10-04 19:03:22 -04:00
dependabot[bot]
646725bb08 Bump pyupgrade from 2.38.2 to 3.0.0 (#3922)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.38.2 to 3.0.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.38.2...v3.0.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-04 14:32:37 -04:00
Mike Degatano
618c89c4d8 Don't sync unmanaged interfaces (#3925) 2022-10-04 20:17:30 +02:00
dependabot[bot]
0dc442d0cb Bump actions/cache from 3.0.9 to 3.0.10 (#3920)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.9 to 3.0.10.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.9...v3.0.10)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-04 11:50:58 -04:00
dependabot[bot]
6ae664b448 Bump sentry-sdk from 1.9.9 to 1.9.10 (#3923)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.9 to 1.9.10.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.9.9...1.9.10)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-04 11:49:18 -04:00
Pascal Vizeli
18b43ce767 Catch OS-Error (#3924) 2022-10-04 11:48:53 -04:00
Pascal Vizeli
f9b474866b Adjust stale bot (#3915) 2022-10-03 10:14:54 -04:00
dependabot[bot]
1a76035682 Bump actions/cache from 3.0.8 to 3.0.9 (#3912)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.8 to 3.0.9.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.8...v3.0.9)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-30 11:23:02 +02:00
dependabot[bot]
e332f4b2bd Bump coverage from 6.4.4 to 6.5.0 (#3914)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.4.4 to 6.5.0.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.4.4...6.5.0)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-30 11:22:54 +02:00
dependabot[bot]
ab27fd7b57 Bump time-machine from 2.8.1 to 2.8.2 (#3913)
Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/adamchainz/time-machine/releases)
- [Changelog](https://github.com/adamchainz/time-machine/blob/main/HISTORY.rst)
- [Commits](https://github.com/adamchainz/time-machine/compare/2.8.1...2.8.2)

---
updated-dependencies:
- dependency-name: time-machine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-30 11:22:44 +02:00
dependabot[bot]
12c0faf803 Bump dbus-fast from 1.15.1 to 1.17.0 (#3907)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.15.1 to 1.17.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.15.1...v1.17.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-29 12:18:15 -04:00
Mike Degatano
c0a409b25f No unpack variants for property sets (#3911) 2022-09-29 18:13:02 +02:00
dependabot[bot]
2be33a80a7 Bump pytest-cov from 3.0.0 to 4.0.0 (#3909)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-29 10:06:08 +02:00
Mike Degatano
d684aab207 Addon version shouldn't rely on io.hass.version (#3906)
* Addon version doesn't rely on `io.hass.version`

* Legacy and non-legacy match so remove the if
2022-09-27 21:43:42 +02:00
Mike Degatano
ec6da7851e Bump HA timeout to match S6_SERVICES_GRACETIME (#3904) 2022-09-27 18:55:18 +02:00
dependabot[bot]
eb621f6a2c Bump sentry-sdk from 1.9.8 to 1.9.9 (#3903)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.8 to 1.9.9.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.9.8...1.9.9)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-27 08:41:24 +02:00
Mike Degatano
a1a9c55542 Manual stop true after a reboot (#3902)
* Manual stop true after a reboot

* Fix test
2022-09-27 08:40:55 +02:00
Mike Degatano
d15a7c27ca Don't disconnect in executor (#3901)
* Don't disconnect in executor

* DBus disconnect doesn't raise

* Separate shutdown and disconnect

* pylint fix

* noop coroutine and test
2022-09-27 08:33:28 +02:00
Mike Degatano
fb46335d16 Bump dbus-fast from 1.14.0 to 1.15.1 (#3899) 2022-09-26 20:26:25 -04:00
Mike Degatano
48e666e1fc Bad introspection causes DBus error not KeyError (#3898)
* Bad introspection causes DBus error not KeyError

* Fix none error on disconnect race
2022-09-26 18:27:08 +02:00
dependabot[bot]
ff462ae976 Bump dbus-fast from 1.7.0 to 1.14.0 (#3897)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.7.0 to 1.14.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.7.0...v1.14.0)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-26 11:01:31 -04:00
dependabot[bot]
23731d9a6e Bump pyupgrade from 2.38.0 to 2.38.2 (#3896)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.38.0 to 2.38.2.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.38.0...v2.38.2)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-26 11:31:34 +02:00
Mike Degatano
30df8ce5c7 Attach event monitor after addon restore (#3893)
* Attach event monitor after addon restore

* Load after install and listener removal
2022-09-23 21:11:36 +02:00
Mike Degatano
951efd6b29 Replace __del__ with explicit disconnect (#3892) 2022-09-23 10:28:16 +02:00
Pascal Vizeli
262fd05c6d Add portainer as container orchestra (#3889) 2022-09-22 11:12:37 -04:00
Mike Degatano
2a6fc512e7 Check if issue in list, not end of list in test (#3891)
* Check if issue in list, not end of list

* Similar fix to other test
2022-09-22 16:52:07 +02:00
dependabot[bot]
bb0d89f8fd Bump aiohttp from 3.8.2 to 3.8.3 (#3888)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.2 to 3.8.3.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.8.2...v3.8.3)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 10:44:43 +02:00
dependabot[bot]
e9ccc7ee19 Bump actions/stale from 5.2.0 to 6.0.0 (#3887)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 09:49:54 +02:00
Mike Degatano
a5103cc329 Add restart policy evaluation (#3886)
* Add restart policy evaluation

* No container meta does not fail evaluation
2022-09-22 09:16:33 +02:00
Mike Degatano
c24b811180 Use dbus-fast unpack_variants option (#3885)
* Use dbus-fast unpack_variants option

* More readable log on signals
2022-09-21 20:52:06 +02:00
dependabot[bot]
611963f5dd Bump aiohttp from 3.8.1 to 3.8.2 (#3883)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.1 to 3.8.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/v3.8.2/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.8.1...v3.8.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-21 09:24:40 +02:00
Mike Degatano
0958cd0c06 Switch from dbus-next to dbus-fast (#3882)
* Switch to dbus-fast

* dbus-fast==1.6.0
2022-09-21 09:24:04 +02:00
dependabot[bot]
c406814794 Bump pylint from 2.15.2 to 2.15.3 (#3880)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.2 to 2.15.3.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.15.2...v2.15.3)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-20 17:39:07 +02:00
dependabot[bot]
c3459fd32a Bump codecov/codecov-action from 3.1.0 to 3.1.1 (#3879)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-20 16:22:28 +02:00
Mike Degatano
2072370ccc Revert "Switch to dbus-fast (#3877)" (#3878)
This reverts commit 615758a1df.
2022-09-19 17:18:25 -04:00
Mike Degatano
615758a1df Switch to dbus-fast (#3877) 2022-09-19 21:55:22 +02:00
Mike Degatano
cd10b597dd Empty string in gateway returns none (#3873) 2022-09-17 16:24:56 +02:00
dependabot[bot]
50c277137d Bump pylint from 2.14.5 to 2.15.2 (#3849)
* Bump pylint from 2.14.5 to 2.15.2

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.14.5 to 2.15.2.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.14.5...v2.15.2)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix unspecified-encoding pylint errors

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-09-17 09:56:03 +02:00
Mike Degatano
99bc201688 Listen for dbus property changes (#3872)
* Listen for dbus property changes

* Avoid remaking dbus proxy objects

* proper snake case for pylint

* some cleanup and more tests
2022-09-17 09:55:41 +02:00
dependabot[bot]
0b09eb3659 Bump actions/stale from 5.1.1 to 5.2.0 (#3867)
Bumps [actions/stale](https://github.com/actions/stale) from 5.1.1 to 5.2.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5.1.1...v5.2.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 15:28:08 -04:00
dependabot[bot]
a6795536ad Bump pyupgrade from 2.37.3 to 2.38.0 (#3870)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.37.3 to 2.38.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.37.3...v2.38.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 15:27:42 -04:00
dependabot[bot]
a46536e9be Bump awesomeversion from 22.8.0 to 22.9.0 (#3871)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 08:20:37 +02:00
dependabot[bot]
c01bed9d97 Bump release-drafter/release-drafter from 5.20.1 to 5.21.0 (#3869)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 08:20:09 +02:00
Pascal Vizeli
2f4e06aadf Only update HW condition at once (#3868)
* Only update HW condition at once

* extend logging
2022-09-15 22:18:14 +02:00
Mike Degatano
b8249548ae Fix network vlan api (#3865) 2022-09-13 21:23:13 +02:00
Mike Degatano
5f98ab7e3e Reduce patching call dbus in tests (#3866) 2022-09-13 21:22:15 +02:00
Mike Degatano
d195f19fa8 Refactor to dbus-next proxy interfaces (#3862)
* Refactor to dbus-next proxy interfaces

* Fix tests mocking dbus methods

* Fix call dbus
2022-09-13 13:45:28 -04:00
Joakim Sørensen
c67d4d7c0b Cleanup evaluations (#3857)
* Cleanup

* move

* Add OS available test

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-09-13 13:19:07 -04:00
Joakim Sørensen
5aa8028ff5 Use the same python version for all steps (#3864) 2022-09-13 19:03:57 +02:00
Mike Degatano
b71c6c60da Share MessageBus across dbus objects (#3860)
* Share MessageBus across dbus objects

* Fix connect calls in tests
2022-09-12 20:10:12 +02:00
Mike Degatano
4f272ad4fd Dbus refactor and tests (#3854)
* Dbus refactor and tests

* Link to timedate introspection
2022-09-12 11:59:56 -04:00
dependabot[bot]
611128c014 Bump home-assistant/builder from 2022.07.0 to 2022.09.0 (#3852)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2022.07.0 to 2022.09.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2022.07.0...2022.09.0)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-10 08:54:25 -04:00
Pascal Vizeli
cbf73ceaa3 Bump supported docker version (#3853)
* Bump supported docker version

* Update supervisor/docker/manager.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2022-09-10 08:53:25 -04:00
Stefan Agner
01e24a3e74 Replace loop test fixture with event_loop (#3847)
This addresses a deprecation warning when calling tests with Python
3.10:

```
../python3.10/site-packages/pytest_aiohttp/plugin.py:33: DeprecationWarning: 'loop' fixture is deprecated and scheduled for removal, please use 'event_loop' instead
```
2022-09-09 09:54:57 -04:00
dependabot[bot]
10dcf5c12f Bump cryptography from 37.0.4 to 38.0.1 (#3850)
Bumps [cryptography](https://github.com/pyca/cryptography) from 37.0.4 to 38.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/37.0.4...38.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-08 11:21:00 +02:00
Mike Degatano
ebae1e70ee Add tests for backups check (#3845) 2022-09-07 10:33:46 +02:00
dependabot[bot]
b1ddb917c8 Bump sentry-sdk from 1.9.7 to 1.9.8 (#3843)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.7 to 1.9.8.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.9.7...1.9.8)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-06 18:13:33 +02:00
dependabot[bot]
d6c25c4188 Bump pytest from 7.1.2 to 7.1.3 (#3842)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.2 to 7.1.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.2...7.1.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-06 18:13:22 +02:00
Joakim Sørensen
170e85396e Add missing await in backup check (#3844) 2022-09-06 12:24:27 +02:00
Mike Degatano
bf48d48c51 Create issue+suggestion when no recent backup (#3814)
* Automatic full backup option

* Fix test for change in free space check

* Suggestions only, no automation

* Remove extra in backup config schema
2022-09-03 09:50:23 +02:00
Mike Degatano
fc646db95f Reduce connectivity checks (#3836)
* Reduce connectivity checks

* Fix/remove connectivity tests

* Remove throttle from prior connectivity tests

* Use dbus_property wrapper

* Allow variable throttle period with lambda

* Add evaluation for connectivity check disabled
2022-09-03 09:48:30 +02:00
dependabot[bot]
0769af9383 Bump sentry-sdk from 1.9.6 to 1.9.7 (#3840)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.6 to 1.9.7.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.9.6...1.9.7)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 13:30:55 -04:00
Mike Degatano
1f28e6ad93 Fire issue events on HA's bus (#3837)
* Fire issue events on HA's bus

* Convey event type with event field

* Message for humans
2022-09-02 17:40:10 +02:00
Marco Trevisan
2dab39bf90 supervisor/backup: Ensure compressed flag is respected by homeassistant (#3839)
As per commit 80e67b3 we're supporting a compressed flag on backups to
define whether a tar archive should be fully compressed or not, but
while we respect this for all the addons and folders we don't do it for
the actual homeassistant archive, that is always compressed despite the
passed flag.

Fix this by applying the same logic to the homeassistant archive too.
2022-09-02 09:21:33 +02:00
dependabot[bot]
dcd0592d44 Bump sentry-sdk from 1.9.5 to 1.9.6 (#3835)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.5 to 1.9.6.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.9.5...1.9.6)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 10:51:37 +02:00
dependabot[bot]
7c4b20380e Bump black from 22.6.0 to 22.8.0 (#3834)
Bumps [black](https://github.com/psf/black) from 22.6.0 to 22.8.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.6.0...22.8.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 10:51:19 +02:00
dependabot[bot]
1d304bd6ff Bump colorlog from 6.6.0 to 6.7.0 (#3832)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 6.6.0 to 6.7.0.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v6.6.0...v6.7.0)

---
updated-dependencies:
- dependency-name: colorlog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-30 11:28:04 +02:00
Mike Degatano
4ea27f6311 Network connection check only about ipv4 (#3830)
* Network connection test only about ipv4

* Better test of change being made
2022-08-30 08:39:08 +02:00
Pascal Vizeli
3dc36c3402 Use link-local instead disabled for ipv6 (#3829)
* Use link-local instead disabled for ipv6

* Add a test

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-08-29 16:56:59 -04:00
Mike Degatano
bae7fe4184 Debug info for network connection problem (#3828)
* Debug info for network connection problem

* Update network tests
2022-08-29 22:01:40 +02:00
Mike Degatano
df030e6209 No bool conversion in resolution test (#3826) 2022-08-26 16:42:45 +02:00
Mike Degatano
09d60b4957 Store load ignores supervisor updated condition (#3823) 2022-08-26 10:22:55 +02:00
dependabot[bot]
004065ae33 Bump pyudev from 0.23.2 to 0.24.0 (#3824)
Bumps [pyudev](https://github.com/pyudev/pyudev) from 0.23.2 to 0.24.0.
- [Release notes](https://github.com/pyudev/pyudev/releases)
- [Changelog](https://github.com/pyudev/pyudev/blob/master/CHANGES.rst)
- [Commits](https://github.com/pyudev/pyudev/compare/v0.23.2...v0.24.0)

---
updated-dependencies:
- dependency-name: pyudev
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-26 09:56:10 +02:00
Mike Degatano
854d337dd3 Bump ruamel.yaml to 0.17.21 (#3821) 2022-08-25 16:33:07 -04:00
Mike Degatano
2c5bb3f714 Fix suggestion test to be order agnostic (#3822) 2022-08-25 16:06:47 -04:00
Pascal Vizeli
7b63544474 Simplify watchdog container rules (#3820) 2022-08-25 15:20:14 -04:00
Joakim Sørensen
97af1fc66e Bump frontend to 255cb23c (#3819) 2022-08-25 10:10:16 -04:00
Mike Degatano
32d65722e9 Handle multiple suggestions with different references (#3817) 2022-08-25 10:09:25 -04:00
Mike Degatano
d5f9fcfdc7 Fire events on issue changes (#3818)
* Fire events on issue changes

* API includes if suggestion has autofix
2022-08-25 11:42:31 +02:00
dependabot[bot]
ffa524d3a4 Bump actions/cache from 3.0.7 to 3.0.8 (#3816)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.7 to 3.0.8.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.7...v3.0.8)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-23 10:53:25 -04:00
Stefan Agner
9c7de4a6c3 Improve system behavior on low memory situation (#3781)
* Improve system behavior on low memory situation

Adjust OOM killer score to prevent crucial services from getting
selected.

* Adjust OOM score of DNS plug-in as well
2022-08-23 16:02:51 +02:00
Mike Degatano
b4e1e3e853 Identify and handle dhcp issues (#3806)
* Identify and handle dhcp issues

* Change test from DHCP to Connection Problem
2022-08-23 13:57:16 +02:00
Mike Degatano
c7f7fbd41a Remove static-only fields when method is auto (#3810) 2022-08-23 13:56:14 +02:00
Mike Degatano
cbddca2658 Rename dns checks to fit pattern (#3811)
* Rename dns checks to fit pattern

* Missed a patch reference
2022-08-23 13:54:22 +02:00
Mike Degatano
f4811a0243 Watchdog addon on successful but unexpected exit (#3815) 2022-08-22 20:29:27 -04:00
dependabot[bot]
024b813865 Bump awesomeversion from 22.6.0 to 22.8.0 (#3808)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 22.6.0 to 22.8.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/22.6.0...22.8.0)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 16:31:41 -04:00
Stefan Agner
5919bc2252 Create asyncio loop explicitly (#3804)
Creating the asyncio loop explicitly. This fixes the following
deprecation warning on Python 3.10:
/usr/src/supervisor/supervisor/__main__.py:31: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
2022-08-19 10:01:01 -04:00
Stefan Agner
8bca34ec6b Update architecture compatibility JSON file (#3801)
* Update architecture compatibility JSON file

In particular, this enables 32-bit Arm add-ons for Yellow.

* Set correct hassio machine for odroid-xu4 (which is odroid-xu)
2022-08-19 10:11:01 +02:00
Mike Degatano
8b5e96a8ad Set autoreconnect to true for interfaces (#3807) 2022-08-19 10:09:44 +02:00
dependabot[bot]
2d908ffcec Bump docker from 5.0.3 to 6.0.0 (#3809)
Bumps [docker](https://github.com/docker/docker-py) from 5.0.3 to 6.0.0.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/5.0.3...6.0.0)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 10:08:30 +02:00
Mike Degatano
c3f7a45d61 Fix memory calculation for cgroupv2 (#3802) 2022-08-17 16:50:08 -04:00
dependabot[bot]
97b05c2078 Bump time-machine from 2.8.0 to 2.8.1 (#3799)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 09:48:00 +02:00
dependabot[bot]
aa9a774939 Bump home-assistant/builder from 2022.06.2 to 2022.07.0 (#3713)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 09:30:03 +02:00
dependabot[bot]
3388a13693 Bump release-drafter/release-drafter from 5.20.0 to 5.20.1 (#3797)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 09:10:58 +02:00
dependabot[bot]
9957e3dd4c Bump coverage from 6.4.3 to 6.4.4 (#3798)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 09:03:45 +02:00
dependabot[bot]
01c2bd1b0c Bump sentry-sdk from 1.9.4 to 1.9.5 (#3800)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 08:58:41 +02:00
Mike Degatano
2cd7f9d1b0 Attempt plugin update before failing job condition (#3796) 2022-08-17 07:36:05 +02:00
Mike Degatano
5fc9484f73 Supervisor updated before addon repositories (#3795) 2022-08-17 07:28:06 +02:00
Pascal Vizeli
e6dfe83d62 Handle timedrift better if not synchronized (#3783)
* Handle timedrift better if not synchronized

* fix description

* adjust days

* Implement feedback

* Whoami error

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-08-16 16:04:17 -04:00
Franck Nijhof
3f88236495 Support for Docker manifests base images add-on build (#3724)
* Support for Docker manifests base images add-on build

* Set platform for build and tests

* Remove empty test

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-08-16 14:34:32 +02:00
Mike Degatano
96065ed704 Bump to python 3.10 and alpine 3.16 (#3791)
* Bump to python 3.10

* 3.10 is not a number

* Musllinux wheels link

* Revert attrs 22.1.0 -> 21.2.0 for wheel

* Revert cryptography for wheel & pylint fix

* Precommit and devcontainer to 3.10

* pyupgrade rewriting things

* revert

* Update builder.yml

* fix rust

* Update builder.yml

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-08-16 14:33:23 +02:00
dependabot[bot]
7754424cb8 Bump time-machine from 2.7.1 to 2.8.0 (#3793)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-16 11:37:48 +02:00
dependabot[bot]
be842d5e6c Bump debugpy from 1.6.2 to 1.6.3 (#3794)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-16 11:35:05 +02:00
Mike Degatano
c8f184f24c Add auto update option (#3769)
* Add update freeze option

* Freeze to auto update and plugin condition

* Add tests

* Add supervisor_version evaluation

* OS updates require supervisor up to date

* Run version check during startup
2022-08-15 12:13:22 -04:00
dependabot[bot]
e82cb5da45 Bump sentry-sdk from 1.9.3 to 1.9.4 (#3789)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.3 to 1.9.4.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.9.3...1.9.4)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-12 11:33:37 -04:00
dependabot[bot]
a968f6e90a Bump actions/cache from 3.0.6 to 3.0.7 (#3788)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.6 to 3.0.7.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.6...v3.0.7)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-12 11:33:00 -04:00
Mike Degatano
3eac3a6178 Absolute imports to relative imports (#3787) 2022-08-12 10:42:40 +02:00
dependabot[bot]
b831dce443 Bump sentry-sdk from 1.9.2 to 1.9.3 (#3782)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-10 11:40:41 +02:00
Mike Degatano
e62324e43f Set limits on watchdog retries (#3779)
* Set limits on watchdog retries

* Use relative import
2022-08-09 11:44:35 -04:00
Stefan Agner
a92058e6fc Mark CGroup V2 supported on Home Assistant OS (#3778)
* Mark CGroup V2 supported on Home Assistant OS

* Fix tests

* Fix comparision

* Move evaluation of CGroup after OSManager has been initialized
2022-08-09 11:32:51 +02:00
dependabot[bot]
29b2de6998 Bump actions/cache from 3.0.5 to 3.0.6 (#3774)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-08 11:27:01 +02:00
dependabot[bot]
057a048504 Bump coverage from 6.4.2 to 6.4.3 (#3776)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-08 11:24:55 +02:00
Joakim Sørensen
29a1e6f68b Bump frontend to ca28feca (#3777) 2022-08-08 10:34:23 +02:00
dependabot[bot]
702cb4f5be Bump sentry-sdk from 1.9.0 to 1.9.2 (#3775)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.0 to 1.9.2.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.9.0...1.9.2)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-08 09:44:02 +02:00
Mike Degatano
13c10dbb47 Healthy/Unhealthy state means addon started (#3773) 2022-08-05 10:04:34 -04:00
dependabot[bot]
2279c813d0 Bump attrs from 21.4.0 to 22.1.0 (#3758)
Bumps [attrs](https://github.com/python-attrs/attrs) from 21.4.0 to 22.1.0.
- [Release notes](https://github.com/python-attrs/attrs/releases)
- [Changelog](https://github.com/python-attrs/attrs/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/python-attrs/attrs/compare/21.4.0...22.1.0)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-04 13:02:19 -04:00
dependabot[bot]
1b52b2d23b Bump flake8 from 5.0.3 to 5.0.4 (#3770)
Bumps [flake8](https://github.com/pycqa/flake8) from 5.0.3 to 5.0.4.
- [Release notes](https://github.com/pycqa/flake8/releases)
- [Commits](https://github.com/pycqa/flake8/compare/5.0.3...5.0.4)

---
updated-dependencies:
- dependency-name: flake8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-04 12:35:30 -04:00
Mike Degatano
27ac96f5f9 Attach is in executor, use call_soon_threadsafe (#3771)
* Attach is in executor, use `call_soon_threadsafe`

* Fix formatting
2022-08-04 12:33:54 -04:00
Mike Degatano
f87209f66f Add fields back for legacy addons info routing (#3768)
* Add fields back for legacy addons info routing

* Fixes from feedback
2022-08-03 16:03:45 -04:00
dependabot[bot]
b670efa47f Bump flake8 from 4.0.1 to 5.0.3 (#3763)
Bumps [flake8](https://github.com/pycqa/flake8) from 4.0.1 to 5.0.3.
- [Release notes](https://github.com/pycqa/flake8/releases)
- [Commits](https://github.com/pycqa/flake8/compare/4.0.1...5.0.3)

---
updated-dependencies:
- dependency-name: flake8
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-03 16:11:40 +02:00
dependabot[bot]
c749e21d3f Bump sentry-sdk from 1.8.0 to 1.9.0 (#3759)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.8.0...1.9.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-03 15:44:53 +02:00
Mike Degatano
4f8f28b9f6 addons/info returns info on all addons (#3762)
* Change to legacy routing approach

* Revert launch.json changes
2022-08-03 15:44:18 +02:00
Mike Degatano
2b4f46f6b3 Watchdog shouldn't rebuild addons (#3766)
* Watchdog shouldn't rebuild addons

* pylint fix
2022-08-03 12:06:59 +02:00
dependabot[bot]
5d6e2eeaac Bump actions/setup-python from 4.1.0 to 4.2.0 (#3767)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-03 10:37:51 +02:00
Mike Degatano
a45789c906 Fix keyerror on unnamed containers (#3765) 2022-08-02 15:40:27 -04:00
Mike Degatano
d097044fa8 Update supervisor before auto-updating others (#3756) 2022-07-28 12:29:05 -04:00
dependabot[bot]
73778780ef Bump actions/stale from 5.1.0 to 5.1.1 (#3755)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-28 11:03:33 +02:00
dependabot[bot]
df05c844c0 Bump pyupgrade from 2.37.2 to 2.37.3 (#3753)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.37.2 to 2.37.3.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.37.2...v2.37.3)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-27 17:16:05 +02:00
Mike Degatano
ebeff31bf6 Pass supervisor debug value to audio (#3752) 2022-07-27 17:15:54 +02:00
dependabot[bot]
037e42e894 Bump pyupgrade from 2.34.0 to 2.37.2 (#3751)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.34.0 to 2.37.2.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.34.0...v2.37.2)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-25 15:12:48 +02:00
Mike Degatano
13db0e5c70 Increase max line size for ingress addons (#3747)
* Increase max line size for ingress addons

* Set max field size too
2022-07-25 15:04:27 +02:00
dependabot[bot]
dab75b597c Bump sentry-sdk from 1.7.2 to 1.8.0 (#3749)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-24 21:12:54 +02:00
dependabot[bot]
a1bab8ad08 Bump getsentry/action-release from 1.1.6 to 1.2.0 (#3748)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-21 11:48:20 +02:00
Mike Degatano
48c5dd064c Fix addons always unknown after install (#3746) 2022-07-18 15:11:55 -04:00
dependabot[bot]
fd998155c2 Bump actions/stale from 5.0.0 to 5.1.0 (#3743)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-18 11:11:31 +02:00
dependabot[bot]
4a3ab4ba8d Bump pylint from 2.14.4 to 2.14.5 (#3745)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-18 11:06:34 +02:00
dependabot[bot]
c76e7a22df Bump sentry-sdk from 1.7.1 to 1.7.2 (#3744)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-18 11:04:00 +02:00
Mike Degatano
d19166bb86 Docker events based watchdog and docker healthchecks (#3725)
* Docker events based watchdog

* Separate monitor from DockerAPI since it needs coresys

* Move monitor into dockerAPI

* Fix properties on coresys

* Add watchdog tests

* Added tests

* pylint issue

* Current state failures test

* Thread-safe event processing

* Use labels property
2022-07-15 09:21:59 +02:00
Stefan Agner
14bc771ba9 Fix add-on memory calculation (#3739)
Docker versions newer than 19.03 calculate memory usage sligthly
different compared to previous versions. It seems the field
"total_inactive_file" was not available in 19.03, so it can be used
as indicator.

See: https://docs.docker.com/engine/reference/commandline/stats/#description
2022-07-14 11:59:34 +02:00
dependabot[bot]
8f84eaa096 Bump sentry-sdk from 1.7.0 to 1.7.1 (#3738)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-14 10:25:09 +02:00
dependabot[bot]
2fd51c36b8 Bump actions/cache from 3.0.4 to 3.0.5 (#3734)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-13 08:40:59 +02:00
dependabot[bot]
c473d7ca62 Bump coverage from 6.4.1 to 6.4.2 (#3735)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-13 08:40:24 +02:00
dependabot[bot]
2de5b2f0fb Bump actions/setup-python from 4.0.0 to 4.1.0 (#3731)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-12 08:51:47 +02:00
dependabot[bot]
cf30810677 Bump sentry-sdk from 1.6.0 to 1.7.0 (#3732)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-12 08:43:22 +02:00
Joakim Sørensen
a8dc842f97 Bump frontend to 414db833 (#3729) 2022-07-11 16:53:59 +02:00
dependabot[bot]
38509aa3b8 Bump pre-commit from 2.19.0 to 2.20.0 (#3727)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-11 09:32:52 +02:00
Mike Degatano
9be2b3bced Bump atomicwrites (#3726) 2022-07-09 01:13:19 -04:00
dependabot[bot]
ceed1bc318 Bump debugpy from 1.6.0 to 1.6.2 (#3723)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-08 08:27:05 +02:00
Pascal Vizeli
389aab8d4a Output backup log on error (#3722)
* Output backup log on error

* Apply suggestions from code review

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-07-07 13:20:00 -04:00
Mike Degatano
8b7aa7640c Branch names can contain periods (#3721) 2022-07-07 18:27:32 +02:00
Pascal Vizeli
a5cc3cba63 Docker info more robust (#3720) 2022-07-07 10:01:57 +02:00
dependabot[bot]
9266062709 Bump cryptography from 36.0.2 to 37.0.4 (#3714)
Bumps [cryptography](https://github.com/pyca/cryptography) from 36.0.2 to 37.0.4.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/36.0.2...37.0.4)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-06 12:12:07 -04:00
Franck Nijhof
bacedd1622 Bump black in pre-commit (#3709) 2022-07-05 11:05:09 +02:00
Franck Nijhof
7227f022b1 Upgrade pytest-asyncio to 0.18.3 and pytest-aiohttp to 1.0.4 (#3711) 2022-06-30 11:05:18 -07:00
dependabot[bot]
0ce91f2e25 Bump awesomeversion from 22.5.2 to 22.6.0 (#3706)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 10:57:39 +02:00
dependabot[bot]
fdb195cf59 Bump sentry-sdk from 1.5.12 to 1.6.0 (#3691)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 10:56:51 +02:00
Franck Nijhof
b85936774a Fix wheels build by pinning wheels action (#3710) 2022-06-30 10:07:39 +02:00
dependabot[bot]
bd106be026 Bump pylint from 2.14.3 to 2.14.4 (#3708)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 09:03:50 +02:00
dependabot[bot]
e588541fe3 Bump black from 22.3.0 to 22.6.0 (#3705)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-28 10:01:02 +02:00
Mike Degatano
d685d8539b Get version info from installed addon (#3702)
* Get version info from installed addon

* addon.slug not self.slug
2022-06-27 22:25:38 +02:00
Mike Degatano
bb3b8891bc AddonStore is_installed needs to check installed (#3701) 2022-06-27 17:46:42 +02:00
Joakim Sørensen
44e4e727cc Use checkonline instead of version for online check (#3700) 2022-06-27 16:29:16 +02:00
dependabot[bot]
acc49579f6 Bump time-machine from 2.7.0 to 2.7.1 (#3699)
Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.7.0 to 2.7.1.
- [Release notes](https://github.com/adamchainz/time-machine/releases)
- [Changelog](https://github.com/adamchainz/time-machine/blob/main/HISTORY.rst)
- [Commits](https://github.com/adamchainz/time-machine/compare/2.7.0...2.7.1)

---
updated-dependencies:
- dependency-name: time-machine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-27 09:42:43 +02:00
dependabot[bot]
48eb1e8958 Bump home-assistant/builder from 2022.06.1 to 2022.06.2 (#3696)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-24 08:54:33 +02:00
Joakim Sørensen
a5e3f6f0b4 Remove installed key from store list API (#3695) 2022-06-24 07:50:05 +02:00
Joakim Sørensen
d309524fe7 Add back missing state to addons list API (#3694) 2022-06-24 07:49:35 +02:00
Pascal Vizeli
bfb0a961cd Add chidlren to the HW output (#3690) 2022-06-22 14:55:19 -04:00
dependabot[bot]
b1a23f3980 Bump pylint from 2.13.9 to 2.14.3 (#3685)
* Bump pylint from 2.13.9 to 2.14.3

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.13.9 to 2.14.3.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.13.9...v2.14.3)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Remove non-existent or optional checkers

- `abstract-class-little-used` was removed in pylint [1.4.3](https://pylint.pycqa.org/en/latest/whatsnew/1/1.4.html#what-s-new-in-pylint-1-4-3)
- `no-self-use` became optional in pylint [2.14](https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers)
- `redefined-variable-type` doesn't exist. It's actually [`multiple_types`](https://pylint.pycqa.org/en/latest/user_guide/checkers/extensions.html#pylint-extensions-redefined-variable-type) and it's optional.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-06-22 14:30:57 -04:00
Pascal Vizeli
1f69cf0fe6 Verify the cgroup supported level (#3688)
* Verify the cgroup supported level

* add tests
2022-06-22 11:22:27 -04:00
dependabot[bot]
b001aa882a Bump pyupgrade from 2.32.1 to 2.34.0 (#3669)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.32.1 to 2.34.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.32.1...v2.34.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-22 11:15:02 -04:00
Pascal Vizeli
e92d8695c7 Cleanup API / old rebranding (#3623)
* Cleanup API / old rebranding

* cleanup p2

* next round

* better comments

* cleanup import

* support only installed add-ons

* legacy migration

* test fixes

* add old env back

* revert for Core

* fix issues with old core

* fix

* using installed short cat

* revert

* extend legacy

* cleanup

* fix path

* Fix missing

* add stop

* readd old token

* Add minimal

* extend attributes

* Add repo back

* add more repo info

* Make it working

* Bump frontend to e7848262 (#3680)

* Add icon

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2022-06-21 15:19:04 +02:00
dependabot[bot]
acfa686bb6 Bump home-assistant/builder from 2022.03.1 to 2022.06.1 (#3683)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2022.03.1 to 2022.06.1.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2022.03.1...2022.06.1)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-14 16:26:44 +02:00
Mike Degatano
3b3cd61e3d Never disable interfaces at startup (#3676) 2022-06-09 13:55:36 +02:00
Joakim Sørensen
b82dbc0cac Extended store addon info (#3678)
* Add extended store addon info

* Add missing hassio_api

* Fix test
2022-06-09 13:47:15 +02:00
dependabot[bot]
8d1a5c5d6a Bump actions/setup-python from 3.1.2 to 4.0.0 (#3677)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-09 09:41:37 +02:00
Mike Degatano
7a74d77d43 Move addon repo migration to bootstrap (#3672)
* Move addon repo migration to bootstrap

* Save data after migrating it
2022-06-08 15:21:34 -04:00
Joakim Sørensen
977fd8abe2 Bump frontend to 4ad49ef0 (#3675) 2022-06-08 16:19:59 +02:00
dependabot[bot]
e048c71dc8 Bump actions/cache from 3.0.3 to 3.0.4 (#3673)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-08 09:10:05 +02:00
Mike Degatano
b8259471b0 Don't add dupe repos to data on startup (#3671) 2022-06-07 18:47:41 +02:00
Mike Degatano
5f9b999a3c Use source instead of URL for repos (#3670) 2022-06-07 17:55:53 +02:00
Mike Degatano
ccd2c31390 Move repository urls to store settings file (#3665)
* Move repository urls to store settings file

* Remove default repos from supervisor config

* Fix clone at initial store load

* Mock git load in repository fixture
2022-06-07 10:02:21 +02:00
dependabot[bot]
deeaf2133b Bump coverage from 6.4 to 6.4.1 (#3666)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.4 to 6.4.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.4...6.4.1)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-06 18:17:52 -04:00
dependabot[bot]
d004093a1e Bump actions/cache from 3.0.2 to 3.0.3 (#3662)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.2...v3.0.3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-01 14:35:34 -04:00
dependabot[bot]
9275c6af34 Bump awesomeversion from 22.5.1 to 22.5.2 (#3659)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-30 10:58:53 +02:00
dependabot[bot]
890313701c Bump coverage from 6.3.3 to 6.4 (#3653)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.3.3 to 6.4.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.3.3...6.4)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-24 18:22:59 -04:00
Joakim Sørensen
4e4fa488f9 Bump frontend to 3acab5a3 (#3655) 2022-05-24 10:33:04 +02:00
Mike Degatano
138fd7eec9 APIs for adding/removing an addon repository (#3649)
* APIs for adding/removing an addon repository

* Misunderstood addons.store, fixed usage
2022-05-23 09:16:42 +02:00
dependabot[bot]
6e017a36c4 Bump actions/upload-artifact from 3.0.0 to 3.1.0 (#3652)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-23 09:14:45 +02:00
Mike Degatano
5bc7255756 Catch assertion error on git pull (#3651) 2022-05-20 11:40:33 +02:00
dependabot[bot]
8c7c2fca28 Bump time-machine from 2.6.0 to 2.7.0 (#3637)
Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/adamchainz/time-machine/releases)
- [Changelog](https://github.com/adamchainz/time-machine/blob/main/HISTORY.rst)
- [Commits](https://github.com/adamchainz/time-machine/compare/2.6.0...2.7.0)

---
updated-dependencies:
- dependency-name: time-machine
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-19 11:52:51 -04:00
Stefan Agner
2fe358fb1e Resepect capitialization of network interfaces (#3646) 2022-05-19 17:47:50 +02:00
dependabot[bot]
2c09021427 Bump pylint from 2.13.8 to 2.13.9 (#3640)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.13.8 to 2.13.9.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.13.8...v2.13.9)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-16 19:59:25 -04:00
Pascal Vizeli
5297edb57d Support new s6 overlay (#3630)
* Support new s6 overlay

* fix permission

* using bashio
2022-05-13 18:07:16 +02:00
dependabot[bot]
1b8ad44833 Bump coverage from 6.3.2 to 6.3.3 (#3638)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-13 08:56:12 +02:00
dependabot[bot]
1b53ca92c5 Bump release-drafter/release-drafter from 5.19.0 to 5.20.0 (#3636)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-12 10:13:06 +02:00
Mike Degatano
cbe0adf53f OS latest version set from upgrade path (#3632)
* OS latest version set from upgrade path

* fix tests

* Update test_updater.py

* Revert / fetch_update is global unwrapped

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-05-11 13:14:28 +02:00
Stefan Agner
eabd976d33 Use volume as Docker storage location (#3337) 2022-05-11 12:23:28 +02:00
Joakim Sørensen
99023b9522 Bump awesomeversion to 22.5.1 (#3634) 2022-05-11 12:16:19 +02:00
dependabot[bot]
129a79ae24 Bump sentry-sdk from 1.5.11 to 1.5.12 (#3633)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.11 to 1.5.12.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.11...1.5.12)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 09:20:15 +02:00
Mike Degatano
f8ac2b202c Revert "OS latest version set from upgrade path" (#3631) 2022-05-10 18:31:37 -04:00
Mike Degatano
0548afdb61 OS latest version set from upgrade path 2022-05-10 18:13:11 -04:00
Mike Degatano
567806cd14 Don't include addresses in network update (#3628)
* Don't include addresses in network update

* revert format fix
2022-05-09 16:44:17 -04:00
dependabot[bot]
aa8910280d Bump pre-commit from 2.18.1 to 2.19.0 (#3625)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.18.1 to 2.19.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.18.1...v2.19.0)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-06 16:37:36 -04:00
dependabot[bot]
1d5806d0c7 Bump docker/login-action from 1.14.1 to 2.0.0 (#3624)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.14.1 to 2.0.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.14.1...v2.0.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-06 16:36:57 -04:00
Pascal Vizeli
942b5e6150 Rework fixups & Add integrity (#3614)
* Rework fixups & Add integrity

* Fix tests

* fix test v2

* Protect ddos
2022-05-05 16:21:19 +02:00
dependabot[bot]
ae00ea178d Bump pyupgrade from 2.32.0 to 2.32.1 (#3621)
* Bump pyupgrade from 2.32.0 to 2.32.1

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.32.0 to 2.32.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.32.0...v2.32.1)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-05-05 09:53:35 +02:00
dependabot[bot]
7971be51b7 Bump sentry-sdk from 1.5.10 to 1.5.11 (#3617)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.10 to 1.5.11.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.10...1.5.11)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-04 09:30:37 +02:00
dependabot[bot]
4ad69dc038 Bump pylint from 2.13.7 to 2.13.8 (#3615)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.13.7 to 2.13.8.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.13.7...v2.13.8)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-03 15:21:01 -04:00
Joakim Sørensen
475b8c9cac Bump frontend to 080cad0c (#3616) 2022-05-03 15:20:17 -04:00
Pascal Vizeli
f684c8f0dd Using job limit ONCE for integrity (#3613) 2022-05-02 11:28:56 +02:00
Joakim Sørensen
e390a3e5d5 Bump frontend to bb5f6e88 (#3612) 2022-05-02 10:58:22 +02:00
Pascal Vizeli
ca1f764080 Add integrity check (#3608)
* Add integrity check

* add API test

* add tests

* tests for add-ons
2022-04-30 10:14:43 +02:00
dependabot[bot]
1c75b515e0 Bump jinja2 from 3.1.1 to 3.1.2 (#3607)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.1...3.1.2)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-29 09:20:17 -04:00
dependabot[bot]
5e266e58ac Bump awesomeversion from 22.4.1 to 22.4.2 (#3606)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 22.4.1 to 22.4.2.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/22.4.1...22.4.2)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-29 09:19:31 -04:00
dependabot[bot]
31401674d0 Bump codecov/codecov-action from 3.0.0 to 3.1.0 (#3588)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-28 14:32:42 -04:00
dependabot[bot]
04ff9f431a Bump awesomeversion from 22.4.0 to 22.4.1 (#3603)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 22.4.0 to 22.4.1.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/22.4.0...22.4.1)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-28 11:26:10 +02:00
Pascal Vizeli
7b46c4759d Tuning Jemalloc (#3600) 2022-04-28 11:25:38 +02:00
dependabot[bot]
e73809d350 Bump pytest from 7.1.1 to 7.1.2 (#3593)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.1 to 7.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.1...7.1.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-27 20:40:10 -04:00
Joakim Sørensen
d79dcf74ca Bump frontend to 4b644d8b (#3598) 2022-04-27 19:05:43 +02:00
Pascal Vizeli
ff08ca5920 Enable CAS (#3595) 2022-04-27 15:22:36 +02:00
Joakim Sørensen
3299772f3c Bump frontend to 145e5d7b (#3594) 2022-04-26 10:45:25 +02:00
Mike Degatano
8bb4596d04 Add API option to disable fallback DNS (#3586)
* Add API option to disable fallback DNS

* DNS unsupported evaluation and fallback in sentry
2022-04-25 18:15:40 +02:00
dependabot[bot]
0440437369 Bump actions/checkout from 3.0.1 to 3.0.2 (#3587)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-22 08:57:12 +02:00
dependabot[bot]
46d0cc9777 Bump pylint from 2.13.5 to 2.13.7 (#3584)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-21 13:09:52 +02:00
Mike Degatano
f3e2ccce43 Create issue for detected DNS server problem (#3578)
* Create issue for detected DNS server problem

* Validate behavior on restart as well

* tls:// not supported, remove check

* Move DNS server checks into resolution checks

* Revert all changes to plugins.dns

* Run DNS server checks if affected

* Mock aiodns query during all checks tests
2022-04-21 10:55:49 +02:00
dependabot[bot]
32d3a5224e Bump sentry-sdk from 1.5.9 to 1.5.10 (#3580)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-18 11:07:02 +02:00
Mike Degatano
32d1296da1 Merge updates with existing network settings (#3570)
* Preserve network customizations over updates

* Fix issues from testing

* Test case to ensure updates generated correctly
2022-04-18 09:49:30 +02:00
dependabot[bot]
88795c56f0 Bump actions/checkout from 3.0.0 to 3.0.1 (#3574)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-15 08:41:14 +02:00
dependabot[bot]
6a075a49e3 Bump actions/cache from 3.0.1 to 3.0.2 (#3563)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-14 20:57:26 -04:00
dependabot[bot]
6395be5b68 Bump actions/setup-python from 3.1.1 to 3.1.2 (#3562)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3.1.1...v3.1.2)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-14 19:28:34 -04:00
dependabot[bot]
8c528f7ec5 Bump sentry-sdk from 1.5.8 to 1.5.9 (#3564)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.8 to 1.5.9.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.8...1.5.9)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-12 17:38:43 +02:00
Mike Degatano
a553ba5d24 Update resolved information with host info (#3560) 2022-04-12 09:21:35 +02:00
dependabot[bot]
61d79b6b9c Bump pyupgrade from 2.31.1 to 2.32.0 (#3558)
* Bump pyupgrade from 2.31.1 to 2.32.0

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.31.1 to 2.32.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.31.1...v2.32.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-04-11 10:30:07 -04:00
Joakim Sørensen
7feab2e31a Bump frontend to d900e40d (#3559) 2022-04-11 10:28:12 -04:00
dependabot[bot]
5dd0a7611b Bump actions/download-artifact from 2 to 3 (#3557)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 13:14:17 +02:00
dependabot[bot]
8eba766f77 Bump voluptuous from 0.13.0 to 0.13.1 (#3554)
Bumps [voluptuous](https://github.com/alecthomas/voluptuous) from 0.13.0 to 0.13.1.
- [Release notes](https://github.com/alecthomas/voluptuous/releases)
- [Changelog](https://github.com/alecthomas/voluptuous/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alecthomas/voluptuous/compare/0.13.0...0.13.1)

---
updated-dependencies:
- dependency-name: voluptuous
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 12:09:47 +02:00
Mike Degatano
12da8a0c55 Add MDNS and LLMNR status to API (#3545)
* Add mdns and llmnr status to API

* Add broadcast info to host/info and move constants

* Fix new test and isort error
2022-04-11 12:08:51 +02:00
dependabot[bot]
6666637a77 Bump actions/setup-python from 3.1.0 to 3.1.1 (#3553)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-08 10:15:43 +02:00
Stefan Agner
9847e456cd Handle TarError/OSError in backup routine (#3468)
* Handle TarError/OSError in Core config backup routine

Make sure to handle TarError and OSError exceptions and print a warning
when backing up the Home Assistant Core config folder. This restores
behavior before the introduction of Backup notification in #3305.

* Reraise errors during HA Core backup

* Raise BackupError when encountering error during Add-on Backup

* Log to error as well

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2022-04-07 20:37:51 +02:00
Stefan Agner
b701e1917e Drop unnecessary command from CLI plug-in (#3551)
The CLI plug-in stays up even without command. This saves a few
kilobytes of RAM.

It also allows s6-overlay's stage2 to complete. The stage2 execlineb
process has an enormously long cmdline, with strings like "init-stage2
failed" in it. This has previously led people to belive that there is a
problem (while there isn't). So as a side effect, getting stage2 to
complete side steps such confusion and makes the list of processes
cleaner.
2022-04-07 12:11:21 -04:00
Joakim Sørensen
393a11c696 Bump frontend to bbca7b76 (#3547) 2022-04-07 11:42:58 -04:00
dependabot[bot]
19de0a22be Bump codecov/codecov-action from 2.1.0 to 3 (#3546)
* Bump codecov/codecov-action from 2.1.0 to 3

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.1.0 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2.1.0...v3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Exact version

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-04-07 11:14:58 -04:00
dependabot[bot]
b67ee216ae Bump pylint from 2.13.4 to 2.13.5 (#3549)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.13.4 to 2.13.5.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.13.4...v2.13.5)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 11:12:03 -04:00
Stefan Agner
939c3f1b4a Use black 22.3.0 (#3550)
This fixes an issue with latest click versions
(see https://github.com/psf/black/issues/2964).

It also synchronizes pre-commit black version with what
requirements_tests.txt installs.
2022-04-07 15:27:57 +02:00
dependabot[bot]
ad85fa29b6 Bump pylint from 2.12.2 to 2.13.4 (#3539)
* Bump pylint from 2.12.2 to 2.13.4

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.12.2 to 2.13.4.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.12.2...v2.13.4)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Explicitly provide maxsize in lru_cache decorator

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-04-04 12:52:33 -04:00
dependabot[bot]
f57aeab9ae Bump pre-commit from 2.17.0 to 2.18.1 (#3543)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.17.0 to 2.18.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.17.0...v2.18.1)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 12:15:01 -04:00
dependabot[bot]
383ea277b7 Bump actions/setup-python from 3.0.0 to 3.1.0 (#3541)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 12:10:24 -04:00
dependabot[bot]
a32d1668ee Bump awesomeversion from 22.2.0 to 22.4.0 (#3542)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 22.2.0 to 22.4.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/22.2.0...22.4.0)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 12:08:44 -04:00
Pascal Vizeli
e445a8aabf Enable CAS for Add-ons (#3506)
* Revert "Disable CAS until it work (#3504)"

This reverts commit 435241bccf.

* Revert exception that are not forwarded

* enable for add-ons

* Apply suggestions from code review

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* fix black

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-03-31 10:59:34 -04:00
dependabot[bot]
0de190268f Bump voluptuous from 0.12.2 to 0.13.0 (#3538)
Bumps [voluptuous](https://github.com/alecthomas/voluptuous) from 0.12.2 to 0.13.0.
- [Release notes](https://github.com/alecthomas/voluptuous/releases)
- [Changelog](https://github.com/alecthomas/voluptuous/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alecthomas/voluptuous/compare/0.12.2...0.13.0)

---
updated-dependencies:
- dependency-name: voluptuous
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-31 16:55:13 +02:00
dependabot[bot]
9e5101aa39 Bump actions/cache from 3.0.0 to 3.0.1 (#3537)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-31 14:21:01 +02:00
Mike Degatano
e2ac5042d8 Apply network settings on start to fix defaults (#3528)
* Apply network settings on start to fix defaults

* Use job check and add tests
2022-03-31 12:14:40 +02:00
dependabot[bot]
bfe1cb073c Bump pulsectl from 22.1.3 to 22.3.2 (#3527)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 22.1.3 to 22.3.2.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-29 20:12:13 -04:00
dependabot[bot]
3a1364dfcd Bump black from 22.1.0 to 22.3.0 (#3535)
Bumps [black](https://github.com/psf/black) from 22.1.0 to 22.3.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.1.0...22.3.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-29 18:53:45 -04:00
dependabot[bot]
3f63414bb3 Bump debugpy from 1.5.1 to 1.6.0 (#3530)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.5.1...v1.6.0)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-29 10:26:35 +02:00
dependabot[bot]
8b3a09e5b8 Bump jinja2 from 3.0.3 to 3.1.1 (#3534)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.3 to 3.1.1.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.3...3.1.1)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-29 10:26:16 +02:00
dependabot[bot]
ca7dc8113b Bump actions/cache from 2.1.7 to 3 (#3525)
* Bump actions/cache from 2.1.7 to 3

Bumps [actions/cache](https://github.com/actions/cache) from 2.1.7 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.7...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix 3 -> 3.0.0

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-22 14:01:15 +01:00
dependabot[bot]
6d2a603cf9 Bump sentry-sdk from 1.5.7 to 1.5.8 (#3523)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 08:13:38 +01:00
dependabot[bot]
d536ac8604 Bump pytest from 7.1.0 to 7.1.1 (#3522)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-18 08:42:05 +01:00
Pascal Vizeli
c67317571c Fix issues with old protection flag (#3521)
* Fix issues with old protection flag

* fix typing
2022-03-16 13:15:56 +01:00
dependabot[bot]
d93def7f22 Bump cryptography from 36.0.1 to 36.0.2 (#3520)
Bumps [cryptography](https://github.com/pyca/cryptography) from 36.0.1 to 36.0.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/36.0.1...36.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-16 11:23:21 +01:00
dependabot[bot]
20e45e3c00 Bump pytest from 7.0.1 to 7.1.0 (#3516)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.0.1 to 7.1.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.0.1...7.1.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-14 17:42:07 +01:00
dependabot[bot]
5758d42c91 Bump pyupgrade from 2.31.0 to 2.31.1 (#3515)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.31.0 to 2.31.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-14 13:38:15 +01:00
Joakim Sørensen
d2dc78ae6a Add backup and restore to CI (#3509)
* Add backup and restore to CI

* Update .github/workflows/builder.yml

* -r

* restore ssl

* restart between

* Make sure it actually installed

* access .data
2022-03-11 09:43:50 -05:00
Joakim Sørensen
3fd3c02010 Remove name argument to _restore (#3508) 2022-03-11 09:31:22 -05:00
Joakim Sørensen
a82b4aa6c8 Get arch from config and not data when generating image (#3507) 2022-03-11 09:27:34 -05:00
Pascal Vizeli
45e54d93c7 Remove timeout on validate for docker (#3505) 2022-03-10 14:11:18 +01:00
Pascal Vizeli
435241bccf Disable CAS until it work (#3504)
* Disable CAS until it work

* fix tests
2022-03-10 13:18:52 +01:00
Pascal Vizeli
1b8558ced3 Reduce floot on startup (#3500)
* Reduce floot on startup

* Stop loading

* Update supervisor/resolution/checks/core_trust.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Update supervisor/resolution/checks/plugin_trust.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Update supervisor/resolution/checks/core_trust.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2022-03-10 10:42:18 +01:00
dependabot[bot]
4339cae241 Bump sentry-sdk from 1.5.6 to 1.5.7 (#3494)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.6 to 1.5.7.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.6...1.5.7)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-09 12:53:56 +01:00
Joakim Sørensen
4f2469fd98 Add collapse-after for dependencies (#3493)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-08 08:19:16 +01:00
dependabot[bot]
a90e8be6bc Bump actions/stale from 4.1.0 to 5.0.0 (#3492)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2022-03-08 07:50:16 +01:00
dependabot[bot]
dcaf36a8e5 Bump release-drafter/release-drafter from 5.18.1 to 5.19.0 (#3491)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-08 07:48:42 +01:00
dependabot[bot]
908df3b234 Bump home-assistant/builder from 2022.01.0 to 2022.03.1 (#3481)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2022.01.0 to 2022.03.1.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2022.01.0...2022.03.1)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-07 12:41:12 -05:00
Mike Degatano
1b445feaaa Use full version in actions to prevent auto-updates (#3490) 2022-03-07 12:22:47 -05:00
dependabot[bot]
c05504a069 Bump actions/upload-artifact from 2.3.1 to 3 (#3484)
* Bump actions/upload-artifact from 2.3.1 to 3

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.3.1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.3.1...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Use full version to prevent auto-updates

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-03-07 12:07:58 -05:00
Joakim Sørensen
e37cee9818 Update whoami URL (#3488) 2022-03-07 11:11:45 +01:00
Mike Degatano
dd3a4a1f47 Add unsupported message if no systemd-resolved (#3487)
* Require resolved for supported systems

* Added properties for dbus resolved
2022-03-07 10:38:24 +01:00
Pascal Vizeli
b451e555d3 Remove Debian buster from supported OS (#3483) 2022-03-03 18:23:19 +01:00
dependabot[bot]
5fb2b99917 Bump actions/checkout from 2.4.0 to 3 (#3478)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-02 16:11:44 +01:00
Pascal Vizeli
8984d4afd6 Fix partial backup with Core (#3476)
* Fix partial backup with Core

* reformat

* same style
2022-03-02 15:54:34 +01:00
dependabot[bot]
7ae8dfe587 Bump docker/login-action from 1.14.0 to 1.14.1 (#3479)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.14.0 to 1.14.1.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.14.0...v1.14.1)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-02 10:14:53 +01:00
Mike Degatano
c931a4c3e5 Error response handling & tests (#3473) 2022-03-01 21:52:50 +01:00
Mike Degatano
c58fa816d9 Use enum in arch to platform map (#3474) 2022-03-01 15:23:28 -05:00
dependabot[bot]
557f029aa0 Bump actions/setup-python from 2.3.2 to 3 (#3472)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2.3.2 to 3.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2.3.2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-01 09:39:34 +01:00
dependabot[bot]
e8e3cc2f67 Bump docker/login-action from 1.13.0 to 1.14.0 (#3471)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-01 09:39:24 +01:00
Mike Degatano
b0e4983488 Passing platform arg on image pull (#3465)
* Passing platform arg on image pull

* Passing in addon arch to image pull

* Move sys_arch above sys_plugins in setup

* Default to supervisor arch

* Cleanup from feedback
2022-03-01 09:38:58 +01:00
Pascal Vizeli
205f3a74dd Fix CI warning "[: =~: binary operator expected" (#3470) 2022-02-28 12:26:38 +01:00
Pascal Vizeli
21a5479a2e Test CI codenotary timeout of 15sec for DNS plugin issues (#3469)
* Test CI codenotary timeout of 15sec for DNS plugin issues

* Update codenotary.py
2022-02-28 11:14:49 +01:00
Pascal Vizeli
a9ab64a29a Disable diagnostic on dev/unsupported (#3441) 2022-02-25 12:25:37 +01:00
Pascal Vizeli
3edfaa1ee7 Partial backup v1 bugfix (#3463)
* Fix compatibility to v1 partial backups

* Add test

* migrate folder list

* add test
2022-02-24 20:27:50 +01:00
Pascal Vizeli
71903d906b Create a backup on add-on auto update (#3464) 2022-02-24 20:26:57 +01:00
Pascal Vizeli
36f4e494a2 Add CAS configs to image (#3462) 2022-02-23 17:31:16 -05:00
Pascal Vizeli
9104b287e5 New Backup format for core (#3451)
* New Backup format for core

* cleanup

* next round

* partial resotre encrypted function of metadata

* Using securetar as modul

* fix securetar imports

* simplify

* more typing

* adjust handling

* Handling replace better

* increase the order

* more logic cleanup

* create new core backup

* handle restore

* fix tests

* better checks

* Fix attribute issues

* Update supervisor/backups/manager.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Address comments

* Fix tests

* Update supervisor/exceptions.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2022-02-23 16:08:02 +01:00
Joakim Sørensen
842c4b3864 Update frontend to 7e68393c (#3461) 2022-02-23 11:44:05 +01:00
dependabot[bot]
244005471b Bump pytest-timeout from 2.0.2 to 2.1.0 (#3408)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-23 10:19:45 +01:00
dependabot[bot]
0ca837903f Bump sentry-sdk from 1.5.5 to 1.5.6 (#3460)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-23 10:19:12 +01:00
Mike Degatano
8683d46ab6 Add dbus support to plugin-dns (#3459) 2022-02-21 20:31:15 +01:00
dependabot[bot]
c17006cc37 Bump coverage from 6.3.1 to 6.3.2 (#3456)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.3.1 to 6.3.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.3.1...6.3.2)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 18:36:26 +01:00
dependabot[bot]
136d8613a5 Bump gitpython from 3.1.26 to 3.1.27 (#3457)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.26 to 3.1.27.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.26...3.1.27)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 14:20:45 +01:00
dependabot[bot]
670d05df95 Bump awesomeversion from 22.1.0 to 22.2.0 (#3458)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 22.1.0 to 22.2.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/22.1.0...22.2.0)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 08:37:02 +01:00
dependabot[bot]
93fc4e97a0 Bump docker/login-action from 1.12.0 to 1.13.0 (#3454)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-18 08:45:33 +01:00
dependabot[bot]
b86df0696e Bump actions/setup-python from 2.3.1 to 2.3.2 (#3443)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2.3.1...v2.3.2)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 18:43:29 +01:00
dependabot[bot]
b0af73b0b5 Bump coverage from 6.2 to 6.3.1 (#3427)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.2 to 6.3.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.2...6.3.1)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 18:42:58 +01:00
dependabot[bot]
f1e884b264 Bump pytest from 6.2.5 to 7.0.1 (#3445)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.5 to 7.0.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.5...7.0.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 18:42:47 +01:00
Pascal Vizeli
a2f43d8c7b Add add-on support for CAS (#3450)
* Add add-on support for CAS

* add tests

* Update tests/test_security.py

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

* address comments

* Address rating comments

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-02-17 10:21:30 +01:00
Stefan Agner
b4cfbe46c1 Ignore corrupted databases in backup (#3452) 2022-02-16 18:11:02 +01:00
Pascal Vizeli
2a006ae76d Update CAS to 1.0.2 (#3448) 2022-02-15 16:27:18 +01:00
dependabot[bot]
40812450df Bump sentry-sdk from 1.5.4 to 1.5.5 (#3446)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.4 to 1.5.5.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.4...1.5.5)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 11:28:12 +01:00
Mike Degatano
d2e0b0417c Hash correct folder in source_mods tests (#3442)
Source mods test was corrected to start from `supervisor` folder within repo and not include tests. The patch here was still starting from the workspace directory since that's what it used to do
2022-02-10 11:33:47 -05:00
dependabot[bot]
d4fd8f3f0d Bump black from 21.12b0 to 22.1.0 (#3425)
* Bump black from 21.12b0 to 22.1.0

Bumps [black](https://github.com/psf/black) from 21.12b0 to 22.1.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits/22.1.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update black

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-02-10 14:13:40 +01:00
Pascal Vizeli
199b57c833 Fix source-mod detection calculation (#3440) 2022-02-10 14:07:17 +01:00
Pascal Vizeli
597a27ba33 Fix source-mod check (#3439)
* Fix source-mod check

* Fix stderr

* make handling robust
2022-02-10 13:23:05 +01:00
dependabot[bot]
d6e44b43b4 Bump attrs from 21.2.0 to 21.4.0 (#3386)
Bumps [attrs](https://github.com/python-attrs/attrs) from 21.2.0 to 21.4.0.
- [Release notes](https://github.com/python-attrs/attrs/releases)
- [Changelog](https://github.com/python-attrs/attrs/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/python-attrs/attrs/compare/21.2.0...21.4.0)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-10 10:23:34 +01:00
Pascal Vizeli
84c2053b57 Add suffix hash on CAS CI (#3438) 2022-02-10 10:21:34 +01:00
dependabot[bot]
2df3678fef Bump pyudev from 0.23.1 to 0.23.2 (#3434)
Bumps [pyudev](https://github.com/pyudev/pyudev) from 0.23.1 to 0.23.2.
- [Release notes](https://github.com/pyudev/pyudev/releases)
- [Changelog](https://github.com/pyudev/pyudev/blob/master/CHANGES.rst)
- [Commits](https://github.com/pyudev/pyudev/compare/v0.23.1...v0.23.2)

---
updated-dependencies:
- dependency-name: pyudev
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-10 10:14:14 +01:00
Pascal Vizeli
920f9846ac Fix asset name (#3437) 2022-02-10 10:13:22 +01:00
Pascal Vizeli
3478005e70 Using CAS for content-trust (#3382)
* Using CAS for content-trust

* v2

* Fix linting errors

* Adjust field checked for status in CAS response

* CI workflow needs CAS not VCN now

* Use cwd in test as code won't be in /usr/src

* Pre-cache CAS pub key for supervisor

* Cas doesn't actually need key file executable

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-02-10 09:21:21 +01:00
Matheson Steplock
e5d64f6c75 Fix bashio-typo in watchdog service (#3436) 2022-02-09 10:01:26 +01:00
Pascal Vizeli
787695a763 ESPHome default repo for new installations (#3430)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2022-02-08 14:07:34 -08:00
dependabot[bot]
a495fd6b3a Bump actions/setup-python from 2.3.1 to 2.3.2 (#3433)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-07 08:57:19 +01:00
Marco Trevisan
80e67b3c57 backups: Add support for creating fully uncompressed backups (#3378)
Hassio supervisor saves backups in tar files that contains compressed
tar archives, this is convenient when such backups are kept in the same
environment or need to be transferred remotely, but it's not convenient
when they will be processed using other backup tools such as borg or
restic that can handle compression, encryption and data deduplication
themselves.

In fact deduplication won't actually work at all with hassio compressed
backups as there's no way to find common streams for such tools (unless
we make them to export the archives during importing as borg's
import-tar can do), but this would lead to archives that are not easily
recoverable by the supervisor.

So, make possible to pass a "compressed" boolean parameter when creating
backups that will just archive all the data uncompressed.

It will be then up to other tools to manage the archives compression.
2022-02-03 10:24:44 +01:00
dependabot[bot]
a52272a7fe Bump home-assistant/builder from 2021.12.0 to 2022.01.0 (#3424)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-31 09:18:18 +01:00
dependabot[bot]
fb24ed3f1a Bump pyudev from 0.22.0 to 0.23.1 (#3423)
Bumps [pyudev](https://github.com/pyudev/pyudev) from 0.22.0 to 0.23.1.
- [Release notes](https://github.com/pyudev/pyudev/releases)
- [Changelog](https://github.com/pyudev/pyudev/blob/master/CHANGES.rst)
- [Commits](https://github.com/pyudev/pyudev/compare/v0.22...v0.23.1)

---
updated-dependencies:
- dependency-name: pyudev
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-27 15:15:09 +01:00
Pascal Vizeli
8d8704e049 Fixing IO on the loop with docker HW events (#3422) 2022-01-26 17:41:00 +01:00
dependabot[bot]
a60f25100d Bump sentry-sdk from 1.5.3 to 1.5.4 (#3419)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.3...1.5.4)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 16:49:55 +01:00
dependabot[bot]
5be4a1f4dc Bump pulsectl from 21.10.5 to 22.1.3 (#3416)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.10.5 to 22.1.3.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 16:49:28 +01:00
Pascal Vizeli
caacb421c1 Support dynamic device access cgroup (#3421)
* Support dynamic device access cgroup

* Clean listener better

* Update supervisor/docker/addon.py

Co-authored-by: Stefan Agner <stefan@agner.ch>

* Update addon.py

* Fix black

Co-authored-by: Stefan Agner <stefan@agner.ch>
2022-01-26 16:48:23 +01:00
Joakim Sørensen
724eaddf19 Bump frontend to b0b953bf (#3417) 2022-01-24 12:11:17 +01:00
Pascal Vizeli
c3019bce7e Add Core Update API (#3413)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-01-24 10:32:23 +01:00
dependabot[bot]
4ae61814d4 Bump sentry-sdk from 1.5.2 to 1.5.3 (#3412)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-21 21:12:11 +01:00
Joakim Sørensen
b651d63758 Add backup size to list API (#3409) 2022-01-19 08:59:30 -08:00
dependabot[bot]
400d3981a2 Bump pre-commit from 2.16.0 to 2.17.0 (#3407)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-19 09:16:13 +01:00
Stefan Agner
69c2517d52 Fix local Add-on restore on blank instance (#3403)
Make sure to not reference version attribute from the DockerAddon
instance since it is not yet populated in case this instance hadn't
installed that Add-on previously.

Use the higher level Images.load() API which returns a list of images
instead of loading with the lower level API and then search for the
image we just imported.
2022-01-11 16:55:19 +01:00
Stefan Agner
c8b49aba42 Avoid sending backup start notification to HA Core 2021.12 (#3400) 2022-01-11 13:20:19 +01:00
Stefan Agner
8071b107e7 Release all pending WebSocket calls on connection close (#3401) 2022-01-11 13:18:49 +01:00
dependabot[bot]
603d19b075 Bump sentry-sdk from 1.5.1 to 1.5.2 (#3398)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 09:04:24 +01:00
dependabot[bot]
a5ce2ef7cb Bump gitpython from 3.1.25 to 3.1.26 (#3399)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 08:36:23 +01:00
dependabot[bot]
f392dc5492 Bump awesomeversion from 21.12.0 to 22.1.0 (#3397)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 09:04:58 +01:00
dependabot[bot]
0c63883269 Bump gitpython from 3.1.24 to 3.1.25 (#3394)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.24 to 3.1.25.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.24...3.1.25)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-09 21:47:50 +01:00
dependabot[bot]
612d4f950b Bump pyupgrade from 2.30.0 to 2.31.0 (#3390)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-01-06 16:14:24 +01:00
Stefan Agner
1799c765b4 Notify HA Core when backup is being executed (#3305)
* Notify HA Core when backup is being executed

Notify Home Assistant Core using the Websocket API when the Home Assistant
config directory is about to get backed up. This makes sure the Core can
prepare the SQLite database (if active) so it safe to make a backup.

* Only close WebSocket connection on connection errors

Let regular WebSocket errors bubble to the caller so they can be handled
explicitly.

* Add version restriction to backup/start/end WS commands

* Restore Home Assistant metadata when Home Assistant is selected
2022-01-05 11:57:41 +01:00
Allen Porter
809ac1ffca Add Add-on discovery schema for rtsp-to-webrtc (#3392) 2022-01-05 11:30:15 +01:00
Allen Porter
fefc99e825 Fix copy/paste issues in tests (#3393) 2022-01-05 10:01:00 +01:00
Allen Porter
d994170a9d Fix copy-paste error in pydoc for test_almond.py (#3389) 2022-01-02 16:09:46 +01:00
Stefan Agner
d8c934365a Exclude old log files from backup (#3307)
Currently log files are excluded from the backup. Core uses a time or
startup based log rotation mechanism, both append a dot and an
additional; string (`.1`, `.{timestamp}`). There is also a fault
mechanism which creates a log file with the ending `.log.fault`. Exclude
all cases from the backup.
2021-12-28 17:40:32 +01:00
Joakim Sørensen
e0fd31c390 Create backup of add-ons and core before update (#3369)
* Create backup of addons and core before update

* Move responsibility
2021-12-28 11:13:54 +01:00
dependabot[bot]
22238c9c0e Bump awesomeversion from 21.11.0 to 21.12.0 (#3379)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.11.0 to 21.12.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.11.0...21.12.0)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-28 11:10:36 +01:00
dependabot[bot]
5ff96cfa5e Bump pyupgrade from 2.29.1 to 2.30.0 (#3381)
* Bump pyupgrade from 2.29.1 to 2.30.0

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.29.1 to 2.30.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.29.1...v2.30.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-12-28 11:09:28 +01:00
dependabot[bot]
e22a19df1a Bump cryptography from 35.0.0 to 36.0.1 (#3365)
Bumps [cryptography](https://github.com/pyca/cryptography) from 35.0.0 to 36.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/35.0.0...36.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-23 14:09:19 +01:00
dependabot[bot]
f57bc0db25 Bump async-timeout from 4.0.1 to 4.0.2 (#3376)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:57:51 +01:00
dependabot[bot]
6ba6b5ea56 Bump pylint from 2.12.1 to 2.12.2 (#3341)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:52:58 +01:00
dependabot[bot]
5dc9f9235e Bump docker/login-action from 1.10.0 to 1.12.0 (#3375)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:51:43 +01:00
Franck Nijhof
323fa2e637 Change CI cache restore policy (#3377) 2021-12-21 10:47:20 +01:00
dependabot[bot]
0986419b2f Bump deepmerge from 0.3.0 to 1.0.1 (#3373)
Bumps [deepmerge](https://github.com/toumorokoshi/deepmerge) from 0.3.0 to 1.0.1.
- [Release notes](https://github.com/toumorokoshi/deepmerge/releases)
- [Commits](https://github.com/toumorokoshi/deepmerge/commits)

---
updated-dependencies:
- dependency-name: deepmerge
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:26:03 +01:00
dependabot[bot]
f0bc952269 Bump home-assistant/builder from 2021.11.4 to 2021.12.0 (#3359)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.11.4 to 2021.12.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.11.4...2021.12.0)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:25:20 +01:00
dependabot[bot]
9266997482 Bump sentry-sdk from 1.5.0 to 1.5.1 (#3360)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.0...1.5.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:24:54 +01:00
dependabot[bot]
75d252e21a Bump pytest-timeout from 2.0.1 to 2.0.2 (#3361)
Bumps [pytest-timeout](https://github.com/pytest-dev/pytest-timeout) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/pytest-dev/pytest-timeout/releases)
- [Commits](https://github.com/pytest-dev/pytest-timeout/compare/2.0.1...2.0.2)

---
updated-dependencies:
- dependency-name: pytest-timeout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:24:24 +01:00
Joakim Sørensen
368e94f95f Bump frontend to 2f9c0880 (#3374) 2021-12-20 11:51:31 +01:00
Stefan Agner
3fbecf89db Enable asyncio debug in developer mode (#3348) 2021-12-16 10:50:56 +01:00
dependabot[bot]
54e6ae5fd9 Bump actions/upload-artifact from 2.3.0 to 2.3.1 (#3368)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-16 08:24:10 +01:00
Stefan Agner
5b96074055 Log if board reported by HAOS isn't in version file (#3366)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-12-15 16:45:18 +01:00
Joakim Sørensen
5503f93a75 Don't remove add-on repos if add-on is installed (#3364) 2021-12-14 21:04:31 +01:00
Stefan Agner
eadc629cd9 De-duplicate Backup/Restore logic (#3311)
* De-duplicate Backup/Restore logic

Create internal _do_backup()/_do_restore() method which de-duplicates
some of the backup/restore logic previously part of full/partial backup/restore.

* Add Backup/Restore test coverage
2021-12-14 17:21:52 +00:00
Stefan Agner
cde45e2e7a Address pytest warnings (#3347)
* Avoid accessing properties of udevice.parent

The if statement currently causes access of a property of
udevice.parent, leading to:
tests/hardware/test_module.py: 104 warnings
  /workspaces/supervisor/supervisor/hardware/data.py:50: DeprecationWarning: Will be removed in 1.0. Access properties with Device.properties.

Change the if statement to avoid property access and the deprecation
warning.

* Create task before using asyncio.wait()

Avoid deprecation warnings such as:
tests/store/test_custom_repository.py: 5 warnings
  /workspaces/supervisor/supervisor/store/__init__.py:113: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
    await asyncio.wait(tasks)
2021-12-14 15:30:22 +00:00
Franck Nijhof
050851a9ac Update ruamel.yaml to 0.17.17 (#3363) 2021-12-14 14:00:46 +01:00
dependabot[bot]
86bd16b2ba Bump black from 21.11b1 to 21.12b0 (#3342)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-12-14 02:14:38 +01:00
Joakim Sørensen
ce9181b05f Bump frontend to a7b558b6 (#3357) 2021-12-13 18:57:47 +01:00
Joakim Sørensen
f7ba364076 Bump frontend to 0a7b703d (#3346) 2021-12-08 10:13:47 +01:00
dependabot[bot]
3511c19726 Bump actions/upload-artifact from 2.2.4 to 2.3.0 (#3344)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-08 08:34:50 +01:00
Joakim Sørensen
d9ed58696b Bump frontend to 6877fd9e (#3338) 2021-12-02 20:42:42 +01:00
Joakim Sørensen
373f452774 Fix path name for build file (#3328) 2021-12-02 11:54:49 +01:00
dependabot[bot]
e54efa681f Bump pre-commit from 2.15.0 to 2.16.0 (#3335)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-01 07:49:54 +01:00
Stefan Agner
79cd8ac390 Allow to clear explicit image name (#3333)
The documentation says that passing null to `image` allows to clear
the option. Currently `null` is not allowed leading to:
Error: expected string or buffer for dictionary value @ data['image']. Got None

While at it, also update type annotation to reflect what the API
currently allows.
2021-11-30 18:48:09 +01:00
dependabot[bot]
dc24f332f8 Bump actions/setup-python from 2.3.0 to 2.3.1 (#3332)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-30 09:11:28 +01:00
dependabot[bot]
99cdf7b028 Bump sentry-sdk from 1.4.3 to 1.5.0 (#3316)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 23:01:27 +01:00
Joakim Sørensen
54edfa53bc Bump pylint from 2.11.1 to 2.12.1 (#3330) 2021-11-29 22:56:38 +01:00
Joakim Sørensen
571c9a05c6 Bump aiohttp and friends (#3329) 2021-11-29 22:34:42 +01:00
dependabot[bot]
864b7bf023 Bump jinja2 from 3.0.2 to 3.0.3 (#3296)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 17:40:34 +01:00
dependabot[bot]
e303431d74 Bump awesomeversion from 21.10.1 to 21.11.0 (#3308)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 17:27:52 +01:00
dependabot[bot]
19dd40275c Bump black from 21.9b0 to 21.11b1 (#3278)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-11-29 17:22:07 +01:00
Joakim Sørensen
4cf970e37a WS connection fix (#3317) 2021-11-29 17:21:09 +01:00
dependabot[bot]
7947c27089 Bump pytest-timeout from 1.4.2 to 2.0.1 (#3227)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 17:08:42 +01:00
Joakim Sørensen
d0e2c8b694 Split homeassistant watchdog conditions (#3318) 2021-11-29 17:03:49 +01:00
dependabot[bot]
19e3a859b0 Bump pyupgrade from 2.29.0 to 2.29.1 (#3306)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-11-29 16:59:46 +01:00
dependabot[bot]
e6557ded34 Bump actions/cache from 2.1.6 to 2.1.7 (#3320)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 16:54:08 +01:00
dependabot[bot]
f4aae4522d Bump actions/setup-python from 2.2.2 to 2.3.0 (#3315)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 16:50:40 +01:00
Joakim Sørensen
2066aefd6d Bump frontend to e91d1777 (#3326) 2021-11-29 15:45:14 +01:00
dependabot[bot]
2f56cab953 Bump home-assistant/builder from 2021.09.0 to 2021.11.4 (#3323)
* Bump home-assistant/builder from 2021.09.0 to 2021.11.4

Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.09.0 to 2021.11.4.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.09.0...2021.11.4)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* CAS fixes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-11-29 15:43:04 +01:00
dependabot[bot]
883399f583 Bump pytest-cov from 2.12.1 to 3.0.0 (#3192)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 15:16:41 +01:00
dependabot[bot]
47f53501e5 Bump coverage from 5.5 to 6.2 (#3324)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 14:46:12 +01:00
Joakim Sørensen
b23a89e6fb Bump frontend to a567312b (#3313) 2021-11-17 10:53:20 -08:00
Stefan Agner
7764decc37 Fix grammer of some error messages (#3310) 2021-11-17 15:41:35 +01:00
Joakim Sørensen
88490140af Add /supervisor/available_updates endpoint (#3300) 2021-11-17 09:28:46 +01:00
Pascal Vizeli
61d56dce9c Reload secrets on options config (#3292) 2021-11-11 12:09:50 +01:00
Pascal Vizeli
838af87ad7 Fix: using deep merge for test update schema (#3297) 2021-11-10 11:34:57 +01:00
dependabot[bot]
8f263ab345 Bump colorlog from 6.5.0 to 6.6.0 (#3294)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 6.5.0 to 6.6.0.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v6.5.0...v6.6.0)

---
updated-dependencies:
- dependency-name: colorlog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-09 09:54:22 +01:00
Pascal Vizeli
6b76086652 Handle whoami SSL error less strict (#3293) 2021-11-08 14:40:45 +01:00
Pascal Vizeli
efa5205800 Using rolling token on observer (#3286) 2021-11-04 10:18:44 +01:00
Philip Allgaier
a0c8b77737 Fix typo in HA startup message (#3287) 2021-11-03 23:19:34 +01:00
dependabot[bot]
9ee0efe6c0 Bump actions/checkout from 2.3.5 to 2.4.0 (#3285)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-03 08:17:16 +01:00
dependabot[bot]
a2af63d050 Bump flake8 from 3.9.2 to 4.0.1 (#3228)
Bumps [flake8](https://github.com/pycqa/flake8) from 3.9.2 to 4.0.1.
- [Release notes](https://github.com/pycqa/flake8/releases)
- [Commits](https://github.com/pycqa/flake8/compare/3.9.2...4.0.1)

---
updated-dependencies:
- dependency-name: flake8
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-01 16:36:00 +01:00
Pascal Vizeli
da246dc40a Fix AppArmor cache path (#3272) 2021-10-27 15:59:28 +02:00
Pascal Vizeli
3c52f87cdc Host Apparmor version on info (#3271) 2021-10-27 14:58:33 +02:00
Pascal Vizeli
d80d76a24d Using AppArmor from OS-Agent (#3254)
* Using AppArmor from OS-Agent

* cleanup
2021-10-27 12:55:31 +02:00
dependabot[bot]
8653f7a0e1 Bump awesomeversion from 21.8.1 to 21.10.1 (#3257)
* Bump awesomeversion from 21.8.1 to 21.10.1

Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.8.1 to 21.10.1.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.8.1...21.10.1)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix exception name

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-10-26 17:43:12 +02:00
Joakim Sørensen
8458d9e0f6 Only get stats for running containers (#3268) 2021-10-26 17:43:02 +02:00
Joakim Sørensen
5d4ce94155 Return directly for set_property (#3265)
* Return directly for set_property

* Fix typehint
2021-10-26 14:19:57 +02:00
Joakim Sørensen
828cf773cc Direct import from docker modules to get better typing (#3266) 2021-10-26 14:18:03 +02:00
Joakim Sørensen
a902b55df7 Remove note in log about removing containers (#3263)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-10-26 00:06:48 +02:00
Joakim Sørensen
f38cde4c68 Ignore intermediate images (#3264) 2021-10-26 00:06:26 +02:00
Pascal Vizeli
4c9cbb112e Fix dbus timeout on connection (#3258) 2021-10-25 14:19:09 +02:00
Stefan Agner
3d814f3c44 Network settings IPv6 fixes (#3251)
* Fix static assignment of IPv6 addresses

* Support statically assigned link local addresses

Statically assigned link local addresses are perfectly supported in IPv6
use cases.
2021-10-22 10:50:15 +02:00
Joakim Sørensen
f269f72082 Bump frontend to d05c7635 (#3250) 2021-10-22 10:49:13 +02:00
Stefan Agner
f07193dc3c Handle empty Add-on backup properly (#3253)
* Handle empty Add-on backup properly

Check if the data directory exist in the backup. If not, make sure a
directory gets created so the options.json can be written afterwards.

* Remove unrelated change
2021-10-22 10:48:53 +02:00
Stefan Agner
d2b706df05 Ignore disappearing network devices while querying them (#3249)
Sometimes NetworkManager network devices disappear while we are query
them. Presumably those are network interfaces generated by Docker.
Skip them and print a warning.
2021-10-20 15:06:36 +02:00
Stefan Agner
e5817e9445 D-Bus signal handling improvements (#3248)
* Allow to update connection information

* Introduce Signal wrapper class using async context manager

This allows to start monitoring signals and execute code before
processing signals. With that it is possible to check for state changes
in a race free manor.

* Fix unit tests
2021-10-20 14:40:28 +02:00
Joakim Sørensen
85313f26ea Handle unbound introspection (#3247) 2021-10-20 11:51:10 +02:00
Pascal Vizeli
f864613ffb Handle EOFError with dbus-next (#3246) 2021-10-20 11:37:44 +02:00
Joakim Sørensen
36ea8b2bb4 Update frontend to b760e543 (#3245) 2021-10-20 11:01:53 +02:00
Joakim Sørensen
df9d62f874 Fix update frontend script (#3244) 2021-10-19 19:42:47 +02:00
dependabot[bot]
4a6aaa8559 Bump pulsectl from 21.9.1 to 21.10.5 (#3237)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.9.1 to 21.10.5.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 18:22:28 +02:00
Stefan Agner
435f479984 D-Bus NetworkManager improvements (#3243)
* Introduce enum for network connectivity

* Differentiate between Bus Name and Interface consts

The Bus names and interfaces look quite similar in D-Bus: Both use dots
to separate words. Usually all interfaces available below a certan Bus
name start with the Bus name. Quite often the Bus name itself is also
available as an interface.

However, those are different things. To avoid confusion, add the type of
const to the const name.

* Remove unused const

* Disconnect D-Bus when not used

Make sure Python disconnects from D-Bus when objects get destroyed. This
avoids exhausting D-Bus connection limit which causes the following
error message:
[system] The maximum number of active connections for UID 0 has been reached (max_connections_per_user=256)

* Filter signals by object as well

Make sure we only listen to signals on that particular object. Also
support filtering messages via message filter callback.

* Explicitly wait until Connection is activated

Wait for activated or raise an error. This avoids too early/errornous
updates when state of the connection changes to "activating" or similar
intermediate signal states.

Fixes: #2639

* Fix VLAN configuration

* Add link to D-Bus object documentation

* Fix network settings update test

* Make MessageBus object optional
2021-10-19 16:38:52 +02:00
dependabot[bot]
e2f39059c6 Bump cryptography from 3.4.6 to 35.0.0 (#3170)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.6 to 35.0.0.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.6...35.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 15:05:25 +02:00
dependabot[bot]
531073d5ec Bump debugpy from 1.5.0 to 1.5.1 (#3242)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.5.0...v1.5.1)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 14:52:11 +02:00
Joakim Sørensen
ef5b6a5f4c Rename unsupported reason container to software (#3240)
* Rename unsupported reason container to software

* rename in tests
2021-10-19 11:26:58 +02:00
Joakim Sørensen
03f0a136ab Remove vcn from Dockerfile (#3241) 2021-10-19 10:08:53 +02:00
Stefan Agner
7a6663ba80 Use Python dbus-next D-Bus library (#3234)
* Use the correct interface name to get properties of systemd

It seems that gdbus (or systemd) automatically pick the correct
interface and return the properties. However, dbussy requires the
correct interface name to get all properties.

* Don't expect array from Strength property

The property returns a type "y" which equates to "guchar":
https://developer-old.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.AccessPoint.html#gdbus-property-org-freedesktop-NetworkManager-AccessPoint.Strength

It seems that the old D-Bus implementation returned an array. With
dbus-next a integer is returned, so no list indexing required.

* Support signals and remove no longer used tests and code

* Pass rauc update file path as string

That is what the interface is expecting, otherwise the new lib chocks on
the Pathlib type.

* Support Network configuration with dbus-next

Assemble Python native objects and pass them to dbus-next. Use dbus-next
specific Variant class where necessary.

* Use org.freedesktop.NetworkManager.Connection.Active.StateChanged

org.freedesktop.NetworkManager.Connection.Active.PropertyChanged is
depricated. Also it seems that StateChanged leads to fewer and more
accurate signals.

* Pass correct data type to RequestScan.

RequestScan expects an option dictionary. Pass an empty option
dictionary to it.

* Update unit tests

Replace gdbus specific fixtures with json files representing the return
values. Those can be easily converted into native Python objects.

* Rename D-Bus utils module gdbus to dbus
2021-10-18 23:06:44 +02:00
Stefan Agner
9dd5eee1ae Update to isort 5.9.3 (#3238) 2021-10-18 20:28:38 +02:00
Joakim Sørensen
bb474a5c14 Only run container evaluation when system is running (#3239)
* Only run container evaluation when system is running

* adjust test
2021-10-18 20:25:50 +02:00
Joakim Sørensen
6ab4dda5e8 Set agent diagnostics (#3203)
* Set agent diagnostics

* Add AttributeError to dbus_property wrapper

* Use dbus_property instead of dbus_connected

* Move sync to core setup
2021-10-18 14:48:47 +02:00
Joakim Sørensen
8a553dbb59 Adjust container evaluation (#3174)
* Adjust container evaluation

* remove test
2021-10-18 13:58:51 +02:00
dependabot[bot]
1ee6c0491c Bump sentry-sdk from 1.4.2 to 1.4.3 (#3171)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.4.2 to 1.4.3.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.4.2...1.4.3)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 10:59:45 +02:00
dependabot[bot]
cc50a91a42 Bump debugpy from 1.4.3 to 1.5.0 (#3202)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.4.3 to 1.5.0.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.4.3...v1.5.0)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 10:57:08 +02:00
Joakim Sørensen
637377f81d Replace devcontainer (#3175) 2021-10-18 10:44:28 +02:00
Vighnesh Kadam
a90f70e017 Use new format for logging exceptions - docker/network.py (#3220) 2021-10-18 10:09:21 +02:00
dependabot[bot]
949ecb255d Bump actions/checkout from 2.3.4 to 2.3.5 (#3236)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 08:33:53 +02:00
Anand Borkar
15f62837c8 Use new format for logging exceptions - docker/supervisor.py (#3221) 2021-10-08 16:03:30 +02:00
dependabot[bot]
e5246a5b1d Bump jinja2 from 3.0.1 to 3.0.2 (#3201)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 10:51:09 +02:00
Anand Borkar
394d66290d Use new format for logging exceptions - host/services.py (#3213)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-10-08 10:21:47 +02:00
dependabot[bot]
79d541185f Bump colorlog from 6.4.1 to 6.5.0 (#3216)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 10:09:10 +02:00
dependabot[bot]
b433d129ef Bump docker from 5.0.2 to 5.0.3 (#3215)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 10:08:24 +02:00
Samprit | Nekrós
4b0278fee8 Use new format for logging exceptions - store/repository.py (#3212) 2021-10-08 09:46:52 +02:00
Joakim Sørensen
8c59e6d05a Bump frontend to 910cd98a (#3211) 2021-10-07 13:11:03 +02:00
Joakim Sørensen
5c66278a1c Bump frontend to 066a0771 (#3210) 2021-10-07 11:37:16 +02:00
Vedant Bhamare
7abe9487a0 Use new format for logging exceptions - resolution/module.py (#3207) 2021-10-06 20:03:48 +02:00
Vedant Bhamare
73832dd6d6 Use new format for logging exceptions - plugins/multicast.py (#3206) 2021-10-06 19:52:07 +02:00
Vedant Bhamare
6cc3df54e9 Use new format for logging exceptions - plugins/audio.py (#3205) 2021-10-06 19:42:45 +02:00
Samprit | Nekrós
c07c7c5146 Use new format for logging exceptions - host/info.py (#3204)
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-10-06 13:01:04 +02:00
Balamurugan P
a6d1078fe3 Use new format for logging exceptions - docker/interface.py (#3184)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-10-04 22:49:55 +02:00
Joakim Sørensen
eba6da485d Rename disk_data to data_disk (#3200) 2021-10-04 22:46:28 +02:00
Prathamesh Gawas
de880e24ed Use new format for logging exceptions - host/apparmor.py (#3197) 2021-10-04 22:29:20 +02:00
Prathamesh Gawas
f344df9e5c Use new format for logging exceptions - host/network.py (#3196) 2021-10-04 22:23:55 +02:00
Prathamesh Gawas
5af62a8834 Use new format for logging exceptions - dbus/network/__init__.py (#3195) 2021-10-04 22:20:39 +02:00
Vighnesh Kadam
800fb683f8 Use new format for logging exceptions - plugins/dns.py (#3191)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-10-03 18:33:30 +02:00
Vedant Bhamare
ad2566d58a Use new format for logging exceptions - docker/init.py (#3189) 2021-10-03 12:33:55 +02:00
Vedant Bhamare
6c679b07e1 Use new format for logging exceptions - utils/apparmor.py (#3190) 2021-10-03 12:31:51 +02:00
Vighnesh Kadam
aa4f4c8d47 Use new format for logging exceptions - plugins/cli.py (#3188) 2021-10-03 10:16:49 +02:00
Anand Borkar
b83da5d89f Use new format for logging exceptions - api/proxy.py (#3187) 2021-10-02 11:29:12 +02:00
Vedant Bhamare
0afff9a9e2 Use new format for logging exceptions - services/modules/mqtt.py (#3183) 2021-10-01 14:46:36 +02:00
Finn
0433d72ae6 Use new format for logging exception - homeassistent/api.py (#3182) 2021-10-01 14:18:23 +02:00
Vedant Bhamare
d33beb06cd Use new format for logging exceptions - services/modules/mysql.py (#3180) 2021-10-01 14:03:16 +02:00
Prathamesh Gawas
279d6ccd79 Use new format for logging exceptions - host/sound.py (#3176) 2021-10-01 14:01:12 +02:00
Finn
af628293f3 Use new format for logging exceptions - addons/init.py (#3179)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-10-01 13:46:46 +02:00
Finn
df6b815175 Use new format for logging exceptions - addons/addon.py (#3178) 2021-10-01 13:23:57 +02:00
Finn
d6127832a7 Use new format for logging exceptions - auth.py (#3177) 2021-10-01 13:23:38 +02:00
Joakim Sørensen
8240623806 Fix observer security filter (#3173) 2021-09-30 15:12:04 +02:00
Joakim Sørensen
2b4527fa64 Return early in validate (#3168)
* Return early in validate

* pylint
2021-09-29 18:33:45 +02:00
Joakim Sørensen
23143aede4 Add all_plugins to cleanup code (#3166) 2021-09-29 18:23:25 +02:00
dependabot[bot]
8b93f0aee7 Bump pyupgrade from 2.28.1 to 2.29.0 (#3165)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-29 17:47:04 +02:00
Stefan Agner
5cc4a9a929 Use = instead of deprecated : as security option separator (#3167)
Docker reports:
Sep 23 08:16:31 homeassistant dockerd[467]: time="2021-09-23T08:16:31.771717436Z" level=warning msg="Security options with `:` as a separator are deprecated and will be completely unsupported in 17.04, use `=` instead."

Since it seems that Docker supports `=` since quite a while, we should
use `=` only.
2021-09-29 16:42:41 +02:00
Pascal Vizeli
288d2e5bdb Use deepmerge for options (#3162)
* Use deepmerge for options

* fix issue

* Update supervisor/addons/addon.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Add tests

* Fix merge schema

* Make save for overwrites

* drop community

* more cleanup

* Fix tests

* Fix lists

* revert strategy

* protect overwritten lists

* Update tests/api/test_store.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-09-29 09:37:04 +02:00
dependabot[bot]
73d84113ea Bump sentry-sdk from 1.4.1 to 1.4.2 (#3159)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.4.1...1.4.2)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-28 09:57:17 +02:00
dependabot[bot]
4b15945ca1 Bump pyupgrade from 2.28.0 to 2.28.1 (#3160)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-28 09:43:00 +02:00
dependabot[bot]
10720b2988 Bump dessant/lock-threads from 2.1.2 to 3 (#3158)
* Bump dessant/lock-threads from 2.1.2 to 3

Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 2.1.2 to 3.
- [Release notes](https://github.com/dessant/lock-threads/releases)
- [Changelog](https://github.com/dessant/lock-threads/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dessant/lock-threads/compare/v2.1.2...v3)

---
updated-dependencies:
- dependency-name: dessant/lock-threads
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Adjust config for breaking change

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-09-28 09:41:20 +02:00
Joakim Sørensen
bb991b69bb Bmp frontend to b6344eb6 (#3161) 2021-09-28 09:33:38 +02:00
Pascal Vizeli
7c9f6067c0 Fix pyupgrade precommit (#3155)
* Fix pyupgrade precommit

* address comments
2021-09-27 11:05:21 +02:00
dependabot[bot]
e960a70217 Bump pyupgrade from 2.26.0.post1 to 2.28.0 (#3151)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 10:37:21 +02:00
dependabot[bot]
9b0a2e6da9 Bump sentry-sdk from 1.4.0 to 1.4.1 (#3140)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 10:36:58 +02:00
Joakim Sørensen
cd0c151bd9 Fix typo in vcn_version (#3154) 2021-09-27 10:25:03 +02:00
Pascal Vizeli
b03c8c24dd Fix UnboundLocalError (#3153) 2021-09-27 09:44:15 +02:00
Pascal Vizeli
4416b6524e Bump voluptuous from 0.12.1 to 0.12.2 (#3147) 2021-09-27 08:28:34 +02:00
dependabot[bot]
c9d3f65cc8 Bump home-assistant/builder from 2021.07.0 to 2021.09.0 (#3150)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 08:07:28 +02:00
Pascal Vizeli
0407122fbe Revert "Bump voluptuous from 0.12.1 to 0.12.2 (#3141)" (#3145)
This reverts commit 5e871d9399.
2021-09-25 14:50:01 +02:00
dependabot[bot]
5e871d9399 Bump voluptuous from 0.12.1 to 0.12.2 (#3141)
Bumps [voluptuous](https://github.com/alecthomas/voluptuous) from 0.12.1 to 0.12.2.
- [Release notes](https://github.com/alecthomas/voluptuous/releases)
- [Changelog](https://github.com/alecthomas/voluptuous/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alecthomas/voluptuous/compare/0.12.1...v0.12.2)

---
updated-dependencies:
- dependency-name: voluptuous
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-25 11:02:48 +02:00
Joakim Sørensen
6df7a88666 Bump frontend to 03dc3e52 (#3142) 2021-09-25 10:59:53 +02:00
Pascal Vizeli
5933b66b1c Add os-agent to evaluations for supported systems (#3138) 2021-09-22 15:59:35 +02:00
dependabot[bot]
a85e816cd7 Bump pylint from 2.10.2 to 2.11.1 (#3128)
* Bump pylint from 2.10.2 to 2.11.1

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.10.2 to 2.11.1.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.10.2...v2.11.1)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix linter issues

* fix tests lint

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-22 14:33:32 +02:00
dependabot[bot]
96f6c07912 Bump sentry-sdk from 1.3.1 to 1.4.0 (#3135)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.3.1...1.4.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-22 12:18:33 +02:00
Joakim Sørensen
40bcee38f3 Add startup time and boot_timestamp (#3136)
* Add startup time

* Add boot_timestamp

* Fix type

* patch and rename properties fixture
2021-09-22 11:15:38 +02:00
dependabot[bot]
6d2a38c96e Bump gitpython from 3.1.18 to 3.1.24 (#3130)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.18 to 3.1.24.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.18...3.1.24)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-21 18:23:56 +02:00
dependabot[bot]
dafc2cfec2 Bump pyupgrade from 2.26.0 to 2.26.0.post1 (#3131)
* Bump pyupgrade from 2.26.0 to 2.26.0.post1

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.26.0 to 2.26.0.post1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/commits)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

* Fixes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-21 18:22:56 +02:00
Pascal Vizeli
04f36e92e1 Return list of possible data disk targets (#3133)
* Return list of possible data disk targets

* fix path

* fix tests

* Add test

* Fix tests

* Add tests

* Add more tests

* Remove debug

* Address comments

* more clear
2021-09-21 14:51:58 +02:00
Pascal Vizeli
4f97013df4 Using git token + pull image from ghcr.io for tests (#3132) 2021-09-20 13:41:35 +02:00
Pascal Vizeli
53eae96a98 DataDisk reload devices (#3129)
* DataDisk reload devices

* improve loading

* simplify

* validate input device

* add comments

* Add agent version to API

* more tests

* fix test lint
2021-09-20 12:52:51 +02:00
Joakim Sørensen
74530baeb7 Detect if frontend is not loaded (#3124)
* Detect if frontend is not loaded

* update
2021-09-18 14:30:01 +02:00
Pascal Vizeli
271e4f0cc4 Support OS-Agent Data disk (#3120)
* Support OS-Agent Data disk

* fix lint

* add tests

* Fix empty path

* revert change

* Using as_posix()

* clean not needed cast

* rename

* Rename files
2021-09-17 15:01:07 +02:00
Joakim Sørensen
f4c7f2cae1 Update frontend to cb11c6b3 (#3125) 2021-09-15 10:54:12 +02:00
dependabot[bot]
24cdb4787a Bump black from 21.8b0 to 21.9b0 (#3123)
* Bump black from 21.8b0 to 21.9b0

Bumps [black](https://github.com/psf/black) from 21.8b0 to 21.9b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-14 12:01:10 +02:00
dependabot[bot]
57b1c21af4 Bump codecov/codecov-action from 2.0.3 to 2.1.0 (#3122)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.3 to 2.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2.0.3...v2.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-14 09:02:30 +02:00
dependabot[bot]
f0eddb6926 Bump debugpy from 1.4.1 to 1.4.3 (#3116)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.4.1 to 1.4.3.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.4.1...v1.4.3)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-13 16:06:59 +02:00
dependabot[bot]
7c74c1bd8c Bump pyupgrade from 2.25.0 to 2.26.0 (#3118)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.25.0 to 2.26.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.25.0...v2.26.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-13 16:06:42 +02:00
dependabot[bot]
2d4a85ae43 Bump pulsectl from 21.5.18 to 21.9.1 (#3108)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.5.18 to 21.9.1.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-13 14:00:08 +02:00
Joakim Sørensen
d48c439737 Print supervisor container logs on failure (#3110) 2021-09-09 13:21:22 +02:00
dependabot[bot]
874c50d3e8 Bump docker from 5.0.0 to 5.0.2 (#3099)
Bumps [docker](https://github.com/docker/docker-py) from 5.0.0 to 5.0.2.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/5.0.0...5.0.2)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-06 08:50:42 +02:00
Joakim Sørensen
4beaf571c2 Bump frontend to d5a16176 (#3101) 2021-09-03 12:49:33 +02:00
dependabot[bot]
58a948447e Bump pre-commit from 2.14.1 to 2.15.0 (#3103)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.14.1 to 2.15.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.14.1...v2.15.0)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-03 10:37:19 +02:00
Pascal Vizeli
32af7ef28b Support USB discovery (#3100)
* Support USB discovery

* fix policy

* Fix scan command

* address comments

Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-09-02 20:34:18 +02:00
Joakim Sørensen
208fb549b7 Update translations as a part of updating the frontend (#3096)
* Update translations as a part of updating the frontend

* Update frontend to ac64d293 with translations
2021-09-01 13:59:12 +02:00
Joakim Sørensen
ab704c11cf Ignore rootfs (#3097) 2021-09-01 13:58:48 +02:00
Joakim Sørensen
966b962ccf Ignore all files and directories that starts with . (#3094)
* Ignore all files and directories that starts with .

* pylint

* Check all parts
2021-09-01 12:50:44 +02:00
dependabot[bot]
4ea3695982 Bump pytest from 6.2.4 to 6.2.5 (#3092)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.4 to 6.2.5.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.4...6.2.5)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-31 08:19:36 +02:00
Pascal Vizeli
b2abe37d72 Add check for plugin trust (#3080)
* Add check for plugin trust

* Update supervisor/resolution/checks/plugin_trust.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-08-30 10:56:05 +02:00
dependabot[bot]
9bf8d15b01 Bump black from 21.7b0 to 21.8b0 (#3088)
* Bump black from 21.7b0 to 21.8b0

Bumps [black](https://github.com/psf/black) from 21.7b0 to 21.8b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-08-30 10:20:14 +02:00
dependabot[bot]
70acbffc23 Bump pyupgrade from 2.24.0 to 2.25.0 (#3086)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.24.0 to 2.25.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.24.0...v2.25.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 10:06:44 +02:00
dependabot[bot]
c9b1eb751e Bump pre-commit from 2.14.0 to 2.14.1 (#3087)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.14.0 to 2.14.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.14.0...v2.14.1)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 10:06:24 +02:00
Joakim Sørensen
ad8d850ed7 Update frontend to 67ab63f0 (#3083) 2021-08-28 10:08:15 +02:00
Pascal Vizeli
1b0eb9397d Fix command for disable content-trust (#3078) 2021-08-26 17:18:00 +02:00
dependabot[bot]
8572f8c4e5 Bump awesomeversion from 21.8.0 to 21.8.1 (#3074)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.8.0 to 21.8.1.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.8.0...21.8.1)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-26 14:51:24 +02:00
dependabot[bot]
66565dde87 Bump codecov/codecov-action from 2.0.2 to 2.0.3 (#3073)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-25 08:38:20 +02:00
Pascal Vizeli
d54c23952f Codenotary vcn 0.9.8 - System trust check (#3070)
* Update codenotary 0.9.8

* Fix lint

* ditch wrong code

* Fix run health check

* remove old code

* better structured

* more cleaner

* Fix core

* Add tests

* addjust test

* Split checks

* Update supervisor/resolution/checks/core_trust.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Fix line end

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-08-24 12:19:08 +02:00
dependabot[bot]
62b364ea29 Bump colorlog from 5.0.1 to 6.4.1 (#3072)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 5.0.1 to 6.4.1.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v5.0.1...v6.4.1)

---
updated-dependencies:
- dependency-name: colorlog
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-24 11:20:21 +02:00
dependabot[bot]
e6f00144f2 Bump pylint from 2.9.6 to 2.10.2 (#3069)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.6 to 2.10.2.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.9.6...v2.10.2)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-23 11:07:28 +02:00
Franck Nijhof
8894984c12 Add Debian 11: Bulleyes to support systems check (#3066) 2021-08-23 11:07:15 +02:00
foreign-sub
49fbdedf6b Relax check_system_runtime timeout to 10 seconds (#3037)
Probably related to https://github.com/home-assistant/plugin-observer/issues/22

Sometimes i notice my supervisor logs shows a random : 

WARNING (MainThread) [supervisor.misc.tasks] Watchdog/Application found a problem with observer plugin!

i believe the cause to be related to the timeout being too short on a "busy" system, thus my proposal to relax it to 10 seconds.
2021-08-21 16:15:31 +02:00
Joakim Sørensen
0899c16895 Update frontend to 44548fdc (#3061) 2021-08-21 10:41:59 +02:00
dependabot[bot]
0747a7e4b2 Bump pyupgrade from 2.23.3 to 2.24.0 (#3065)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.23.3 to 2.24.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.23.3...v2.24.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-20 08:06:51 +02:00
dependabot[bot]
0123d7935d Bump dessant/lock-threads from 2.1.1 to 2.1.2 (#3063)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-18 08:59:51 +02:00
dependabot[bot]
7a1009446b Bump awesomeversion from 21.6.0 to 21.8.0 (#3059)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.6.0 to 21.8.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.6.0...21.8.0)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-12 16:21:14 +02:00
Pascal Vizeli
034606cd0f Give audio plugin machine data for mixer evaluation (#3056) 2021-08-10 13:36:48 +02:00
dependabot[bot]
ddc30cfd7d Bump pylint from 2.9.4 to 2.9.6 (#3036)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.4 to 2.9.6.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.9.4...v2.9.6)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-10 10:42:51 +02:00
Pascal Vizeli
f10fccaff8 Fix vcn install on CI (#3055)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-08-10 10:36:57 +02:00
Pascal Vizeli
31001280c8 Add bus system for handling events hw/pulse/docker (#2999)
* Add bus system for handling events hw/pulse/docker

* give sound update back

* register events

* Add tests

* Add debug logger

* Update supervisor/coresys.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-08-09 19:30:26 +02:00
dependabot[bot]
9638775944 Bump debugpy from 1.3.0 to 1.4.1 (#3028)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.3.0 to 1.4.1.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.3.0...v1.4.1)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 19:29:12 +02:00
dependabot[bot]
fbec0befde Bump ciso8601 from 2.1.3 to 2.2.0 (#3052)
Bumps [ciso8601](https://github.com/closeio/ciso8601) from 2.1.3 to 2.2.0.
- [Release notes](https://github.com/closeio/ciso8601/releases)
- [Changelog](https://github.com/closeio/ciso8601/blob/master/CHANGELOG.md)
- [Commits](https://github.com/closeio/ciso8601/compare/v2.1.3...v2.2.0)

---
updated-dependencies:
- dependency-name: ciso8601
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 19:28:51 +02:00
Joakim Sørensen
81e7fac848 Fix flaky tests when CI did not have access to /run/supervisor (#3054) 2021-08-09 19:26:37 +02:00
dependabot[bot]
97599b3e70 Bump sentry-sdk from 1.2.0 to 1.3.1 (#3031)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 17:44:44 +02:00
dependabot[bot]
c94b23a3fd Bump getsentry/action-release from 1.1.5 to 1.1.6 (#3030)
Bumps [getsentry/action-release](https://github.com/getsentry/action-release) from 1.1.5 to 1.1.6.
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Commits](https://github.com/getsentry/action-release/compare/v1.1.5...v1.1.6)

---
updated-dependencies:
- dependency-name: getsentry/action-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 17:05:31 +02:00
dependabot[bot]
9758980ae0 Bump pyupgrade from 2.21.2 to 2.23.3 (#3050)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.21.2 to 2.23.3.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.21.2...v2.23.3)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 17:04:18 +02:00
dependabot[bot]
6ab3fbaab3 Bump pre-commit from 2.13.0 to 2.14.0 (#3053)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.13.0 to 2.14.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.13.0...v2.14.0)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 17:03:20 +02:00
dependabot[bot]
4933ff83df Bump codecov from 2.1.11 to 2.1.12 (#3045)
Bumps [codecov](https://github.com/codecov/codecov-python) from 2.1.11 to 2.1.12.
- [Release notes](https://github.com/codecov/codecov-python/releases)
- [Changelog](https://github.com/codecov/codecov-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-python/compare/v2.1.11...v2.1.12)

---
updated-dependencies:
- dependency-name: codecov
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 17:02:50 +02:00
dependabot[bot]
71e12ecb2b Bump home-assistant/builder from 2021.06.2 to 2021.07.0 (#3035)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.06.2 to 2021.07.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.06.2...2021.07.0)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 16:51:28 +02:00
dependabot[bot]
36687530e0 Bump black from 21.6b0 to 21.7b0 (#3013)
Bumps [black](https://github.com/psf/black) from 21.6b0 to 21.7b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 16:40:21 +02:00
Joakim Sørensen
e7b5864c03 Replace abstractproperty with abstractmethod (#3049) 2021-08-05 15:28:32 +02:00
Joakim Sørensen
9497f85db9 Use custom user agent string for aiohttp (#3033) 2021-07-28 14:46:37 +02:00
Joakim Sørensen
419f603571 Rename snapshot -> backup (#2940) 2021-07-27 10:06:09 +02:00
dependabot[bot]
f4f1fc524d Bump codecov/codecov-action from 2.0.1 to 2.0.2 (#3027)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-26 10:21:00 +02:00
dependabot[bot]
6d9f44a900 Bump pylint from 2.9.3 to 2.9.4 (#3020)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.3 to 2.9.4.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.9.3...v2.9.4)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-21 15:50:00 +02:00
Pascal Vizeli
aeb9b26d44 Alpine 3.14 (#3019)
* Alpine 3.14

* revert trigger
2021-07-20 18:30:08 +02:00
dependabot[bot]
631f78f468 Bump codecov/codecov-action from 1.5.2 to 2.0.1 (#3018)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1.5.2 to 2.0.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.5.2...v2.0.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-20 11:11:51 +02:00
dependabot[bot]
13cedb308e Bump pyupgrade from 2.21.1 to 2.21.2 (#3012)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.21.1 to 2.21.2.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.21.1...v2.21.2)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-19 09:59:09 +02:00
dependabot[bot]
82c183e1a8 Bump pyupgrade from 2.21.0 to 2.21.1 (#3010)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.21.0 to 2.21.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.21.0...v2.21.1)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-16 09:07:49 +02:00
dependabot[bot]
25cf1e7394 Bump actions/stale from 3.0.19 to 4 (#3009)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-15 09:36:18 +02:00
dependabot[bot]
91509a4205 Bump dessant/lock-threads from 2.0.3 to 2.1.1 (#3007)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-12 11:44:53 +02:00
dependabot[bot]
d93ebd15a2 Bump pyupgrade from 2.20.0 to 2.21.0 (#3008)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.20.0 to 2.21.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.20.0...v2.21.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-12 11:40:34 +02:00
dependabot[bot]
85e7f817e6 Bump sentry-sdk from 1.1.0 to 1.2.0 (#2997)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.1.0...1.2.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-08 11:40:45 +02:00
dependabot[bot]
772cadb435 Bump pylint from 2.9.1 to 2.9.3 (#2992)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.1 to 2.9.3.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.9.1...v2.9.3)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-05 09:39:25 +02:00
dependabot[bot]
853aeef583 Bump pyupgrade from 2.19.4 to 2.20.0 (#2993)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.19.4 to 2.20.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.19.4...v2.20.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-05 09:39:13 +02:00
dependabot[bot]
cd07bde307 Bump pylint from 2.8.3 to 2.9.1 (#2988)
* Bump pylint from 2.8.3 to 2.9.1

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.8.3 to 2.9.1.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.8.3...v2.9.1)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update pylintrc

* Update base.py

* Update base.py

* Fix black

* fix helper

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-07-01 18:07:15 +02:00
Joakim Sørensen
3057df3181 Update frontend to 30d6c689 (#2989) 2021-07-01 17:40:42 +02:00
Joakim Sørensen
fe785622ec Format log as string (#2984) 2021-06-30 12:31:56 +02:00
Pascal Vizeli
2b6829a786 OS-Agent support (#2811)
* OS-Agent support

* add agent to host feature

* Add support for os-agent on devcontainer

* Rename core

* fix tests

* add setter

* add cgroup / apparmor

* all interfaces added

* fix import

* Add tests

* More tests

* Finish tests

* reformating xml files

* fix doc string

* address comments

* change return value

* fix tests

* Update supervisor/dbus/agent/__init__.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Update scripts/supervisor.sh

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-06-30 11:55:53 +02:00
Joakim Sørensen
7c6c982414 Add ingress_stream add-on option (#2982) 2021-06-30 09:28:29 +02:00
Joakim Sørensen
07eeb2eaf2 Only use .content for POST (#2981)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-06-29 11:29:47 +02:00
Joakim Sørensen
223f5b7bb1 Fix failing test (#2980) 2021-06-26 19:32:00 +02:00
Joakim Sørensen
8a9657c452 Stream requests to ingress (#2979)
* Chunk large requests to ingress

* Remove timout for POST

* No timeout

* stream

* Remove chunked
2021-06-26 19:31:15 +02:00
Joakim Sørensen
564e9811d0 Use brotlipy instead of Brotli (#2977) 2021-06-24 19:12:48 +02:00
Pascal Vizeli
b944b52b21 Add running job condition to OS update (#2976) 2021-06-24 16:06:06 +02:00
dependabot[bot]
24aecdddf3 Bump docker/login-action from 1.9.0 to 1.10.0 (#2975)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-24 12:48:33 +02:00
Stefan Agner
7bbfb60039 Allow upgrade when using {os_name} in URL (#2974)
Once {os_name} is part of the update URL we also need to set the OS name
explicitly for upgrades: A user might use a new Supervisor version on a
OS release 5 device. The device will still use "hassos" as OS name.
Before introducing {os_name}, the new OS name was part of the URL. Now
when {os_name} is used, we need to adjust the name for upgrade as well.
2021-06-24 08:39:50 +02:00
Pascal Vizeli
ece40008c7 Logging in local timezone (#2971)
* Logging in local timezone

* fix convert

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-06-21 13:42:39 +02:00
Pascal Vizeli
0177b38ded Support HOT/COLD snapshots for Add-ons (#2943)
* Support HOT/COLD snapshots for Add-ons

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Add warning

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-06-21 09:07:54 +02:00
Stefan Agner
16f2f63081 Allow downgrade to "hassos" from "haos" (#2970)
* Add "os_name" as possible URL variable

* Replace "os_name" for downgrades to OS versions before 6.0
2021-06-19 18:50:54 +02:00
Pascal Vizeli
5f376c2a27 Using images data from version file (#2969)
* Using images data from version file

* fix tests
2021-06-18 22:59:11 +02:00
dependabot[bot]
90a6f109ee Bump gitpython from 3.1.17 to 3.1.18 (#2967)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.17 to 3.1.18.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.17...3.1.18)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-18 13:32:53 +02:00
dependabot[bot]
e6fd0ef5dc Bump actions/upload-artifact from 2.2.3 to 2.2.4 (#2965)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.2.3 to 2.2.4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.2.3...v2.2.4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-17 09:49:28 +02:00
Joakim Sørensen
d46ab56901 Update frontend to 446a9b5c (#2962) 2021-06-16 11:45:28 +02:00
Pascal Vizeli
3b1ad5c0cd Run API watchdog only if core is running (#2961)
* Run API watchdog only if core is running

* negate

* fix comment
2021-06-16 11:45:06 +02:00
Joakim Sørensen
de8a241e72 When validating add-ons transform core-addons url (#2960) 2021-06-15 15:06:40 +02:00
Pascal Vizeli
a4a0b43d91 Using ghcr.io/home-assistant + fallback (#2959) 2021-06-14 20:07:44 +02:00
Pascal Vizeli
adf355e54f Fix API watchdog never trigger (#2958) 2021-06-14 14:11:22 +02:00
Joakim Sørensen
4f9e646b4c Fix addon_pwned enabled setter (#2952)
* Fix addon_pwned enabled setter

* whatever

* adjust
2021-06-14 11:33:53 +02:00
dependabot[bot]
ce57d384ca Bump pyupgrade from 2.19.3 to 2.19.4 (#2957)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.19.3 to 2.19.4.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.19.3...v2.19.4)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-14 11:32:50 +02:00
Pascal Vizeli
d53d526673 Add-on: Block update itself (#2956)
* Add-on: Block update itself

* Better logging

* Update
2021-06-14 10:37:59 +02:00
Pascal Vizeli
cd8fc16bcb Cleanup security layer - Add-on default access role (#2954)
* Allow access to network info (add-on)

* fix check

* make it nice

* cleanup

* cleanup

* fix tests

* Add warning

* allow access to addons/store/snapshot infos

* revert
2021-06-14 10:05:37 +02:00
dependabot[bot]
6b58970354 Bump black from 21.5b2 to 21.6b0 (#2953)
* Bump black from 21.5b2 to 21.6b0

Bumps [black](https://github.com/psf/black) from 21.5b2 to 21.6b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-06-13 12:44:11 +02:00
Joakim Sørensen
b70ed9a60d Rename fixtures (#2946)
* Rename fixtures

* Use tilde
2021-06-10 12:45:39 +02:00
dependabot[bot]
22c8ff1314 Bump pyupgrade from 2.19.1 to 2.19.3 (#2948)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.19.1 to 2.19.3.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.19.1...v2.19.3)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-10 11:39:16 +02:00
Stefan Agner
ba2cf8078e Bump awesomeversion to 21.6.0 (#2949) 2021-06-10 10:15:43 +02:00
dependabot[bot]
ef138b619b Bump pulsectl from 21.5.17 to 21.5.18 (#2911)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.5.17 to 21.5.18.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-09 14:38:30 +02:00
dependabot[bot]
9252af5ddb Bump codecov/codecov-action from 1.5.0 to 1.5.2 (#2942)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1.5.0 to 1.5.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.5.0...v1.5.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-09 10:39:24 +02:00
Pascal Vizeli
bcef34012d Time handling (#2901)
* Add new time handling

* migrate date for python3.9

* add timedate

* add tests & simplify it

* better testing

* use ssl

* use hostname with new interface

* expose to API

* update data

* add base handler

* new timezone handling

* improve handling

* Improve handling

* Add tests

* Time adjustment function

* Fix logging

* tweak condition

* don't adjust synchronized time

* Guard

* ignore UTC

* small cleanup

* like that, we can leaf it

* add URL

* add comment

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-06-09 09:38:32 +02:00
Stefan Agner
2f18c177ae Introduce pre-/post-snapshot commands (#2941)
Introduce commands which are run before and after a snapshot is being
taken. This is useful for e.g. for database add-ons to suspend write
operations during snapshot.
2021-06-08 21:44:31 +02:00
dependabot[bot]
12487fb69d Bump home-assistant/builder from 2021.05.0 to 2021.06.2 (#2939)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.05.0 to 2021.06.2.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.05.0...2021.06.2)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-08 21:41:50 +02:00
Joakim Sørensen
e629bab8ee Fix setting audio profile (#2934) 2021-06-04 14:18:23 +02:00
Joakim Sørensen
e85d7c3d2e Update frontend to a45b8ca8 (#2936) 2021-06-04 14:05:50 +02:00
Joakim Sørensen
64c59d0fe9 Lmit ensure_access_token (#2931) 2021-06-03 11:03:46 +02:00
dependabot[bot]
522cbe3295 Bump pytest-cov from 2.12.0 to 2.12.1 (#2930)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.12.0 to 2.12.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.12.0...v2.12.1)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-02 12:31:44 +02:00
Sergio Oller
fd185fc326 Minor spelling fixes (#2929) 2021-06-02 11:50:07 +02:00
dependabot[bot]
6ddc135266 Bump pylint from 2.8.2 to 2.8.3 (#2924)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.8.2 to 2.8.3.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.8.2...v2.8.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-01 15:49:02 +02:00
dependabot[bot]
f8d5279d9c Bump black from 21.5b1 to 21.5b2 (#2926)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-01 15:48:28 +02:00
dependabot[bot]
2acae9af57 Bump pyupgrade from 2.19.0 to 2.19.1 (#2925)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.19.0 to 2.19.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.19.0...v2.19.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-01 14:38:05 +02:00
Pascal Vizeli
b425d21d05 Adjust content-trust core version (#2923) 2021-05-31 11:48:37 +02:00
dependabot[bot]
4c7ba20a58 Bump pyupgrade from 2.18.3 to 2.19.0 (#2922)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.18.3 to 2.19.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.18.3...v2.19.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-31 10:19:39 +02:00
dependabot[bot]
a4f325dd2e Bump actions/cache from 2.1.5 to 2.1.6 (#2916)
Bumps [actions/cache](https://github.com/actions/cache) from 2.1.5 to 2.1.6.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.5...v2.1.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-28 11:09:30 +02:00
Stefan Agner
a99bfa2926 Update OS on intel-nuc to generic-x86-64 image (#2909)
* Add architectures supported by generic-x86-64 board

* Follow intel-nuc to generic-x86-64 rename when updating

Home Assistant OS renamed the intel-nuc board to generic-x86-64. Make
sure to download the generic-x86-64 raucb OS update when updating a
intel-nuc machine.

* Don't explicit use section, rely on AwesomeVersion's comparision

* Remove unecessary global variable TEST_URL

* Fix version comparision

* Remove rate limiter on updater.fetch_data()

* Update tests/test_hassos.py

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>

* Fix black issue

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2021-05-27 14:25:16 +02:00
Joakim Sørensen
bb127a614b Bump frontend to 59f3f819 (#2915) 2021-05-27 10:53:14 +02:00
Joakim Sørensen
6f2f005897 Update frontend to fa9c6a76 (#2914) 2021-05-26 15:35:20 +02:00
dependabot[bot]
e22a20c165 Bump pre-commit from 2.12.1 to 2.13.0 (#2912)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 10:58:39 +02:00
dependabot[bot]
20c2121e5f Bump pyupgrade from 2.18.1 to 2.18.3 (#2913)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.18.1 to 2.18.3.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.18.1...v2.18.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 09:42:44 +02:00
dependabot[bot]
8a5831d6b2 Bump pyupgrade from 2.17.0 to 2.18.1 (#2910)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.17.0 to 2.18.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.17.0...v2.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-21 14:50:01 +02:00
Franck Nijhof
fb81946240 Fix Watchdog port being used as string (#2903) 2021-05-19 17:32:31 +02:00
dependabot[bot]
4bec86c58c Bump pydocstyle from 6.0.0 to 6.1.1 (#2895)
Bumps [pydocstyle](https://github.com/PyCQA/pydocstyle) from 6.0.0 to 6.1.1.
- [Release notes](https://github.com/PyCQA/pydocstyle/releases)
- [Changelog](https://github.com/PyCQA/pydocstyle/blob/master/docs/release_notes.rst)
- [Commits](https://github.com/PyCQA/pydocstyle/compare/6.0.0...6.1.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-19 12:45:39 +02:00
dependabot[bot]
7034b79991 Bump pyupgrade from 2.16.0 to 2.17.0 (#2894)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.16.0 to 2.17.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.16.0...v2.17.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-19 12:41:39 +02:00
dependabot[bot]
7b9a09dc4b Bump pulsectl from 21.5.6 to 21.5.17 (#2892)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.5.6 to 21.5.17.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-19 12:12:58 +02:00
dependabot[bot]
0746c4dec5 Bump actions/stale from 3.0.18 to 3.0.19 (#2896)
Bumps [actions/stale](https://github.com/actions/stale) from 3.0.18 to 3.0.19.
- [Release notes](https://github.com/actions/stale/releases)
- [Commits](https://github.com/actions/stale/compare/v3.0.18...v3.0.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-19 11:36:46 +02:00
Joakim Sørensen
6dadb933bd Bump frontend to 245bb639 (#2897) 2021-05-19 11:34:49 +02:00
dependabot[bot]
07197e6a50 Bump jinja2 from 3.0.0 to 3.0.1 (#2900)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.0...3.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-19 10:27:27 +02:00
dependabot[bot]
6c79fb8325 Bump pytest-cov from 2.11.1 to 2.12.0 (#2893)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.11.1 to 2.12.0.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.11.1...v2.12.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 10:57:24 +02:00
dependabot[bot]
7488750ee4 Bump pyupgrade from 2.15.0 to 2.16.0 (#2891)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.15.0 to 2.16.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.15.0...v2.16.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 10:41:48 +02:00
dependabot[bot]
c9574254aa Bump jinja2 from 2.11.3 to 3.0.0 (#2873)
Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.3 to 3.0.0.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.11.3...3.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-14 21:28:16 +02:00
Pascal Vizeli
f466721ffa Update builder builder-2021.05.0 (#2888) 2021-05-14 19:00:23 +02:00
Joakim Sørensen
3834cead07 Update frontend to fe2fe746 (#2887) 2021-05-14 14:09:04 +02:00
dependabot[bot]
75975de201 Bump gitpython from 3.1.16 to 3.1.17 (#2884)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.16 to 3.1.17.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-14 14:02:23 +02:00
Pascal Vizeli
cb9f998ef1 Python 3.9 (#2886)
* Python 3.9

* Fix lint

* fix lint
2021-05-14 13:57:56 +02:00
Pascal Vizeli
eb9ce8ea1f Fix wheels host (#2885) 2021-05-14 12:18:36 +02:00
Pascal Vizeli
a5ed68b641 Cleanup websession with new aiohttp ssl (#2861) 2021-05-14 10:07:00 +02:00
Pascal Vizeli
1ef46424ea Fix tests (#2883) 2021-05-14 08:36:49 +02:00
dependabot[bot]
53c99547d0 Bump gitpython from 3.1.15 to 3.1.16 (#2882)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.15 to 3.1.16.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 16:44:15 +02:00
dependabot[bot]
a34e7622d2 Bump pulsectl from 21.5.0 to 21.5.6 (#2874)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.5.0 to 21.5.6.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 13:09:43 +02:00
Pascal Vizeli
b234c18664 Enable connectivity on startup (#2879)
* Check connectivity on system startup

* move it
2021-05-12 16:02:51 +02:00
dependabot[bot]
d8d594c728 Bump actions/checkout from 2 to 2.3.4 (#2877)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 2.3.4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v2.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-12 10:39:41 +02:00
dependabot[bot]
1cd35841e8 Bump docker/login-action from 1 to 1.9.0 (#2875)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1 to 1.9.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1...v1.9.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-12 10:33:18 +02:00
dependabot[bot]
d05b7edd87 Bump getsentry/action-release from 1.1 to 1.1.5 (#2876)
Bumps [getsentry/action-release](https://github.com/getsentry/action-release) from 1.1 to 1.1.5.
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Commits](https://github.com/getsentry/action-release/compare/v1.1...v1.1.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-12 10:04:19 +02:00
Joakim Sørensen
95ef7d4508 Add snapshot content to list API (#2870) 2021-05-11 10:17:37 -07:00
dependabot[bot]
9812e5be6a Bump black from 21.5b0 to 21.5b1 (#2868)
Bumps [black](https://github.com/psf/black) from 21.5b0 to 21.5b1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 09:51:55 +02:00
dependabot[bot]
183182943d Bump pulsectl from 21.3.4 to 21.5.0 (#2865)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.3.4 to 21.5.0.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 16:17:47 +02:00
dependabot[bot]
a0189d65de Bump attrs from 21.1.0 to 21.2.0 (#2864)
Bumps [attrs](https://github.com/python-attrs/attrs) from 21.1.0 to 21.2.0.
- [Release notes](https://github.com/python-attrs/attrs/releases)
- [Changelog](https://github.com/python-attrs/attrs/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/python-attrs/attrs/compare/21.1.0...21.2.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 14:35:33 +02:00
Pascal Vizeli
b59f741162 Validate secrets on options/validate UI check (#2854)
* Validate secrets on options/validate UI check

* Allow schema as payload

* Update supervisor/api/addons.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Offload into a module

* using new function

* disable check

* fix options value

* generated return value

* add debug logging

Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-05-10 14:27:50 +02:00
dependabot[bot]
efc2e826a1 Bump flake8 from 3.9.1 to 3.9.2 (#2866)
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.9.1 to 3.9.2.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.9.1...3.9.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 13:27:41 +02:00
dependabot[bot]
a3ad23e262 Bump pyupgrade from 2.14.0 to 2.15.0 (#2867)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.14.0 to 2.15.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.14.0...v2.15.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 13:27:31 +02:00
Joakim Sørensen
5e3bcbfaac Bump awesomeversion to 21.5.0 (#2862) 2021-05-07 21:55:13 +02:00
dependabot[bot]
7f3e4558b9 Bump sentry-sdk from 1.0.0 to 1.1.0 (#2860)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.0.0...1.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 14:04:37 +02:00
dependabot[bot]
567a01c2ed Bump attrs from 20.3.0 to 21.1.0 (#2858)
Bumps [attrs](https://github.com/python-attrs/attrs) from 20.3.0 to 21.1.0.
- [Release notes](https://github.com/python-attrs/attrs/releases)
- [Changelog](https://github.com/python-attrs/attrs/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/python-attrs/attrs/compare/20.3.0...21.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 13:48:31 +02:00
dependabot[bot]
2236cf146e Bump black from 21.4b2 to 21.5b0 (#2857)
* Bump black from 21.4b2 to 21.5b0

Bumps [black](https://github.com/psf/black) from 21.4b2 to 21.5b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-05-07 13:47:57 +02:00
dependabot[bot]
8e2f33ba1e Bump debugpy from 1.2.1 to 1.3.0 (#2855)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.2.1...v1.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 13:47:44 +02:00
dependabot[bot]
8190883a71 Bump pytest from 6.2.3 to 6.2.4 (#2856)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.3 to 6.2.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.3...6.2.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 10:08:18 +02:00
dependabot[bot]
c01218a97a Bump codecov/codecov-action from v1.4.1 to v1.5.0 (#2853)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from v1.4.1 to v1.5.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.4.1...a1ed4b322b4b38cb846afb5a0ebfa17086917d27)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-04 10:59:02 +02:00
dependabot[bot]
2437817a41 Bump pyupgrade from 2.13.0 to 2.14.0 (#2852)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.13.0 to 2.14.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.13.0...v2.14.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-03 12:43:26 +02:00
Pascal Vizeli
682ee4529e Check integritiy of core (#2851) 2021-05-03 11:44:46 +02:00
Franck Nijhof
cee520f0b5 Add discovery support for motionEye (#2850) 2021-04-29 23:35:57 +02:00
Pascal Vizeli
0d915a3efc Handle iptables better WSL2 (#2849) 2021-04-29 12:31:34 +02:00
dependabot[bot]
f3a562006a Bump black from 21.4b1 to 21.4b2 (#2848)
Bumps [black](https://github.com/psf/black) from 21.4b1 to 21.4b2.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 10:41:03 +02:00
Pascal Vizeli
d78091cc60 Switch back to jemalloc (#2847) 2021-04-28 17:02:28 +02:00
Pascal Vizeli
f785c4e909 Fix WSL2 issues + cleanup scripts (#2846) 2021-04-28 14:09:37 +02:00
Pascal Vizeli
cda66ba737 Update black 21.4b1 on pre-commit (#2845) 2021-04-28 13:05:40 +02:00
dependabot[bot]
ea68ffc5a4 Bump black from 21.4b0 to 21.4b1 (#2844)
Bumps [black](https://github.com/psf/black) from 21.4b0 to 21.4b1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-28 10:59:08 +02:00
Franck Nijhof
31b0b721c8 Update GitHub issue form with render field (#2841) 2021-04-26 22:16:28 +02:00
Pascal Vizeli
b97e33f5d5 Ignore version on supervisor update (#2840)
* Ignore version on supervisor update

* fix property
2021-04-26 19:48:57 +02:00
Pascal Vizeli
29e55d3664 Clean env on remove-folder (#2839) 2021-04-26 19:47:46 +02:00
Joakim Sørensen
9112f27dc0 Update frontend to 4d287a1f (#2838) 2021-04-26 17:01:15 +02:00
eparla774
9e67df26b3 Fix for bug in host network info collector (#2821)
* Fix for bug in host network info collector

Fixed bug in host network info collector (Issue #2779)

* Added psk to authentification

* Fixed error

* Fixed error

* Update network.py
2021-04-26 16:37:06 +02:00
dependabot[bot]
37d1a577ef Bump black from 20.8b1 to 21.4b0 (#2837)
Bumps [black](https://github.com/psf/black) from 20.8b1 to 21.4b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-26 13:02:45 +02:00
dependabot[bot]
1eebb31004 Bump gitpython from 3.1.14 to 3.1.15 (#2831)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.14 to 3.1.15.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.14...3.1.15)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-23 10:37:38 +02:00
dependabot[bot]
885764ea1c Bump pyupgrade from 2.12.0 to 2.13.0 (#2832)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.12.0 to 2.13.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.12.0...v2.13.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-21 13:15:35 +02:00
dependabot[bot]
b3d184b5c7 Bump codecov/codecov-action from v1.4.0 to v1.4.1 (#2830)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from v1.4.0 to v1.4.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.4.0...967e2b38a85a62bd61be5529ada27ebc109948c2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-21 13:05:20 +02:00
Franck Nijhof
96d04ec17e Update GitHub issue form (#2827) 2021-04-20 12:24:08 +02:00
dependabot[bot]
e0bb3ad609 Bump codecov/codecov-action from v1.3.2 to v1.4.0 (#2826)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from v1.3.2 to v1.4.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.3.2...0e28ff86a50029a44d10df6ed4c308711925a6a8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-19 12:20:34 +02:00
dependabot[bot]
1a8842cb81 Bump pre-commit from 2.12.0 to 2.12.1 (#2825)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.12.0 to 2.12.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.12.0...v2.12.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-19 12:02:56 +02:00
Pascal Vizeli
092d526749 Clean env on subprocess (#2819)
* Clean env on subprocess

* use new format
2021-04-16 16:01:36 +02:00
Pascal Vizeli
9db95c188a Add more image-spec annotations (#2818) 2021-04-16 11:21:37 +02:00
dependabot[bot]
0e45fc7d66 Bump flake8 from 3.9.0 to 3.9.1 (#2817)
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.9.0 to 3.9.1.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.9.0...3.9.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-16 10:33:32 +02:00
Pascal Vizeli
4d1ddbfa2b Using exists container on publish (#2816) 2021-04-15 16:41:33 +02:00
Pascal Vizeli
caa1c6f1bd Using mimalloc (#2815) 2021-04-15 16:15:38 +02:00
dependabot[bot]
10d686b415 Bump home-assistant/builder from 2021.04.1 to 2021.04.2 (#2814)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.04.1 to 2021.04.2.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.04.1...fda1b6e500d815a890d62156188f09265a3a99e6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-15 10:59:52 +02:00
Pascal Vizeli
29fae90da5 Extend supervisor CI checks (#2813) 2021-04-15 10:50:07 +02:00
Pascal Vizeli
e27337da85 Improve local build / allow cache on dev (#2810) 2021-04-15 08:19:58 +02:00
dependabot[bot]
8f22316869 Bump colorlog from 4.8.0 to 5.0.1 (#2808)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 4.8.0 to 5.0.1.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v4.8.0...v5.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-14 17:01:27 +02:00
Joakim Sørensen
dd10d3e037 Guard against multiple client creations (#2809) 2021-04-14 14:30:49 +02:00
dependabot[bot]
4a53c62af8 Bump home-assistant/builder from 2021.04.0 to 2021.04.1 (#2807)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.04.0 to 2021.04.1.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.04.0...b77028ab08315dd69807752d2f3e00b0f0f49786)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-14 14:30:31 +02:00
Pascal Vizeli
1ebbf2b693 Remove double sentry event for untrusted (#2804)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-13 12:07:22 +02:00
Pascal Vizeli
62d198111c System unsupported source modification (#2789)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-13 11:59:12 +02:00
dependabot[bot]
1fc0ab71aa Bump actions/cache from v2.1.4 to v2.1.5 (#2806)
Bumps [actions/cache](https://github.com/actions/cache) from v2.1.4 to v2.1.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.4...1a9e2138d905efd099035b49d8b7a3888c653ca8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-13 10:19:58 +02:00
dependabot[bot]
f4402a1633 Bump actions/setup-python from v2.2.1 to v2.2.2 (#2805)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from v2.2.1 to v2.2.2.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2.2.1...dc73133d4da04e56a135ae2246682783cc7c7cb6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-13 10:19:45 +02:00
dependabot[bot]
13a17bcb34 Bump home-assistant/builder from 2021.03.4 to 2021.04.0 (#2803)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.03.4 to 2021.04.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.03.4...b2cc138f063be786183e24df4b6ff472c0e9add0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-12 11:51:49 +02:00
Pascal Vizeli
e1b49d90c2 Add image source to build.json (#2798) 2021-04-10 12:07:42 +02:00
Pascal Vizeli
85ab25ea16 Remove not needed warning before raise on JobDecorator (#2797) 2021-04-09 18:36:34 +02:00
Joakim Sørensen
80131ddfa8 Signal frontend when updater runs (#2795)
* Signal frontend when updater runs

* Update updater.py

* Update updater.py

* Update updater.py

* Update supervisor/updater.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-04-09 18:22:34 +02:00
Joakim Sørensen
e9c123459f Break loop when we have the correct file (#2796)
* Break loop when we have the correct file

* Fix tests
2021-04-09 16:49:41 +02:00
Pascal Vizeli
d3e4bb7219 Improve message handling of job condition (#2791) 2021-04-09 13:33:28 +02:00
dependabot[bot]
fd98d38125 Bump pyupgrade from 2.11.0 to 2.12.0 (#2793)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.11.0...v2.12.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-09 10:30:49 +02:00
dependabot[bot]
3237611034 Bump docker from 4.4.4 to 5.0.0 (#2787)
Bumps [docker](https://github.com/docker/docker-py) from 4.4.4 to 5.0.0.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/4.4.4...5.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 14:26:48 +02:00
dependabot[bot]
ce2bffda15 Bump pre-commit from 2.11.1 to 2.12.0 (#2788)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.11.1 to 2.12.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.11.1...v2.12.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 12:03:56 +02:00
dependabot[bot]
977e7b7adc Bump actions/upload-artifact from v2.2.2 to v2.2.3 (#2786)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from v2.2.2 to v2.2.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.2.2...ee69f02b3dfdecd58bb31b4d133da38ba6fe3700)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 11:48:53 +02:00
Joakim Sørensen
5082078527 Update frontend to 8dd3d78f (#2785) 2021-04-07 11:18:01 +02:00
Pascal Vizeli
3615091c93 Evaluate AppArmor support (#2784)
* Evaluate AppArmor support

* Update supervisor/resolution/evaluations/apparmor.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-04-06 23:41:57 +02:00
Pascal Vizeli
fb1eb44d82 Fix issues with special compiled binary with own version schema (#2783) 2021-04-06 12:02:39 +02:00
dependabot[bot]
13910d44bf Bump codecov/codecov-action from v1.3.1 to v1.3.2 (#2782)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from v1.3.1 to v1.3.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.3.1...9b0b9bbe2c64e9ed41413180dd7398450dfeee14)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-06 11:30:49 +02:00
dependabot[bot]
cda1d15070 Bump awesomeversion from 21.2.3 to 21.4.0 (#2780)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.2.3 to 21.4.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.2.3...21.4.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-06 11:13:50 +02:00
dependabot[bot]
d0a1de23a6 Bump pytest from 6.2.2 to 6.2.3 (#2781)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.2 to 6.2.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.2...6.2.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 12:16:58 +02:00
Pascal Vizeli
44fd75220f Enable content-trust for all plugins (#2777) 2021-04-02 14:05:32 +02:00
Pascal Vizeli
ed594d653f Add NET_ADMIN to multicast for pimd (#2776) 2021-04-01 20:58:58 +02:00
Pascal Vizeli
40bb3a7581 Merge branch 'main' of https://github.com/home-assistant/supervisor into main 2021-04-01 15:48:04 +00:00
dependabot[bot]
df7f0345e8 Bump home-assistant/builder from 2021.03.3 to 2021.03.4 (#2775)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.03.3 to 2021.03.4.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.03.3...b6b93f774f0e60493f7e1285b4d507a50ac9d8ad)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-01 13:18:09 +02:00
Pascal Vizeli
f7ab76bb9a Enable content-trust on CLI docker (#2773) 2021-03-31 13:59:28 +02:00
Pascal Vizeli
45e24bfa65 Enable content-trust on CLI docker 2021-03-31 11:51:48 +00:00
Pascal Vizeli
8cd149783c Fix request status check on AppArmor profile fetch (#2772)
* Fix reuest statuts check on AppArmor profile fetch

* Adjust logger
2021-03-31 12:15:42 +02:00
dependabot[bot]
8e8e6e48a9 Bump pylint from 2.7.2 to 2.7.4 (#2768)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.7.2 to 2.7.4.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.7.2...pylint-2.7.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 11:56:35 +02:00
Franck Nijhof
816e0d503a Map both persistent and volatile journald logs (#2765)
* Map both persistent and volatile journald logs

* Code comment tweak
2021-03-29 11:46:47 +02:00
Pascal Vizeli
c43acd50f4 Updater check response code (#2766)
* Updater check response code

* use newstyle timeout
2021-03-29 11:35:54 +02:00
Joakim Sørensen
16ce4296a2 Fix devcontainer (#2767) 2021-03-29 11:06:14 +02:00
Franck Nijhof
65386b753f Fix swapped volume/bind variables in Journald volume support (#2764) 2021-03-29 09:46:22 +02:00
Pascal Vizeli
2be1529cb8 Make secrets more robust again (#2758) 2021-03-26 16:01:25 +01:00
Pascal Vizeli
98f8e032e3 Supervisor image handler (#2757) 2021-03-26 15:21:54 +01:00
Joakim Sørensen
900b785789 Update frontend to 5c63f8e5 (#2756) 2021-03-26 14:33:26 +01:00
Pascal Vizeli
9194088947 Fix HAOS sync output (#2755)
* Fix HAOS sync output

* revert api change

* As usaly

* Simplify code

* Adjust error handling
2021-03-26 14:33:14 +01:00
Mike Degatano
58c40cbef6 Allow optional array configs (#2752) 2021-03-26 10:42:58 +01:00
Mike Degatano
e6c57dfc80 Fix typo in journald location (#2751)
* Fix typo in journal location

* Patch pathlib.Path.exists to ensure false return for test
2021-03-25 11:43:34 +01:00
Pascal Vizeli
82f76f60bd Force / Enforce security if service is not available (#2744)
* Force / Enforce security if service is not available

* add options

* Add tests

* force security on test

* force security add-on validation

* Adjust style like codenotary

* Different exception type for backend error

* Adjust messages

* add comments

* ditch, not needed

* Address comment

* fix build
2021-03-24 14:36:23 +01:00
dependabot[bot]
b9af4aec6b Bump colorlog from 4.7.2 to 4.8.0 (#2746)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 4.7.2 to 4.8.0.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v4.7.2...v4.8.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-23 11:43:30 +01:00
Pascal Vizeli
f71ce27248 Add link to cli on pull request template (#2745) 2021-03-23 00:08:25 +01:00
Joakim Sørensen
5b2b1765bc Update frontend to 25c886d4 (#2743) 2021-03-22 17:15:56 +01:00
Franck Nijhof
2a892544c2 Fix journald add-on option to work with default Debian (#2742) 2021-03-22 17:04:20 +01:00
Pascal Vizeli
bedb37ca6b fix signerID command (#2740) 2021-03-22 11:20:11 +01:00
Pascal Vizeli
a456cd645f remove git from build-dependencies (#2741) 2021-03-22 11:19:35 +01:00
dependabot[bot]
9c68094cf6 Bump pyupgrade from 2.10.1 to 2.11.0 (#2739)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.10.1...v2.11.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-22 11:10:31 +01:00
Pascal Vizeli
379cef9e35 Fix sentry logs with None (#2738)
* Fix sentry logs with None

* change comment
2021-03-20 13:17:53 +01:00
Pascal Vizeli
cb3e2dab71 Full content trust support (#2735)
* Full content trust support

* expose content-trust for info

* fix log message

* Add system test

* Fix name

* Add tests

* ditch wrong disable

* fix partition

* remove untrust image
2021-03-20 00:10:35 +01:00
dependabot[bot]
3e89f83e0b Bump pydocstyle from 5.1.1 to 6.0.0 (#2734)
Bumps [pydocstyle](https://github.com/PyCQA/pydocstyle) from 5.1.1 to 6.0.0.
- [Release notes](https://github.com/PyCQA/pydocstyle/releases)
- [Changelog](https://github.com/PyCQA/pydocstyle/blob/master/docs/release_notes.rst)
- [Commits](https://github.com/PyCQA/pydocstyle/compare/5.1.1...6.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 11:01:42 +01:00
dependabot[bot]
af0bdd890a Bump flake8-docstrings from 1.5.0 to 1.6.0 (#2733)
Bumps [flake8-docstrings](https://gitlab.com/pycqa/flake8-docstrings) from 1.5.0 to 1.6.0.
- [Release notes](https://gitlab.com/pycqa/flake8-docstrings/tags)
- [Changelog](https://gitlab.com/pycqa/flake8-docstrings/blob/master/HISTORY.rst)
- [Commits](https://gitlab.com/pycqa/flake8-docstrings/compare/1.5.0...1.6.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 10:02:45 +01:00
Pascal Vizeli
f93f5d0e71 Add CodeNotary / for version file (#2731)
* Add CodeNotary / for version file

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Address comment

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-03-19 08:40:35 +01:00
mdegat01
667672a20b Addons can access systemd journal logs (#2722)
* Added journald access to addons

* Name change to journald and added tests
2021-03-17 12:26:23 +01:00
Stefan Agner
9e1f899274 Detect haos as well (#2724)
* Detect "haos" CPE string as Home Assistant OS as well

* Improve Home Assistant OS detection/update messages

* Update supervisor/hassos.py

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2021-03-17 12:23:48 +01:00
dependabot[bot]
75e0741665 Bump codecov/codecov-action from v1.2.2 to v1.3.1 (#2729)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from v1.2.2 to v1.3.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.2.2...fcebab03f26c7530a22baa63f06b3e0515f0c7cd)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-17 10:43:21 +01:00
Pascal Vizeli
392d0e929b Fix access to needs.init.outputs.publish (#2728)
* Fix access to needs.init.outputs.publish

* Update Dockerfile
2021-03-16 21:03:19 +01:00
Pascal Vizeli
b342073ba9 Install vcn inside docker container (#2727)
* Install vcn inside docker container

* ditch multistage

* Fix docker file

* fix lint
2021-03-16 20:31:30 +01:00
Pascal Vizeli
ff4e550ba3 Use github context object for workspace (#2726) 2021-03-16 16:01:59 +01:00
Pascal Vizeli
17aa544be5 Sign code folder (#2725)
* Sign code folder

* Update builder.yml
2021-03-16 15:47:40 +01:00
Pascal Vizeli
390676dbc4 New error handling (#2680)
* New error handling

* Extend it
2021-03-16 12:17:05 +01:00
dependabot[bot]
d423252bc7 Bump pyupgrade from 2.10.0 to 2.10.1 (#2723)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.10.0 to 2.10.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.10.0...v2.10.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-16 09:09:56 +01:00
Pascal Vizeli
790e887b70 CoreNotary Image singing (#2721)
* CoreNotary Image singing

* Update builder.yml

* Update builder.yml

* using helper
2021-03-15 22:13:53 +01:00
dependabot[bot]
47e377683e Bump flake8 from 3.8.4 to 3.9.0 (#2720)
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.4 to 3.9.0.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.4...3.9.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-15 10:33:32 +01:00
Pascal Vizeli
b1232c0d8d Resolution: API call for run check manual (#2719) 2021-03-15 10:33:06 +01:00
Joakim Sørensen
059233c111 Dynamically load resolution checks (#2716)
* Dynamically load resouces checks

* address comment

* Apply suggestions from code review

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>

* Update supervisor/resolution/check.py

* fix check

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-03-15 10:28:18 +01:00
Pascal Vizeli
55382d000b Revert "Tweak check API path" (#2718)
This reverts commit e30171746b.
2021-03-15 10:16:32 +01:00
Joakim Sørensen
75ab6eec43 Update frontend to 3b837e1d (#2715) 2021-03-12 11:49:10 +01:00
Pascal Vizeli
e30171746b Tweak check API path (#2714) 2021-03-12 11:42:24 +01:00
Joakim Sørensen
73849b7468 Check management (#2703)
* Check management

* Add test

* Don't allow disable core_security

* options and decorator

* streamline config handling

* streamline v2

* fix logging

* Add tests

* Fix test

* cleanup v1

* fix api

* Add more test

* Expose option also for cli

* address comments from Paulus

* Address second comment

* Update supervisor/resolution/checks/base.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* fix lint

* Fix black

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-03-12 11:32:56 +01:00
Pascal Vizeli
a52713611c Fix landingpage on first boot (#2713) 2021-03-12 10:47:04 +01:00
Pascal Vizeli
85a66c663c Cache hits on pwned (#2712)
* Cache hits on pwned

* address comments
2021-03-11 14:23:08 +01:00
Pascal Vizeli
e478e68b70 Disable secomp global (#2711) 2021-03-11 13:23:06 +01:00
dependabot[bot]
16095c319a Bump pre-commit from 2.11.0 to 2.11.1 (#2709)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.11.0 to 2.11.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.11.0...v2.11.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-10 13:56:43 +01:00
dependabot[bot]
f4a6100fba Bump codecov/codecov-action from v1.2.1 to v1.2.2 (#2708)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from v1.2.1 to v1.2.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.2.1...1f8f3abcccf7960749744fd13547965f0e7d1bdd)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-10 13:56:28 +01:00
Casper
82060dd242 Fix typos (#2704) 2021-03-09 13:37:10 +01:00
dependabot[bot]
a58cfb797c Bump aiohttp from 3.7.4 to 3.7.4.post0 (#2699)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.7.4 to 3.7.4.post0.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.7.4...v3.7.4.post0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 17:12:30 +01:00
dependabot[bot]
c8256a50f4 Bump pulsectl from 21.3.2 to 21.3.4 (#2700)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.3.2 to 21.3.4.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 12:10:02 +01:00
dependabot[bot]
3ae974e9e2 Bump pre-commit from 2.10.1 to 2.11.0 (#2701)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.10.1...v2.11.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 12:09:32 +01:00
dependabot[bot]
ac5e74a375 Bump actions/stale from v3.0.17 to v3.0.18 (#2698)
Bumps [actions/stale](https://github.com/actions/stale) from v3.0.17 to v3.0.18.
- [Release notes](https://github.com/actions/stale/releases)
- [Commits](https://github.com/actions/stale/compare/v3.0.17...3b3c3f03cd4d8e2b61e179ef744a0d20efbe90b4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 10:14:33 +01:00
Pascal Vizeli
05e3d3b779 Abort on Connection Error (#2697) 2021-03-07 12:12:37 +01:00
Joakim Sørensen
681a1ecff5 Set connectivity state on network tasks (#2686)
* Set connectivity state on network tasks

* target connectivity error
2021-03-07 11:47:46 +01:00
Joakim Sørensen
2b411b0bf9 Update frontend to d715867b (#2689) 2021-03-07 11:40:56 +01:00
dependabot[bot]
fee16847d3 Bump sentry-sdk from 0.20.3 to 1.0.0 (#2674)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 0.20.3 to 1.0.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/0.20.3...1.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 11:44:34 +01:00
dependabot[bot]
501a52a3c6 Bump pulsectl from 21.2.0 to 21.3.2 (#2685)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.2.0 to 21.3.2.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 11:43:58 +01:00
Joakim Sørensen
2bb014fda5 Update frontend to 0d1c7238 (#2681) 2021-03-04 17:16:17 +01:00
Pascal Vizeli
09203f67b2 Fix defaults for builds (#2675) 2021-03-04 11:48:25 +01:00
Joakim Sørensen
169c7ec004 Update frontend to 419e5644 (#2667) 2021-03-03 16:20:04 +01:00
Joakim Sørensen
202e94615e Update frontend to bee17fce (#2665)
* Update frontend to fe50f422

* revert unrelated change

* Update frontend to bee17fce
2021-03-03 15:15:07 +01:00
Pascal Vizeli
5fe2a815ad Fix error handling with new config handling (#2666) 2021-03-03 12:46:34 +01:00
Joakim Sørensen
a13a0b4770 Guard for missing repository file (#2664)
* Guard for missing repository file

* Update supervisor/store/data.py

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-03-03 11:33:58 +01:00
Joakim Sørensen
455bbc457b Update frontend to 9f73f0ca (#2661)
* Update frontend to 9f73f0ca

* Update frontend to 935d97ce
2021-03-02 17:12:36 +01:00
Joakim Sørensen
d50fd3b580 Add network description to translation files (#2660) 2021-03-02 15:41:00 +01:00
Pascal Vizeli
455e80b07c Merge branch 'main' of https://github.com/home-assistant/supervisor into main 2021-03-02 13:16:09 +00:00
Joakim Sørensen
291becbdf9 Update frontend to 1642c684 (#2657) 2021-03-01 17:19:48 +01:00
Pascal Vizeli
33385b46a7 Fix add-on is not installed anymore (#2656)
* Fix add-on is not installed anymore

* Fix and add tests
2021-03-01 17:19:38 +01:00
Pascal Vizeli
df17668369 Fix add-on is not installed anymore 2021-03-01 15:43:50 +00:00
Joakim Sørensen
43449c85bb Fix translation schema (#2654)
* Fix translation schema

* really fix it

* fix migration path

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-03-01 16:39:00 +01:00
Stefan Agner
9e86eda05a Adjust CPU runtime allocation to support multiple add-ons (#2655)
Adjust realtime CPU runtime allocation to support multiple
add-ons/plug-ins with the runtime flag set.

The cpu.rt_runtime_us allocation is somewhat special as it
allocates the guaranteed runtime. Hence we cannot simply allocate all
time to each add-on.

Unfortunately we cannot distribute the CPU time equally based on the
number of add-ons as we don't know the number of add-ons which will use
realtime ahead of time. Also adjusting at runtime is currenlty not
supported by the Docker Python SDK (the underlying http API does
however, so this would be a possible future improvement).

This solution distributes the total available time of 950ms to up to 5
add-ons/plug-ins in equal slices. On a quad-core system this allows up
to 760ms CPU time in the real-time scheduler per 1s (76% of one CPU)
which should be sufficient for most cases.
2021-03-01 15:29:10 +01:00
Pascal Vizeli
b288554d9c Allow dynamic lookup cgroup rules based on Host udev (#2652) 2021-03-01 14:57:44 +01:00
Joakim Sørensen
bee55d08fb Create FileConfiguration baseclass (#2651) 2021-03-01 12:26:43 +01:00
Joakim Sørensen
7a542aeb38 Add support for loading add-on translation files (#2644)
* Add support for loading add-on translation files

* Fix storing translations for installed add-ons

* Allow YAML, force schema

* Adjust schema
2021-03-01 11:44:24 +01:00
dependabot[bot]
8d42513ba8 Bump gitpython from 3.1.13 to 3.1.14 (#2647)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.13 to 3.1.14.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/master/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.13...3.1.14)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 11:33:41 +01:00
dependabot[bot]
89b7247aa2 Bump home-assistant/builder from 2021.01.1 to 2021.02.0 (#2650)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.01.1 to 2021.02.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.01.1...8c4b820c467894c8374aca262deac0a8aef4982d)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 10:56:10 +01:00
dependabot[bot]
29132e7f4c Bump coverage from 5.4 to 5.5 (#2648)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.4 to 5.5.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.4...coverage-5.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 10:24:38 +01:00
dependabot[bot]
3fd9baf78e Bump pylint from 2.6.2 to 2.7.2 (#2649)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.6.2 to 2.7.2.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.6.2...pylint-2.7.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 10:17:21 +01:00
Philip Allgaier
f3aa3757ce Fixed typos in resolution notify (#2646) 2021-03-01 09:44:16 +01:00
Joakim Sørensen
3760967f59 Allow use YAML for addon and repository config (#2645)
* Allow use YAML for addon and repository config

* pylint
2021-02-28 20:00:02 +01:00
Joakim Sørensen
f7ab8e0f7f Update frontend to 478a4b25 (#2637) 2021-02-26 15:23:15 +01:00
Joakim Sørensen
0e46ea12b2 Allways store docker and repository config (#2636) 2021-02-26 13:40:47 +01:00
Joakim Sørensen
be226b2b01 Make homeassistant optional in partial snapshot (#2635) 2021-02-26 12:51:04 +01:00
dependabot[bot]
9e1239e192 Bump aiohttp from 3.7.3 to 3.7.4 (#2633)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.7.3 to 3.7.4.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.7.3...v3.7.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-26 09:43:45 +01:00
dependabot[bot]
2eba3d85b0 Bump pulsectl from 20.5.1 to 21.2.0 (#2634)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 20.5.1 to 21.2.0.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-26 09:42:59 +01:00
Joakim Sørensen
9b569268ab Fix add-on updates (#2632)
* Fix add-on updates

* Add to security role
2021-02-25 23:29:39 +01:00
Pascal Vizeli
31f5033dca Add throttle to job execution (#2631)
* Add throttle to job execution

* fix unittests

* Add tests

* address comments

* add comment

* better on __init__

* New text

* Simplify logic
2021-02-25 23:29:03 +01:00
Pascal Vizeli
78d9c60be5 Log issues/suggestion with info (#2629) 2021-02-25 19:52:19 +01:00
Stefan Agner
baa86f09e5 Real-time fixes (#2630)
* Fix path of cpu.rt_runtime_us sysfs file

Fix detection of CPU bandwidth allocation (CONFIG_RT_GROUP_SCHED) option
by checking the correct file location.

* Set priority limit and memory lock limit

Set a soft limit of real-time priority 90 and hard limit of 99. The
maximum is 99, to avoid add-ons using such a high priority without
second thought set the soft limit to 90. This allows a process to higher
the limit to 99, if really required.

Also set max locked memory to 128MB. Locking memory from getting paged
out is often used for the real-time process/thread to avoid delays due
to swapping/pageing in. Ideally a real-time process should only do the
real-time job, hence not need too much memory.

* Remove check for support_cpu_realtime and set correct limit for audio plug-in
2021-02-25 18:48:08 +01:00
Pascal Vizeli
a4c4b39ba8 Fix k-anonymity handling (#2627) 2021-02-25 18:16:20 +01:00
Joakim Sørensen
752068bb56 Add /store API (#2626) 2021-02-25 16:15:51 +01:00
Pascal Vizeli
739cfbb273 Small cleanups with pwned handling (#2625) 2021-02-25 15:36:02 +01:00
Pascal Vizeli
115af4cadf Optimize resolution checks / add endpoint to trigger it manual (#2622) 2021-02-25 14:05:27 +01:00
Joakim Sørensen
ae3274e559 Add home-assistant version to API response (#2621) 2021-02-25 11:44:22 +01:00
dependabot[bot]
c61f096dbd Bump docker from 4.4.3 to 4.4.4 (#2619)
Bumps [docker](https://github.com/docker/docker-py) from 4.4.3 to 4.4.4.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/4.4.3...4.4.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-25 10:27:24 +01:00
dependabot[bot]
ee7b5c42fd Bump awesomeversion from 21.2.2 to 21.2.3 (#2620)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.2.2 to 21.2.3.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.2.2...21.2.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-25 10:27:05 +01:00
Pascal Vizeli
85d527bfbc Add check for pwned secrets to resolution center (#2614)
* Add check for pwned secrets to resolution center

* restructure check

* add checks

* Add test

* Add test

* reload secrets before check

* simplify

* create notification

* Use own exceptions

* Check on startup

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Add job decorator

* Update supervisor/resolution/notify.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Update supervisor/utils/pwned.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-02-25 09:37:45 +01:00
Pascal Vizeli
dd561da819 Fix landingpage on check_api_state (#2615)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-02-24 21:52:18 +01:00
Joakim Sørensen
cb5932cb8b Fix issue with concurrent reads (#2610)
* Fix issue with concurrent reads

* Use lock

* acquire/release

* handle ConnectionError

* No there was not mulitple issues, it's the same code just different syle.....Which is stated on the same page as that image...
2021-02-24 18:36:21 +01:00
Pascal Vizeli
8630adc54a Add execution limit for jobs (#2612)
* Add execution limit for jobs

* Add test for execution police

* Use better test

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Rename JobExecutionLimit

* fix typing

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-02-24 17:15:13 +01:00
Joakim Sørensen
90d8832cd2 Send event when add-on changes state (#2608)
* Send event when add-on changes state

* fix test
2021-02-23 15:12:30 +01:00
Pascal Vizeli
3802b97bb6 Add kernel docs about the device classes (#2607) 2021-02-22 15:10:28 +01:00
Pascal Vizeli
2de175e181 Remove not needed call_soon (#2606) 2021-02-22 14:41:44 +01:00
Joakim Sørensen
6b7d437b00 Signal frontend to refresh on SU startup (#2603)
* Signal frontend to refresh on SU startup

* Use sync variant
2021-02-22 14:31:48 +01:00
Pascal Vizeli
e2faf906de Use the cpu_rt support check also for rtprio (#2605) 2021-02-22 14:02:36 +01:00
Franck Nijhof
bb44ce5cd2 Fix small typo in log message (#2604) 2021-02-22 13:44:12 +01:00
Joakim Sørensen
15544ae589 Show add-on with bad config in log (#2601) 2021-02-22 13:43:03 +01:00
Pascal Vizeli
e421284471 Detect host support for CPU realtime + add an option for enable it (#2602) 2021-02-22 13:30:32 +01:00
Pascal Vizeli
785dc64787 Imrove the LXC detection (#2599) 2021-02-22 11:39:18 +01:00
Joakim Sørensen
7e7e3a7876 Update frontend to ef0bfb23 (#2598) 2021-02-22 11:22:47 +01:00
Pascal Vizeli
2b45c059e0 Support realtime scheduling for add-ons (#2593)
* Support realtime scheduling for add-ons

* support on audio

* address comments from @jens-maus
2021-02-22 11:22:36 +01:00
Joakim Sørensen
14ec61f9bd Update frontend to 2d3cf7d8 (#2594) 2021-02-22 09:41:52 +01:00
Joakim Sørensen
5cc72756f8 Fix some issues with the issue template (#2592) 2021-02-19 23:35:00 +01:00
Franck Nijhof
44785ef3e2 Update GitHub Issue Form template (#2591) 2021-02-19 23:18:23 +01:00
Franck Nijhof
e60d858feb Allow for static port in Watchdog add-on configuration (#2589) 2021-02-19 15:23:17 +01:00
Joakim Sørensen
b31ecfefcd Initial WS support (#2439)
* Initial WS support

* test

* Update frontend to fc7c4af2

* Fix issue with closing states

* log error

* make data optional

* limit stopping states

* Move wrappers to HomeAssistantWebSocket

* use info

* Use call_soon

* Use lookuptable for WS commands

* Fix tests
2021-02-19 11:57:31 +01:00
dependabot[bot]
c342231052 Bump docker from 4.4.2 to 4.4.3 (#2587)
Bumps [docker](https://github.com/docker/docker-py) from 4.4.2 to 4.4.3.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/4.4.2...4.4.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-19 10:09:03 +01:00
dependabot[bot]
673666837e Bump sentry-sdk from 0.20.2 to 0.20.3 (#2588) 2021-02-19 08:59:22 +01:00
dependabot[bot]
c8f74d6c0d Bump actions/stale from v3.0.16 to v3.0.17 (#2586) 2021-02-19 08:42:14 +01:00
Pascal Vizeli
7ed9de8014 Fix device check if not exists (#2585) 2021-02-18 12:39:42 +01:00
Pascal Vizeli
8650947f04 Add capabilities for puleaudio (#2583)
* Add capabilities for puleaudio

* fix import
2021-02-17 17:21:47 +01:00
Pascal Vizeli
a0ac8ced31 Fix handling with full access / blocked devices (#2581)
* Fix handling with full access / blocked devices

* address comment

* Use name

* Add validation warning

* add GPIO check too

* remove warning

* return directly

* fix tests
2021-02-17 15:48:48 +01:00
Joakim Sørensen
2145bbea81 Update frontend to 03d41741 (#2580) 2021-02-17 13:12:37 +01:00
Pascal Vizeli
480000ee7f Fix typo in suggestion (#2578) 2021-02-17 12:49:07 +01:00
dependabot[bot]
9ec2ad022e Bump cryptography from 3.4.5 to 3.4.6 (#2576)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.5 to 3.4.6.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.5...3.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-17 12:01:18 +01:00
dependabot[bot]
43e40816dc Bump pylint from 2.6.0 to 2.6.2 (#2577)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.6.0 to 2.6.2.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.6.0...pylint-2.6.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-17 12:00:59 +01:00
Pascal Vizeli
941ea3ee68 Fix audio cgroup issue (#2575) 2021-02-16 09:34:15 +01:00
Pascal Vizeli
a6e4b5159e Discovery for vlc telnet (#2573) 2021-02-16 09:31:07 +01:00
dependabot[bot]
6f542d58d5 Bump docker from 4.4.1 to 4.4.2 (#2571)
Bumps [docker](https://github.com/docker/docker-py) from 4.4.1 to 4.4.2.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/4.4.1...4.4.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 08:41:01 +01:00
dependabot[bot]
b2b5fcee7d Bump sentry-sdk from 0.20.1 to 0.20.2 (#2572)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 0.20.1 to 0.20.2.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/0.20.1...0.20.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 08:40:38 +01:00
Pascal Vizeli
59a82345a9 Drop full privileged from audio plugin (#2570) 2021-02-16 08:40:19 +01:00
Pascal Vizeli
b61a747876 Kernel modules add-on flag need no extra cap (#2569) 2021-02-15 20:42:03 +01:00
dependabot[bot]
72e5d800d5 Bump cryptography from 3.4.4 to 3.4.5 (#2567)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.4 to 3.4.5.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.4...3.4.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-15 10:09:54 +01:00
dependabot[bot]
c7aa6d4804 Bump sentry-sdk from 0.20.0 to 0.20.1 (#2568)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 0.20.0 to 0.20.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/0.20.0...0.20.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-15 10:08:58 +01:00
Pascal Vizeli
b31063449d Fix path for tmpfs (#2565) 2021-02-13 20:34:32 +01:00
dependabot[bot]
477672459d Bump sentry-sdk from 0.19.5 to 0.20.0 (#2563)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 0.19.5 to 0.20.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/0.19.5...0.20.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-12 15:33:20 +01:00
Pascal Vizeli
9c33897296 Add some issues and suggestion (#2557) 2021-02-11 09:06:46 +01:00
Matheson Steplock
100cfb57c5 Fix Typos in LOGGER (#2552)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-02-10 21:53:37 +01:00
Pascal Vizeli
40b34071e7 Revert "Mask folder /dev/bus/usb RW (#2555)" (#2556)
This reverts commit 341833fd8f.
2021-02-10 11:35:21 +01:00
Pascal Vizeli
341833fd8f Mask folder /dev/bus/usb RW (#2555) 2021-02-10 10:37:40 +01:00
dependabot[bot]
f647fd6fea Bump cryptography from 3.4.3 to 3.4.4 (#2553)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.3 to 3.4.4.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.3...3.4.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 10:23:42 +01:00
dependabot[bot]
53642f2389 Bump gitpython from 3.1.12 to 3.1.13 (#2554)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.12 to 3.1.13.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/master/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.12...3.1.13)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 10:23:06 +01:00
Pascal Vizeli
b9bdd655ab Add hidraw to USB (#2549) 2021-02-09 21:09:57 +01:00
Pascal Vizeli
e9e1b5b54f Add support for hiddev on USB (#2548) 2021-02-09 19:25:16 +01:00
Franck Nijhof
be2163d635 Small tweaks to issue form (#2545) 2021-02-09 17:25:34 +01:00
Franck Nijhof
7f6dde3a5f Fix issue template forms (#2543) 2021-02-09 17:14:44 +01:00
Joakim Sørensen
334aafee23 Update frontend to c7821b9c (#2542) 2021-02-09 13:10:13 +01:00
Pascal Vizeli
1a20c18b19 Use Alpine 3.13 (#2539)
* Use Alpine 3.13

* Update builder.yml
2021-02-09 10:21:14 +01:00
dependabot[bot]
6e655b165c Bump cryptography from 3.3.1 to 3.4.3 (#2537)
* Bump cryptography from 3.3.1 to 3.4.3

Bumps [cryptography](https://github.com/pyca/cryptography) from 3.3.1 to 3.4.3.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.3.1...3.4.3)

Signed-off-by: dependabot[bot] <support@github.com>

* Update builder.yml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-02-09 10:04:58 +01:00
Pascal Vizeli
d768b2fa1e Fix UI options without filter (#2536) 2021-02-08 21:37:44 +01:00
Joakim Sørensen
85bce1cfba Add core state to /info API (#2531) 2021-02-08 12:39:46 +01:00
Pascal Vizeli
a798a2466f Change Supervisor update flow with AppArmor (#2529) 2021-02-08 10:45:34 +01:00
dependabot[bot]
2a5d8a5c82 Bump actions/stale from v3.0.15 to v3.0.16 (#2527)
Bumps [actions/stale](https://github.com/actions/stale) from v3.0.15 to v3.0.16.
- [Release notes](https://github.com/actions/stale/releases)
- [Commits](https://github.com/actions/stale/compare/v3.0.15...9d6f46564a515a9ea11e7762ab3957ee58ca50da)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-08 09:40:58 +01:00
dependabot[bot]
ea62171d98 Bump pyupgrade from 2.9.0 to 2.10.0 (#2526)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.9.0 to 2.10.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.9.0...v2.10.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-08 09:40:46 +01:00
dependabot[bot]
196389d5ee Bump pre-commit from 2.10.0 to 2.10.1 (#2525)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.10.0 to 2.10.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.10.0...v2.10.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-08 09:40:33 +01:00
dependabot[bot]
1776021620 Bump actions/cache from v2 to v2.1.4 (#2528)
Bumps [actions/cache](https://github.com/actions/cache) from v2 to v2.1.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2...26968a09c0ea4f3e233fdddbafd1166051a095f6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-08 09:39:28 +01:00
Pascal Vizeli
c42a9124d3 Fix cleanup with changed image (#2521) 2021-02-05 16:03:57 +01:00
dependabot[bot]
a44647b4cd Bump awesomeversion from 21.2.0 to 21.2.2 (#2520)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.2.0 to 21.2.2.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.2.0...21.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 11:31:57 +01:00
Pascal Vizeli
e0c3fd87c5 Add API endpoint for add-on for his own config (#2515)
* Add API endpoint for add-on for his own config

* allow access his config
2021-02-04 16:32:48 +01:00
Pascal Vizeli
ed8f2a85b7 Fix memory stats calc (#2518) 2021-02-04 16:06:12 +01:00
Pascal Vizeli
48f8553c75 Show the current core state on message (#2516) 2021-02-04 15:52:48 +01:00
Joakim Sørensen
af4517fd1e Update frontend to 4273b72d (#2517) 2021-02-04 15:50:07 +01:00
Joakim Sørensen
78e6a46318 Update frontend to e06642e8 (#2513) 2021-02-03 18:00:43 +01:00
Pascal Vizeli
49ca923e51 Apply old udev handling like core container (#2511) 2021-02-03 12:56:25 +01:00
Pascal Vizeli
7ad22e0399 Make add-on file schema more future approved (#2510) 2021-02-03 12:06:22 +01:00
Pascal Vizeli
bb8acc6065 Fix add-on state was not fast reflected (#2509) 2021-02-03 12:02:09 +01:00
Joakim Sørensen
c0fa4a19e9 Change verbosity for hardware.trigger API (#2508) 2021-02-02 20:56:37 +01:00
Franck Nijhof
3f1741dd18 Typo: depircated -> deprecated (#2507) 2021-02-02 20:41:56 +01:00
Stefan Agner
9ef02e4110 Add eMMC life-time estimate support (#2413)
* Add eMMC life-time estimate support

Expose life time estimate as Host Info property "ssd_life_time"

* Fix pytest

* Fix path to helper

* Allow protected access in tests

* Apply suggestions from code review

Rename SSD to disk.

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>

* Rename functions as well

* Update host.py

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2021-02-02 10:31:02 +01:00
Pascal Vizeli
15a6f38ebb Make sure device is ready initialize on udev (#2504)
* Make sure device is ready initialize on udev

* fix style

* let's start with 2sec

* better logic

* style

* add change events back
2021-02-02 09:53:09 +01:00
dependabot[bot]
227f2e5a21 Bump pyupgrade from 2.8.0 to 2.9.0 (#2505)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.8.0 to 2.9.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.8.0...v2.9.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-02 09:52:51 +01:00
Pascal Vizeli
517d6ee981 Lookup udev device in monitor thread (#2503) 2021-02-01 18:29:05 +01:00
Pascal Vizeli
184eeb7f49 Udev - move away form depricated callback / increase buffer (#2502)
* Use new callback from udev / only forward

* minimize loop

* Udev - move away form depricated callback / increase buffer

* code cleanup
2021-02-01 17:33:53 +01:00
Joakim Sørensen
a3555c74e8 Bump awesomeversion from 21.1.8 to 21.2.0 (#2501) 2021-02-01 15:45:35 +01:00
Pascal Vizeli
657bafd458 Fix handling with shm and shared /dev (#2499)
* Fix handling with shm and shared /dev

* address commends

* let's share shm
2021-02-01 14:44:02 +01:00
Joakim Sørensen
2ad5df420c Rerun label check on synchronize (#2500) 2021-02-01 14:37:56 +01:00
Joakim Sørensen
b24d489ec5 Update frontend to a9192ae2 (#2498) 2021-02-01 13:26:54 +01:00
Franck Nijhof
6bb0210f1f Fix add-on is_valid check (#2497) 2021-02-01 11:27:34 +01:00
dependabot[bot]
c1de50266a Bump pytz from 2020.5 to 2021.1 (#2496)
Bumps [pytz](https://github.com/stub42/pytz) from 2020.5 to 2021.1.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](https://github.com/stub42/pytz/compare/release_2020.5...release_2021.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-01 11:27:17 +01:00
dependabot[bot]
562e02bc64 Bump pyupgrade from 2.7.4 to 2.8.0 (#2494)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.7.4 to 2.8.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.7.4...v2.8.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-01 11:27:04 +01:00
dependabot[bot]
f71ec7913a Bump awesomeversion from 21.1.5 to 21.1.8 (#2493)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.1.5 to 21.1.8.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.1.5...21.1.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-01 11:26:51 +01:00
dependabot[bot]
d98baaf660 Bump jinja2 from 2.11.2 to 2.11.3 (#2495)
Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.2 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.11.2...2.11.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-01 11:26:30 +01:00
Pascal Vizeli
72db591576 Validate build env before using it (#2492) 2021-02-01 09:46:48 +01:00
Wouter Schoot
509a37fc04 Typofix exsist -> exist (#2491)
* Typofix exsist -> exist

* Typofix exist -> exists
2021-02-01 09:34:17 +01:00
Pascal Vizeli
17f62b6e86 Handle corrupt store branch / ignore local reset on corruption (#2490)
* Handle corrupt store branch / ignore local reset on corruption

* Update data.py

* Update data.py
2021-01-31 22:55:43 +01:00
Pascal Vizeli
b09aee7644 Filter out virtual vcs devices (#2489)
* Filter out virtual vcs devices

* fix test
2021-01-31 14:40:14 +01:00
Pascal Vizeli
babcc0de0c Cleanup supervisor/udev device action / add GPIO (#2488)
* Cleanup supervisor/udev device action / add GPIO

* Apply francks comment
2021-01-31 14:24:22 +01:00
Franck Nijhof
5cc47c9222 Re-enable old template until form is resolved (#2486) 2021-01-30 19:47:45 +01:00
Franck Nijhof
833559a3b3 Add initial GitHub Issue Form (#2485)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-01-30 19:35:15 +01:00
Pascal Vizeli
b8a976b344 Change handling kernel udev events (#2484)
* Change handling kernel udev events / add USB events

* finish USB

* map dev ro

* fix bind
2021-01-30 14:19:53 +01:00
Joakim Sørensen
10b14132b9 Update frontend to 86847263 (#2483) 2021-01-29 18:23:58 +01:00
Pascal Vizeli
18953f0b7c plug & play devices (#2482)
* Add support for plug&play container & full udev passtrhough

* plug & play devices

* this hack is not needed anymore

* Fix GPIO issue

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-01-29 17:17:41 +01:00
Joakim Sørensen
19f5fba3aa Bump awesomeversion from 21.1.4 to 21.1.5 (#2481) 2021-01-29 14:10:06 +01:00
Pascal Vizeli
636bc3e61a Handle GPIO / VIDEO map with subystem (#2478)
* Handle GPIO / VIDEO mapping with subystem

* fix tests

* add udev support

* init udev data

* fix
2021-01-29 11:28:16 +01:00
Pascal Vizeli
521037e1a6 Fix mknod creating of the device on runtime time (#2477) 2021-01-28 17:07:33 +01:00
Pascal Vizeli
e024c3e38d Improve device selection and show device by id if available (#2476) 2021-01-28 15:43:06 +01:00
Pascal Vizeli
6a0206c1e7 Next generation hardware handling (#2429)
* Next generation hardware handling

* need daemon for some details

* fix tests

* fix wrong coresys lookup

* test initial import

* test device lookup

* validate if device exists

* Add cgroups rules manager

* mapping udev from host

* Modify validation/options handling

* lookup devices

* add support for host udev mapping

* next

* Add policy support to add-ons

* Depricate hardware trigger call

* next cleanup round

* detect USB linking

* optimize

* readd udev utils for backwards compatibility

* fix tests

* Add more tests

* fix tests

* Make device explicit

* Add filter

* work on tests

* Add migration step

* clean out auto_uart

* Fix all tests

* Expose all device information

* small  improvment

* Fix loop over right devices

* Use migration for new device format

* Update rootfs/etc/cont-init.d/udev.sh

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Fix old helper

* Fix API

* add helper for by-id

* fix tests

* Fix serial helper

* Fix hardware API schema

* Hide some virtual devices from tracking

* Apply suggestions from code review

Co-authored-by: Stefan Agner <stefan@agner.ch>

* Update supervisor/addons/validate.py

Co-authored-by: Stefan Agner <stefan@agner.ch>

* Update supervisor/addons/validate.py

Co-authored-by: Stefan Agner <stefan@agner.ch>

* fix lint

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* fix black

* fix lint

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-01-28 15:26:56 +01:00
Joakim Sørensen
69a8a83528 Limit label check (#2475) 2021-01-28 12:07:42 +01:00
Joakim Sørensen
0307d700fa Add TypeError guard for docker stats (#2474) 2021-01-28 11:58:04 +01:00
Joakim Sørensen
919c383b41 Bump awesomeversion from 21.1.3 to 21.1.4 (#2473) 2021-01-28 11:41:11 +01:00
dependabot[bot]
d331af4d5a Bump pre-commit from 2.9.3 to 2.10.0 (#2472)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.9.3 to 2.10.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.9.3...v2.10.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-28 08:46:29 +01:00
Joakim Sørensen
b5467d3c23 Update frontend to 5ee0250b (#2471) 2021-01-28 08:45:33 +01:00
dependabot[bot]
3ef0040d66 Bump coverage from 5.3.1 to 5.4 (#2470)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.3.1 to 5.4.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.3.1...coverage-5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-27 08:41:22 +01:00
Joakim Sørensen
ec4dfd2172 Add action to check PR labels (#2469)
* Check PR labels

* update

* update

* update

* only use lable events

* remove env stuff

* add back types
2021-01-26 14:21:05 +01:00
Pascal Vizeli
8f54d7c8e9 New version logic NM (#2466) 2021-01-26 10:33:35 +01:00
dependabot[bot]
b59e709dc0 Bump home-assistant/builder from 2020.11.0 to 2021.01.1 (#2468)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2020.11.0 to 2021.01.1.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2020.11.0...e33ea8af3ad98e9ed7513cad92cc88fb303b42ff)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-26 10:17:50 +01:00
dependabot[bot]
b236e6c886 Bump pytest from 6.2.1 to 6.2.2 (#2467)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.1...6.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-26 09:47:45 +01:00
Pascal Vizeli
8acbb7d6f0 Fix API info calls access (#2464) 2021-01-25 10:45:08 +01:00
dependabot[bot]
49e4bc9381 Bump actions/stale from v3.0.14 to v3.0.15 (#2463)
Bumps [actions/stale](https://github.com/actions/stale) from v3.0.14 to v3.0.15.
- [Release notes](https://github.com/actions/stale/releases)
- [Commits](https://github.com/actions/stale/compare/v3.0.14...86561461b92875de77a8b2d2e75f004c826e8f45)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-25 09:59:20 +01:00
Philip Allgaier
36106cc08d Small README tweaks (#2460) 2021-01-24 21:18:06 +01:00
Pascal Vizeli
8f1763abe2 Fix OSError with custom component check (#2458) 2021-01-24 16:46:49 +01:00
3817 changed files with 80776 additions and 22446 deletions

View File

@@ -1,54 +0,0 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.8
WORKDIR /workspaces
# Set Docker daemon config
RUN \
mkdir -p /etc/docker \
&& echo '{"storage-driver": "vfs"}' > /etc/docker/daemon.json
# Install Node/Yarn for Frontent
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
apt-utils \
apt-transport-https \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update && apt-get install -y --no-install-recommends \
nodejs \
yarn \
&& curl -o - https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \
&& rm -rf /var/lib/apt/lists/*
ENV NVM_DIR /root/.nvm
# Install docker
# https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
gpg-agent \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
&& apt-get update && apt-get install -y --no-install-recommends \
docker-ce \
docker-ce-cli \
containerd.io \
&& rm -rf /var/lib/apt/lists/*
# Install tools
RUN apt-get update && apt-get install -y --no-install-recommends \
jq \
dbus \
network-manager \
libpulse0 \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies from requirements.txt if it exists
COPY requirements.txt requirements_tests.txt ./
RUN pip3 install -U setuptools pip \
&& pip3 install -r requirements.txt -r requirements_tests.txt \
&& pip3 install tox \
&& rm -f requirements.txt requirements_tests.txt

View File

@@ -1,33 +1,51 @@
{ {
"name": "Supervisor dev", "name": "Supervisor dev",
"context": "..", "image": "ghcr.io/home-assistant/devcontainer:2-supervisor",
"dockerFile": "Dockerfile", "containerEnv": {
"appPort": "9123:8123", "WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
"postCreateCommand": "pre-commit install", },
"remoteEnv": {
"PATH": "${containerEnv:VIRTUAL_ENV}/bin:${containerEnv:PATH}"
},
"appPort": ["9123:8123", "7357:4357"],
"postCreateCommand": "bash devcontainer_setup",
"postStartCommand": "bash devcontainer_bootstrap",
"runArgs": ["-e", "GIT_EDITOR=code --wait", "--privileged"], "runArgs": ["-e", "GIT_EDITOR=code --wait", "--privileged"],
"containerEnv": {"NVM_DIR":"/usr/local/share/nvm"}, "customizations": {
"extensions": [ "vscode": {
"ms-python.python", "extensions": [
"ms-python.vscode-pylance", "charliermarsh.ruff",
"visualstudioexptteam.vscodeintellicode", "ms-python.pylint",
"esbenp.prettier-vscode" "ms-python.vscode-pylance",
], "visualstudioexptteam.vscodeintellicode",
"settings": { "redhat.vscode-yaml",
"terminal.integrated.shell.linux": "/bin/bash", "esbenp.prettier-vscode",
"editor.formatOnPaste": false, "GitHub.vscode-pull-request-github"
"editor.formatOnSave": true, ],
"editor.formatOnType": true, "settings": {
"files.trimTrailingWhitespace": true, "python.defaultInterpreterPath": "/home/vscode/.local/ha-venv/bin/python",
"python.pythonPath": "/usr/local/bin/python3", "python.pythonPath": "/home/vscode/.local/ha-venv/bin/python",
"python.linting.pylintEnabled": true, "python.terminal.activateEnvInCurrentTerminal": true,
"python.linting.enabled": true, "python.testing.pytestArgs": ["--no-cov"],
"python.formatting.provider": "black", "pylint.importStrategy": "fromEnvironment",
"python.formatting.blackArgs": ["--target-version", "py38"], "editor.formatOnPaste": false,
"python.formatting.blackPath": "/usr/local/bin/black", "editor.formatOnSave": true,
"python.linting.banditPath": "/usr/local/bin/bandit", "editor.formatOnType": true,
"python.linting.flake8Path": "/usr/local/bin/flake8", "files.trimTrailingWhitespace": true,
"python.linting.mypyPath": "/usr/local/bin/mypy", "terminal.integrated.profiles.linux": {
"python.linting.pylintPath": "/usr/local/bin/pylint", "zsh": {
"python.linting.pydocstylePath": "/usr/local/bin/pydocstyle" "path": "/usr/bin/zsh"
} }
},
"terminal.integrated.defaultProfile.linux": "zsh",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
}
},
"mounts": [
"type=volume,target=/var/lib/docker",
"type=volume,target=/mnt/supervisor"
]
} }

View File

@@ -1,69 +0,0 @@
---
name: Report a bug with the Supervisor on a supported System
about: Report an issue related to the Home Assistant Supervisor.
labels: bug
---
<!-- READ THIS FIRST:
- If you need additional help with this template please refer to https://www.home-assistant.io/help/reporting_issues/
- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests
- Provide as many details as possible. Paste logs, configuration sample and code into the backticks. Do not delete any text from this template!
- If you have a problem with an add-on, make an issue in it's repository.
-->
<!--
Important: You can only fill a bug repport for an supported system! If you run an unsupported installation. This report would be closed without comment.
-->
### Describe the issue
<!-- Provide as many details as possible. -->
### Steps to reproduce
<!-- What do you do to encounter the issue. -->
1. ...
2. ...
3. ...
### Enviroment details
<!-- You can find these details in the system tab of the supervisor panel, or by using the `ha` CLI. -->
- **Operating System:**: xxx
- **Supervisor version:**: xxx
- **Home Assistant version**: xxx
### Supervisor logs
<details>
<summary>Supervisor logs</summary>
<!--
- Frontend -> Supervisor -> System
- Or use this command: ha supervisor logs
- Logs are more than just errors, even if you don't think it's important, it is.
-->
```
Paste supervisor logs here
```
</details>
### System Information
<details>
<summary>System Information</summary>
<!--
- Use this command: ha info
-->
```
Paste system info here
```
</details>

96
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,96 @@
name: Report an issue with Home Assistant Supervisor
description: Report an issue related to the Home Assistant Supervisor.
body:
- type: markdown
attributes:
value: |
This issue form is for reporting bugs with **supported** setups only!
If you have a feature or enhancement request, please use the [feature request][fr] section of our [Community Forum][fr].
[fr]: https://github.com/orgs/home-assistant/discussions
- type: textarea
validations:
required: true
attributes:
label: Describe the issue you are experiencing
description: Provide a clear and concise description of what the bug is.
- type: markdown
attributes:
value: |
## Environment
- type: dropdown
validations:
required: true
attributes:
label: What type of installation are you running?
description: >
If you don't know, can be found in [Settings -> System -> Repairs -> (three dot menu) -> System Information](https://my.home-assistant.io/redirect/system_health/).
It is listed as the `Installation Type` value.
options:
- Home Assistant OS
- Home Assistant Supervised
- type: dropdown
validations:
required: true
attributes:
label: Which operating system are you running on?
options:
- Home Assistant Operating System
- Debian
- Other (e.g., Raspbian/Raspberry Pi OS/Fedora)
- type: markdown
attributes:
value: |
# Details
- type: textarea
validations:
required: true
attributes:
label: Steps to reproduce the issue
description: |
Please tell us exactly how to reproduce your issue.
Provide clear and concise step by step instructions and add code snippets if needed.
value: |
1.
2.
3.
...
- type: textarea
validations:
required: true
attributes:
label: Anything in the Supervisor logs that might be useful for us?
description: >
Supervisor Logs can be found in [Settings -> System -> Logs](https://my.home-assistant.io/redirect/logs/)
then choose `Supervisor` in the top right.
[![Open your Home Assistant instance and show your Supervisor system logs.](https://my.home-assistant.io/badges/supervisor_logs.svg)](https://my.home-assistant.io/redirect/supervisor_logs/)
render: txt
- type: textarea
validations:
required: true
attributes:
label: System information
description: >
The System information can be found in [Settings -> System -> Repairs -> (three dot menu) -> System Information](https://my.home-assistant.io/redirect/system_health/).
Click the copy button at the bottom of the pop-up and paste it here.
[![Open your Home Assistant instance and show health information about your system.](https://my.home-assistant.io/badges/system_health.svg)](https://my.home-assistant.io/redirect/system_health/)
- type: textarea
attributes:
label: Supervisor diagnostics
placeholder: "drag-and-drop the diagnostics data file here (do not copy-and-paste the content)"
description: >-
Supervisor diagnostics can be found in [Settings -> Devices & services](https://my.home-assistant.io/redirect/integrations/).
Find the card that says `Home Assistant Supervisor`, open it, and select the three dot menu of the Supervisor integration entry
and select 'Download diagnostics'.
**Please drag-and-drop the downloaded file into the textbox below. Do not copy and paste its contents.**
- type: textarea
attributes:
label: Additional information
description: >
If you have any additional information for us, use the field below.
Please note, you can attach screenshots or screen recordings here, by
dragging and dropping files in the field below.

View File

@@ -13,7 +13,7 @@ contact_links:
about: Our documentation has its own issue tracker. Please report issues with the website there. about: Our documentation has its own issue tracker. Please report issues with the website there.
- name: Request a feature for the Supervisor - name: Request a feature for the Supervisor
url: https://community.home-assistant.io/c/feature-requests url: https://github.com/orgs/home-assistant/discussions
about: Request an new feature for the Supervisor. about: Request an new feature for the Supervisor.
- name: I have a question or need support - name: I have a question or need support

53
.github/ISSUE_TEMPLATE/task.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: Task
description: For staff only - Create a task
type: Task
body:
- type: markdown
attributes:
value: |
## ⚠️ RESTRICTED ACCESS
**This form is restricted to Open Home Foundation staff and authorized contributors only.**
If you are a community member wanting to contribute, please:
- For bug reports: Use the [bug report form](https://github.com/home-assistant/supervisor/issues/new?template=bug_report.yml)
- For feature requests: Submit to [Feature Requests](https://github.com/orgs/home-assistant/discussions)
---
### For authorized contributors
Use this form to create tasks for development work, improvements, or other actionable items that need to be tracked.
- type: textarea
id: description
attributes:
label: Description
description: |
Provide a clear and detailed description of the task that needs to be accomplished.
Be specific about what needs to be done, why it's important, and any constraints or requirements.
placeholder: |
Describe the task, including:
- What needs to be done
- Why this task is needed
- Expected outcome
- Any constraints or requirements
validations:
required: true
- type: textarea
id: additional_context
attributes:
label: Additional context
description: |
Any additional information, links, research, or context that would be helpful.
Include links to related issues, research, prototypes, roadmap opportunities etc.
placeholder: |
- Roadmap opportunity: [link]
- Epic: [link]
- Feature request: [link]
- Technical design documents: [link]
- Prototype/mockup: [link]
- Dependencies: [links]
validations:
required: false

View File

@@ -37,6 +37,8 @@
- This PR fixes or closes issue: fixes # - This PR fixes or closes issue: fixes #
- This PR is related to issue: - This PR is related to issue:
- Link to documentation pull request: - Link to documentation pull request:
- Link to cli pull request:
- Link to client library pull request:
## Checklist ## Checklist
@@ -51,12 +53,14 @@
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass** - [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR. - [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist] - [ ] I have followed the [development checklist][dev-checklist]
- [ ] The code has been formatted using Black (`black --fast supervisor tests`) - [ ] The code has been formatted using Ruff (`ruff format supervisor tests`)
- [ ] Tests have been added to verify that the new code works. - [ ] Tests have been added to verify that the new code works.
If API endpoints of add-on configuration are added/changed: If API endpoints or add-on configuration are added/changed:
- [ ] Documentation added/updated for [developers.home-assistant.io][docs-repository] - [ ] Documentation added/updated for [developers.home-assistant.io][docs-repository]
- [ ] [CLI][cli-repository] updated (if necessary)
- [ ] [Client library][client-library-repository] updated (if necessary)
<!-- <!--
Thank you for contributing <3 Thank you for contributing <3
@@ -66,3 +70,5 @@ If API endpoints of add-on configuration are added/changed:
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html [dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[docs-repository]: https://github.com/home-assistant/developers.home-assistant [docs-repository]: https://github.com/home-assistant/developers.home-assistant
[cli-repository]: https://github.com/home-assistant/cli
[client-library-repository]: https://github.com/home-assistant-libs/python-supervisor-client/

288
.github/copilot-instructions.md vendored Normal file
View File

@@ -0,0 +1,288 @@
# GitHub Copilot & Claude Code Instructions
This repository contains the Home Assistant Supervisor, a Python 3 based container
orchestration and management system for Home Assistant.
## Supervisor Capabilities & Features
### Architecture Overview
Home Assistant Supervisor is a Python-based container orchestration system that
communicates with the Docker daemon to manage containerized components. It is tightly
integrated with the underlying Operating System and core Operating System components
through D-Bus.
**Managed Components:**
- **Home Assistant Core**: The main home automation application running in its own
container (also provides the web interface)
- **Add-ons**: Third-party applications and services (each add-on runs in its own
container)
- **Plugins**: Built-in system services like DNS, Audio, CLI, Multicast, and Observer
- **Host System Integration**: OS-level operations and hardware access via D-Bus
- **Container Networking**: Internal Docker network management and external
connectivity
- **Storage & Backup**: Data persistence and backup management across all containers
**Key Dependencies:**
- **Docker Engine**: Required for all container operations
- **D-Bus**: System-level communication with the host OS
- **systemd**: Service management for host system operations
- **NetworkManager**: Network configuration and management
### Add-on System
**Add-on Architecture**: Add-ons are containerized applications available through
add-on stores. Each store contains multiple add-ons, and each add-on includes metadata
that tells Supervisor the version, startup configuration (permissions), and available
user configurable options. Add-on metadata typically references a container image that
Supervisor fetches during installation. If not, the Supervisor builds the container
image from a Dockerfile.
**Built-in Stores**: Supervisor comes with several pre-configured stores:
- **Core Add-ons**: Official add-ons maintained by the Home Assistant team
- **Community Add-ons**: Popular third-party add-ons repository
- **ESPHome**: Add-ons for ESPHome ecosystem integration
- **Music Assistant**: Audio and music-related add-ons
- **Local Development**: Local folder for testing custom add-ons during development
**Store Management**: Stores are Git-based repositories that are periodically updated.
When updates are available, users receive notifications.
**Add-on Lifecycle**:
- **Installation**: Supervisor fetches or builds container images based on add-on
metadata
- **Configuration**: Schema-validated options with integrated UI management
- **Runtime**: Full container lifecycle management, health monitoring
- **Updates**: Automatic or manual version management
### Update System
**Core Components**: Supervisor, Home Assistant Core, HAOS, and built-in plugins
receive version information from a central JSON file fetched from
`https://version.home-assistant.io/{channel}.json`. The `Updater` class handles
fetching this data, validating signatures, and updating internal version tracking.
**Update Channels**: Three channels (`stable`/`beta`/`dev`) determine which version
JSON file is fetched, allowing users to opt into different release streams.
**Add-on Updates**: Add-on version information comes from store repository updates, not
the central JSON file. When repositories are refreshed via the store system, add-ons
compare their local versions against repository versions to determine update
availability.
### Backup & Recovery System
**Backup Capabilities**:
- **Full Backups**: Complete system state capture including all add-ons,
configuration, and data
- **Partial Backups**: Selective backup of specific components (Home Assistant,
add-ons, folders)
- **Encrypted Backups**: Optional backup encryption with user-provided passwords
- **Multiple Storage Locations**: Local storage and remote backup destinations
**Recovery Features**:
- **One-click Restore**: Simple restoration from backup files
- **Selective Restore**: Choose specific components to restore
- **Automatic Recovery**: Self-healing for common system issues
---
## Supervisor Development
### Python Requirements
- **Compatibility**: Python 3.13+
- **Language Features**: Use modern Python features:
- Type hints with `typing` module
- f-strings (preferred over `%` or `.format()`)
- Dataclasses and enum classes
- Async/await patterns
- Pattern matching where appropriate
### Code Quality Standards
- **Formatting**: Ruff
- **Linting**: PyLint and Ruff
- **Type Checking**: MyPy
- **Testing**: pytest with asyncio support
- **Language**: American English for all code, comments, and documentation
### Code Organization
**Core Structure**:
```
supervisor/
├── __init__.py # Package initialization
├── const.py # Constants and enums
├── coresys.py # Core system management
├── bootstrap.py # System initialization
├── exceptions.py # Custom exception classes
├── api/ # REST API endpoints
├── addons/ # Add-on management
├── backups/ # Backup system
├── docker/ # Docker integration
├── host/ # Host system interface
├── homeassistant/ # Home Assistant Core management
├── dbus/ # D-Bus system integration
├── hardware/ # Hardware detection and management
├── plugins/ # Plugin system
├── resolution/ # Issue detection and resolution
├── security/ # Security management
├── services/ # Service discovery and management
├── store/ # Add-on store management
└── utils/ # Utility functions
```
**Shared Constants**: Use constants from `supervisor/const.py` instead of hardcoding
values. Define new constants following existing patterns and group related constants
together.
### Supervisor Architecture Patterns
**CoreSysAttributes Inheritance Pattern**: Nearly all major classes in Supervisor
inherit from `CoreSysAttributes`, providing access to the centralized system state
via `self.coresys` and convenient `sys_*` properties.
```python
# Standard Supervisor class pattern
class MyManager(CoreSysAttributes):
"""Manage my functionality."""
def __init__(self, coresys: CoreSys):
"""Initialize manager."""
self.coresys: CoreSys = coresys
self._component: MyComponent = MyComponent(coresys)
@property
def component(self) -> MyComponent:
"""Return component handler."""
return self._component
# Access system components via inherited properties
async def do_something(self):
await self.sys_docker.containers.get("my_container")
self.sys_bus.fire_event(BusEvent.MY_EVENT, {"data": "value"})
```
**Key Inherited Properties from CoreSysAttributes**:
- `self.sys_docker` - Docker API access
- `self.sys_run_in_executor()` - Execute blocking operations
- `self.sys_create_task()` - Create async tasks
- `self.sys_bus` - Event bus for system events
- `self.sys_config` - System configuration
- `self.sys_homeassistant` - Home Assistant Core management
- `self.sys_addons` - Add-on management
- `self.sys_host` - Host system access
- `self.sys_dbus` - D-Bus system interface
**Load Pattern**: Many components implement a `load()` method which effectively
initialize the component from external sources (containers, files, D-Bus services).
### API Development
**REST API Structure**:
- **Base Path**: `/api/` for all endpoints
- **Authentication**: Bearer token authentication
- **Consistent Response Format**: `{"result": "ok", "data": {...}}` or
`{"result": "error", "message": "..."}`
- **Validation**: Use voluptuous schemas with `api_validate()`
**Use `@api_process` Decorator**: This decorator handles all standard error handling
and response formatting automatically. The decorator catches `APIError`, `HassioError`,
and other exceptions, returning appropriate HTTP responses.
```python
from ..api.utils import api_process, api_validate
@api_process
async def backup_full(self, request: web.Request) -> dict[str, Any]:
"""Create full backup."""
body = await api_validate(SCHEMA_BACKUP_FULL, request)
job = await self.sys_backups.do_backup_full(**body)
return {ATTR_JOB_ID: job.uuid}
```
### Docker Integration
- **Container Management**: Use Supervisor's Docker manager instead of direct
Docker API
- **Networking**: Supervisor manages internal Docker networks with predefined IP
ranges
- **Security**: AppArmor profiles, capability restrictions, and user namespace
isolation
- **Health Checks**: Implement health monitoring for all managed containers
### D-Bus Integration
- **Use dbus-fast**: Async D-Bus library for system integration
- **Service Management**: systemd, NetworkManager, hostname management
- **Error Handling**: Wrap D-Bus exceptions in Supervisor-specific exceptions
### Async Programming
- **All I/O operations must be async**: File operations, network calls, subprocess
execution
- **Use asyncio patterns**: Prefer `asyncio.gather()` over sequential awaits
- **Executor jobs**: Use `self.sys_run_in_executor()` for blocking operations
- **Two-phase initialization**: `__init__` for sync setup, `post_init()` for async
initialization
### Testing
- **Location**: `tests/` directory with module mirroring
- **Fixtures**: Extensive use of pytest fixtures for CoreSys setup
- **Mocking**: Mock external dependencies (Docker, D-Bus, network calls)
- **Coverage**: Minimum 90% test coverage, 100% for security-sensitive code
### Error Handling
- **Custom Exceptions**: Defined in `exceptions.py` with clear inheritance hierarchy
- **Error Propagation**: Use `from` clause for exception chaining
- **API Errors**: Use `APIError` with appropriate HTTP status codes
### Security Considerations
- **Container Security**: AppArmor profiles mandatory for add-ons, minimal
capabilities
- **Authentication**: Token-based API authentication with role-based access
- **Data Protection**: Backup encryption, secure secret management, comprehensive
input validation
### Development Commands
```bash
# Run tests, adjust paths as necessary
pytest -qsx tests/
# Linting and formatting
ruff check supervisor/
ruff format supervisor/
# Type checking
mypy --ignore-missing-imports supervisor/
# Pre-commit hooks
pre-commit run --all-files
```
Always run the pre-commit hooks at the end of code editing.
### Common Patterns to Follow
**✅ Use These Patterns**:
- Inherit from `CoreSysAttributes` for system access
- Use `@api_process` decorator for API endpoints
- Use `self.sys_run_in_executor()` for blocking operations
- Access Docker via `self.sys_docker` not direct Docker API
- Use constants from `const.py` instead of hardcoding
- Store types in (per-module) `const.py` (e.g. supervisor/store/const.py)
**❌ Avoid These Patterns**:
- Direct Docker API usage - use Supervisor's Docker manager
- Blocking operations in async context (use asyncio alternatives)
- Hardcoded values - use constants from `const.py`
- Manual error handling in API endpoints - let `@api_process` handle it
This guide provides the foundation for contributing to Home Assistant Supervisor.
Follow these patterns and guidelines to ensure code quality, security, and
maintainability.

View File

@@ -31,6 +31,7 @@ categories:
- title: ":arrow_up: Dependency Updates" - title: ":arrow_up: Dependency Updates"
label: "dependencies" label: "dependencies"
collapse-after: 1
include-labels: include-labels:
- "breaking-change" - "breaking-change"

View File

@@ -27,15 +27,19 @@ on:
paths: paths:
- "rootfs/**" - "rootfs/**"
- "supervisor/**" - "supervisor/**"
- build.json - build.yaml
- Dockerfile - Dockerfile
- requirements.txt - requirements.txt
- setup.py - setup.py
env: env:
DEFAULT_PYTHON: "3.13"
BUILD_NAME: supervisor BUILD_NAME: supervisor
BUILD_TYPE: supervisor BUILD_TYPE: supervisor
WHEELS_TAG: 3.8-alpine3.12
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs: jobs:
init: init:
@@ -49,7 +53,7 @@ jobs:
requirements: ${{ steps.requirements.outputs.changed }} requirements: ${{ steps.requirements.outputs.changed }}
steps: steps:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -66,39 +70,51 @@ jobs:
- name: Get changed files - name: Get changed files
id: changed_files id: changed_files
if: steps.version.outputs.publish == 'false' if: steps.version.outputs.publish == 'false'
uses: jitterbit/get-changed-files@v1 uses: masesgroup/retrieve-changed-files@v3.0.0
- name: Check if requirements files changed - name: Check if requirements files changed
id: requirements id: requirements
run: | run: |
if [[ "${{ steps.changed_files.outputs.all }}" =~ requirements.txt ]]; then if [[ "${{ steps.changed_files.outputs.all }}" =~ (requirements.txt|build.yaml) ]]; then
echo "::set-output name=changed::true" echo "changed=true" >> "$GITHUB_OUTPUT"
fi fi
build: build:
name: Build ${{ matrix.arch }} supervisor name: Build ${{ matrix.arch }} supervisor
needs: init needs: init
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
strategy: strategy:
matrix: matrix:
arch: ${{ fromJson(needs.init.outputs.architectures) }} arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps: steps:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Write env-file
if: needs.init.outputs.requirements == 'true'
run: |
(
# Fix out of memory issues with rust
echo "CARGO_NET_GIT_FETCH_WITH_CLI=true"
) > .env_file
- 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@2025.07.0
with: with:
tag: ${{ env.WHEELS_TAG }} abi: cp313
tag: musllinux_1_2
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
wheels-host: ${{ secrets.WHEELS_HOST }}
wheels-key: ${{ secrets.WHEELS_KEY }} wheels-key: ${{ secrets.WHEELS_KEY }}
wheels-user: wheels apk: "libffi-dev;openssl-dev;yaml-dev"
apk: "build-base;libffi-dev;openssl-dev"
skip-binary: aiohttp skip-binary: aiohttp
env-file: true
requirements: "requirements.txt" requirements: "requirements.txt"
- name: Set version - name: Set version
@@ -107,25 +123,53 @@ jobs:
with: with:
type: ${{ env.BUILD_TYPE }} type: ${{ env.BUILD_TYPE }}
- name: Login to DockerHub - name: Set up Python ${{ env.DEFAULT_PYTHON }}
if: needs.init.outputs.publish == 'true' if: needs.init.outputs.publish == 'true'
uses: docker/login-action@v1 uses: actions/setup-python@v5.6.0
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} python-version: ${{ env.DEFAULT_PYTHON }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install Cosign
if: needs.init.outputs.publish == 'true'
uses: sigstore/cosign-installer@v3.9.2
with:
cosign-release: "v2.4.3"
- name: Install dirhash and calc hash
if: needs.init.outputs.publish == 'true'
run: |
pip3 install setuptools dirhash
dir_hash="$(dirhash "${{ github.workspace }}/supervisor" -a sha256 --match "*.py")"
echo "${dir_hash}" > rootfs/supervisor.sha256
- name: Sign supervisor SHA256
if: needs.init.outputs.publish == 'true'
run: |
cosign sign-blob --yes rootfs/supervisor.sha256 --bundle rootfs/supervisor.sha256.sig
- name: Login to GitHub Container Registry
if: needs.init.outputs.publish == 'true'
uses: docker/login-action@v3.5.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set build arguments - name: Set build arguments
if: needs.init.outputs.publish == 'false' if: needs.init.outputs.publish == 'false'
run: echo "BUILD_ARGS=--test" >> $GITHUB_ENV run: echo "BUILD_ARGS=--test" >> $GITHUB_ENV
- name: Build supervisor - name: Build supervisor
uses: home-assistant/builder@2020.11.0 uses: home-assistant/builder@2025.03.0
with: with:
args: | args: |
$BUILD_ARGS \ $BUILD_ARGS \
--${{ matrix.arch }} \ --${{ matrix.arch }} \
--target /data \ --target /data \
--cosign \
--generic ${{ needs.init.outputs.version }} --generic ${{ needs.init.outputs.version }}
env:
CAS_API_KEY: ${{ secrets.CAS_TOKEN }}
version: version:
name: Update version name: Update version
@@ -134,7 +178,7 @@ jobs:
steps: steps:
- name: Checkout the repository - name: Checkout the repository
if: needs.init.outputs.publish == 'true' if: needs.init.outputs.publish == 'true'
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Initialize git - name: Initialize git
if: needs.init.outputs.publish == 'true' if: needs.init.outputs.publish == 'true'
@@ -155,13 +199,15 @@ jobs:
run_supervisor: run_supervisor:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Run the Supervisor name: Run the Supervisor
needs: ["build"] needs: ["build", "init"]
timeout-minutes: 60
steps: steps:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Build the Supervisor - name: Build the Supervisor
uses: home-assistant/builder@2020.11.0 if: needs.init.outputs.publish != 'true'
uses: home-assistant/builder@2025.03.0
with: with:
args: | args: |
--test \ --test \
@@ -169,13 +215,19 @@ jobs:
--target /data \ --target /data \
--generic runner --generic runner
- name: Pull Supervisor
if: needs.init.outputs.publish == 'true'
run: |
docker pull ghcr.io/home-assistant/amd64-hassio-supervisor:${{ needs.init.outputs.version }}
docker tag ghcr.io/home-assistant/amd64-hassio-supervisor:${{ needs.init.outputs.version }} ghcr.io/home-assistant/amd64-hassio-supervisor:runner
- name: Create the Supervisor - name: Create the Supervisor
run: | run: |
mkdir -p /tmp/supervisor/data mkdir -p /tmp/supervisor/data
docker create --name hassio_supervisor \ docker create --name hassio_supervisor \
--privileged \ --privileged \
--security-opt seccomp=unconfined \ --security-opt seccomp=unconfined \
--security-opt apparmor:unconfined \ --security-opt apparmor=unconfined \
-v /run/docker.sock:/run/docker.sock \ -v /run/docker.sock:/run/docker.sock \
-v /run/dbus:/run/dbus \ -v /run/dbus:/run/dbus \
-v /tmp/supervisor/data:/data \ -v /tmp/supervisor/data:/data \
@@ -184,7 +236,7 @@ jobs:
-e SUPERVISOR_NAME=hassio_supervisor \ -e SUPERVISOR_NAME=hassio_supervisor \
-e SUPERVISOR_DEV=1 \ -e SUPERVISOR_DEV=1 \
-e SUPERVISOR_MACHINE="qemux86-64" \ -e SUPERVISOR_MACHINE="qemux86-64" \
homeassistant/amd64-hassio-supervisor:runner ghcr.io/home-assistant/amd64-hassio-supervisor:runner
- name: Start the Supervisor - name: Start the Supervisor
run: docker start hassio_supervisor run: docker start hassio_supervisor
@@ -194,22 +246,135 @@ jobs:
SUPERVISOR=$(docker inspect --format='{{.NetworkSettings.IPAddress}}' hassio_supervisor) SUPERVISOR=$(docker inspect --format='{{.NetworkSettings.IPAddress}}' hassio_supervisor)
ping="error" ping="error"
while [ "$ping" != "ok" ]; do while [ "$ping" != "ok" ]; do
ping=$(curl -sSL "http://$SUPERVISOR/supervisor/ping" | jq -r .result) ping=$(curl -sSL "http://$SUPERVISOR/supervisor/ping" | jq -r '.result')
sleep 5 sleep 5
done done
- name: Check the Supervisor - name: Check the Supervisor
run: | run: |
echo "Checking supervisor info" echo "Checking supervisor info"
test=$(docker exec hassio_cli ha supervisor info --no-progress --raw-json | jq -r .result) test=$(docker exec hassio_cli ha supervisor info --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ];then if [ "$test" != "ok" ]; then
docker logs hassio_supervisor
exit 1 exit 1
fi fi
echo "Checking supervisor network info" echo "Checking supervisor network info"
test=$(docker exec hassio_cli ha network info --no-progress --raw-json | jq -r .result) test=$(docker exec hassio_cli ha network info --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ];then if [ "$test" != "ok" ]; then
docker logs hassio_supervisor
exit 1 exit 1
fi fi
- name: Check the Store / Addon
run: |
echo "Install Core SSH Add-on"
test=$(docker exec hassio_cli ha addons install core_ssh --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
# Make sure it actually installed
test=$(docker exec hassio_cli ha addons info core_ssh --no-progress --raw-json | jq -r '.data.version')
if [[ "$test" == "null" ]]; then
exit 1
fi
echo "Start Core SSH Add-on"
test=$(docker exec hassio_cli ha addons start core_ssh --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
# Make sure its state is started
test="$(docker exec hassio_cli ha addons info core_ssh --no-progress --raw-json | jq -r '.data.state')"
if [ "$test" != "started" ]; then
exit 1
fi
- name: Check the Supervisor code sign
if: needs.init.outputs.publish == 'true'
run: |
echo "Enable Content-Trust"
test=$(docker exec hassio_cli ha security options --content-trust=true --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
echo "Run supervisor health check"
test=$(docker exec hassio_cli ha resolution healthcheck --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
echo "Check supervisor unhealthy"
test=$(docker exec hassio_cli ha resolution info --no-progress --raw-json | jq -r '.data.unhealthy[]')
if [ "$test" != "" ]; then
exit 1
fi
echo "Check supervisor supported"
test=$(docker exec hassio_cli ha resolution info --no-progress --raw-json | jq -r '.data.unsupported[]')
if [[ "$test" =~ source_mods ]]; then
exit 1
fi
- name: Create full backup
id: backup
run: |
test=$(docker exec hassio_cli ha backups new --no-progress --raw-json)
if [ "$(echo $test | jq -r '.result')" != "ok" ]; then
exit 1
fi
echo "slug=$(echo $test | jq -r '.data.slug')" >> "$GITHUB_OUTPUT"
- name: Uninstall SSH add-on
run: |
test=$(docker exec hassio_cli ha addons uninstall core_ssh --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
- name: Restart supervisor
run: |
test=$(docker exec hassio_cli ha supervisor restart --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
- name: Wait for Supervisor to come up
run: |
SUPERVISOR=$(docker inspect --format='{{.NetworkSettings.IPAddress}}' hassio_supervisor)
ping="error"
while [ "$ping" != "ok" ]; do
ping=$(curl -sSL "http://$SUPERVISOR/supervisor/ping" | jq -r '.result')
sleep 5
done
- name: Restore SSH add-on from backup
run: |
test=$(docker exec hassio_cli ha backups restore ${{ steps.backup.outputs.slug }} --addons core_ssh --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
# Make sure it actually installed
test=$(docker exec hassio_cli ha addons info core_ssh --no-progress --raw-json | jq -r '.data.version')
if [[ "$test" == "null" ]]; then
exit 1
fi
# Make sure its state is started
test="$(docker exec hassio_cli ha addons info core_ssh --no-progress --raw-json | jq -r '.data.state')"
if [ "$test" != "started" ]; then
exit 1
fi
- name: Restore SSL directory from backup
run: |
test=$(docker exec hassio_cli ha backups restore ${{ steps.backup.outputs.slug }} --folders ssl --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
- name: Get supervisor logs on failiure
if: ${{ cancelled() || failure() }}
run: docker logs hassio_supervisor

19
.github/workflows/check_pr_labels.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Check PR
on:
pull_request:
branches: ["main"]
types: [labeled, unlabeled, synchronize]
jobs:
init:
name: Check labels
runs-on: ubuntu-latest
steps:
- name: Check labels
run: |
labels=$(jq -r '.pull_request.labels[] | .name' ${{github.event_path }})
echo "$labels"
if [ "$labels" == "cla-signed" ]; then
exit 1
fi

View File

@@ -8,36 +8,37 @@ on:
pull_request: ~ pull_request: ~
env: env:
DEFAULT_PYTHON: 3.8 DEFAULT_PYTHON: "3.13"
PRE_COMMIT_HOME: ~/.cache/pre-commit PRE_COMMIT_CACHE: ~/.cache/pre-commit
MYPY_CACHE_VERSION: 1
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs: jobs:
# Separate job to pre-populate the base dependency cache # Separate job to pre-populate the base dependency cache
# This prevent upcoming jobs to do the same individually # This prevent upcoming jobs to do the same individually
prepare: prepare:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: outputs:
matrix: python-version: ${{ steps.python.outputs.python-version }}
python-version: [3.8] name: Prepare Python dependencies
name: Prepare Python ${{ matrix.python-version }} dependencies
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python
id: python id: python
uses: actions/setup-python@v2.2.1 uses: actions/setup-python@v5.6.0
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2 uses: actions/cache@v4.2.4
with: with:
path: venv path: venv
key: | key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }} ${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
restore-keys: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
- name: Create Python virtual environment - name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true' if: steps.cache-venv.outputs.cache-hit != 'true'
run: | run: |
@@ -47,9 +48,10 @@ 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@v2 uses: actions/cache@v4.2.4
with: with:
path: ${{ env.PRE_COMMIT_HOME }} path: ${{ env.PRE_COMMIT_CACHE }}
lookup-only: true
key: | key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: | restore-keys: |
@@ -60,34 +62,91 @@ jobs:
. venv/bin/activate . venv/bin/activate
pre-commit install-hooks pre-commit install-hooks
lint-black: lint-ruff-format:
name: Check black name: Check ruff-format
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v2.2.1 uses: actions/setup-python@v5.6.0
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2 uses: actions/cache@v4.2.4
with: with:
path: venv path: venv
key: | key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }} ${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed - name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true' if: steps.cache-venv.outputs.cache-hit != 'true'
run: | run: |
echo "Failed to restore Python virtual environment from cache" echo "Failed to restore Python virtual environment from cache"
exit 1 exit 1
- name: Run black - name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v4.2.4
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Run ruff-format
run: | run: |
. venv/bin/activate . venv/bin/activate
black --target-version py38 --check supervisor tests setup.py pre-commit run --hook-stage manual ruff-format --all-files --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
lint-ruff:
name: Check ruff
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.2.2
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v5.6.0
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v4.2.4
with:
path: venv
key: |
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v4.2.4
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Run ruff
run: |
. venv/bin/activate
pre-commit run --hook-stage manual ruff --all-files --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
lint-dockerfile: lint-dockerfile:
name: Check Dockerfile name: Check Dockerfile
@@ -95,7 +154,7 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Register hadolint problem matcher - name: Register hadolint problem matcher
run: | run: |
echo "::add-matcher::.github/workflows/matchers/hadolint.json" echo "::add-matcher::.github/workflows/matchers/hadolint.json"
@@ -110,19 +169,19 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v2.2.1 uses: actions/setup-python@v5.6.0
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2 uses: actions/cache@v4.2.4
with: with:
path: venv path: venv
key: | key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }} ${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed - name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true' if: steps.cache-venv.outputs.cache-hit != 'true'
run: | run: |
@@ -130,9 +189,9 @@ 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@v2 uses: actions/cache@v4.2.4
with: with:
path: ${{ env.PRE_COMMIT_HOME }} path: ${{ env.PRE_COMMIT_CACHE }}
key: | key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed - name: Fail job if cache restore failed
@@ -148,98 +207,25 @@ jobs:
. venv/bin/activate . venv/bin/activate
pre-commit run --hook-stage manual check-executables-have-shebangs --all-files pre-commit run --hook-stage manual check-executables-have-shebangs --all-files
lint-flake8:
name: Check flake8
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.1
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Register flake8 problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/flake8.json"
- name: Run flake8
run: |
. venv/bin/activate
flake8 supervisor tests
lint-isort:
name: Check isort
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.1
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v2
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Run isort
run: |
. venv/bin/activate
pre-commit run --hook-stage manual isort --all-files --show-diff-on-failure
lint-json: lint-json:
name: Check JSON name: Check JSON
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v2.2.1 uses: actions/setup-python@v5.6.0
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2 uses: actions/cache@v4.2.4
with: with:
path: venv path: venv
key: | key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }} ${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed - name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true' if: steps.cache-venv.outputs.cache-hit != 'true'
run: | run: |
@@ -247,9 +233,9 @@ 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@v2 uses: actions/cache@v4.2.4
with: with:
path: ${{ env.PRE_COMMIT_HOME }} path: ${{ env.PRE_COMMIT_CACHE }}
key: | key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed - name: Fail job if cache restore failed
@@ -271,95 +257,19 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v2.2.1 uses: actions/setup-python@v5.6.0
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2 uses: actions/cache@v4.2.4
with: with:
path: venv path: venv
key: | key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }} ${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Register pylint problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
- name: Run pylint
run: |
. venv/bin/activate
pylint supervisor tests
lint-pyupgrade:
name: Check pyupgrade
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.1
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v2
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Run pyupgrade
run: |
. venv/bin/activate
pre-commit run --hook-stage manual pyupgrade --all-files --show-diff-on-failure
pytest:
runs-on: ubuntu-latest
needs: prepare
strategy:
matrix:
python-version: [3.8]
name: Run tests Python ${{ matrix.python-version }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.1
id: python
with:
python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed - name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true' if: steps.cache-venv.outputs.cache-hit != 'true'
run: | run: |
@@ -368,7 +278,93 @@ jobs:
- name: Install additional system dependencies - name: Install additional system dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y --no-install-recommends libpulse0 libudev1 sudo apt-get install -y --no-install-recommends libpulse0
- name: Register pylint problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
- name: Run pylint
run: |
. venv/bin/activate
pylint supervisor tests
mypy:
name: Check mypy
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.2.2
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v5.6.0
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Generate partial mypy restore key
id: generate-mypy-key
run: |
mypy_version=$(cat requirements_test.txt | grep mypy | cut -d '=' -f 3)
echo "version=$mypy_version" >> $GITHUB_OUTPUT
echo "key=mypy-${{ env.MYPY_CACHE_VERSION }}-$mypy_version-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v4.2.4
with:
path: venv
key: >-
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore mypy cache
uses: actions/cache@v4.2.4
with:
path: .mypy_cache
key: >-
${{ runner.os }}-mypy-${{ needs.prepare.outputs.python-version }}-${{ steps.generate-mypy-key.outputs.key }}
restore-keys: >-
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-mypy-${{ env.MYPY_CACHE_VERSION }}-${{ steps.generate-mypy-key.outputs.version }}
- name: Register mypy problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/mypy.json"
- name: Run mypy
run: |
. venv/bin/activate
mypy --ignore-missing-imports supervisor
pytest:
runs-on: ubuntu-latest
needs: prepare
name: Run tests Python ${{ needs.prepare.outputs.python-version }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.2.2
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v5.6.0
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Install Cosign
uses: sigstore/cosign-installer@v3.9.2
with:
cosign-release: "v2.4.3"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v4.2.4
with:
path: venv
key: |
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Install additional system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libpulse0 libudev1 dbus-daemon
- name: Register Python problem matcher - name: Register Python problem matcher
run: | run: |
echo "::add-matcher::.github/workflows/matchers/python.json" echo "::add-matcher::.github/workflows/matchers/python.json"
@@ -390,37 +386,41 @@ jobs:
-o console_output_style=count \ -o console_output_style=count \
tests tests
- name: Upload coverage artifact - name: Upload coverage artifact
uses: actions/upload-artifact@v2.2.2 uses: actions/upload-artifact@v4.6.2
with: with:
name: coverage-${{ matrix.python-version }} name: coverage
path: .coverage path: .coverage
include-hidden-files: true
coverage: coverage:
name: Process test coverage name: Process test coverage
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: pytest needs: ["pytest", "prepare"]
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v2.2.1 uses: actions/setup-python@v5.6.0
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2 uses: actions/cache@v4.2.4
with: with:
path: venv path: venv
key: | key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }} ${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed - name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true' if: steps.cache-venv.outputs.cache-hit != 'true'
run: | run: |
echo "Failed to restore Python virtual environment from cache" echo "Failed to restore Python virtual environment from cache"
exit 1 exit 1
- name: Download all coverage artifacts - name: Download all coverage artifacts
uses: actions/download-artifact@v2 uses: actions/download-artifact@v5.0.0
with:
name: coverage
path: coverage/
- name: Combine coverage results - name: Combine coverage results
run: | run: |
. venv/bin/activate . venv/bin/activate
@@ -428,4 +428,4 @@ jobs:
coverage report coverage report
coverage xml coverage xml
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.2.1 uses: codecov/codecov-action@v5.4.3

View File

@@ -9,12 +9,12 @@ jobs:
lock: lock:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: dessant/lock-threads@v2.0.3 - uses: dessant/lock-threads@v5.0.1
with: with:
github-token: ${{ github.token }} github-token: ${{ github.token }}
issue-lock-inactive-days: "30" issue-inactive-days: "30"
issue-exclude-created-before: "2020-10-01T00:00:00Z" exclude-issue-created-before: "2020-10-01T00:00:00Z"
issue-lock-reason: "" issue-lock-reason: ""
pr-lock-inactive-days: "1" pr-inactive-days: "1"
pr-exclude-created-before: "2020-11-01T00:00:00Z" exclude-pr-created-before: "2020-11-01T00:00:00Z"
pr-lock-reason: "" pr-lock-reason: ""

View File

@@ -1,30 +0,0 @@
{
"problemMatcher": [
{
"owner": "flake8-error",
"severity": "error",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s(E\\d{3}\\s.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
},
{
"owner": "flake8-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s([CDFNW]\\d{3}\\s.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}

16
.github/workflows/matchers/mypy.json vendored Normal file
View File

@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "mypy",
"pattern": [
{
"regexp": "^(.+):(\\d+):\\s(error|warning):\\s(.+)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
]
}
]
}

View File

@@ -11,7 +11,7 @@ jobs:
name: Release Drafter name: Release Drafter
steps: steps:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -33,10 +33,10 @@ jobs:
echo Current version: $latest echo Current version: $latest
echo New target version: $datepre.$newpost echo New target version: $datepre.$newpost
echo "::set-output name=version::$datepre.$newpost" echo "version=$datepre.$newpost" >> "$GITHUB_OUTPUT"
- name: Run Release Drafter - name: Run Release Drafter
uses: release-drafter/release-drafter@v5 uses: release-drafter/release-drafter@v6.1.0
with: with:
tag: ${{ steps.version.outputs.version }} tag: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }} name: ${{ steps.version.outputs.version }}

View File

@@ -0,0 +1,58 @@
name: Restrict task creation
# yamllint disable-line rule:truthy
on:
issues:
types: [opened]
jobs:
check-authorization:
runs-on: ubuntu-latest
# Only run if this is a Task issue type (from the issue form)
if: github.event.issue.issue_type == 'Task'
steps:
- name: Check if user is authorized
uses: actions/github-script@v7
with:
script: |
const issueAuthor = context.payload.issue.user.login;
// Check if user is an organization member
try {
await github.rest.orgs.checkMembershipForUser({
org: 'home-assistant',
username: issueAuthor
});
console.log(`✅ ${issueAuthor} is an organization member`);
return; // Authorized
} catch (error) {
console.log(`❌ ${issueAuthor} is not authorized to create Task issues`);
}
// Close the issue with a comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `Hi @${issueAuthor}, thank you for your contribution!\n\n` +
`Task issues are restricted to Open Home Foundation staff and authorized contributors.\n\n` +
`If you would like to:\n` +
`- Report a bug: Please use the [bug report form](https://github.com/home-assistant/supervisor/issues/new?template=bug_report.yml)\n` +
`- Request a feature: Please submit to [Feature Requests](https://github.com/orgs/home-assistant/discussions)\n\n` +
`If you believe you should have access to create Task issues, please contact the maintainers.`
});
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
state: 'closed'
});
// Add a label to indicate this was auto-closed
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['auto-closed']
});

View File

@@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Sentry Release - name: Sentry Release
uses: getsentry/action-release@v1.1 uses: getsentry/action-release@v3.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 }}

View File

@@ -9,10 +9,10 @@ jobs:
stale: stale:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/stale@v3.0.14 - uses: actions/stale@v9.1.0
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 60 days-before-stale: 30
days-before-close: 7 days-before-close: 7
stale-issue-label: "stale" stale-issue-label: "stale"
exempt-issue-labels: "no-stale,Help%20wanted,help-wanted,pinned,rfc,security" exempt-issue-labels: "no-stale,Help%20wanted,help-wanted,pinned,rfc,security"

82
.github/workflows/update_frontend.yml vendored Normal file
View File

@@ -0,0 +1,82 @@
name: Update frontend
on:
schedule: # once a day
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check_version.outputs.skip || steps.check_existing_pr.outputs.skip }}
current_version: ${{ steps.check_version.outputs.current_version }}
latest_version: ${{ steps.latest_frontend_version.outputs.latest_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get latest frontend release
id: latest_frontend_version
uses: abatilo/release-info-action@v1.3.3
with:
owner: home-assistant
repo: frontend
- name: Check if version is up to date
id: check_version
run: |
current_version="$(cat .ha-frontend-version)"
latest_version="${{ steps.latest_frontend_version.outputs.latest_tag }}"
echo "current_version=${current_version}" >> $GITHUB_OUTPUT
echo "LATEST_VERSION=${latest_version}" >> $GITHUB_ENV
if [[ ! "$current_version" < "$latest_version" ]]; then
echo "Frontend version is up to date"
echo "skip=true" >> $GITHUB_OUTPUT
fi
- name: Check if there is no open PR with this version
if: steps.check_version.outputs.skip != 'true'
id: check_existing_pr
env:
GH_TOKEN: ${{ github.token }}
run: |
PR=$(gh pr list --state open --base main --json title --search "Update frontend to version $LATEST_VERSION")
if [[ "$PR" != "[]" ]]; then
echo "Skipping - There is already a PR open for version $LATEST_VERSION"
echo "skip=true" >> $GITHUB_OUTPUT
fi
create-pr:
runs-on: ubuntu-latest
needs: check-version
if: needs.check-version.outputs.skip != 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Clear www folder
run: |
rm -rf supervisor/api/panel/*
- name: Update version file
run: |
echo "${{ needs.check-version.outputs.latest_version }}" > .ha-frontend-version
- name: Download release assets
uses: robinraju/release-downloader@v1
with:
repository: 'home-assistant/frontend'
tag: ${{ needs.check-version.outputs.latest_version }}
fileName: home_assistant_frontend_supervisor-${{ needs.check-version.outputs.latest_version }}.tar.gz
extract: true
out-file-path: supervisor/api/panel/
- name: Remove release assets archive
run: |
rm -f supervisor/api/panel/home_assistant_frontend_supervisor-*.tar.gz
- name: Create PR
uses: peter-evans/create-pull-request@v7
with:
commit-message: "Update frontend to version ${{ needs.check-version.outputs.latest_version }}"
branch: autoupdate-frontend
base: main
draft: true
sign-commits: true
title: "Update frontend to version ${{ needs.check-version.outputs.latest_version }}"
body: >
Update frontend from ${{ needs.check-version.outputs.current_version }} to
[${{ needs.check-version.outputs.latest_version }}](https://github.com/home-assistant/frontend/releases/tag/${{ needs.check-version.outputs.latest_version }})

4
.gitmodules vendored
View File

@@ -1,4 +0,0 @@
[submodule "home-assistant-polymer"]
path = home-assistant-polymer
url = https://github.com/home-assistant/home-assistant-polymer
branch = dev

1
.ha-frontend-version Normal file
View File

@@ -0,0 +1 @@
20250806.0

View File

@@ -1,5 +1,7 @@
ignored: ignored:
- DL3018 - DL3003
- DL3006 - DL3006
- DL3013 - DL3013
- DL3018
- DL3042
- SC2155 - SC2155

View File

@@ -1,34 +1,27 @@
repos: repos:
- repo: https://github.com/psf/black - repo: https://github.com/astral-sh/ruff-pre-commit
rev: 20.8b1 rev: v0.11.10
hooks: hooks:
- id: black - id: ruff
args: args:
- --safe - --fix
- --quiet - id: ruff-format
- --target-version
- py38
files: ^((supervisor|tests)/.+)?[^/]+\.py$ files: ^((supervisor|tests)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==5.0.2
files: ^(supervisor|script|tests)/.+\.py$
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0 rev: v5.0.0
hooks: hooks:
- id: check-executables-have-shebangs - id: check-executables-have-shebangs
stages: [manual] stages: [manual]
- id: check-json - id: check-json
- repo: https://github.com/pre-commit/mirrors-isort - repo: local
rev: v4.3.21
hooks: hooks:
- id: isort # Run mypy through our wrapper script in order to get the possible
- repo: https://github.com/asottile/pyupgrade # pyenv and/or virtualenv activated; it may not have been e.g. if
rev: v2.6.2 # committing from a GUI tool that was not launched from an activated
hooks: # shell.
- id: pyupgrade - id: mypy
args: [--py37-plus] name: mypy
entry: script/run-in-env.sh mypy --ignore-missing-imports
language: script
types_or: [python, pyi]
files: ^supervisor/.+\.(py|pyi)$

21
.vcnignore Normal file
View File

@@ -0,0 +1,21 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# Distribution / packaging
*.egg-info/
# General files
.git
.github
.devcontainer
.vscode
.tox
# Data
home-assistant-polymer/
script/
tests/
data/
venv/

7
.vscode/launch.json vendored
View File

@@ -13,6 +13,13 @@
"remoteRoot": "/usr/src/supervisor" "remoteRoot": "/usr/src/supervisor"
} }
] ]
},
{
"name": "Debug Tests",
"type": "python",
"request": "test",
"console": "internalConsole",
"justMyCode": false
} }
] ]
} }

43
.vscode/tasks.json vendored
View File

@@ -4,7 +4,7 @@
{ {
"label": "Run Supervisor", "label": "Run Supervisor",
"type": "shell", "type": "shell",
"command": "./scripts/run-supervisor.sh", "command": "supervisor_run",
"group": { "group": {
"kind": "test", "kind": "test",
"isDefault": true "isDefault": true
@@ -15,20 +15,6 @@
}, },
"problemMatcher": [] "problemMatcher": []
}, },
{
"label": "Build Supervisor",
"type": "shell",
"command": "./scripts/build-supervisor.sh",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{ {
"label": "Run Supervisor CLI", "label": "Run Supervisor CLI",
"type": "shell", "type": "shell",
@@ -46,7 +32,7 @@
{ {
"label": "Update Supervisor Panel", "label": "Update Supervisor Panel",
"type": "shell", "type": "shell",
"command": "./scripts/update-frontend.sh", "command": "LOKALISE_TOKEN='${input:localiseToken}' ./scripts/update-frontend.sh",
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true
@@ -72,9 +58,23 @@
"problemMatcher": [] "problemMatcher": []
}, },
{ {
"label": "Flake8", "label": "Ruff Check",
"type": "shell", "type": "shell",
"command": "flake8 supervisor tests", "command": "ruff check --fix supervisor tests",
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "Ruff Format",
"type": "shell",
"command": "ruff format supervisor tests",
"group": { "group": {
"kind": "test", "kind": "test",
"isDefault": true "isDefault": true
@@ -100,5 +100,12 @@
}, },
"problemMatcher": [] "problemMatcher": []
} }
],
"inputs": [
{
"id": "localiseToken",
"type": "promptString",
"description": "Paste your lokalise token to download frontend translations"
}
] ]
} }

1
CLAUDE.md Symbolic link
View File

@@ -0,0 +1 @@
.github/copilot-instructions.md

View File

@@ -1,38 +1,51 @@
ARG BUILD_FROM ARG BUILD_FROM
FROM $BUILD_FROM FROM ${BUILD_FROM}
ENV \ ENV \
S6_SERVICES_GRACETIME=10000 \ S6_SERVICES_GRACETIME=10000 \
SUPERVISOR_API=http://localhost SUPERVISOR_API=http://localhost \
CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1 \
UV_SYSTEM_PYTHON=true
ARG \
COSIGN_VERSION \
BUILD_ARCH \
QEMU_CPU
# Install base # Install base
WORKDIR /usr/src
RUN \ RUN \
apk add --no-cache \ set -x \
&& apk add --no-cache \
findutils \
eudev \ eudev \
eudev-libs \ eudev-libs \
git \ git \
glib \
libffi \ libffi \
libpulse \ libpulse \
musl \ musl \
openssl openssl \
yaml \
ARG BUILD_ARCH \
WORKDIR /usr/src && curl -Lso /usr/bin/cosign "https://github.com/home-assistant/cosign/releases/download/${COSIGN_VERSION}/cosign_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/cosign \
&& pip3 install uv==0.6.17
# Install requirements # Install requirements
COPY requirements.txt . COPY requirements.txt .
RUN \ RUN \
export MAKEFLAGS="-j$(nproc)" \ if [ "${BUILD_ARCH}" = "i386" ]; then \
&& pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links \ setarch="linux32"; \
"https://wheels.home-assistant.io/alpine-$(cut -d '.' -f 1-2 < /etc/alpine-release)/${BUILD_ARCH}/" \ else \
-r ./requirements.txt \ setarch=""; \
fi \
&& ${setarch} uv pip install --compile-bytecode --no-cache --no-build -r requirements.txt \
&& rm -f requirements.txt && rm -f requirements.txt
# Install Home Assistant Supervisor # Install Home Assistant Supervisor
COPY . supervisor COPY . supervisor
RUN \ RUN \
pip3 install --no-cache-dir -e ./supervisor \ uv pip install --no-cache -e ./supervisor \
&& python3 -m compileall ./supervisor/supervisor && python3 -m compileall ./supervisor/supervisor

View File

@@ -21,12 +21,14 @@ Development instructions can be found [here][development].
Releases are done in 3 stages (channels) with this structure: Releases are done in 3 stages (channels) with this structure:
1. Pull requests are merged to the `main` branch 1. Pull requests are merged to the `main` branch.
2. A new build is pushed to the `dev` stage. 2. A new build is pushed to the `dev` stage.
3. Releases are published 3. Releases are published.
4. A new build is pushed to the `beta` stage. 4. A new build is pushed to the `beta` stage.
5. The [`stable.json][stable] file is updated 5. The [`stable.json`][stable] file is updated.
6. The build that was pushed to `beta` will now be pushed to `stable` 6. The build that was pushed to `beta` will now be pushed to `stable`.
[development]: https://developers.home-assistant.io/docs/supervisor/development [development]: https://developers.home-assistant.io/docs/supervisor/development
[stable]: https://github.com/home-assistant/version/blob/master/stable.json [stable]: https://github.com/home-assistant/version/blob/master/stable.json
[![Home Assistant - A project from the Open Home Foundation](https://www.openhomefoundation.org/badges/home-assistant.png)](https://www.openhomefoundation.org/)

View File

@@ -1,13 +0,0 @@
{
"image": "homeassistant/{arch}-hassio-supervisor",
"build_from": {
"aarch64": "homeassistant/aarch64-base-python:3.8-alpine3.12",
"armhf": "homeassistant/armhf-base-python:3.8-alpine3.12",
"armv7": "homeassistant/armv7-base-python:3.8-alpine3.12",
"amd64": "homeassistant/amd64-base-python:3.8-alpine3.12",
"i386": "homeassistant/i386-base-python:3.8-alpine3.12"
},
"labels": {
"io.hass.type": "supervisor"
}
}

24
build.yaml Normal file
View File

@@ -0,0 +1,24 @@
image: ghcr.io/home-assistant/{arch}-hassio-supervisor
build_from:
aarch64: ghcr.io/home-assistant/aarch64-base-python:3.13-alpine3.22
armhf: ghcr.io/home-assistant/armhf-base-python:3.13-alpine3.22
armv7: ghcr.io/home-assistant/armv7-base-python:3.13-alpine3.22
amd64: ghcr.io/home-assistant/amd64-base-python:3.13-alpine3.22
i386: ghcr.io/home-assistant/i386-base-python:3.13-alpine3.22
codenotary:
signer: notary@home-assistant.io
base_image: notary@home-assistant.io
cosign:
base_identity: https://github.com/home-assistant/docker-base/.*
identity: https://github.com/home-assistant/supervisor/.*
args:
COSIGN_VERSION: 2.4.3
labels:
io.hass.type: supervisor
org.opencontainers.image.title: Home Assistant Supervisor
org.opencontainers.image.description: Container-based system for managing Home Assistant Core installation
org.opencontainers.image.source: https://github.com/home-assistant/supervisor
org.opencontainers.image.authors: The Home Assistant Authors
org.opencontainers.image.url: https://www.home-assistant.io/
org.opencontainers.image.documentation: https://www.home-assistant.io/docs/
org.opencontainers.image.licenses: Apache License 2.0

View File

@@ -1,46 +0,0 @@
[MASTER]
reports=no
jobs=2
good-names=id,i,j,k,ex,Run,_,fp,T
# Reasons disabled:
# format - handled by black
# locally-disabled - it spams too much
# duplicate-code - unavoidable
# cyclic-import - doesn't test if both import on load
# abstract-class-little-used - prevents from setting right foundation
# abstract-class-not-used - is flaky, should not show up but does
# unused-argument - generic callbacks and setup methods create a lot of warnings
# redefined-variable-type - this is Python, we're duck typing!
# too-many-* - are not enforced for the sake of readability
# too-few-* - same as too-many-*
# abstract-method - with intro of async there are always methods missing
disable=
format,
abstract-class-little-used,
abstract-method,
cyclic-import,
duplicate-code,
locally-disabled,
no-else-return,
no-self-use,
not-context-manager,
redefined-variable-type,
too-few-public-methods,
too-many-arguments,
too-many-branches,
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-public-methods,
too-many-return-statements,
too-many-statements,
unused-argument,
[EXCEPTIONS]
overgeneral-exceptions=Exception
[TYPECHECK]
ignored-modules = distutils

376
pyproject.toml Normal file
View File

@@ -0,0 +1,376 @@
[build-system]
requires = ["setuptools~=80.9.0", "wheel~=0.46.1"]
build-backend = "setuptools.build_meta"
[project]
name = "Supervisor"
dynamic = ["version", "dependencies"]
license = { text = "Apache-2.0" }
description = "Open-source private cloud os for Home-Assistant based on HassOS"
readme = "README.md"
authors = [
{ name = "The Home Assistant Authors", email = "hello@home-assistant.io" },
]
keywords = ["docker", "home-assistant", "api"]
requires-python = ">=3.13.0"
[project.urls]
"Homepage" = "https://www.home-assistant.io/"
"Source Code" = "https://github.com/home-assistant/supervisor"
"Bug Reports" = "https://github.com/home-assistant/supervisor/issues"
"Docs: Dev" = "https://developers.home-assistant.io/"
"Discord" = "https://www.home-assistant.io/join-chat/"
"Forum" = "https://community.home-assistant.io/"
[tool.setuptools]
platforms = ["any"]
zip-safe = false
include-package-data = true
[tool.setuptools.packages.find]
include = ["supervisor*"]
[tool.pylint.MAIN]
py-version = "3.13"
# Use a conservative default here; 2 should speed up most setups and not hurt
# any too bad. Override on command line as appropriate.
jobs = 2
persistent = false
extension-pkg-allow-list = ["ciso8601"]
[tool.pylint.BASIC]
class-const-naming-style = "any"
good-names = ["id", "i", "j", "k", "ex", "Run", "_", "fp", "T", "os"]
[tool.pylint."MESSAGES CONTROL"]
# Reasons disabled:
# format - handled by ruff
# abstract-method - with intro of async there are always methods missing
# cyclic-import - doesn't test if both import on load
# duplicate-code - unavoidable
# locally-disabled - it spams too much
# too-many-* - are not enforced for the sake of readability
# too-few-* - same as too-many-*
# unused-argument - generic callbacks and setup methods create a lot of warnings
disable = [
"format",
"abstract-method",
"cyclic-import",
"duplicate-code",
"locally-disabled",
"no-else-return",
"not-context-manager",
"too-few-public-methods",
"too-many-arguments",
"too-many-branches",
"too-many-instance-attributes",
"too-many-lines",
"too-many-locals",
"too-many-public-methods",
"too-many-return-statements",
"too-many-statements",
"unused-argument",
"consider-using-with",
# Handled by ruff
# Ref: <https://github.com/astral-sh/ruff/issues/970>
"await-outside-async", # PLE1142
"bad-str-strip-call", # PLE1310
"bad-string-format-type", # PLE1307
"bidirectional-unicode", # PLE2502
"continue-in-finally", # PLE0116
"duplicate-bases", # PLE0241
"format-needs-mapping", # F502
"function-redefined", # F811
# Needed because ruff does not understand type of __all__ generated by a function
# "invalid-all-format", # PLE0605
"invalid-all-object", # PLE0604
"invalid-character-backspace", # PLE2510
"invalid-character-esc", # PLE2513
"invalid-character-nul", # PLE2514
"invalid-character-sub", # PLE2512
"invalid-character-zero-width-space", # PLE2515
"logging-too-few-args", # PLE1206
"logging-too-many-args", # PLE1205
"missing-format-string-key", # F524
"mixed-format-string", # F506
"no-method-argument", # N805
"no-self-argument", # N805
"nonexistent-operator", # B002
"nonlocal-without-binding", # PLE0117
"not-in-loop", # F701, F702
"notimplemented-raised", # F901
"return-in-init", # PLE0101
"return-outside-function", # F706
"syntax-error", # E999
"too-few-format-args", # F524
"too-many-format-args", # F522
"too-many-star-expressions", # F622
"truncated-format-string", # F501
"undefined-all-variable", # F822
"undefined-variable", # F821
"used-prior-global-declaration", # PLE0118
"yield-inside-async-function", # PLE1700
"yield-outside-function", # F704
"anomalous-backslash-in-string", # W605
"assert-on-string-literal", # PLW0129
"assert-on-tuple", # F631
"bad-format-string", # W1302, F
"bad-format-string-key", # W1300, F
"bare-except", # E722
"binary-op-exception", # PLW0711
"cell-var-from-loop", # B023
# "dangerous-default-value", # B006, ruff catches new occurrences, needs more work
"duplicate-except", # B014
"duplicate-key", # F601
"duplicate-string-formatting-argument", # F
"duplicate-value", # F
"eval-used", # PGH001
"exec-used", # S102
# "expression-not-assigned", # B018, ruff catches new occurrences, needs more work
"f-string-without-interpolation", # F541
"forgotten-debug-statement", # T100
"format-string-without-interpolation", # F
# "global-statement", # PLW0603, ruff catches new occurrences, needs more work
"global-variable-not-assigned", # PLW0602
"implicit-str-concat", # ISC001
"import-self", # PLW0406
"inconsistent-quotes", # Q000
"invalid-envvar-default", # PLW1508
"keyword-arg-before-vararg", # B026
"logging-format-interpolation", # G
"logging-fstring-interpolation", # G
"logging-not-lazy", # G
"misplaced-future", # F404
"named-expr-without-context", # PLW0131
"nested-min-max", # PLW3301
# "pointless-statement", # B018, ruff catches new occurrences, needs more work
"raise-missing-from", # TRY200
# "redefined-builtin", # A001, ruff is way more stricter, needs work
"try-except-raise", # TRY203
"unused-argument", # ARG001, we don't use it
"unused-format-string-argument", #F507
"unused-format-string-key", # F504
"unused-import", # F401
"unused-variable", # F841
"useless-else-on-loop", # PLW0120
"wildcard-import", # F403
"bad-classmethod-argument", # N804
"consider-iterating-dictionary", # SIM118
"empty-docstring", # D419
"invalid-name", # N815
"line-too-long", # E501, disabled globally
"missing-class-docstring", # D101
"missing-final-newline", # W292
"missing-function-docstring", # D103
"missing-module-docstring", # D100
"multiple-imports", #E401
"singleton-comparison", # E711, E712
"subprocess-run-check", # PLW1510
"superfluous-parens", # UP034
"ungrouped-imports", # I001
"unidiomatic-typecheck", # E721
"unnecessary-direct-lambda-call", # PLC3002
"unnecessary-lambda-assignment", # PLC3001
"unneeded-not", # SIM208
"useless-import-alias", # PLC0414
"wrong-import-order", # I001
"wrong-import-position", # E402
"comparison-of-constants", # PLR0133
"comparison-with-itself", # PLR0124
# "consider-alternative-union-syntax", # UP007, typing extension
"consider-merging-isinstance", # PLR1701
# "consider-using-alias", # UP006, typing extension
"consider-using-dict-comprehension", # C402
"consider-using-generator", # C417
"consider-using-get", # SIM401
"consider-using-set-comprehension", # C401
"consider-using-sys-exit", # PLR1722
"consider-using-ternary", # SIM108
"literal-comparison", # F632
"property-with-parameters", # PLR0206
"super-with-arguments", # UP008
"too-many-branches", # PLR0912
"too-many-return-statements", # PLR0911
"too-many-statements", # PLR0915
"trailing-comma-tuple", # COM818
"unnecessary-comprehension", # C416
"use-a-generator", # C417
"use-dict-literal", # C406
"use-list-literal", # C405
"useless-object-inheritance", # UP004
"useless-return", # PLR1711
# "no-self-use", # PLR6301 # Optional plugin, not enabled
]
[tool.pylint.REPORTS]
score = false
[tool.pylint.TYPECHECK]
ignored-modules = ["distutils"]
[tool.pylint.FORMAT]
expected-line-ending-format = "LF"
[tool.pylint.EXCEPTIONS]
overgeneral-exceptions = ["builtins.BaseException", "builtins.Exception"]
[tool.pylint.DESIGN]
max-positional-arguments = 10
[tool.pytest.ini_options]
testpaths = ["tests"]
norecursedirs = [".git"]
log_format = "%(asctime)s.%(msecs)03d %(levelname)-8s %(threadName)s %(name)s:%(filename)s:%(lineno)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
filterwarnings = [
"error",
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:dirhash",
"ignore::pytest.PytestUnraisableExceptionWarning",
]
markers = [
"no_mock_init_websession: disable the autouse mock of init_websession for this test",
]
[tool.ruff]
lint.select = [
"B002", # Python does not support the unary prefix increment
"B007", # Loop control variable {name} not used within loop body
"B014", # Exception handler with duplicate exception
"B023", # Function definition does not bind loop variable {name}
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
"B904", # Use raise from to specify exception cause
"C", # complexity
"COM818", # Trailing comma on bare tuple prohibited
"D", # docstrings
"DTZ003", # Use datetime.now(tz=) instead of datetime.utcnow()
"DTZ004", # Use datetime.fromtimestamp(ts, tz=) instead of datetime.utcfromtimestamp(ts)
"E", # pycodestyle
"F", # pyflakes/autoflake
"G", # flake8-logging-format
"I", # isort
"ICN001", # import concentions; {name} should be imported as {asname}
"N804", # First argument of a class method should be named cls
"N805", # First argument of a method should be named self
"N815", # Variable {name} in class scope should not be mixedCase
"PGH004", # Use specific rule codes when using noqa
"PLC0414", # Useless import alias. Import alias does not rename original package.
"PLC", # pylint
"PLE", # pylint
"PLR", # pylint
"PLW", # pylint
"Q000", # Double quotes found but single quotes preferred
"RUF006", # Store a reference to the return value of asyncio.create_task
"S102", # Use of exec detected
"S103", # bad-file-permissions
"S108", # hardcoded-temp-file
"S306", # suspicious-mktemp-usage
"S307", # suspicious-eval-usage
"S313", # suspicious-xmlc-element-tree-usage
"S314", # suspicious-xml-element-tree-usage
"S315", # suspicious-xml-expat-reader-usage
"S316", # suspicious-xml-expat-builder-usage
"S317", # suspicious-xml-sax-usage
"S318", # suspicious-xml-mini-dom-usage
"S319", # suspicious-xml-pull-dom-usage
"S601", # paramiko-call
"S602", # subprocess-popen-with-shell-equals-true
"S604", # call-with-shell-equals-true
"S608", # hardcoded-sql-expression
"S609", # unix-command-wildcard-injection
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
"SIM117", # Merge with-statements that use the same scope
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
"SIM201", # Use {left} != {right} instead of not {left} == {right}
"SIM208", # Use {expr} instead of not (not {expr})
"SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a}
"SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'.
"SIM401", # Use get from dict with default instead of an if block
"T100", # Trace found: {name} used
"T20", # flake8-print
"TID251", # Banned imports
"TRY004", # Prefer TypeError exception for invalid type
"TRY203", # Remove exception handler; error is immediately re-raised
"UP", # pyupgrade
"W", # pycodestyle
]
lint.ignore = [
"D202", # No blank lines allowed after function docstring
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D406", # Section name should end with a newline
"D407", # Section name underlining
"E501", # line too long
"E731", # do not assign a lambda expression, use a def
# Ignore ignored, as the rule is now back in preview/nursery, which cannot
# be ignored anymore without warnings.
# https://github.com/astral-sh/ruff/issues/7491
# "PLC1901", # Lots of false positives
# False positives https://github.com/astral-sh/ruff/issues/5386
"PLC0208", # Use a sequence type instead of a `set` when iterating over values
"PLR0911", # Too many return statements ({returns} > {max_returns})
"PLR0912", # Too many branches ({branches} > {max_branches})
"PLR0913", # Too many arguments to function call ({c_args} > {max_args})
"PLR0915", # Too many statements ({statements} > {max_statements})
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
"UP006", # keep type annotation style as is
"UP007", # keep type annotation style as is
# Ignored due to performance: https://github.com/charliermarsh/ruff/issues/2923
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)`
# May conflict with the formatter, https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E111",
"E114",
"E117",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM812",
"COM819",
"ISC001",
"ISC002",
# Disabled because ruff does not understand type of __all__ generated by a function
"PLE0605",
]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
voluptuous = "vol"
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"pytz".msg = "use zoneinfo instead"
[tool.ruff.lint.isort]
force-sort-within-sections = true
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]
forced-separate = ["tests"]
known-first-party = ["supervisor", "tests"]
combine-as-imports = true
split-on-trailing-comma = false
[tool.ruff.lint.per-file-ignores]
# DBus Service Mocks must use typing and names understood by dbus-fast
"tests/dbus_service_mocks/*.py" = ["F722", "F821", "N815"]
[tool.ruff.lint.mccabe]
max-complexity = 25

View File

@@ -1,21 +1,30 @@
aiohttp==3.7.3 aiodns==3.5.0
async_timeout==3.0.1 aiohttp==3.12.15
atomicwrites==1.4.0 atomicwrites-homeassistant==1.4.1
attrs==20.3.0 attrs==25.3.0
awesomeversion==21.1.3 awesomeversion==25.8.0
brotli==1.0.9 blockbuster==1.5.25
cchardet==2.1.7 brotli==1.1.0
colorlog==4.7.2 ciso8601==2.3.2
cpe==1.2.1 colorlog==6.9.0
cryptography==3.3.1 cpe==1.3.1
debugpy==1.2.1 cryptography==45.0.6
docker==4.4.1 debugpy==1.8.16
gitpython==3.1.12 deepmerge==2.0
jinja2==2.11.2 dirhash==0.5.0
packaging==20.4 docker==7.1.0
pulsectl==20.5.1 faust-cchardet==2.1.19
pytz==2020.5 gitpython==3.1.45
pyudev==0.22.0 jinja2==3.1.6
ruamel.yaml==0.15.100 log-rate-limit==1.4.2
sentry-sdk==0.19.5 orjson==3.11.1
voluptuous==0.12.1 pulsectl==24.12.0
pyudev==0.24.3
PyYAML==6.0.2
requests==2.32.4
securetar==2025.2.1
sentry-sdk==2.34.1
setuptools==80.9.0
voluptuous==0.15.2
dbus-fast==2.44.3
zlib-fast==0.2.1

View File

@@ -1,14 +1,16 @@
black==20.8b1 astroid==3.3.11
codecov==2.1.11 coverage==7.10.2
coverage==5.3.1 mypy==1.17.1
flake8-docstrings==1.5.0 pre-commit==4.2.0
flake8==3.8.4 pylint==3.3.7
pre-commit==2.9.3 pytest-aiohttp==1.1.0
pydocstyle==5.1.1 pytest-asyncio==0.25.2
pylint==2.6.0 pytest-cov==6.2.1
pytest-aiohttp==0.3.0 pytest-timeout==2.4.0
pytest-asyncio==0.12.0 # NB!: Versions over 0.12.0 breaks pytest-aiohttp (https://github.com/aio-libs/pytest-aiohttp/issues/16) pytest==8.4.1
pytest-cov==2.11.1 ruff==0.12.8
pytest-timeout==1.4.2 time-machine==2.17.0
pytest==6.2.1 types-docker==7.1.0.20250705
pyupgrade==2.7.4 types-pyyaml==6.0.12.20250516
types-requests==2.32.4.20250611
urllib3==2.5.0

8
rootfs/etc/cont-init.d/udev.sh Normal file → Executable file
View File

@@ -2,9 +2,17 @@
# ============================================================================== # ==============================================================================
# Start udev service # Start udev service
# ============================================================================== # ==============================================================================
if bashio::fs.directory_exists /run/udev && ! bashio::fs.file_exists /run/.old_udev; then
bashio::log.info "Using udev information from host"
bashio::exit.ok
fi
bashio::log.info "Setup udev backend inside container"
udevd --daemon udevd --daemon
bashio::log.info "Update udev information" bashio::log.info "Update udev information"
touch /run/.old_udev
if udevadm trigger; then if udevadm trigger; then
udevadm settle || true udevadm settle || true
else else

11
rootfs/etc/services.d/supervisor/finish Normal file → Executable file
View File

@@ -1,8 +1,11 @@
#!/usr/bin/execlineb -S1 #!/usr/bin/env bashio
# ============================================================================== # ==============================================================================
# Take down the S6 supervision tree when Supervisor fails # Take down the S6 supervision tree when Supervisor fails
# ============================================================================== # ==============================================================================
if { s6-test ${1} -ne 100 }
if { s6-test ${1} -ne 256 }
redirfd -w 2 /dev/null s6-svscanctl -t /var/run/s6/services if [[ "$1" -ne 100 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "Halt Supervisor"
/run/s6/basedir/bin/halt
fi
bashio::log.info "Supervisor restart after closing"

1
rootfs/etc/services.d/supervisor/run Normal file → Executable file
View File

@@ -3,5 +3,6 @@
# Start Supervisor service # Start Supervisor service
# ============================================================================== # ==============================================================================
export LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" export LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
export MALLOC_CONF="background_thread:true,metadata_thp:auto"
exec python3 -m supervisor exec python3 -m supervisor

11
rootfs/etc/services.d/watchdog/finish Normal file → Executable file
View File

@@ -1,8 +1,11 @@
#!/usr/bin/execlineb -S1 #!/usr/bin/env bashio
# ============================================================================== # ==============================================================================
# Take down the S6 supervision tree when Watchdog fails # Take down the S6 supervision tree when Watchdog fails
# ============================================================================== # ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "Halt Supervisor (Wuff)"
/run/s6/basedir/bin/halt
fi
bashio::log.info "Watchdog restart after closing"

4
rootfs/etc/services.d/watchdog/run Normal file → Executable file
View File

@@ -15,7 +15,7 @@ do
if [[ "${supervisor_state}" = "running" ]]; then if [[ "${supervisor_state}" = "running" ]]; then
# Check API # Check API
if bashio::supervisor.ping; then if bashio::supervisor.ping > /dev/null; then
failed_count=0 failed_count=0
else else
bashio::log.warning "Maybe found an issue on API healthy" bashio::log.warning "Maybe found an issue on API healthy"
@@ -31,4 +31,4 @@ do
done done
basio::exit.nok "Watchdog detected issue with Supervisor - taking container down!" bashio::exit.nok "Watchdog detected issue with Supervisor - taking container down!"

30
script/run-in-env.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env sh
set -eu
# Used in venv activate script.
# Would be an error if undefined.
OSTYPE="${OSTYPE-}"
# Activate pyenv and virtualenv if present, then run the specified command
# pyenv, pyenv-virtualenv
if [ -s .python-version ]; then
PYENV_VERSION=$(head -n 1 .python-version)
export PYENV_VERSION
fi
if [ -n "${VIRTUAL_ENV-}" ] && [ -f "${VIRTUAL_ENV}/bin/activate" ]; then
. "${VIRTUAL_ENV}/bin/activate"
else
# other common virtualenvs
my_path=$(git rev-parse --show-toplevel)
for venv in venv .venv .; do
if [ -f "${my_path}/${venv}/bin/activate" ]; then
. "${my_path}/${venv}/bin/activate"
break
fi
done
fi
exec "$@"

View File

@@ -1,28 +0,0 @@
#!/bin/bash
source "${BASH_SOURCE[0]%/*}/common.sh"
set -eE
DOCKER_TIMEOUT=30
DOCKER_PID=0
function build_supervisor() {
docker pull homeassistant/amd64-builder:dev
docker run --rm \
--privileged \
-v /run/docker.sock:/run/docker.sock \
-v "$(pwd):/data" \
homeassistant/amd64-builder:dev \
--generic latest \
--target /data \
--test \
--amd64 \
--no-cache
}
echo "Build Supervisor"
start_docker
trap "stop_docker" ERR
build_supervisor

View File

@@ -1,58 +0,0 @@
#!/bin/bash
function start_docker() {
local starttime
local endtime
echo "Starting docker."
dockerd 2> /dev/null &
DOCKER_PID=$!
echo "Waiting for docker to initialize..."
starttime="$(date +%s)"
endtime="$(date +%s)"
until docker info >/dev/null 2>&1; do
if [ $((endtime - starttime)) -le $DOCKER_TIMEOUT ]; then
sleep 1
endtime=$(date +%s)
else
echo "Timeout while waiting for docker to come up"
exit 1
fi
done
echo "Docker was initialized"
}
function stop_docker() {
local starttime
local endtime
echo "Stopping in container docker..."
if [ "$DOCKER_PID" -gt 0 ] && kill -0 "$DOCKER_PID" 2> /dev/null; then
starttime="$(date +%s)"
endtime="$(date +%s)"
# Now wait for it to die
kill "$DOCKER_PID"
while kill -0 "$DOCKER_PID" 2> /dev/null; do
if [ $((endtime - starttime)) -le $DOCKER_TIMEOUT ]; then
sleep 1
endtime=$(date +%s)
else
echo "Timeout while waiting for container docker to die"
exit 1
fi
done
else
echo "Your host might have been left with unreleased resources"
fi
}
function cleanup_lastboot() {
if [[ -f /workspaces/test_supervisor/config.json ]]; then
echo "Cleaning up last boot"
cp /workspaces/test_supervisor/config.json /tmp/config.json
jq -rM 'del(.last_boot)' /tmp/config.json > /workspaces/test_supervisor/config.json
rm /tmp/config.json
fi
}

View File

@@ -1,81 +0,0 @@
#!/bin/bash
source "${BASH_SOURCE[0]%/*}/common.sh"
source "${BASH_SOURCE[0]%/*}/build-supervisor.sh"
set -eE
DOCKER_TIMEOUT=30
DOCKER_PID=0
function cleanup_docker() {
echo "Cleaning up stopped containers..."
docker rm $(docker ps -a -q) || true
}
function run_supervisor() {
mkdir -p /workspaces/test_supervisor
echo "Start Supervisor"
docker run --rm --privileged \
--name hassio_supervisor \
--privileged \
--security-opt seccomp=unconfined \
--security-opt apparmor:unconfined \
-v /run/docker.sock:/run/docker.sock \
-v /run/dbus:/run/dbus \
-v "/workspaces/test_supervisor":/data \
-v /etc/machine-id:/etc/machine-id:ro \
-v /workspaces/supervisor:/usr/src/supervisor \
-e SUPERVISOR_SHARE="/workspaces/test_supervisor" \
-e SUPERVISOR_NAME=hassio_supervisor \
-e SUPERVISOR_DEV=1 \
-e SUPERVISOR_MACHINE="qemux86-64" \
homeassistant/amd64-hassio-supervisor:latest
}
function init_dbus() {
if pgrep dbus-daemon; then
echo "Dbus is running"
return 0
fi
echo "Startup dbus"
mkdir -p /var/lib/dbus
cp -f /etc/machine-id /var/lib/dbus/machine-id
# cleanups
mkdir -p /run/dbus
rm -f /run/dbus/pid
# run
dbus-daemon --system --print-address
}
echo "Run Supervisor"
start_docker
trap "stop_docker" ERR
if [ "$( docker container inspect -f '{{.State.Status}}' hassio_supervisor )" == "running" ]; then
echo "Restarting Supervisor"
docker rm -f hassio_supervisor
init_dbus
cleanup_lastboot
run_supervisor
stop_docker
else
echo "Starting Supervisor"
docker system prune -f
build_supervisor
cleanup_lastboot
cleanup_docker
init_dbus
run_supervisor
stop_docker
fi

View File

@@ -1,18 +0,0 @@
#!/bin/bash
set -e
# Update frontend
git submodule update --init --recursive --remote
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
cd home-assistant-polymer
nvm install
script/bootstrap
# build frontend
cd hassio
./script/build_hassio
# Copy frontend
rm -rf ../../supervisor/api/panel/*
cp -rf build/* ../../supervisor/api/panel/

View File

@@ -1,30 +0,0 @@
[isort]
multi_line_output = 3
include_trailing_comma=True
force_grid_wrap=0
line_length=88
indent = " "
not_skip = __init__.py
force_sort_within_sections = true
sections = FUTURE,STDLIB,INBETWEENS,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
default_section = THIRDPARTY
forced_separate = tests
combine_as_imports = true
use_parentheses = true
known_first_party = supervisor,tests
[flake8]
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
doctests = True
max-line-length = 88
# E501: line too long
# W503: Line break occurred before a binary operator
# E203: Whitespace before ':'
# D202 No blank lines allowed after function docstring
# W504 line break after binary operator
ignore =
E501,
W503,
E203,
D202,
W504

View File

@@ -1,57 +1,28 @@
"""Home Assistant Supervisor setup.""" """Home Assistant Supervisor setup."""
from pathlib import Path
import re
from setuptools import setup from setuptools import setup
from supervisor.const import SUPERVISOR_VERSION RE_SUPERVISOR_VERSION = re.compile(r"^SUPERVISOR_VERSION =\s*(.+)$")
SUPERVISOR_DIR = Path(__file__).parent
REQUIREMENTS_FILE = SUPERVISOR_DIR / "requirements.txt"
CONST_FILE = SUPERVISOR_DIR / "supervisor/const.py"
REQUIREMENTS = REQUIREMENTS_FILE.read_text(encoding="utf-8")
CONSTANTS = CONST_FILE.read_text(encoding="utf-8")
def _get_supervisor_version():
for line in CONSTANTS.split("/n"):
if match := RE_SUPERVISOR_VERSION.match(line):
return match.group(1)
return "9999.09.9.dev9999"
setup( setup(
name="Supervisor", version=_get_supervisor_version(),
version=SUPERVISOR_VERSION, dependencies=REQUIREMENTS.split("/n"),
license="BSD License",
author="The Home Assistant Authors",
author_email="hello@home-assistant.io",
url="https://home-assistant.io/",
description=("Open-source private cloud os for Home-Assistant" " based on HassOS"),
long_description=(
"A maintainless private cloud operator system that"
"setup a Home-Assistant instance. Based on HassOS"
),
classifiers=[
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Topic :: Home Automation",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.8",
],
keywords=["docker", "home-assistant", "api"],
zip_safe=False,
platforms="any",
packages=[
"supervisor.addons",
"supervisor.api",
"supervisor.dbus.network",
"supervisor.dbus.payloads",
"supervisor.dbus",
"supervisor.discovery.services",
"supervisor.discovery",
"supervisor.docker",
"supervisor.homeassistant",
"supervisor.host",
"supervisor.jobs",
"supervisor.misc",
"supervisor.plugins",
"supervisor.resolution.evaluations",
"supervisor.resolution",
"supervisor.services.modules",
"supervisor.services",
"supervisor.snapshots",
"supervisor.store",
"supervisor.utils",
"supervisor",
],
include_package_data=True,
) )

View File

@@ -1,11 +1,22 @@
"""Main file for Supervisor.""" """Main file for Supervisor."""
import asyncio import asyncio
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
import logging import logging
from pathlib import Path from pathlib import Path
import sys import sys
from supervisor import bootstrap import zlib_fast
# Enable fast zlib before importing supervisor
zlib_fast.enable()
# pylint: disable=wrong-import-position
from supervisor import bootstrap # noqa: E402
from supervisor.utils.blockbuster import BlockBusterManager # noqa: E402
from supervisor.utils.logging import activate_log_queue_handler # noqa: E402
# pylint: enable=wrong-import-position
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -28,7 +39,8 @@ if __name__ == "__main__":
bootstrap.initialize_logging() bootstrap.initialize_logging()
# Init async event loop # Init async event loop
loop = asyncio.get_event_loop() loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
# Check if all information are available to setup Supervisor # Check if all information are available to setup Supervisor
bootstrap.check_environment() bootstrap.check_environment()
@@ -37,12 +49,16 @@ if __name__ == "__main__":
executor = ThreadPoolExecutor(thread_name_prefix="SyncWorker") executor = ThreadPoolExecutor(thread_name_prefix="SyncWorker")
loop.set_default_executor(executor) loop.set_default_executor(executor)
activate_log_queue_handler()
_LOGGER.info("Initializing Supervisor setup") _LOGGER.info("Initializing Supervisor setup")
coresys = loop.run_until_complete(bootstrap.initialize_coresys()) coresys = loop.run_until_complete(bootstrap.initialize_coresys())
loop.set_debug(coresys.config.debug)
if coresys.config.detect_blocking_io:
BlockBusterManager.activate()
loop.run_until_complete(coresys.core.connect()) loop.run_until_complete(coresys.core.connect())
bootstrap.supervisor_debugger(coresys) loop.run_until_complete(bootstrap.supervisor_debugger(coresys))
bootstrap.migrate_system_env(coresys)
# Signal health startup for container # Signal health startup for container
run_os_startup_check_cleanup() run_os_startup_check_cleanup()
@@ -50,8 +66,15 @@ if __name__ == "__main__":
_LOGGER.info("Setting up Supervisor") _LOGGER.info("Setting up Supervisor")
loop.run_until_complete(coresys.core.setup()) loop.run_until_complete(coresys.core.setup())
loop.call_soon_threadsafe(loop.create_task, coresys.core.start()) bootstrap.register_signal_handlers(loop, coresys)
loop.call_soon_threadsafe(bootstrap.reg_signal, loop, coresys)
try:
loop.run_until_complete(coresys.core.start())
except Exception as err: # pylint: disable=broad-except
# Supervisor itself is running at this point, just something didn't
# start as expected. Log with traceback to get more insights for
# such cases.
_LOGGER.critical("Supervisor start failed: %s", err, exc_info=True)
try: try:
_LOGGER.info("Running Supervisor") _LOGGER.info("Running Supervisor")

View File

@@ -1,429 +1 @@
"""Init file for Supervisor add-ons.""" """Init file for Supervisor add-ons."""
import asyncio
from contextlib import suppress
import logging
import tarfile
from typing import Dict, List, Optional, Union
from ..const import AddonBoot, AddonStartup, AddonState
from ..coresys import CoreSys, CoreSysAttributes
from ..exceptions import (
AddonConfigurationError,
AddonsError,
AddonsJobError,
AddonsNotSupportedError,
CoreDNSError,
DockerAPIError,
DockerError,
DockerNotFound,
HomeAssistantAPIError,
HostAppArmorError,
)
from ..jobs.decorator import Job, JobCondition
from ..resolution.const import ContextType, IssueType, SuggestionType
from ..store.addon import AddonStore
from ..utils import check_exception_chain
from .addon import Addon
from .data import AddonsData
_LOGGER: logging.Logger = logging.getLogger(__name__)
AnyAddon = Union[Addon, AddonStore]
class AddonManager(CoreSysAttributes):
"""Manage add-ons inside Supervisor."""
def __init__(self, coresys: CoreSys):
"""Initialize Docker base wrapper."""
self.coresys: CoreSys = coresys
self.data: AddonsData = AddonsData(coresys)
self.local: Dict[str, Addon] = {}
self.store: Dict[str, AddonStore] = {}
@property
def all(self) -> List[AnyAddon]:
"""Return a list of all add-ons."""
addons: Dict[str, AnyAddon] = {**self.store, **self.local}
return list(addons.values())
@property
def installed(self) -> List[Addon]:
"""Return a list of all installed add-ons."""
return list(self.local.values())
def get(self, addon_slug: str, local_only: bool = False) -> Optional[AnyAddon]:
"""Return an add-on from slug.
Prio:
1 - Local
2 - Store
"""
if addon_slug in self.local:
return self.local[addon_slug]
if not local_only:
return self.store.get(addon_slug)
return None
def from_token(self, token: str) -> Optional[Addon]:
"""Return an add-on from Supervisor token."""
for addon in self.installed:
if token == addon.supervisor_token:
return addon
return None
async def load(self) -> None:
"""Start up add-on management."""
tasks = []
for slug in self.data.system:
addon = self.local[slug] = Addon(self.coresys, slug)
tasks.append(addon.load())
# Run initial tasks
_LOGGER.info("Found %d installed add-ons", len(tasks))
if tasks:
await asyncio.wait(tasks)
# Sync DNS
await self.sync_dns()
async def boot(self, stage: AddonStartup) -> None:
"""Boot add-ons with mode auto."""
tasks: List[Addon] = []
for addon in self.installed:
if addon.boot != AddonBoot.AUTO or addon.startup != stage:
continue
tasks.append(addon)
# Evaluate add-ons which need to be started
_LOGGER.info("Phase '%s' starting %d add-ons", stage, len(tasks))
if not tasks:
return
# Start Add-ons sequential
# avoid issue on slow IO
for addon in tasks:
try:
await addon.start()
except AddonsError as err:
# Check if there is an system/user issue
if check_exception_chain(
err, (DockerAPIError, DockerNotFound, AddonConfigurationError)
):
addon.boot = AddonBoot.MANUAL
addon.save_persist()
except Exception as err: # pylint: disable=broad-except
self.sys_capture_exception(err)
else:
continue
_LOGGER.warning("Can't start Add-on %s", addon.slug)
await asyncio.sleep(self.sys_config.wait_boot)
async def shutdown(self, stage: AddonStartup) -> None:
"""Shutdown addons."""
tasks: List[Addon] = []
for addon in self.installed:
if addon.state != AddonState.STARTED or addon.startup != stage:
continue
tasks.append(addon)
# Evaluate add-ons which need to be stopped
_LOGGER.info("Phase '%s' stopping %d add-ons", stage, len(tasks))
if not tasks:
return
# Stop Add-ons sequential
# avoid issue on slow IO
for addon in tasks:
try:
await addon.stop()
except Exception as err: # pylint: disable=broad-except
_LOGGER.warning("Can't stop Add-on %s: %s", addon.slug, err)
self.sys_capture_exception(err)
@Job(
conditions=[
JobCondition.FREE_SPACE,
JobCondition.INTERNET_HOST,
JobCondition.HEALTHY,
],
on_condition=AddonsJobError,
)
async def install(self, slug: str) -> None:
"""Install an add-on."""
if slug in self.local:
_LOGGER.warning("Add-on %s is already installed", slug)
return
store = self.store.get(slug)
if not store:
_LOGGER.error("Add-on %s not exists", slug)
raise AddonsError()
if not store.available:
_LOGGER.error("Add-on %s not supported on that platform", slug)
raise AddonsNotSupportedError()
self.data.install(store)
addon = Addon(self.coresys, slug)
if not addon.path_data.is_dir():
_LOGGER.info(
"Creating Home Assistant add-on data folder %s", addon.path_data
)
addon.path_data.mkdir()
# Setup/Fix AppArmor profile
await addon.install_apparmor()
try:
await addon.instance.install(store.version, store.image)
except DockerError as err:
self.data.uninstall(addon)
raise AddonsError() from err
else:
self.local[slug] = addon
# Reload ingress tokens
if addon.with_ingress:
await self.sys_ingress.reload()
_LOGGER.info("Add-on '%s' successfully installed", slug)
async def uninstall(self, slug: str) -> None:
"""Remove an add-on."""
if slug not in self.local:
_LOGGER.warning("Add-on %s is not installed", slug)
return
addon = self.local[slug]
try:
await addon.instance.remove()
except DockerError as err:
raise AddonsError() from err
else:
addon.state = AddonState.UNKNOWN
await addon.remove_data()
# Cleanup audio settings
if addon.path_pulse.exists():
with suppress(OSError):
addon.path_pulse.unlink()
# Cleanup AppArmor profile
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 Ingress dynamic port assignment
if addon.with_ingress:
self.sys_create_task(self.sys_ingress.reload())
self.sys_ingress.del_dynamic_port(slug)
# Cleanup discovery data
for message in self.sys_discovery.list_messages:
if message.addon != addon.slug:
continue
self.sys_discovery.remove(message)
# Cleanup services data
for service in self.sys_services.list_services:
if addon.slug not in service.active:
continue
service.del_service_data(addon)
self.data.uninstall(addon)
self.local.pop(slug)
_LOGGER.info("Add-on '%s' successfully removed", slug)
@Job(
conditions=[
JobCondition.FREE_SPACE,
JobCondition.INTERNET_HOST,
JobCondition.HEALTHY,
],
on_condition=AddonsJobError,
)
async def update(self, slug: str) -> None:
"""Update add-on."""
if slug not in self.local:
_LOGGER.error("Add-on %s is not installed", slug)
raise AddonsError()
addon = self.local[slug]
if addon.is_detached:
_LOGGER.error("Add-on %s is not available inside store", slug)
raise AddonsError()
store = self.store[slug]
if addon.version == store.version:
_LOGGER.warning("No update available for add-on %s", slug)
return
# Check if available, Maybe something have changed
if not store.available:
_LOGGER.error("Add-on %s not supported on that platform", slug)
raise AddonsNotSupportedError()
# Update instance
last_state: AddonState = addon.state
try:
await addon.instance.update(store.version, store.image)
# Cleanup
with suppress(DockerError):
await addon.instance.cleanup()
except DockerError as err:
raise AddonsError() from err
else:
self.data.update(store)
_LOGGER.info("Add-on '%s' successfully updated", slug)
# Setup/Fix AppArmor profile
await addon.install_apparmor()
# restore state
if last_state == AddonState.STARTED:
await addon.start()
@Job(
conditions=[
JobCondition.FREE_SPACE,
JobCondition.INTERNET_HOST,
JobCondition.HEALTHY,
],
on_condition=AddonsJobError,
)
async def rebuild(self, slug: str) -> None:
"""Perform a rebuild of local build add-on."""
if slug not in self.local:
_LOGGER.error("Add-on %s is not installed", slug)
raise AddonsError()
addon = self.local[slug]
if addon.is_detached:
_LOGGER.error("Add-on %s is not available inside store", slug)
raise AddonsError()
store = self.store[slug]
# Check if a rebuild is possible now
if addon.version != store.version:
_LOGGER.error("Version changed, use Update instead Rebuild")
raise AddonsError()
if not addon.need_build:
_LOGGER.error("Can't rebuild a image based add-on")
raise AddonsNotSupportedError()
# remove docker container but not addon config
last_state: AddonState = addon.state
try:
await addon.instance.remove()
await addon.instance.install(addon.version)
except DockerError as err:
raise AddonsError() from err
else:
self.data.update(store)
_LOGGER.info("Add-on '%s' successfully rebuilt", slug)
# restore state
if last_state == AddonState.STARTED:
await addon.start()
@Job(
conditions=[
JobCondition.FREE_SPACE,
JobCondition.INTERNET_HOST,
JobCondition.HEALTHY,
],
on_condition=AddonsJobError,
)
async def restore(self, slug: str, tar_file: tarfile.TarFile) -> None:
"""Restore state of an add-on."""
if slug not in self.local:
_LOGGER.debug("Add-on %s is not local available for restore", slug)
addon = Addon(self.coresys, slug)
else:
_LOGGER.debug("Add-on %s is local available for restore", slug)
addon = self.local[slug]
await addon.restore(tar_file)
# Check if new
if slug not in self.local:
_LOGGER.info("Detect new Add-on after restore %s", slug)
self.local[slug] = addon
# Update ingress
if addon.with_ingress:
await self.sys_ingress.reload()
with suppress(HomeAssistantAPIError):
await self.sys_ingress.update_hass_panel(addon)
@Job(conditions=[JobCondition.FREE_SPACE, JobCondition.INTERNET_HOST])
async def repair(self) -> None:
"""Repair local add-ons."""
needs_repair: List[Addon] = []
# Evaluate Add-ons to repair
for addon in self.installed:
if await addon.instance.exists():
continue
needs_repair.append(addon)
_LOGGER.info("Found %d add-ons to repair", len(needs_repair))
if not needs_repair:
return
for addon in needs_repair:
_LOGGER.info("Repairing for add-on: %s", addon.slug)
with suppress(DockerError, KeyError):
# Need pull a image again
if not addon.need_build:
await addon.instance.install(addon.version, addon.image)
continue
# Need local lookup
if addon.need_build and not addon.is_detached:
store = self.store[addon.slug]
# If this add-on is available for rebuild
if addon.version == store.version:
await addon.instance.install(addon.version, addon.image)
continue
_LOGGER.error("Can't repair %s", addon.slug)
with suppress(AddonsError):
await self.uninstall(addon.slug)
async def sync_dns(self) -> None:
"""Sync add-ons DNS names."""
# Update hosts
for addon in self.installed:
try:
if not await addon.instance.is_running():
continue
except DockerError as err:
_LOGGER.warning("Add-on %s is corrupt: %s", addon.slug, err)
self.sys_resolution.create_issue(
IssueType.CORRUPT_DOCKER,
ContextType.ADDON,
reference=addon.slug,
suggestions=[SuggestionType.EXECUTE_REPAIR],
)
self.sys_capture_exception(err)
else:
self.sys_plugins.dns.add_host(
ipv4=addon.ip_address, names=[addon.hostname], write=False
)
# Write hosts files
with suppress(CoreDNSError):
self.sys_plugins.dns.write_hosts()

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,33 @@
"""Supervisor add-on build environment.""" """Supervisor add-on build environment."""
from __future__ import annotations from __future__ import annotations
from functools import cached_property
from pathlib import Path from pathlib import Path
from typing import TYPE_CHECKING, Dict from typing import TYPE_CHECKING, Any
from awesomeversion import AwesomeVersion from awesomeversion import AwesomeVersion
from ..const import ATTR_ARGS, ATTR_BUILD_FROM, ATTR_SQUASH, META_ADDON from ..const import (
ATTR_ARGS,
ATTR_BUILD_FROM,
ATTR_LABELS,
ATTR_SQUASH,
FILE_SUFFIX_CONFIGURATION,
META_ADDON,
SOCKET_DOCKER,
)
from ..coresys import CoreSys, CoreSysAttributes from ..coresys import CoreSys, CoreSysAttributes
from ..utils.json import JsonConfig from ..docker.interface import MAP_ARCH
from ..exceptions import ConfigurationFileError, HassioArchNotFound
from ..utils.common import FileConfiguration, find_one_filetype
from .validate import SCHEMA_BUILD_CONFIG from .validate import SCHEMA_BUILD_CONFIG
if TYPE_CHECKING: if TYPE_CHECKING:
from . import AnyAddon from .manager import AnyAddon
class AddonBuild(JsonConfig, CoreSysAttributes): class AddonBuild(FileConfiguration, CoreSysAttributes):
"""Handle build options for add-ons.""" """Handle build options for add-ons."""
def __init__(self, coresys: CoreSys, addon: AnyAddon) -> None: def __init__(self, coresys: CoreSys, addon: AnyAddon) -> None:
@@ -23,20 +35,52 @@ class AddonBuild(JsonConfig, CoreSysAttributes):
self.coresys: CoreSys = coresys self.coresys: CoreSys = coresys
self.addon = addon self.addon = addon
super().__init__( # Search for build file later in executor
Path(self.addon.path_location, "build.json"), SCHEMA_BUILD_CONFIG super().__init__(None, SCHEMA_BUILD_CONFIG)
)
def save_data(self): def _get_build_file(self) -> Path:
"""Get build file.
Must be run in executor.
"""
try:
return find_one_filetype(
self.addon.path_location, "build", FILE_SUFFIX_CONFIGURATION
)
except ConfigurationFileError:
return self.addon.path_location / "build.json"
async def read_data(self) -> None:
"""Load data from file."""
if not self._file:
self._file = await self.sys_run_in_executor(self._get_build_file)
await super().read_data()
async def save_data(self):
"""Ignore save function.""" """Ignore save function."""
raise RuntimeError() raise RuntimeError()
@cached_property
def arch(self) -> str:
"""Return arch of the add-on."""
return self.sys_arch.match([self.addon.arch])
@property @property
def base_image(self) -> str: def base_image(self) -> str:
"""Return base image for this add-on.""" """Return base image for this add-on."""
return self._data[ATTR_BUILD_FROM].get( if not self._data[ATTR_BUILD_FROM]:
self.sys_arch.default, f"homeassistant/{self.sys_arch.default}-base:latest" return f"ghcr.io/home-assistant/{self.sys_arch.default}-base:latest"
)
if isinstance(self._data[ATTR_BUILD_FROM], str):
return self._data[ATTR_BUILD_FROM]
# Evaluate correct base image
if self.arch not in self._data[ATTR_BUILD_FROM]:
raise HassioArchNotFound(
f"Add-on {self.addon.slug} is not supported on {self.arch}"
)
return self._data[ATTR_BUILD_FROM][self.arch]
@property @property
def squash(self) -> bool: def squash(self) -> bool:
@@ -44,37 +88,98 @@ class AddonBuild(JsonConfig, CoreSysAttributes):
return self._data[ATTR_SQUASH] return self._data[ATTR_SQUASH]
@property @property
def additional_args(self) -> Dict[str, str]: def additional_args(self) -> dict[str, str]:
"""Return additional Docker build arguments.""" """Return additional Docker build arguments."""
return self._data[ATTR_ARGS] return self._data[ATTR_ARGS]
def get_docker_args(self, version: AwesomeVersion): @property
"""Create a dict with Docker build arguments.""" def additional_labels(self) -> dict[str, str]:
args = { """Return additional Docker labels."""
"path": str(self.addon.path_location), return self._data[ATTR_LABELS]
"tag": f"{self.addon.image}:{version!s}",
"pull": True, def get_dockerfile(self) -> Path:
"forcerm": True, """Return Dockerfile path.
"squash": self.squash,
"labels": { Must be run in executor.
"io.hass.version": version, """
"io.hass.arch": self.sys_arch.default, if self.addon.path_location.joinpath(f"Dockerfile.{self.arch}").exists():
"io.hass.type": META_ADDON, return self.addon.path_location.joinpath(f"Dockerfile.{self.arch}")
"io.hass.name": self._fix_label("name"), return self.addon.path_location.joinpath("Dockerfile")
"io.hass.description": self._fix_label("description"),
}, async def is_valid(self) -> bool:
"buildargs": { """Return true if the build env is valid."""
"BUILD_FROM": self.base_image,
"BUILD_VERSION": version, def build_is_valid() -> bool:
"BUILD_ARCH": self.sys_arch.default, return all(
**self.additional_args, [
}, self.addon.path_location.is_dir(),
self.get_dockerfile().is_file(),
]
)
try:
return await self.sys_run_in_executor(build_is_valid)
except HassioArchNotFound:
return False
def get_docker_args(
self, version: AwesomeVersion, image_tag: str
) -> dict[str, Any]:
"""Create a dict with Docker run args."""
dockerfile_path = self.get_dockerfile().relative_to(self.addon.path_location)
build_cmd = [
"docker",
"buildx",
"build",
".",
"--tag",
image_tag,
"--file",
str(dockerfile_path),
"--platform",
MAP_ARCH[self.arch],
"--pull",
]
labels = {
"io.hass.version": version,
"io.hass.arch": self.arch,
"io.hass.type": META_ADDON,
"io.hass.name": self._fix_label("name"),
"io.hass.description": self._fix_label("description"),
**self.additional_labels,
} }
if self.addon.url: if self.addon.url:
args["labels"]["io.hass.url"] = self.addon.url labels["io.hass.url"] = self.addon.url
return args for key, value in labels.items():
build_cmd.extend(["--label", f"{key}={value}"])
build_args = {
"BUILD_FROM": self.base_image,
"BUILD_VERSION": version,
"BUILD_ARCH": self.sys_arch.default,
**self.additional_args,
}
for key, value in build_args.items():
build_cmd.extend(["--build-arg", f"{key}={value}"])
# The addon path will be mounted from the host system
addon_extern_path = self.sys_config.local_to_extern_path(
self.addon.path_location
)
return {
"command": build_cmd,
"volumes": {
SOCKET_DOCKER: {"bind": "/var/run/docker.sock", "mode": "rw"},
addon_extern_path: {"bind": "/addon", "mode": "ro"},
},
"working_dir": "/addon",
}
def _fix_label(self, label_name: str) -> str: def _fix_label(self, label_name: str) -> str:
"""Remove characters they are not supported.""" """Remove characters they are not supported."""

View File

@@ -0,0 +1,11 @@
"""Confgiuration Objects for Addon Config."""
from dataclasses import dataclass
@dataclass(slots=True)
class FolderMapping:
"""Represent folder mapping configuration."""
path: str | None
read_only: bool

View File

@@ -0,0 +1,49 @@
"""Add-on static data."""
from datetime import timedelta
from enum import StrEnum
from ..jobs.const import JobCondition
class AddonBackupMode(StrEnum):
"""Backup mode of an Add-on."""
HOT = "hot"
COLD = "cold"
class MappingType(StrEnum):
"""Mapping type of an Add-on Folder."""
DATA = "data"
CONFIG = "config"
SSL = "ssl"
ADDONS = "addons"
BACKUP = "backup"
SHARE = "share"
MEDIA = "media"
HOMEASSISTANT_CONFIG = "homeassistant_config"
ALL_ADDON_CONFIGS = "all_addon_configs"
ADDON_CONFIG = "addon_config"
ATTR_BACKUP = "backup"
ATTR_BREAKING_VERSIONS = "breaking_versions"
ATTR_CODENOTARY = "codenotary"
ATTR_READ_ONLY = "read_only"
ATTR_PATH = "path"
WATCHDOG_RETRY_SECONDS = 10
WATCHDOG_MAX_ATTEMPTS = 5
WATCHDOG_THROTTLE_PERIOD = timedelta(minutes=30)
WATCHDOG_THROTTLE_MAX_CALLS = 10
ADDON_UPDATE_CONDITIONS = [
JobCondition.FREE_SPACE,
JobCondition.HEALTHY,
JobCondition.INTERNET_HOST,
JobCondition.PLUGINS_UPDATED,
JobCondition.SUPERVISOR_UPDATED,
]
RE_SLUG = r"[-_.A-Za-z0-9]+"

View File

@@ -1,7 +1,7 @@
"""Init file for Supervisor add-on data.""" """Init file for Supervisor add-on data."""
from copy import deepcopy from copy import deepcopy
import logging from typing import Any
from typing import Any, Dict
from ..const import ( from ..const import (
ATTR_IMAGE, ATTR_IMAGE,
@@ -13,16 +13,14 @@ from ..const import (
) )
from ..coresys import CoreSys, CoreSysAttributes from ..coresys import CoreSys, CoreSysAttributes
from ..store.addon import AddonStore from ..store.addon import AddonStore
from ..utils.json import JsonConfig from ..utils.common import FileConfiguration
from .addon import Addon from .addon import Addon
from .validate import SCHEMA_ADDONS_FILE from .validate import SCHEMA_ADDONS_FILE
_LOGGER: logging.Logger = logging.getLogger(__name__) Config = dict[str, Any]
Config = Dict[str, Any]
class AddonsData(JsonConfig, CoreSysAttributes): class AddonsData(FileConfiguration, CoreSysAttributes):
"""Hold data for installed Add-ons inside Supervisor.""" """Hold data for installed Add-ons inside Supervisor."""
def __init__(self, coresys: CoreSys): def __init__(self, coresys: CoreSys):
@@ -40,7 +38,7 @@ class AddonsData(JsonConfig, CoreSysAttributes):
"""Return local add-on data.""" """Return local add-on data."""
return self._data[ATTR_SYSTEM] return self._data[ATTR_SYSTEM]
def install(self, addon: AddonStore) -> None: async def install(self, addon: AddonStore) -> None:
"""Set addon as installed.""" """Set addon as installed."""
self.system[addon.slug] = deepcopy(addon.data) self.system[addon.slug] = deepcopy(addon.data)
self.user[addon.slug] = { self.user[addon.slug] = {
@@ -48,26 +46,28 @@ class AddonsData(JsonConfig, CoreSysAttributes):
ATTR_VERSION: addon.version, ATTR_VERSION: addon.version,
ATTR_IMAGE: addon.image, ATTR_IMAGE: addon.image,
} }
self.save_data() await self.save_data()
def uninstall(self, addon: Addon) -> None: async def uninstall(self, addon: Addon) -> None:
"""Set add-on as uninstalled.""" """Set add-on as uninstalled."""
self.system.pop(addon.slug, None) self.system.pop(addon.slug, None)
self.user.pop(addon.slug, None) self.user.pop(addon.slug, None)
self.save_data() await self.save_data()
def update(self, addon: AddonStore) -> None: async def update(self, addon: AddonStore) -> None:
"""Update version of add-on.""" """Update version of add-on."""
self.system[addon.slug] = deepcopy(addon.data) self.system[addon.slug] = deepcopy(addon.data)
self.user[addon.slug].update( self.user[addon.slug].update(
{ATTR_VERSION: addon.version, ATTR_IMAGE: addon.image} {ATTR_VERSION: addon.version, ATTR_IMAGE: addon.image}
) )
self.save_data() await self.save_data()
def restore(self, slug: str, user: Config, system: Config, image: str) -> None: async def restore(
self, slug: str, user: Config, system: Config, image: str
) -> None:
"""Restore data to add-on.""" """Restore data to add-on."""
self.user[slug] = deepcopy(user) self.user[slug] = deepcopy(user)
self.system[slug] = deepcopy(system) self.system[slug] = deepcopy(system)
self.user[slug][ATTR_IMAGE] = image self.user[slug][ATTR_IMAGE] = image
self.save_data() await self.save_data()

View File

@@ -0,0 +1,411 @@
"""Supervisor add-on manager."""
import asyncio
from collections.abc import Awaitable
from contextlib import suppress
import logging
import tarfile
from typing import Self, Union
from attr import evolve
from supervisor.jobs.const import JobConcurrency
from ..const import AddonBoot, AddonStartup, AddonState
from ..coresys import CoreSys, CoreSysAttributes
from ..exceptions import (
AddonsError,
AddonsJobError,
AddonsNotSupportedError,
CoreDNSError,
DockerError,
HassioError,
HomeAssistantAPIError,
)
from ..jobs.decorator import Job, JobCondition
from ..resolution.const import ContextType, IssueType, SuggestionType
from ..store.addon import AddonStore
from ..utils.sentry import async_capture_exception
from .addon import Addon
from .const import ADDON_UPDATE_CONDITIONS
from .data import AddonsData
_LOGGER: logging.Logger = logging.getLogger(__name__)
AnyAddon = Union[Addon, AddonStore]
class AddonManager(CoreSysAttributes):
"""Manage add-ons inside Supervisor."""
def __init__(self, coresys: CoreSys):
"""Initialize Docker base wrapper."""
self.coresys: CoreSys = coresys
self.data: AddonsData = AddonsData(coresys)
self.local: dict[str, Addon] = {}
self.store: dict[str, AddonStore] = {}
@property
def all(self) -> list[AnyAddon]:
"""Return a list of all add-ons."""
addons: dict[str, AnyAddon] = {**self.store, **self.local}
return list(addons.values())
@property
def installed(self) -> list[Addon]:
"""Return a list of all installed add-ons."""
return list(self.local.values())
def get(self, addon_slug: str, local_only: bool = False) -> AnyAddon | None:
"""Return an add-on from slug.
Prio:
1 - Local
2 - Store
"""
if addon_slug in self.local:
return self.local[addon_slug]
if not local_only:
return self.store.get(addon_slug)
return None
def get_local_only(self, addon_slug: str) -> Addon | None:
"""Return an installed add-on from slug."""
return self.local.get(addon_slug)
def from_token(self, token: str) -> Addon | None:
"""Return an add-on from Supervisor token."""
for addon in self.installed:
if token == addon.supervisor_token:
return addon
return None
async def load_config(self) -> Self:
"""Load config in executor."""
await self.data.read_data()
return self
async def load(self) -> None:
"""Start up add-on management."""
# Refresh cache for all store addons
tasks: list[Awaitable[None]] = [
store.refresh_path_cache() for store in self.store.values()
]
# Load all installed addons
for slug in self.data.system:
addon = self.local[slug] = Addon(self.coresys, slug)
tasks.append(addon.load())
# Run initial tasks
_LOGGER.info("Found %d installed add-ons", len(self.data.system))
if tasks:
await asyncio.gather(*tasks)
# Sync DNS
await self.sync_dns()
async def boot(self, stage: AddonStartup) -> None:
"""Boot add-ons with mode auto."""
tasks: list[Addon] = []
for addon in self.installed:
if addon.boot != AddonBoot.AUTO or addon.startup != stage:
continue
tasks.append(addon)
# Evaluate add-ons which need to be started
_LOGGER.info("Phase '%s' starting %d add-ons", stage, len(tasks))
if not tasks:
return
# Start Add-ons sequential
# avoid issue on slow IO
# Config.wait_boot is deprecated. Until addons update with healthchecks,
# add a sleep task for it to keep the same minimum amount of wait time
wait_boot: list[Awaitable[None]] = [asyncio.sleep(self.sys_config.wait_boot)]
for addon in tasks:
try:
if start_task := await addon.start():
wait_boot.append(start_task)
except HassioError:
self.sys_resolution.add_issue(
evolve(addon.boot_failed_issue),
suggestions=[
SuggestionType.EXECUTE_START,
SuggestionType.DISABLE_BOOT,
],
)
else:
continue
_LOGGER.warning("Can't start Add-on %s", addon.slug)
# Ignore exceptions from waiting for addon startup, addon errors handled elsewhere
await asyncio.gather(*wait_boot, return_exceptions=True)
# After waiting for startup, create an issue for boot addons that are error or unknown state
# Ignore stopped as single shot addons can be run at boot and this is successful exit
# Timeout waiting for startup is not a failure, addon is probably just slow
for addon in tasks:
if addon.state in {AddonState.ERROR, AddonState.UNKNOWN}:
self.sys_resolution.add_issue(
evolve(addon.boot_failed_issue),
suggestions=[
SuggestionType.EXECUTE_START,
SuggestionType.DISABLE_BOOT,
],
)
async def shutdown(self, stage: AddonStartup) -> None:
"""Shutdown addons."""
tasks: list[Addon] = []
for addon in self.installed:
if addon.state != AddonState.STARTED or addon.startup != stage:
continue
tasks.append(addon)
# Evaluate add-ons which need to be stopped
_LOGGER.info("Phase '%s' stopping %d add-ons", stage, len(tasks))
if not tasks:
return
# Stop Add-ons sequential
# avoid issue on slow IO
for addon in tasks:
try:
await addon.stop()
except Exception as err: # pylint: disable=broad-except
_LOGGER.warning("Can't stop Add-on %s: %s", addon.slug, err)
await async_capture_exception(err)
@Job(
name="addon_manager_install",
conditions=ADDON_UPDATE_CONDITIONS,
on_condition=AddonsJobError,
concurrency=JobConcurrency.QUEUE,
)
async def install(self, slug: str) -> None:
"""Install an add-on."""
self.sys_jobs.current.reference = slug
if slug in self.local:
raise AddonsError(f"Add-on {slug} is already installed", _LOGGER.warning)
store = self.store.get(slug)
if not store:
raise AddonsError(f"Add-on {slug} does not exist", _LOGGER.error)
store.validate_availability()
await Addon(self.coresys, slug).install()
_LOGGER.info("Add-on '%s' successfully installed", slug)
@Job(name="addon_manager_uninstall")
async def uninstall(self, slug: str, *, remove_config: bool = False) -> None:
"""Remove an add-on."""
if slug not in self.local:
_LOGGER.warning("Add-on %s is not installed", slug)
return
shared_image = any(
self.local[slug].image == addon.image
and self.local[slug].version == addon.version
for addon in self.installed
if addon.slug != slug
)
await self.local[slug].uninstall(
remove_config=remove_config, remove_image=not shared_image
)
_LOGGER.info("Add-on '%s' successfully removed", slug)
@Job(
name="addon_manager_update",
conditions=ADDON_UPDATE_CONDITIONS,
on_condition=AddonsJobError,
)
async def update(
self, slug: str, backup: bool | None = False
) -> asyncio.Task | None:
"""Update add-on.
Returns a Task that completes when addon has state 'started' (see addon.start)
if addon is started after update. Else nothing is returned.
"""
self.sys_jobs.current.reference = slug
if slug not in self.local:
raise AddonsError(f"Add-on {slug} is not installed", _LOGGER.error)
addon = self.local[slug]
if addon.is_detached:
raise AddonsError(
f"Add-on {slug} is not available inside store", _LOGGER.error
)
store = self.store[slug]
if addon.version == store.version:
raise AddonsError(f"No update available for add-on {slug}", _LOGGER.warning)
# Check if available, Maybe something have changed
store.validate_availability()
if backup:
await self.sys_backups.do_backup_partial(
name=f"addon_{addon.slug}_{addon.version}",
homeassistant=False,
addons=[addon.slug],
)
return await addon.update()
@Job(
name="addon_manager_rebuild",
conditions=[
JobCondition.FREE_SPACE,
JobCondition.INTERNET_HOST,
JobCondition.HEALTHY,
],
on_condition=AddonsJobError,
)
async def rebuild(self, slug: str, *, force: bool = False) -> asyncio.Task | None:
"""Perform a rebuild of local build add-on.
Returns a Task that completes when addon has state 'started' (see addon.start)
if addon is started after rebuild. Else nothing is returned.
"""
self.sys_jobs.current.reference = slug
if slug not in self.local:
raise AddonsError(f"Add-on {slug} is not installed", _LOGGER.error)
addon = self.local[slug]
if addon.is_detached:
raise AddonsError(
f"Add-on {slug} is not available inside store", _LOGGER.error
)
store = self.store[slug]
# Check if a rebuild is possible now
if addon.version != store.version:
raise AddonsError(
"Version changed, use Update instead Rebuild", _LOGGER.error
)
if not force and not addon.need_build:
raise AddonsNotSupportedError(
"Can't rebuild a image based add-on", _LOGGER.error
)
return await addon.rebuild()
@Job(
name="addon_manager_restore",
conditions=[
JobCondition.FREE_SPACE,
JobCondition.INTERNET_HOST,
JobCondition.HEALTHY,
],
on_condition=AddonsJobError,
)
async def restore(
self, slug: str, tar_file: tarfile.TarFile
) -> asyncio.Task | None:
"""Restore state of an add-on.
Returns a Task that completes when addon has state 'started' (see addon.start)
if addon is started after restore. Else nothing is returned.
"""
self.sys_jobs.current.reference = slug
if slug not in self.local:
_LOGGER.debug("Add-on %s is not local available for restore", slug)
addon = Addon(self.coresys, slug)
had_ingress: bool | None = False
else:
_LOGGER.debug("Add-on %s is local available for restore", slug)
addon = self.local[slug]
had_ingress = addon.ingress_panel
wait_for_start = await addon.restore(tar_file)
# Check if new
if slug not in self.local:
_LOGGER.info("Detect new Add-on after restore %s", slug)
self.local[slug] = addon
# Update ingress
if had_ingress != addon.ingress_panel:
await self.sys_ingress.reload()
with suppress(HomeAssistantAPIError):
await self.sys_ingress.update_hass_panel(addon)
return wait_for_start
@Job(
name="addon_manager_repair",
conditions=[JobCondition.FREE_SPACE, JobCondition.INTERNET_HOST],
)
async def repair(self) -> None:
"""Repair local add-ons."""
needs_repair: list[Addon] = []
# Evaluate Add-ons to repair
for addon in self.installed:
if await addon.instance.exists():
continue
needs_repair.append(addon)
_LOGGER.info("Found %d add-ons to repair", len(needs_repair))
if not needs_repair:
return
for addon in needs_repair:
_LOGGER.info("Repairing for add-on: %s", addon.slug)
with suppress(DockerError, KeyError):
# Need pull a image again
if not addon.need_build:
await addon.instance.install(addon.version, addon.image)
continue
# Need local lookup
if addon.need_build and not addon.is_detached:
store = self.store[addon.slug]
# If this add-on is available for rebuild
if addon.version == store.version:
await addon.instance.install(addon.version, addon.image)
continue
_LOGGER.error("Can't repair %s", addon.slug)
with suppress(AddonsError):
await self.uninstall(addon.slug)
async def sync_dns(self) -> None:
"""Sync add-ons DNS names."""
# Update hosts
add_host_coros: list[Awaitable[None]] = []
for addon in self.installed:
try:
if not await addon.instance.is_running():
continue
except DockerError as err:
_LOGGER.warning("Add-on %s is corrupt: %s", addon.slug, err)
self.sys_resolution.create_issue(
IssueType.CORRUPT_DOCKER,
ContextType.ADDON,
reference=addon.slug,
suggestions=[SuggestionType.EXECUTE_REPAIR],
)
await async_capture_exception(err)
else:
add_host_coros.append(
self.sys_plugins.dns.add_host(
ipv4=addon.ip_address, names=[addon.hostname], write=False
)
)
await asyncio.gather(*add_host_coros)
# Write hosts files
with suppress(CoreDNSError):
await self.sys_plugins.dns.write_hosts()

View File

@@ -1,10 +1,17 @@
"""Init file for Supervisor add-ons.""" """Init file for Supervisor add-ons."""
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from collections import defaultdict
from collections.abc import Awaitable, Callable
from contextlib import suppress
from datetime import datetime
import logging
from pathlib import Path from pathlib import Path
from typing import Any, Awaitable, Dict, List, Optional from typing import Any
from awesomeversion import AwesomeVersion, AwesomeVersionException from awesomeversion import AwesomeVersion, AwesomeVersionException
import voluptuous as vol
from supervisor.utils.dt import utc_from_timestamp
from ..const import ( from ..const import (
ATTR_ADVANCED, ATTR_ADVANCED,
@@ -12,7 +19,9 @@ from ..const import (
ATTR_ARCH, ATTR_ARCH,
ATTR_AUDIO, ATTR_AUDIO,
ATTR_AUTH_API, ATTR_AUTH_API,
ATTR_AUTO_UART, ATTR_BACKUP_EXCLUDE,
ATTR_BACKUP_POST,
ATTR_BACKUP_PRE,
ATTR_BOOT, ATTR_BOOT,
ATTR_DESCRIPTON, ATTR_DESCRIPTON,
ATTR_DEVICES, ATTR_DEVICES,
@@ -30,12 +39,15 @@ from ..const import (
ATTR_HOST_IPC, ATTR_HOST_IPC,
ATTR_HOST_NETWORK, ATTR_HOST_NETWORK,
ATTR_HOST_PID, ATTR_HOST_PID,
ATTR_HOST_UTS,
ATTR_IMAGE, ATTR_IMAGE,
ATTR_INGRESS, ATTR_INGRESS,
ATTR_INGRESS_STREAM,
ATTR_INIT, ATTR_INIT,
ATTR_JOURNALD,
ATTR_KERNEL_MODULES, ATTR_KERNEL_MODULES,
ATTR_LEGACY, ATTR_LEGACY,
ATTR_LOCATON, ATTR_LOCATION,
ATTR_MACHINE, ATTR_MACHINE,
ATTR_MAP, ATTR_MAP,
ATTR_NAME, ATTR_NAME,
@@ -46,20 +58,24 @@ from ..const import (
ATTR_PORTS, ATTR_PORTS,
ATTR_PORTS_DESCRIPTION, ATTR_PORTS_DESCRIPTION,
ATTR_PRIVILEGED, ATTR_PRIVILEGED,
ATTR_REALTIME,
ATTR_REPOSITORY, ATTR_REPOSITORY,
ATTR_SCHEMA, ATTR_SCHEMA,
ATTR_SERVICES, ATTR_SERVICES,
ATTR_SLUG, ATTR_SLUG,
ATTR_SNAPSHOT_EXCLUDE,
ATTR_STAGE, ATTR_STAGE,
ATTR_STARTUP, ATTR_STARTUP,
ATTR_STDIN, ATTR_STDIN,
ATTR_TIMEOUT, ATTR_TIMEOUT,
ATTR_TMPFS, ATTR_TMPFS,
ATTR_TRANSLATIONS,
ATTR_TYPE,
ATTR_UART,
ATTR_UDEV, ATTR_UDEV,
ATTR_URL, ATTR_URL,
ATTR_USB, ATTR_USB,
ATTR_VERSION, ATTR_VERSION,
ATTR_VERSION_TIMESTAMP,
ATTR_VIDEO, ATTR_VIDEO,
ATTR_WATCHDOG, ATTR_WATCHDOG,
ATTR_WEBUI, ATTR_WEBUI,
@@ -67,22 +83,47 @@ from ..const import (
SECURITY_DISABLE, SECURITY_DISABLE,
SECURITY_PROFILE, SECURITY_PROFILE,
AddonBoot, AddonBoot,
AddonBootConfig,
AddonStage, AddonStage,
AddonStartup, AddonStartup,
) )
from ..coresys import CoreSys, CoreSysAttributes from ..coresys import CoreSys
from .validate import RE_SERVICE, RE_VOLUME, schema_ui_options, validate_options from ..docker.const import Capabilities
from ..exceptions import AddonsNotSupportedError
from ..jobs.const import JOB_GROUP_ADDON
from ..jobs.job_group import JobGroup
from ..utils import version_is_new_enough
from .configuration import FolderMapping
from .const import (
ATTR_BACKUP,
ATTR_BREAKING_VERSIONS,
ATTR_CODENOTARY,
ATTR_PATH,
ATTR_READ_ONLY,
AddonBackupMode,
MappingType,
)
from .options import AddonOptions, UiOptions
from .validate import RE_SERVICE
Data = Dict[str, Any] _LOGGER: logging.Logger = logging.getLogger(__name__)
Data = dict[str, Any]
class AddonModel(CoreSysAttributes, ABC): class AddonModel(JobGroup, ABC):
"""Add-on Data layout.""" """Add-on Data layout."""
def __init__(self, coresys: CoreSys, slug: str): def __init__(self, coresys: CoreSys, slug: str):
"""Initialize data holder.""" """Initialize data holder."""
self.coresys: CoreSys = coresys super().__init__(
coresys, JOB_GROUP_ADDON.format_map(defaultdict(str, slug=slug)), slug
)
self.slug: str = slug self.slug: str = slug
self._path_icon_exists: bool = False
self._path_logo_exists: bool = False
self._path_changelog_exists: bool = False
self._path_documentation_exists: bool = False
@property @property
@abstractmethod @abstractmethod
@@ -105,17 +146,22 @@ class AddonModel(CoreSysAttributes, ABC):
return self._available(self.data) return self._available(self.data)
@property @property
def options(self) -> Dict[str, Any]: def options(self) -> dict[str, Any]:
"""Return options with local changes.""" """Return options with local changes."""
return self.data[ATTR_OPTIONS] return self.data[ATTR_OPTIONS]
@property @property
def boot(self) -> AddonBoot: def boot_config(self) -> AddonBootConfig:
"""Return boot config with prio local settings.""" """Return boot config."""
return self.data[ATTR_BOOT] return self.data[ATTR_BOOT]
@property @property
def auto_update(self) -> Optional[bool]: def boot(self) -> AddonBoot:
"""Return boot config with prio local settings unless config is forced."""
return AddonBoot(self.data[ATTR_BOOT])
@property
def auto_update(self) -> bool | None:
"""Return if auto update is enable.""" """Return if auto update is enable."""
return None return None
@@ -130,7 +176,7 @@ class AddonModel(CoreSysAttributes, ABC):
return self.slug.replace("_", "-") return self.slug.replace("_", "-")
@property @property
def dns(self) -> List[str]: def dns(self) -> list[str]:
"""Return list of DNS name for that add-on.""" """Return list of DNS name for that add-on."""
return [] return []
@@ -140,22 +186,22 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_TIMEOUT] return self.data[ATTR_TIMEOUT]
@property @property
def uuid(self) -> Optional[str]: def uuid(self) -> str | None:
"""Return an API token for this add-on.""" """Return an API token for this add-on."""
return None return None
@property @property
def supervisor_token(self) -> Optional[str]: def supervisor_token(self) -> str | None:
"""Return access token for Supervisor API.""" """Return access token for Supervisor API."""
return None return None
@property @property
def ingress_token(self) -> Optional[str]: def ingress_token(self) -> str | None:
"""Return access token for Supervisor API.""" """Return access token for Supervisor API."""
return None return None
@property @property
def ingress_entry(self) -> Optional[str]: def ingress_entry(self) -> str | None:
"""Return ingress external URL.""" """Return ingress external URL."""
return None return None
@@ -164,29 +210,26 @@ class AddonModel(CoreSysAttributes, ABC):
"""Return description of add-on.""" """Return description of add-on."""
return self.data[ATTR_DESCRIPTON] return self.data[ATTR_DESCRIPTON]
@property
def long_description(self) -> Optional[str]:
"""Return README.md as long_description."""
readme = Path(self.path_location, "README.md")
# If readme not exists
if not readme.exists():
return None
# Return data
with readme.open("r") as readme_file:
return readme_file.read()
@property @property
def repository(self) -> str: def repository(self) -> str:
"""Return repository of add-on.""" """Return repository of add-on."""
return self.data[ATTR_REPOSITORY] return self.data[ATTR_REPOSITORY]
@property
def translations(self) -> dict:
"""Return add-on translations."""
return self.data[ATTR_TRANSLATIONS]
@property @property
def latest_version(self) -> AwesomeVersion: def latest_version(self) -> AwesomeVersion:
"""Return latest version of add-on.""" """Return latest version of add-on."""
return self.data[ATTR_VERSION] return self.data[ATTR_VERSION]
@property
def latest_version_timestamp(self) -> datetime:
"""Return when latest version was first seen."""
return utc_from_timestamp(self.data[ATTR_VERSION_TIMESTAMP])
@property @property
def version(self) -> AwesomeVersion: def version(self) -> AwesomeVersion:
"""Return version of add-on.""" """Return version of add-on."""
@@ -213,7 +256,7 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_STAGE] return self.data[ATTR_STAGE]
@property @property
def services_role(self) -> Dict[str, str]: def services_role(self) -> dict[str, str]:
"""Return dict of services with rights.""" """Return dict of services with rights."""
services_list = self.data.get(ATTR_SERVICES, []) services_list = self.data.get(ATTR_SERVICES, [])
@@ -226,37 +269,37 @@ class AddonModel(CoreSysAttributes, ABC):
return services return services
@property @property
def discovery(self) -> List[str]: def discovery(self) -> list[str]:
"""Return list of discoverable components/platforms.""" """Return list of discoverable components/platforms."""
return self.data.get(ATTR_DISCOVERY, []) return self.data.get(ATTR_DISCOVERY, [])
@property @property
def ports_description(self) -> Optional[Dict[str, str]]: def ports_description(self) -> dict[str, str] | None:
"""Return descriptions of ports.""" """Return descriptions of ports."""
return self.data.get(ATTR_PORTS_DESCRIPTION) return self.data.get(ATTR_PORTS_DESCRIPTION)
@property @property
def ports(self) -> Optional[Dict[str, Optional[int]]]: def ports(self) -> dict[str, int | None] | None:
"""Return ports of add-on.""" """Return ports of add-on."""
return self.data.get(ATTR_PORTS) return self.data.get(ATTR_PORTS)
@property @property
def ingress_url(self) -> Optional[str]: def ingress_url(self) -> str | None:
"""Return URL to ingress url.""" """Return URL to ingress url."""
return None return None
@property @property
def webui(self) -> Optional[str]: def webui(self) -> str | None:
"""Return URL to webui or None.""" """Return URL to webui or None."""
return self.data.get(ATTR_WEBUI) return self.data.get(ATTR_WEBUI)
@property @property
def watchdog(self) -> Optional[str]: def watchdog_url(self) -> str | None:
"""Return URL to for watchdog or None.""" """Return URL to for watchdog or None."""
return self.data.get(ATTR_WATCHDOG) return self.data.get(ATTR_WATCHDOG)
@property @property
def ingress_port(self) -> Optional[int]: def ingress_port(self) -> int | None:
"""Return Ingress port.""" """Return Ingress port."""
return None return None
@@ -290,28 +333,28 @@ class AddonModel(CoreSysAttributes, ABC):
"""Return True if add-on run on host IPC namespace.""" """Return True if add-on run on host IPC namespace."""
return self.data[ATTR_HOST_IPC] return self.data[ATTR_HOST_IPC]
@property
def host_uts(self) -> bool:
"""Return True if add-on run on host UTS namespace."""
return self.data[ATTR_HOST_UTS]
@property @property
def host_dbus(self) -> bool: def host_dbus(self) -> bool:
"""Return True if add-on run on host D-BUS.""" """Return True if add-on run on host D-BUS."""
return self.data[ATTR_HOST_DBUS] return self.data[ATTR_HOST_DBUS]
@property @property
def devices(self) -> List[str]: def static_devices(self) -> list[Path]:
"""Return devices of add-on.""" """Return static devices of add-on."""
return self.data.get(ATTR_DEVICES, []) return [Path(node) for node in self.data.get(ATTR_DEVICES, [])]
@property @property
def tmpfs(self) -> Optional[str]: def environment(self) -> dict[str, str] | None:
"""Return tmpfs of add-on."""
return self.data.get(ATTR_TMPFS)
@property
def environment(self) -> Optional[Dict[str, str]]:
"""Return environment of add-on.""" """Return environment of add-on."""
return self.data.get(ATTR_ENVIRONMENT) return self.data.get(ATTR_ENVIRONMENT)
@property @property
def privileged(self) -> List[str]: def privileged(self) -> list[Capabilities]:
"""Return list of privilege.""" """Return list of privilege."""
return self.data.get(ATTR_PRIVILEGED, []) return self.data.get(ATTR_PRIVILEGED, [])
@@ -350,9 +393,24 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_HASSIO_ROLE] return self.data[ATTR_HASSIO_ROLE]
@property @property
def snapshot_exclude(self) -> List[str]: def backup_exclude(self) -> list[str]:
"""Return Exclude list for snapshot.""" """Return Exclude list for backup."""
return self.data.get(ATTR_SNAPSHOT_EXCLUDE, []) return self.data.get(ATTR_BACKUP_EXCLUDE, [])
@property
def backup_pre(self) -> str | None:
"""Return pre-backup command."""
return self.data.get(ATTR_BACKUP_PRE)
@property
def backup_post(self) -> str | None:
"""Return post-backup command."""
return self.data.get(ATTR_BACKUP_POST)
@property
def backup_mode(self) -> AddonBackupMode:
"""Return if backup is hot/cold."""
return self.data[ATTR_BACKUP]
@property @property
def default_init(self) -> bool: def default_init(self) -> bool:
@@ -370,10 +428,15 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_INGRESS] return self.data[ATTR_INGRESS]
@property @property
def ingress_panel(self) -> Optional[bool]: def ingress_panel(self) -> bool | None:
"""Return True if the add-on access support ingress.""" """Return True if the add-on access support ingress."""
return None return None
@property
def ingress_stream(self) -> bool:
"""Return True if post requests to ingress should be streamed."""
return self.data[ATTR_INGRESS_STREAM]
@property @property
def with_gpio(self) -> bool: def with_gpio(self) -> bool:
"""Return True if the add-on access to GPIO interface.""" """Return True if the add-on access to GPIO interface."""
@@ -387,7 +450,7 @@ class AddonModel(CoreSysAttributes, ABC):
@property @property
def with_uart(self) -> bool: def with_uart(self) -> bool:
"""Return True if we should map all UART device.""" """Return True if we should map all UART device."""
return self.data[ATTR_AUTO_UART] return self.data[ATTR_UART]
@property @property
def with_udev(self) -> bool: def with_udev(self) -> bool:
@@ -399,6 +462,11 @@ class AddonModel(CoreSysAttributes, ABC):
"""Return True if the add-on access to kernel modules.""" """Return True if the add-on access to kernel modules."""
return self.data[ATTR_KERNEL_MODULES] return self.data[ATTR_KERNEL_MODULES]
@property
def with_realtime(self) -> bool:
"""Return True if the add-on need realtime schedule functions."""
return self.data[ATTR_REALTIME]
@property @property
def with_full_access(self) -> bool: def with_full_access(self) -> bool:
"""Return True if the add-on want full access to hardware.""" """Return True if the add-on want full access to hardware."""
@@ -409,6 +477,11 @@ class AddonModel(CoreSysAttributes, ABC):
"""Return True if the add-on read access to devicetree.""" """Return True if the add-on read access to devicetree."""
return self.data[ATTR_DEVICETREE] return self.data[ATTR_DEVICETREE]
@property
def with_tmpfs(self) -> str | None:
"""Return if tmp is in memory of add-on."""
return self.data[ATTR_TMPFS]
@property @property
def access_auth_api(self) -> bool: def access_auth_api(self) -> bool:
"""Return True if the add-on access to login/auth backend.""" """Return True if the add-on access to login/auth backend."""
@@ -425,47 +498,55 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_VIDEO] return self.data[ATTR_VIDEO]
@property @property
def homeassistant_version(self) -> Optional[str]: def homeassistant_version(self) -> str | None:
"""Return min Home Assistant version they needed by Add-on.""" """Return min Home Assistant version they needed by Add-on."""
return self.data.get(ATTR_HOMEASSISTANT) return self.data.get(ATTR_HOMEASSISTANT)
@property @property
def url(self) -> Optional[str]: def url(self) -> str | None:
"""Return URL of add-on.""" """Return URL of add-on."""
return self.data.get(ATTR_URL) return self.data.get(ATTR_URL)
@property @property
def with_icon(self) -> bool: def with_icon(self) -> bool:
"""Return True if an icon exists.""" """Return True if an icon exists."""
return self.path_icon.exists() return self._path_icon_exists
@property @property
def with_logo(self) -> bool: def with_logo(self) -> bool:
"""Return True if a logo exists.""" """Return True if a logo exists."""
return self.path_logo.exists() return self._path_logo_exists
@property @property
def with_changelog(self) -> bool: def with_changelog(self) -> bool:
"""Return True if a changelog exists.""" """Return True if a changelog exists."""
return self.path_changelog.exists() return self._path_changelog_exists
@property @property
def with_documentation(self) -> bool: def with_documentation(self) -> bool:
"""Return True if a documentation exists.""" """Return True if a documentation exists."""
return self.path_documentation.exists() return self._path_documentation_exists
@property @property
def supported_arch(self) -> List[str]: def supported_arch(self) -> list[str]:
"""Return list of supported arch.""" """Return list of supported arch."""
return self.data[ATTR_ARCH] return self.data[ATTR_ARCH]
@property @property
def supported_machine(self) -> List[str]: def supported_machine(self) -> list[str]:
"""Return list of supported machine.""" """Return list of supported machine."""
return self.data.get(ATTR_MACHINE, []) return self.data.get(ATTR_MACHINE, [])
@property @property
def image(self) -> Optional[str]: def arch(self) -> str:
"""Return architecture to use for the addon's image."""
if ATTR_IMAGE in self.data:
return self.sys_arch.match(self.data[ATTR_ARCH])
return self.sys_arch.default
@property
def image(self) -> str | None:
"""Generate image name from data.""" """Generate image name from data."""
return self._image(self.data) return self._image(self.data)
@@ -475,21 +556,20 @@ class AddonModel(CoreSysAttributes, ABC):
return ATTR_IMAGE not in self.data return ATTR_IMAGE not in self.data
@property @property
def map_volumes(self) -> Dict[str, str]: def map_volumes(self) -> dict[MappingType, FolderMapping]:
"""Return a dict of {volume: policy} from add-on.""" """Return a dict of {MappingType: FolderMapping} from add-on."""
volumes = {} volumes = {}
for volume in self.data[ATTR_MAP]: for volume in self.data[ATTR_MAP]:
result = RE_VOLUME.match(volume) volumes[MappingType(volume[ATTR_TYPE])] = FolderMapping(
if not result: volume.get(ATTR_PATH), volume[ATTR_READ_ONLY]
continue )
volumes[result.group(1)] = result.group(2) or "ro"
return volumes return volumes
@property @property
def path_location(self) -> Path: def path_location(self) -> Path:
"""Return path to this add-on.""" """Return path to this add-on."""
return Path(self.data[ATTR_LOCATON]) return Path(self.data[ATTR_LOCATION])
@property @property
def path_icon(self) -> Path: def path_icon(self) -> Path:
@@ -517,48 +597,123 @@ class AddonModel(CoreSysAttributes, ABC):
return Path(self.path_location, "apparmor.txt") return Path(self.path_location, "apparmor.txt")
@property @property
def schema(self) -> vol.Schema: def schema(self) -> AddonOptions:
"""Create a schema for add-on options.""" """Return Addon options validation object."""
raw_schema = self.data[ATTR_SCHEMA] raw_schema = self.data[ATTR_SCHEMA]
if isinstance(raw_schema, bool): if isinstance(raw_schema, bool):
return vol.Schema(dict) raw_schema = {}
return vol.Schema(vol.All(dict, validate_options(self.coresys, raw_schema)))
return AddonOptions(self.coresys, raw_schema, self.name, self.slug)
@property @property
def schema_ui(self) -> Optional[List[Dict[str, Any]]]: def schema_ui(self) -> list[dict[Any, Any]] | None:
"""Create a UI schema for add-on options.""" """Create a UI schema for add-on options."""
raw_schema = self.data[ATTR_SCHEMA] raw_schema = self.data[ATTR_SCHEMA]
if isinstance(raw_schema, bool): if isinstance(raw_schema, bool):
return None return None
return schema_ui_options(raw_schema) return UiOptions(self.coresys)(raw_schema)
def __eq__(self, other): @property
"""Compaired add-on objects.""" def with_journald(self) -> bool:
"""Return True if the add-on accesses the system journal."""
return self.data[ATTR_JOURNALD]
@property
def signed(self) -> bool:
"""Return True if the image is signed."""
return ATTR_CODENOTARY in self.data
@property
def codenotary(self) -> str | None:
"""Return Signer email address for CAS."""
return self.data.get(ATTR_CODENOTARY)
@property
def breaking_versions(self) -> list[AwesomeVersion]:
"""Return breaking versions of addon."""
return self.data[ATTR_BREAKING_VERSIONS]
async def long_description(self) -> str | None:
"""Return README.md as long_description."""
def read_readme() -> str | None:
readme = Path(self.path_location, "README.md")
# If readme not exists
if not readme.exists():
return None
# Return data
return readme.read_text(encoding="utf-8", errors="replace")
return await self.sys_run_in_executor(read_readme)
def refresh_path_cache(self) -> Awaitable[None]:
"""Refresh cache of existing paths."""
def check_paths():
self._path_icon_exists = self.path_icon.exists()
self._path_logo_exists = self.path_logo.exists()
self._path_changelog_exists = self.path_changelog.exists()
self._path_documentation_exists = self.path_documentation.exists()
return self.sys_run_in_executor(check_paths)
def validate_availability(self) -> None:
"""Validate if addon is available for current system."""
return self._validate_availability(self.data, logger=_LOGGER.error)
def __eq__(self, other: Any) -> bool:
"""Compare add-on objects."""
if not isinstance(other, AddonModel): if not isinstance(other, AddonModel):
return False return False
return self.slug == other.slug return self.slug == other.slug
def _available(self, config) -> bool: def __hash__(self) -> int:
"""Return True if this add-on is available on this platform.""" """Hash for add-on objects."""
return hash(self.slug)
def _validate_availability(
self, config, *, logger: Callable[..., None] | None = None
) -> None:
"""Validate if addon is available for current system."""
# Architecture # Architecture
if not self.sys_arch.is_supported(config[ATTR_ARCH]): if not self.sys_arch.is_supported(config[ATTR_ARCH]):
return False raise AddonsNotSupportedError(
f"Add-on {self.slug} not supported on this platform, supported architectures: {', '.join(config[ATTR_ARCH])}",
logger,
)
# Machine / Hardware # Machine / Hardware
machine = config.get(ATTR_MACHINE) machine = config.get(ATTR_MACHINE)
if machine and f"!{self.sys_machine}" in machine: if machine and (
return False f"!{self.sys_machine}" in machine or self.sys_machine not in machine
elif machine and self.sys_machine not in machine: ):
return False raise AddonsNotSupportedError(
f"Add-on {self.slug} not supported on this machine, supported machine types: {', '.join(machine)}",
logger,
)
# Home Assistant # Home Assistant
version: Optional[AwesomeVersion] = config.get(ATTR_HOMEASSISTANT) version: AwesomeVersion | None = config.get(ATTR_HOMEASSISTANT)
with suppress(AwesomeVersionException, TypeError):
if version and not version_is_new_enough(
self.sys_homeassistant.version, version
):
raise AddonsNotSupportedError(
f"Add-on {self.slug} not supported on this system, requires Home Assistant version {version} or greater",
logger,
)
def _available(self, config) -> bool:
"""Return True if this add-on is available on this platform."""
try: try:
return self.sys_homeassistant.version >= version self._validate_availability(config)
except (AwesomeVersionException, TypeError): except AddonsNotSupportedError:
return True return False
return True
def _image(self, config) -> str: def _image(self, config) -> str:
"""Generate image name from data.""" """Generate image name from data."""
@@ -569,19 +724,3 @@ class AddonModel(CoreSysAttributes, ABC):
# local build # local build
return f"{config[ATTR_REPOSITORY]}/{self.sys_arch.default}-addon-{config[ATTR_SLUG]}" return f"{config[ATTR_REPOSITORY]}/{self.sys_arch.default}-addon-{config[ATTR_SLUG]}"
def install(self) -> Awaitable[None]:
"""Install this add-on."""
return self.sys_addons.install(self.slug)
def uninstall(self) -> Awaitable[None]:
"""Uninstall this add-on."""
return self.sys_addons.uninstall(self.slug)
def update(self) -> Awaitable[None]:
"""Update this add-on."""
return self.sys_addons.update(self.slug)
def rebuild(self) -> Awaitable[None]:
"""Rebuild this add-on."""
return self.sys_addons.rebuild(self.slug)

View File

@@ -0,0 +1,423 @@
"""Add-on Options / UI rendering."""
import hashlib
import logging
from pathlib import Path
import re
from typing import Any
import voluptuous as vol
from ..coresys import CoreSys, CoreSysAttributes
from ..exceptions import HardwareNotFound
from ..hardware.const import UdevSubsystem
from ..hardware.data import Device
from ..validate import network_port
_LOGGER: logging.Logger = logging.getLogger(__name__)
_STR = "str"
_INT = "int"
_FLOAT = "float"
_BOOL = "bool"
_PASSWORD = "password"
_EMAIL = "email"
_URL = "url"
_PORT = "port"
_MATCH = "match"
_LIST = "list"
_DEVICE = "device"
RE_SCHEMA_ELEMENT = re.compile(
r"^(?:"
r"|bool"
r"|email"
r"|url"
r"|port"
r"|device(?:\((?P<filter>subsystem=[a-z]+)\))?"
r"|str(?:\((?P<s_min>\d+)?,(?P<s_max>\d+)?\))?"
r"|password(?:\((?P<p_min>\d+)?,(?P<p_max>\d+)?\))?"
r"|int(?:\((?P<i_min>\d+)?,(?P<i_max>\d+)?\))?"
r"|float(?:\((?P<f_min>[\d\.]+)?,(?P<f_max>[\d\.]+)?\))?"
r"|match\((?P<match>.*)\)"
r"|list\((?P<list>.+)\)"
r")\??$"
)
_SCHEMA_LENGTH_PARTS = (
"i_min",
"i_max",
"f_min",
"f_max",
"s_min",
"s_max",
"p_min",
"p_max",
)
class AddonOptions(CoreSysAttributes):
"""Validate Add-ons Options."""
def __init__(
self, coresys: CoreSys, raw_schema: dict[str, Any], name: str, slug: str
):
"""Validate schema."""
self.coresys: CoreSys = coresys
self.raw_schema: dict[str, Any] = raw_schema
self.devices: set[Device] = set()
self.pwned: set[str] = set()
self._name = name
self._slug = slug
@property
def validate(self) -> vol.Schema:
"""Create a schema for add-on options."""
return vol.Schema(vol.All(dict, self))
def __call__(self, struct):
"""Create schema validator for add-ons options."""
options = {}
# read options
for key, value in struct.items():
# Ignore unknown options / remove from list
if key not in self.raw_schema:
_LOGGER.warning(
"Option '%s' does not exist in the schema for %s (%s)",
key,
self._name,
self._slug,
)
continue
typ = self.raw_schema[key]
try:
if isinstance(typ, list):
# nested value list
options[key] = self._nested_validate_list(typ[0], value, key)
elif isinstance(typ, dict):
# nested value dict
options[key] = self._nested_validate_dict(typ, value, key)
else:
# normal value
options[key] = self._single_validate(typ, value, key)
except (IndexError, KeyError):
raise vol.Invalid(
f"Type error for option '{key}' in {self._name} ({self._slug})"
) from None
self._check_missing_options(self.raw_schema, options, "root")
return options
# pylint: disable=no-value-for-parameter
def _single_validate(self, typ: str, value: Any, key: str):
"""Validate a single element."""
# if required argument
if value is None:
raise vol.Invalid(
f"Missing required option '{key}' in {self._name} ({self._slug})"
) from None
# Lookup secret
if str(value).startswith("!secret "):
secret: str = value.partition(" ")[2]
value = self.sys_homeassistant.secrets.get(secret)
if value is None:
raise vol.Invalid(
f"Unknown secret '{secret}' in {self._name} ({self._slug})"
) from None
# parse extend data from type
match = RE_SCHEMA_ELEMENT.match(typ)
if not match:
raise vol.Invalid(
f"Unknown type '{typ}' in {self._name} ({self._slug})"
) from None
# prepare range
range_args: dict[str, Any] = {}
for group_name in _SCHEMA_LENGTH_PARTS:
group_value = match.group(group_name)
if group_value:
range_args[group_name[2:]] = float(group_value)
if typ.startswith(_STR) or typ.startswith(_PASSWORD):
if typ.startswith(_PASSWORD) and value:
self.pwned.add(hashlib.sha1(str(value).encode()).hexdigest())
return vol.All(str(value), vol.Range(**range_args))(value)
elif typ.startswith(_INT):
return vol.All(vol.Coerce(int), vol.Range(**range_args))(value)
elif typ.startswith(_FLOAT):
return vol.All(vol.Coerce(float), vol.Range(**range_args))(value)
elif typ.startswith(_BOOL):
return vol.Boolean()(value)
elif typ.startswith(_EMAIL):
return vol.Email()(value)
elif typ.startswith(_URL):
return vol.Url()(value)
elif typ.startswith(_PORT):
return network_port(value)
elif typ.startswith(_MATCH):
return vol.Match(match.group("match"))(str(value))
elif typ.startswith(_LIST):
return vol.In(match.group("list").split("|"))(str(value))
elif typ.startswith(_DEVICE):
try:
device = self.sys_hardware.get_by_path(Path(value))
except HardwareNotFound:
raise vol.Invalid(
f"Device '{value}' does not exist in {self._name} ({self._slug})"
) from None
# Have filter
if match.group("filter"):
str_filter = match.group("filter")
device_filter = _create_device_filter(str_filter)
if device not in self.sys_hardware.filter_devices(**device_filter):
raise vol.Invalid(
f"Device '{value}' don't match the filter {str_filter}! in {self._name} ({self._slug})"
)
# Device valid
self.devices.add(device)
return str(device.path)
raise vol.Invalid(
f"Fatal error for option '{key}' with type '{typ}' in {self._name} ({self._slug})"
) from None
def _nested_validate_list(self, typ: Any, data_list: list[Any], key: str):
"""Validate nested items."""
options = []
# Make sure it is a list
if not isinstance(data_list, list):
raise vol.Invalid(
f"Invalid list for option '{key}' in {self._name} ({self._slug})"
) from None
# Process list
for element in data_list:
# Nested?
if isinstance(typ, dict):
c_options = self._nested_validate_dict(typ, element, key)
options.append(c_options)
else:
options.append(self._single_validate(typ, element, key))
return options
def _nested_validate_dict(
self, typ: dict[Any, Any], data_dict: dict[Any, Any], key: str
):
"""Validate nested items."""
options = {}
# Make sure it is a dict
if not isinstance(data_dict, dict):
raise vol.Invalid(
f"Invalid dict for option '{key}' in {self._name} ({self._slug})"
) from None
# Process dict
for c_key, c_value in data_dict.items():
# Ignore unknown options / remove from list
if c_key not in typ:
_LOGGER.warning(
"Unknown option '%s' for %s (%s)", c_key, self._name, self._slug
)
continue
# Nested?
if isinstance(typ[c_key], list):
options[c_key] = self._nested_validate_list(
typ[c_key][0], c_value, c_key
)
else:
options[c_key] = self._single_validate(typ[c_key], c_value, c_key)
self._check_missing_options(typ, options, key)
return options
def _check_missing_options(
self, origin: dict[Any, Any], exists: dict[Any, Any], root: str
) -> None:
"""Check if all options are exists."""
missing = set(origin) - set(exists)
for miss_opt in missing:
miss_schema = origin[miss_opt]
# If its a list then value in list decides if its optional like ["str?"]
if isinstance(miss_schema, list) and len(miss_schema) > 0:
miss_schema = miss_schema[0]
if isinstance(miss_schema, str) and miss_schema.endswith("?"):
continue
raise vol.Invalid(
f"Missing option '{miss_opt}' in {root} in {self._name} ({self._slug})"
) from None
class UiOptions(CoreSysAttributes):
"""Render UI Add-ons Options."""
def __init__(self, coresys: CoreSys) -> None:
"""Initialize UI option render."""
self.coresys = coresys
def __call__(self, raw_schema: dict[str, Any]) -> list[dict[str, Any]]:
"""Generate UI schema."""
ui_schema: list[dict[str, Any]] = []
# read options
for key, value in raw_schema.items():
if isinstance(value, list):
# nested value list
self._nested_ui_list(ui_schema, value, key)
elif isinstance(value, dict):
# nested value dict
self._nested_ui_dict(ui_schema, value, key)
else:
# normal value
self._single_ui_option(ui_schema, value, key)
return ui_schema
def _single_ui_option(
self,
ui_schema: list[dict[str, Any]],
value: str,
key: str,
multiple: bool = False,
) -> None:
"""Validate a single element."""
ui_node: dict[str, str | bool | float | list[str]] = {"name": key}
# If multiple
if multiple:
ui_node["multiple"] = True
# Parse extend data from type
match = RE_SCHEMA_ELEMENT.match(value)
if not match:
return
# Prepare range
for group_name in _SCHEMA_LENGTH_PARTS:
group_value = match.group(group_name)
if not group_value:
continue
if group_name[2:] == "min":
ui_node["lengthMin"] = float(group_value)
elif group_name[2:] == "max":
ui_node["lengthMax"] = float(group_value)
# If required
if value.endswith("?"):
ui_node["optional"] = True
else:
ui_node["required"] = True
# Data types
if value.startswith(_STR):
ui_node["type"] = "string"
elif value.startswith(_PASSWORD):
ui_node["type"] = "string"
ui_node["format"] = "password"
elif value.startswith(_INT):
ui_node["type"] = "integer"
elif value.startswith(_FLOAT):
ui_node["type"] = "float"
elif value.startswith(_BOOL):
ui_node["type"] = "boolean"
elif value.startswith(_EMAIL):
ui_node["type"] = "string"
ui_node["format"] = "email"
elif value.startswith(_URL):
ui_node["type"] = "string"
ui_node["format"] = "url"
elif value.startswith(_PORT):
ui_node["type"] = "integer"
elif value.startswith(_MATCH):
ui_node["type"] = "string"
elif value.startswith(_LIST):
ui_node["type"] = "select"
ui_node["options"] = match.group("list").split("|")
elif value.startswith(_DEVICE):
ui_node["type"] = "select"
# Have filter
if match.group("filter"):
device_filter = _create_device_filter(match.group("filter"))
ui_node["options"] = [
(device.by_id or device.path).as_posix()
for device in self.sys_hardware.filter_devices(**device_filter)
]
else:
ui_node["options"] = [
(device.by_id or device.path).as_posix()
for device in self.sys_hardware.devices
]
ui_schema.append(ui_node)
def _nested_ui_list(
self,
ui_schema: list[dict[str, Any]],
option_list: list[Any],
key: str,
) -> None:
"""UI nested list items."""
try:
element = option_list[0]
except IndexError:
_LOGGER.error("Invalid schema %s", key)
return
if isinstance(element, dict):
self._nested_ui_dict(ui_schema, element, key, multiple=True)
else:
self._single_ui_option(ui_schema, element, key, multiple=True)
def _nested_ui_dict(
self,
ui_schema: list[dict[str, Any]],
option_dict: dict[str, Any],
key: str,
multiple: bool = False,
) -> None:
"""UI nested dict items."""
ui_node: dict[str, Any] = {
"name": key,
"type": "schema",
"optional": True,
"multiple": multiple,
}
nested_schema: list[dict[str, Any]] = []
for c_key, c_value in option_dict.items():
# Nested?
if isinstance(c_value, list):
self._nested_ui_list(nested_schema, c_value, c_key)
else:
self._single_ui_option(nested_schema, c_value, c_key)
ui_node["schema"] = nested_schema
ui_schema.append(ui_node)
def _create_device_filter(str_filter: str) -> dict[str, Any]:
"""Generate device Filter."""
raw_filter = dict(value.split("=") for value in str_filter.split(";"))
clean_filter: dict[str, Any] = {}
for key, value in raw_filter.items():
if key == "subsystem":
clean_filter[key] = UdevSubsystem(value)
else:
clean_filter[key] = value
return clean_filter

View File

@@ -1,23 +1,14 @@
"""Util add-ons functions.""" """Util add-ons functions."""
from __future__ import annotations from __future__ import annotations
import asyncio
import logging import logging
from pathlib import Path from pathlib import Path
import subprocess
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from ..const import ( from ..const import ROLE_ADMIN, ROLE_MANAGER, SECURITY_DISABLE, SECURITY_PROFILE
PRIVILEGED_DAC_READ_SEARCH, from ..docker.const import Capabilities
PRIVILEGED_NET_ADMIN,
PRIVILEGED_SYS_ADMIN,
PRIVILEGED_SYS_MODULE,
PRIVILEGED_SYS_PTRACE,
PRIVILEGED_SYS_RAWIO,
ROLE_ADMIN,
ROLE_MANAGER,
SECURITY_DISABLE,
SECURITY_PROFILE,
)
if TYPE_CHECKING: if TYPE_CHECKING:
from .model import AddonModel from .model import AddonModel
@@ -26,10 +17,10 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
def rating_security(addon: AddonModel) -> int: def rating_security(addon: AddonModel) -> int:
"""Return 1-6 for security rating. """Return 1-8 for security rating.
1 = not secure 1 = not secure
6 = high secure 8 = high secure
""" """
rating = 5 rating = 5
@@ -45,17 +36,28 @@ def rating_security(addon: AddonModel) -> int:
elif addon.access_auth_api: elif addon.access_auth_api:
rating += 1 rating += 1
# Signed
if addon.signed:
rating += 1
# Privileged options # Privileged options
if any( if (
privilege in addon.privileged any(
for privilege in ( privilege in addon.privileged
PRIVILEGED_NET_ADMIN, for privilege in (
PRIVILEGED_SYS_ADMIN, Capabilities.BPF,
PRIVILEGED_SYS_RAWIO, Capabilities.CHECKPOINT_RESTORE,
PRIVILEGED_SYS_PTRACE, Capabilities.DAC_READ_SEARCH,
PRIVILEGED_SYS_MODULE, Capabilities.NET_ADMIN,
PRIVILEGED_DAC_READ_SEARCH, Capabilities.NET_RAW,
Capabilities.PERFMON,
Capabilities.SYS_ADMIN,
Capabilities.SYS_MODULE,
Capabilities.SYS_PTRACE,
Capabilities.SYS_RAWIO,
)
) )
or addon.with_kernel_modules
): ):
rating += -1 rating += -1
@@ -73,29 +75,31 @@ def rating_security(addon: AddonModel) -> int:
if addon.host_pid: if addon.host_pid:
rating += -2 rating += -2
# Full Access # UTS host namespace allows to set hostname only with SYS_ADMIN
if addon.with_full_access: if addon.host_uts and Capabilities.SYS_ADMIN in addon.privileged:
rating += -2 rating += -1
# Docker Access # Docker Access & full Access
if addon.access_docker_api: if addon.access_docker_api or addon.with_full_access:
rating = 1 rating = 1
return max(min(6, rating), 1) return max(min(8, rating), 1)
async def remove_data(folder: Path) -> None: def remove_data(folder: Path) -> None:
"""Remove folder and reset privileged.""" """Remove folder and reset privileged.
Must be run in executor.
"""
try: try:
proc = await asyncio.create_subprocess_exec( subprocess.run(
"rm", "-rf", str(folder), stdout=asyncio.subprocess.DEVNULL ["rm", "-rf", str(folder)], stdout=subprocess.DEVNULL, text=True, check=True
) )
_, error_msg = await proc.communicate()
except OSError as err: except OSError as err:
error_msg = str(err) error_msg = str(err)
except subprocess.CalledProcessError as procerr:
error_msg = procerr.stderr.strip()
else: else:
if proc.returncode == 0: return
return
_LOGGER.error("Can't remove Add-on Data: %s", error_msg) _LOGGER.error("Can't remove Add-on Data: %s", error_msg)

View File

@@ -1,8 +1,9 @@
"""Validate add-ons options schema.""" """Validate add-ons options schema."""
import logging import logging
import re import re
import secrets import secrets
from typing import Any, Dict, List, Union from typing import Any
import uuid import uuid
import voluptuous as vol import voluptuous as vol
@@ -18,10 +19,13 @@ from ..const import (
ATTR_AUDIO_INPUT, ATTR_AUDIO_INPUT,
ATTR_AUDIO_OUTPUT, ATTR_AUDIO_OUTPUT,
ATTR_AUTH_API, ATTR_AUTH_API,
ATTR_AUTO_UART,
ATTR_AUTO_UPDATE, ATTR_AUTO_UPDATE,
ATTR_BACKUP_EXCLUDE,
ATTR_BACKUP_POST,
ATTR_BACKUP_PRE,
ATTR_BOOT, ATTR_BOOT,
ATTR_BUILD_FROM, ATTR_BUILD_FROM,
ATTR_CONFIGURATION,
ATTR_DESCRIPTON, ATTR_DESCRIPTON,
ATTR_DEVICES, ATTR_DEVICES,
ATTR_DEVICETREE, ATTR_DEVICETREE,
@@ -38,16 +42,20 @@ from ..const import (
ATTR_HOST_IPC, ATTR_HOST_IPC,
ATTR_HOST_NETWORK, ATTR_HOST_NETWORK,
ATTR_HOST_PID, ATTR_HOST_PID,
ATTR_HOST_UTS,
ATTR_IMAGE, ATTR_IMAGE,
ATTR_INGRESS, ATTR_INGRESS,
ATTR_INGRESS_ENTRY, ATTR_INGRESS_ENTRY,
ATTR_INGRESS_PANEL, ATTR_INGRESS_PANEL,
ATTR_INGRESS_PORT, ATTR_INGRESS_PORT,
ATTR_INGRESS_STREAM,
ATTR_INGRESS_TOKEN, ATTR_INGRESS_TOKEN,
ATTR_INIT, ATTR_INIT,
ATTR_JOURNALD,
ATTR_KERNEL_MODULES, ATTR_KERNEL_MODULES,
ATTR_LABELS,
ATTR_LEGACY, ATTR_LEGACY,
ATTR_LOCATON, ATTR_LOCATION,
ATTR_MACHINE, ATTR_MACHINE,
ATTR_MAP, ATTR_MAP,
ATTR_NAME, ATTR_NAME,
@@ -60,19 +68,24 @@ from ..const import (
ATTR_PORTS_DESCRIPTION, ATTR_PORTS_DESCRIPTION,
ATTR_PRIVILEGED, ATTR_PRIVILEGED,
ATTR_PROTECTED, ATTR_PROTECTED,
ATTR_REALTIME,
ATTR_REPOSITORY, ATTR_REPOSITORY,
ATTR_SCHEMA, ATTR_SCHEMA,
ATTR_SERVICES, ATTR_SERVICES,
ATTR_SLUG, ATTR_SLUG,
ATTR_SNAPSHOT_EXCLUDE,
ATTR_SQUASH, ATTR_SQUASH,
ATTR_STAGE, ATTR_STAGE,
ATTR_STARTUP, ATTR_STARTUP,
ATTR_STATE, ATTR_STATE,
ATTR_STDIN, ATTR_STDIN,
ATTR_SYSTEM, ATTR_SYSTEM,
ATTR_SYSTEM_MANAGED,
ATTR_SYSTEM_MANAGED_CONFIG_ENTRY,
ATTR_TIMEOUT, ATTR_TIMEOUT,
ATTR_TMPFS, ATTR_TMPFS,
ATTR_TRANSLATIONS,
ATTR_TYPE,
ATTR_UART,
ATTR_UDEV, ATTR_UDEV,
ATTR_URL, ATTR_URL,
ATTR_USB, ATTR_USB,
@@ -82,16 +95,15 @@ from ..const import (
ATTR_VIDEO, ATTR_VIDEO,
ATTR_WATCHDOG, ATTR_WATCHDOG,
ATTR_WEBUI, ATTR_WEBUI,
PRIVILEGED_ALL,
ROLE_ALL, ROLE_ALL,
ROLE_DEFAULT, ROLE_DEFAULT,
AddonBoot, AddonBoot,
AddonBootConfig,
AddonStage, AddonStage,
AddonStartup, AddonStartup,
AddonState, AddonState,
) )
from ..coresys import CoreSys from ..docker.const import Capabilities
from ..discovery.validate import valid_discovery_service
from ..validate import ( from ..validate import (
docker_image, docker_image,
docker_ports, docker_ports,
@@ -101,49 +113,25 @@ from ..validate import (
uuid_match, uuid_match,
version_tag, version_tag,
) )
from .const import (
ATTR_BACKUP,
ATTR_BREAKING_VERSIONS,
ATTR_CODENOTARY,
ATTR_PATH,
ATTR_READ_ONLY,
RE_SLUG,
AddonBackupMode,
MappingType,
)
from .options import RE_SCHEMA_ELEMENT
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
RE_VOLUME = re.compile(
RE_VOLUME = re.compile(r"^(config|ssl|addons|backup|share|media)(?::(rw|ro))?$") r"^(data|config|ssl|addons|backup|share|media|homeassistant_config|all_addon_configs|addon_config)(?::(rw|ro))?$"
)
RE_SERVICE = re.compile(r"^(?P<service>mqtt|mysql):(?P<rights>provide|want|need)$") RE_SERVICE = re.compile(r"^(?P<service>mqtt|mysql):(?P<rights>provide|want|need)$")
V_STR = "str"
V_INT = "int"
V_FLOAT = "float"
V_BOOL = "bool"
V_PASSWORD = "password"
V_EMAIL = "email"
V_URL = "url"
V_PORT = "port"
V_MATCH = "match"
V_LIST = "list"
RE_SCHEMA_ELEMENT = re.compile(
r"^(?:"
r"|bool"
r"|email"
r"|url"
r"|port"
r"|str(?:\((?P<s_min>\d+)?,(?P<s_max>\d+)?\))?"
r"|password(?:\((?P<p_min>\d+)?,(?P<p_max>\d+)?\))?"
r"|int(?:\((?P<i_min>\d+)?,(?P<i_max>\d+)?\))?"
r"|float(?:\((?P<f_min>[\d\.]+)?,(?P<f_max>[\d\.]+)?\))?"
r"|match\((?P<match>.*)\)"
r"|list\((?P<list>.+)\)"
r")\??$"
)
_SCHEMA_LENGTH_PARTS = (
"i_min",
"i_max",
"f_min",
"f_max",
"s_min",
"s_max",
"p_min",
"p_max",
)
RE_DOCKER_IMAGE_BUILD = re.compile( RE_DOCKER_IMAGE_BUILD = re.compile(
r"^([a-zA-Z\-\.:\d{}]+/)*?([\-\w{}]+)/([\-\w{}]+)(:[\.\-\w{}]+)?$" r"^([a-zA-Z\-\.:\d{}]+/)*?([\-\w{}]+)/([\-\w{}]+)(:[\.\-\w{}]+)?$"
@@ -154,8 +142,10 @@ SCHEMA_ELEMENT = vol.Match(RE_SCHEMA_ELEMENT)
RE_MACHINE = re.compile( RE_MACHINE = re.compile(
r"^!?(?:" r"^!?(?:"
r"|intel-nuc" r"|intel-nuc"
r"|generic-x86-64"
r"|odroid-c2" r"|odroid-c2"
r"|odroid-c4" r"|odroid-c4"
r"|odroid-m1"
r"|odroid-n2" r"|odroid-n2"
r"|odroid-xu" r"|odroid-xu"
r"|qemuarm-64" r"|qemuarm-64"
@@ -168,41 +158,180 @@ RE_MACHINE = re.compile(
r"|raspberrypi3" r"|raspberrypi3"
r"|raspberrypi4-64" r"|raspberrypi4-64"
r"|raspberrypi4" r"|raspberrypi4"
r"|raspberrypi5-64"
r"|yellow"
r"|green"
r"|tinker" r"|tinker"
r")$" r")$"
) )
RE_SLUG_FIELD = re.compile(r"^" + RE_SLUG + r"$")
def _simple_startup(value) -> str:
"""Define startup schema.""" def _warn_addon_config(config: dict[str, Any]):
if value == "before": """Warn about miss configs."""
return AddonStartup.SERVICES.value name = config.get(ATTR_NAME)
if value == "after": if not name:
return AddonStartup.APPLICATION.value raise vol.Invalid("Invalid Add-on config!")
return value
if config.get(ATTR_FULL_ACCESS, False) and (
config.get(ATTR_DEVICES)
or config.get(ATTR_UART)
or config.get(ATTR_USB)
or config.get(ATTR_GPIO)
):
_LOGGER.warning(
"Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of %s",
name,
)
if config.get(ATTR_BACKUP, AddonBackupMode.HOT) == AddonBackupMode.COLD and (
config.get(ATTR_BACKUP_POST) or config.get(ATTR_BACKUP_PRE)
):
_LOGGER.warning(
"Add-on which only support COLD backups trying to use post/pre commands. Please report this to the maintainer of %s",
name,
)
return config
def _migrate_addon_config(protocol=False):
"""Migrate addon config."""
def _migrate(config: dict[str, Any]):
name = config.get(ATTR_NAME)
if not name:
raise vol.Invalid("Invalid Add-on config!")
# Startup 2018-03-30
if config.get(ATTR_STARTUP) in ("before", "after"):
value = config[ATTR_STARTUP]
if protocol:
_LOGGER.warning(
"Add-on config 'startup' with '%s' is deprecated. Please report this to the maintainer of %s",
value,
name,
)
if value == "before":
config[ATTR_STARTUP] = AddonStartup.SERVICES
elif value == "after":
config[ATTR_STARTUP] = AddonStartup.APPLICATION
# UART 2021-01-20
if "auto_uart" in config:
if protocol:
_LOGGER.warning(
"Add-on config 'auto_uart' is deprecated, use 'uart'. Please report this to the maintainer of %s",
name,
)
config[ATTR_UART] = config.pop("auto_uart")
# Device 2021-01-20
if ATTR_DEVICES in config and any(":" in line for line in config[ATTR_DEVICES]):
if protocol:
_LOGGER.warning(
"Add-on config 'devices' use a deprecated format, the new format uses a list of paths only. Please report this to the maintainer of %s",
name,
)
config[ATTR_DEVICES] = [line.split(":")[0] for line in config[ATTR_DEVICES]]
# TMPFS 2021-02-01
if ATTR_TMPFS in config and not isinstance(config[ATTR_TMPFS], bool):
if protocol:
_LOGGER.warning(
"Add-on config 'tmpfs' use a deprecated format, new it's only a boolean. Please report this to the maintainer of %s",
name,
)
config[ATTR_TMPFS] = True
# 2021-06 "snapshot" renamed to "backup"
for entry in (
"snapshot_exclude",
"snapshot_post",
"snapshot_pre",
"snapshot",
):
if entry in config:
new_entry = entry.replace("snapshot", "backup")
config[new_entry] = config.pop(entry)
_LOGGER.warning(
"Add-on config '%s' is deprecated, '%s' should be used instead. Please report this to the maintainer of %s",
entry,
new_entry,
name,
)
# 2023-11 "map" entries can also be dict to allow path configuration
volumes = []
for entry in config.get(ATTR_MAP, []):
if isinstance(entry, dict):
volumes.append(entry)
if isinstance(entry, str):
result = RE_VOLUME.match(entry)
if not result:
continue
volumes.append(
{
ATTR_TYPE: result.group(1),
ATTR_READ_ONLY: result.group(2) != "rw",
}
)
if volumes:
config[ATTR_MAP] = volumes
# 2023-10 "config" became "homeassistant" so /config can be used for addon's public config
if any(volume[ATTR_TYPE] == MappingType.CONFIG for volume in volumes):
if any(
volume
and volume[ATTR_TYPE]
in {MappingType.ADDON_CONFIG, MappingType.HOMEASSISTANT_CONFIG}
for volume in volumes
):
_LOGGER.warning(
"Add-on config using incompatible map options, '%s' and '%s' are ignored if '%s' is included. Please report this to the maintainer of %s",
MappingType.ADDON_CONFIG,
MappingType.HOMEASSISTANT_CONFIG,
MappingType.CONFIG,
name,
)
else:
_LOGGER.debug(
"Add-on config using deprecated map option '%s' instead of '%s'. Please report this to the maintainer of %s",
MappingType.CONFIG,
MappingType.HOMEASSISTANT_CONFIG,
name,
)
return config
return _migrate
# pylint: disable=no-value-for-parameter # pylint: disable=no-value-for-parameter
SCHEMA_ADDON_CONFIG = vol.Schema( _SCHEMA_ADDON_CONFIG = vol.Schema(
{ {
vol.Required(ATTR_NAME): vol.Coerce(str), vol.Required(ATTR_NAME): str,
vol.Required(ATTR_VERSION): version_tag, vol.Required(ATTR_VERSION): version_tag,
vol.Required(ATTR_SLUG): vol.Coerce(str), vol.Required(ATTR_SLUG): vol.Match(RE_SLUG_FIELD),
vol.Required(ATTR_DESCRIPTON): vol.Coerce(str), vol.Required(ATTR_DESCRIPTON): str,
vol.Required(ATTR_ARCH): [vol.In(ARCH_ALL)], vol.Required(ATTR_ARCH): [vol.In(ARCH_ALL)],
vol.Optional(ATTR_MACHINE): vol.All([vol.Match(RE_MACHINE)], vol.Unique()), vol.Optional(ATTR_MACHINE): vol.All([vol.Match(RE_MACHINE)], vol.Unique()),
vol.Optional(ATTR_URL): vol.Url(), vol.Optional(ATTR_URL): vol.Url(),
vol.Optional(ATTR_STARTUP, default=AddonStartup.APPLICATION): vol.All( vol.Optional(ATTR_STARTUP, default=AddonStartup.APPLICATION): vol.Coerce(
_simple_startup, vol.Coerce(AddonStartup) AddonStartup
),
vol.Optional(ATTR_BOOT, default=AddonBootConfig.AUTO): vol.Coerce(
AddonBootConfig
), ),
vol.Optional(ATTR_BOOT, default=AddonBoot.AUTO): vol.Coerce(AddonBoot),
vol.Optional(ATTR_INIT, default=True): vol.Boolean(), vol.Optional(ATTR_INIT, default=True): vol.Boolean(),
vol.Optional(ATTR_ADVANCED, default=False): vol.Boolean(), vol.Optional(ATTR_ADVANCED, default=False): vol.Boolean(),
vol.Optional(ATTR_STAGE, default=AddonStage.STABLE): vol.Coerce(AddonStage), vol.Optional(ATTR_STAGE, default=AddonStage.STABLE): vol.Coerce(AddonStage),
vol.Optional(ATTR_PORTS): docker_ports, vol.Optional(ATTR_PORTS): docker_ports,
vol.Optional(ATTR_PORTS_DESCRIPTION): docker_ports_description, vol.Optional(ATTR_PORTS_DESCRIPTION): docker_ports_description,
vol.Optional(ATTR_WATCHDOG): vol.Match( vol.Optional(ATTR_WATCHDOG): vol.Match(
r"^(?:https?|\[PROTO:\w+\]|tcp):\/\/\[HOST\]:\[PORT:\d+\].*$" r"^(?:https?|\[PROTO:\w+\]|tcp):\/\/\[HOST\]:(\[PORT:\d+\]|\d+).*$"
), ),
vol.Optional(ATTR_WEBUI): vol.Match( vol.Optional(ATTR_WEBUI): vol.Match(
r"^(?:https?|\[PROTO:\w+\]):\/\/\[HOST\]:\[PORT:\d+\].*$" r"^(?:https?|\[PROTO:\w+\]):\/\/\[HOST\]:\[PORT:\d+\].*$"
@@ -211,30 +340,41 @@ SCHEMA_ADDON_CONFIG = vol.Schema(
vol.Optional(ATTR_INGRESS_PORT, default=8099): vol.Any( vol.Optional(ATTR_INGRESS_PORT, default=8099): vol.Any(
network_port, vol.Equal(0) network_port, vol.Equal(0)
), ),
vol.Optional(ATTR_INGRESS_ENTRY): vol.Coerce(str), vol.Optional(ATTR_INGRESS_ENTRY): str,
vol.Optional(ATTR_PANEL_ICON, default="mdi:puzzle"): vol.Coerce(str), vol.Optional(ATTR_INGRESS_STREAM, default=False): vol.Boolean(),
vol.Optional(ATTR_PANEL_TITLE): vol.Coerce(str), vol.Optional(ATTR_PANEL_ICON, default="mdi:puzzle"): str,
vol.Optional(ATTR_PANEL_TITLE): str,
vol.Optional(ATTR_PANEL_ADMIN, default=True): vol.Boolean(), vol.Optional(ATTR_PANEL_ADMIN, default=True): vol.Boolean(),
vol.Optional(ATTR_HOMEASSISTANT): vol.Maybe(version_tag), vol.Optional(ATTR_HOMEASSISTANT): version_tag,
vol.Optional(ATTR_HOST_NETWORK, default=False): vol.Boolean(), vol.Optional(ATTR_HOST_NETWORK, default=False): vol.Boolean(),
vol.Optional(ATTR_HOST_PID, default=False): vol.Boolean(), vol.Optional(ATTR_HOST_PID, default=False): vol.Boolean(),
vol.Optional(ATTR_HOST_IPC, default=False): vol.Boolean(), vol.Optional(ATTR_HOST_IPC, default=False): vol.Boolean(),
vol.Optional(ATTR_HOST_UTS, default=False): vol.Boolean(),
vol.Optional(ATTR_HOST_DBUS, default=False): vol.Boolean(), vol.Optional(ATTR_HOST_DBUS, default=False): vol.Boolean(),
vol.Optional(ATTR_DEVICES): [vol.Match(r"^(.*):(.*):([rwm]{1,3})$")], vol.Optional(ATTR_DEVICES): [str],
vol.Optional(ATTR_AUTO_UART, default=False): vol.Boolean(),
vol.Optional(ATTR_UDEV, default=False): vol.Boolean(), vol.Optional(ATTR_UDEV, default=False): vol.Boolean(),
vol.Optional(ATTR_TMPFS): vol.Match(r"^size=(\d)*[kmg](,uid=\d{1,4})?(,rw)?$"), vol.Optional(ATTR_TMPFS, default=False): vol.Boolean(),
vol.Optional(ATTR_MAP, default=list): [vol.Match(RE_VOLUME)], vol.Optional(ATTR_MAP, default=list): [
vol.Optional(ATTR_ENVIRONMENT): {vol.Match(r"\w*"): vol.Coerce(str)}, vol.Schema(
vol.Optional(ATTR_PRIVILEGED): [vol.In(PRIVILEGED_ALL)], {
vol.Required(ATTR_TYPE): vol.Coerce(MappingType),
vol.Optional(ATTR_READ_ONLY, default=True): bool,
vol.Optional(ATTR_PATH): str,
}
)
],
vol.Optional(ATTR_ENVIRONMENT): {vol.Match(r"\w*"): str},
vol.Optional(ATTR_PRIVILEGED): [vol.Coerce(Capabilities)],
vol.Optional(ATTR_APPARMOR, default=True): vol.Boolean(), vol.Optional(ATTR_APPARMOR, default=True): vol.Boolean(),
vol.Optional(ATTR_FULL_ACCESS, default=False): vol.Boolean(), vol.Optional(ATTR_FULL_ACCESS, default=False): vol.Boolean(),
vol.Optional(ATTR_AUDIO, default=False): vol.Boolean(), vol.Optional(ATTR_AUDIO, default=False): vol.Boolean(),
vol.Optional(ATTR_VIDEO, default=False): vol.Boolean(), vol.Optional(ATTR_VIDEO, default=False): vol.Boolean(),
vol.Optional(ATTR_GPIO, default=False): vol.Boolean(), vol.Optional(ATTR_GPIO, default=False): vol.Boolean(),
vol.Optional(ATTR_USB, default=False): vol.Boolean(), vol.Optional(ATTR_USB, default=False): vol.Boolean(),
vol.Optional(ATTR_UART, default=False): vol.Boolean(),
vol.Optional(ATTR_DEVICETREE, default=False): vol.Boolean(), vol.Optional(ATTR_DEVICETREE, default=False): vol.Boolean(),
vol.Optional(ATTR_KERNEL_MODULES, default=False): vol.Boolean(), vol.Optional(ATTR_KERNEL_MODULES, default=False): vol.Boolean(),
vol.Optional(ATTR_REALTIME, default=False): vol.Boolean(),
vol.Optional(ATTR_HASSIO_API, default=False): vol.Boolean(), vol.Optional(ATTR_HASSIO_API, default=False): vol.Boolean(),
vol.Optional(ATTR_HASSIO_ROLE, default=ROLE_DEFAULT): vol.In(ROLE_ALL), vol.Optional(ATTR_HASSIO_ROLE, default=ROLE_DEFAULT): vol.In(ROLE_ALL),
vol.Optional(ATTR_HOMEASSISTANT_API, default=False): vol.Boolean(), vol.Optional(ATTR_HOMEASSISTANT_API, default=False): vol.Boolean(),
@@ -243,27 +383,27 @@ SCHEMA_ADDON_CONFIG = vol.Schema(
vol.Optional(ATTR_DOCKER_API, default=False): vol.Boolean(), vol.Optional(ATTR_DOCKER_API, default=False): vol.Boolean(),
vol.Optional(ATTR_AUTH_API, default=False): vol.Boolean(), vol.Optional(ATTR_AUTH_API, default=False): vol.Boolean(),
vol.Optional(ATTR_SERVICES): [vol.Match(RE_SERVICE)], vol.Optional(ATTR_SERVICES): [vol.Match(RE_SERVICE)],
vol.Optional(ATTR_DISCOVERY): [valid_discovery_service], vol.Optional(ATTR_DISCOVERY): [str],
vol.Optional(ATTR_SNAPSHOT_EXCLUDE): [vol.Coerce(str)], vol.Optional(ATTR_BACKUP_EXCLUDE): [str],
vol.Optional(ATTR_BACKUP_PRE): str,
vol.Optional(ATTR_BACKUP_POST): str,
vol.Optional(ATTR_BACKUP, default=AddonBackupMode.HOT): vol.Coerce(
AddonBackupMode
),
vol.Optional(ATTR_CODENOTARY): vol.Email(),
vol.Optional(ATTR_OPTIONS, default={}): dict, vol.Optional(ATTR_OPTIONS, default={}): dict,
vol.Optional(ATTR_SCHEMA, default={}): vol.Any( vol.Optional(ATTR_SCHEMA, default={}): vol.Any(
vol.Schema( vol.Schema(
{ {
vol.Coerce(str): vol.Any( str: vol.Any(
SCHEMA_ELEMENT, SCHEMA_ELEMENT,
[ [
vol.Any( vol.Any(
SCHEMA_ELEMENT, SCHEMA_ELEMENT,
{ {str: vol.Any(SCHEMA_ELEMENT, [SCHEMA_ELEMENT])},
vol.Coerce(str): vol.Any(
SCHEMA_ELEMENT, [SCHEMA_ELEMENT]
)
},
) )
], ],
vol.Schema( vol.Schema({str: vol.Any(SCHEMA_ELEMENT, [SCHEMA_ELEMENT])}),
{vol.Coerce(str): vol.Any(SCHEMA_ELEMENT, [SCHEMA_ELEMENT])}
),
) )
} }
), ),
@@ -273,21 +413,44 @@ SCHEMA_ADDON_CONFIG = vol.Schema(
vol.Optional(ATTR_TIMEOUT, default=10): vol.All( vol.Optional(ATTR_TIMEOUT, default=10): vol.All(
vol.Coerce(int), vol.Range(min=10, max=300) vol.Coerce(int), vol.Range(min=10, max=300)
), ),
vol.Optional(ATTR_JOURNALD, default=False): vol.Boolean(),
vol.Optional(ATTR_BREAKING_VERSIONS, default=list): [version_tag],
}, },
extra=vol.REMOVE_EXTRA, extra=vol.REMOVE_EXTRA,
) )
SCHEMA_ADDON_CONFIG = vol.All(
_migrate_addon_config(True), _warn_addon_config, _SCHEMA_ADDON_CONFIG
)
# pylint: disable=no-value-for-parameter # pylint: disable=no-value-for-parameter
SCHEMA_BUILD_CONFIG = vol.Schema( SCHEMA_BUILD_CONFIG = vol.Schema(
{ {
vol.Optional(ATTR_BUILD_FROM, default=dict): vol.Schema( vol.Optional(ATTR_BUILD_FROM, default=dict): vol.Any(
{vol.In(ARCH_ALL): vol.Match(RE_DOCKER_IMAGE_BUILD)} vol.Match(RE_DOCKER_IMAGE_BUILD),
vol.Schema({vol.In(ARCH_ALL): vol.Match(RE_DOCKER_IMAGE_BUILD)}),
), ),
vol.Optional(ATTR_SQUASH, default=False): vol.Boolean(), vol.Optional(ATTR_SQUASH, default=False): vol.Boolean(),
vol.Optional(ATTR_ARGS, default=dict): vol.Schema( vol.Optional(ATTR_ARGS, default=dict): vol.Schema({str: str}),
{vol.Coerce(str): vol.Coerce(str)} vol.Optional(ATTR_LABELS, default=dict): vol.Schema({str: str}),
), },
extra=vol.REMOVE_EXTRA,
)
SCHEMA_TRANSLATION_CONFIGURATION = vol.Schema(
{
vol.Required(ATTR_NAME): str,
vol.Optional(ATTR_DESCRIPTON): vol.Maybe(str),
},
extra=vol.REMOVE_EXTRA,
)
SCHEMA_ADDON_TRANSLATIONS = vol.Schema(
{
vol.Optional(ATTR_CONFIGURATION): {str: SCHEMA_TRANSLATION_CONFIGURATION},
vol.Optional(ATTR_NETWORK): {str: str},
}, },
extra=vol.REMOVE_EXTRA, extra=vol.REMOVE_EXTRA,
) )
@@ -300,301 +463,51 @@ SCHEMA_ADDON_USER = vol.Schema(
vol.Optional(ATTR_IMAGE): docker_image, vol.Optional(ATTR_IMAGE): docker_image,
vol.Optional(ATTR_UUID, default=lambda: uuid.uuid4().hex): uuid_match, vol.Optional(ATTR_UUID, default=lambda: uuid.uuid4().hex): uuid_match,
vol.Optional(ATTR_ACCESS_TOKEN): token, vol.Optional(ATTR_ACCESS_TOKEN): token,
vol.Optional(ATTR_INGRESS_TOKEN, default=secrets.token_urlsafe): vol.Coerce( vol.Optional(ATTR_INGRESS_TOKEN, default=secrets.token_urlsafe): str,
str
),
vol.Optional(ATTR_OPTIONS, default=dict): dict, vol.Optional(ATTR_OPTIONS, default=dict): dict,
vol.Optional(ATTR_AUTO_UPDATE, default=False): vol.Boolean(), vol.Optional(ATTR_AUTO_UPDATE, default=False): vol.Boolean(),
vol.Optional(ATTR_BOOT): vol.Coerce(AddonBoot), vol.Optional(ATTR_BOOT): vol.Coerce(AddonBoot),
vol.Optional(ATTR_NETWORK): docker_ports, vol.Optional(ATTR_NETWORK): docker_ports,
vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(str),
vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(str),
vol.Optional(ATTR_PROTECTED, default=True): vol.Boolean(), vol.Optional(ATTR_PROTECTED, default=True): vol.Boolean(),
vol.Optional(ATTR_INGRESS_PANEL, default=False): vol.Boolean(), vol.Optional(ATTR_INGRESS_PANEL, default=False): vol.Boolean(),
vol.Optional(ATTR_WATCHDOG, default=False): vol.Boolean(), vol.Optional(ATTR_WATCHDOG, default=False): vol.Boolean(),
vol.Optional(ATTR_SYSTEM_MANAGED, default=False): vol.Boolean(),
vol.Optional(ATTR_SYSTEM_MANAGED_CONFIG_ENTRY, default=None): vol.Maybe(str),
}, },
extra=vol.REMOVE_EXTRA, extra=vol.REMOVE_EXTRA,
) )
SCHEMA_ADDON_SYSTEM = vol.All(
SCHEMA_ADDON_SYSTEM = SCHEMA_ADDON_CONFIG.extend( _migrate_addon_config(),
{ _SCHEMA_ADDON_CONFIG.extend(
vol.Required(ATTR_LOCATON): vol.Coerce(str), {
vol.Required(ATTR_REPOSITORY): vol.Coerce(str), vol.Required(ATTR_LOCATION): str,
} vol.Required(ATTR_REPOSITORY): str,
vol.Required(ATTR_TRANSLATIONS, default=dict): {
str: SCHEMA_ADDON_TRANSLATIONS
},
}
),
) )
SCHEMA_ADDONS_FILE = vol.Schema( SCHEMA_ADDONS_FILE = vol.Schema(
{ {
vol.Optional(ATTR_USER, default=dict): {vol.Coerce(str): SCHEMA_ADDON_USER}, vol.Optional(ATTR_USER, default=dict): {str: SCHEMA_ADDON_USER},
vol.Optional(ATTR_SYSTEM, default=dict): {vol.Coerce(str): SCHEMA_ADDON_SYSTEM}, vol.Optional(ATTR_SYSTEM, default=dict): {str: SCHEMA_ADDON_SYSTEM},
}
)
SCHEMA_ADDON_SNAPSHOT = vol.Schema(
{
vol.Required(ATTR_USER): SCHEMA_ADDON_USER,
vol.Required(ATTR_SYSTEM): SCHEMA_ADDON_SYSTEM,
vol.Required(ATTR_STATE): vol.Coerce(AddonState),
vol.Required(ATTR_VERSION): vol.Coerce(str),
}, },
extra=vol.REMOVE_EXTRA, extra=vol.REMOVE_EXTRA,
) )
def validate_options(coresys: CoreSys, raw_schema: Dict[str, Any]): SCHEMA_ADDON_BACKUP = vol.Schema(
"""Validate schema.""" {
vol.Required(ATTR_USER): SCHEMA_ADDON_USER,
def validate(struct): vol.Required(ATTR_SYSTEM): SCHEMA_ADDON_SYSTEM,
"""Create schema validator for add-ons options.""" vol.Required(ATTR_STATE): vol.Coerce(AddonState),
options = {} vol.Required(ATTR_VERSION): version_tag,
},
# read options extra=vol.REMOVE_EXTRA,
for key, value in struct.items(): )
# Ignore unknown options / remove from list
if key not in raw_schema:
_LOGGER.warning("Unknown options %s", key)
continue
typ = raw_schema[key]
try:
if isinstance(typ, list):
# nested value list
options[key] = _nested_validate_list(coresys, typ[0], value, key)
elif isinstance(typ, dict):
# nested value dict
options[key] = _nested_validate_dict(coresys, typ, value, key)
else:
# normal value
options[key] = _single_validate(coresys, typ, value, key)
except (IndexError, KeyError):
raise vol.Invalid(f"Type error for {key}") from None
_check_missing_options(raw_schema, options, "root")
return options
return validate
# pylint: disable=no-value-for-parameter
# pylint: disable=inconsistent-return-statements
def _single_validate(coresys: CoreSys, typ: str, value: Any, key: str):
"""Validate a single element."""
# if required argument
if value is None:
raise vol.Invalid(f"Missing required option '{key}'") from None
# Lookup secret
if str(value).startswith("!secret "):
secret: str = value.partition(" ")[2]
value = coresys.homeassistant.secrets.get(secret)
if value is None:
raise vol.Invalid(f"Unknown secret {secret}") from None
# parse extend data from type
match = RE_SCHEMA_ELEMENT.match(typ)
if not match:
raise vol.Invalid(f"Unknown type {typ}") from None
# prepare range
range_args = {}
for group_name in _SCHEMA_LENGTH_PARTS:
group_value = match.group(group_name)
if group_value:
range_args[group_name[2:]] = float(group_value)
if typ.startswith(V_STR) or typ.startswith(V_PASSWORD):
return vol.All(str(value), vol.Range(**range_args))(value)
elif typ.startswith(V_INT):
return vol.All(vol.Coerce(int), vol.Range(**range_args))(value)
elif typ.startswith(V_FLOAT):
return vol.All(vol.Coerce(float), vol.Range(**range_args))(value)
elif typ.startswith(V_BOOL):
return vol.Boolean()(value)
elif typ.startswith(V_EMAIL):
return vol.Email()(value)
elif typ.startswith(V_URL):
return vol.Url()(value)
elif typ.startswith(V_PORT):
return network_port(value)
elif typ.startswith(V_MATCH):
return vol.Match(match.group("match"))(str(value))
elif typ.startswith(V_LIST):
return vol.In(match.group("list").split("|"))(str(value))
raise vol.Invalid(f"Fatal error for {key} type {typ}") from None
def _nested_validate_list(coresys, typ, data_list, key):
"""Validate nested items."""
options = []
# Make sure it is a list
if not isinstance(data_list, list):
raise vol.Invalid(f"Invalid list for {key}") from None
# Process list
for element in data_list:
# Nested?
if isinstance(typ, dict):
c_options = _nested_validate_dict(coresys, typ, element, key)
options.append(c_options)
else:
options.append(_single_validate(coresys, typ, element, key))
return options
def _nested_validate_dict(coresys, typ, data_dict, key):
"""Validate nested items."""
options = {}
# Make sure it is a dict
if not isinstance(data_dict, dict):
raise vol.Invalid(f"Invalid dict for {key}") from None
# Process dict
for c_key, c_value in data_dict.items():
# Ignore unknown options / remove from list
if c_key not in typ:
_LOGGER.warning("Unknown options %s", c_key)
continue
# Nested?
if isinstance(typ[c_key], list):
options[c_key] = _nested_validate_list(
coresys, typ[c_key][0], c_value, c_key
)
else:
options[c_key] = _single_validate(coresys, typ[c_key], c_value, c_key)
_check_missing_options(typ, options, key)
return options
def _check_missing_options(origin, exists, root):
"""Check if all options are exists."""
missing = set(origin) - set(exists)
for miss_opt in missing:
if isinstance(origin[miss_opt], str) and origin[miss_opt].endswith("?"):
continue
raise vol.Invalid(f"Missing option {miss_opt} in {root}") from None
def schema_ui_options(raw_schema: Dict[str, Any]) -> List[Dict[str, Any]]:
"""Generate UI schema."""
ui_schema: List[Dict[str, Any]] = []
# read options
for key, value in raw_schema.items():
if isinstance(value, list):
# nested value list
_nested_ui_list(ui_schema, value, key)
elif isinstance(value, dict):
# nested value dict
_nested_ui_dict(ui_schema, value, key)
else:
# normal value
_single_ui_option(ui_schema, value, key)
return ui_schema
def _single_ui_option(
ui_schema: List[Dict[str, Any]], value: str, key: str, multiple: bool = False
) -> None:
"""Validate a single element."""
ui_node: Dict[str, Union[str, bool, float, List[str]]] = {"name": key}
# If multiple
if multiple:
ui_node["multiple"] = True
# Parse extend data from type
match = RE_SCHEMA_ELEMENT.match(value)
if not match:
return
# Prepare range
for group_name in _SCHEMA_LENGTH_PARTS:
group_value = match.group(group_name)
if not group_value:
continue
if group_name[2:] == "min":
ui_node["lengthMin"] = float(group_value)
elif group_name[2:] == "max":
ui_node["lengthMax"] = float(group_value)
# If required
if value.endswith("?"):
ui_node["optional"] = True
else:
ui_node["required"] = True
# Data types
if value.startswith(V_STR):
ui_node["type"] = "string"
elif value.startswith(V_PASSWORD):
ui_node["type"] = "string"
ui_node["format"] = "password"
elif value.startswith(V_INT):
ui_node["type"] = "integer"
elif value.startswith(V_FLOAT):
ui_node["type"] = "float"
elif value.startswith(V_BOOL):
ui_node["type"] = "boolean"
elif value.startswith(V_EMAIL):
ui_node["type"] = "string"
ui_node["format"] = "email"
elif value.startswith(V_URL):
ui_node["type"] = "string"
ui_node["format"] = "url"
elif value.startswith(V_PORT):
ui_node["type"] = "integer"
elif value.startswith(V_MATCH):
ui_node["type"] = "string"
elif value.startswith(V_LIST):
ui_node["type"] = "select"
ui_node["options"] = match.group("list").split("|")
ui_schema.append(ui_node)
def _nested_ui_list(
ui_schema: List[Dict[str, Any]], option_list: List[Any], key: str
) -> None:
"""UI nested list items."""
try:
element = option_list[0]
except IndexError:
_LOGGER.error("Invalid schema %s", key)
return
if isinstance(element, dict):
_nested_ui_dict(ui_schema, element, key, multiple=True)
else:
_single_ui_option(ui_schema, element, key, multiple=True)
def _nested_ui_dict(
ui_schema: List[Dict[str, Any]],
option_dict: Dict[str, Any],
key: str,
multiple: bool = False,
) -> None:
"""UI nested dict items."""
ui_node = {"name": key, "type": "schema", "optional": True, "multiple": multiple}
nested_schema = []
for c_key, c_value in option_dict.items():
# Nested?
if isinstance(c_value, list):
_nested_ui_list(nested_schema, c_value, c_key)
else:
_single_ui_option(nested_schema, c_value, c_key)
ui_node["schema"] = nested_schema
ui_schema.append(ui_node)

View File

@@ -1,39 +1,59 @@
"""Init file for Supervisor RESTful API.""" """Init file for Supervisor RESTful API."""
from dataclasses import dataclass
from functools import partial
import logging import logging
from pathlib import Path from pathlib import Path
from typing import Optional from typing import Any
from aiohttp import web from aiohttp import hdrs, web
from ..const import SUPERVISOR_DOCKER_NAME, AddonState
from ..coresys import CoreSys, CoreSysAttributes from ..coresys import CoreSys, CoreSysAttributes
from ..exceptions import APIAddonNotInstalled, HostNotSupportedError
from ..utils.sentry import async_capture_exception
from .addons import APIAddons from .addons import APIAddons
from .audio import APIAudio from .audio import APIAudio
from .auth import APIAuth from .auth import APIAuth
from .backups import APIBackups
from .cli import APICli from .cli import APICli
from .const import CONTENT_TYPE_TEXT
from .discovery import APIDiscovery from .discovery import APIDiscovery
from .dns import APICoreDNS from .dns import APICoreDNS
from .docker import APIDocker from .docker import APIDocker
from .hardware import APIHardware from .hardware import APIHardware
from .homeassistant import APIHomeAssistant from .homeassistant import APIHomeAssistant
from .host import APIHost from .host import APIHost
from .info import APIInfo
from .ingress import APIIngress from .ingress import APIIngress
from .jobs import APIJobs from .jobs import APIJobs
from .middleware.security import SecurityMiddleware
from .mounts import APIMounts
from .multicast import APIMulticast from .multicast import APIMulticast
from .network import APINetwork from .network import APINetwork
from .observer import APIObserver from .observer import APIObserver
from .os import APIOS from .os import APIOS
from .proxy import APIProxy from .proxy import APIProxy
from .resolution import APIResoulution from .resolution import APIResoulution
from .security import SecurityMiddleware from .root import APIRoot
from .security import APISecurity
from .services import APIServices from .services import APIServices
from .snapshots import APISnapshots from .store import APIStore
from .supervisor import APISupervisor from .supervisor import APISupervisor
from .utils import api_process, api_process_raw
_LOGGER: logging.Logger = logging.getLogger(__name__) _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
@dataclass(slots=True, frozen=True)
class StaticResourceConfig:
"""Configuration for a static resource."""
prefix: str
path: Path
class RestAPI(CoreSysAttributes): class RestAPI(CoreSysAttributes):
@@ -46,20 +66,33 @@ class RestAPI(CoreSysAttributes):
self.webapp: web.Application = web.Application( self.webapp: web.Application = web.Application(
client_max_size=MAX_CLIENT_SIZE, client_max_size=MAX_CLIENT_SIZE,
middlewares=[ middlewares=[
self.security.block_bad_requests,
self.security.system_validation, self.security.system_validation,
self.security.token_validation, self.security.token_validation,
self.security.core_proxy,
], ],
handler_args={
"max_line_size": MAX_LINE_SIZE,
"max_field_size": MAX_LINE_SIZE,
},
) )
# service stuff # service stuff
self._runner: web.AppRunner = web.AppRunner(self.webapp) self._runner: web.AppRunner = web.AppRunner(self.webapp, shutdown_timeout=5)
self._site: Optional[web.TCPSite] = None self._site: web.TCPSite | None = None
# share single host API handler for reuse in logging endpoints
self._api_host: APIHost = APIHost()
self._api_host.coresys = coresys
async def load(self) -> None: async def load(self) -> None:
"""Register REST API Calls.""" """Register REST API Calls."""
static_resource_configs: list[StaticResourceConfig] = []
self._register_addons() self._register_addons()
self._register_audio() self._register_audio()
self._register_auth() self._register_auth()
self._register_backups()
self._register_cli() self._register_cli()
self._register_discovery() self._register_discovery()
self._register_dns() self._register_dns()
@@ -67,40 +100,104 @@ class RestAPI(CoreSysAttributes):
self._register_hardware() self._register_hardware()
self._register_homeassistant() self._register_homeassistant()
self._register_host() self._register_host()
self._register_info() self._register_jobs()
self._register_ingress() self._register_ingress()
self._register_mounts()
self._register_multicast() self._register_multicast()
self._register_network() self._register_network()
self._register_observer() self._register_observer()
self._register_os() self._register_os()
self._register_jobs() static_resource_configs.extend(self._register_panel())
self._register_panel()
self._register_proxy() self._register_proxy()
self._register_resolution() self._register_resolution()
self._register_root()
self._register_security()
self._register_services() self._register_services()
self._register_snapshots() self._register_store()
self._register_supervisor() self._register_supervisor()
if static_resource_configs:
def process_configs() -> list[web.StaticResource]:
return [
web.StaticResource(config.prefix, config.path)
for config in static_resource_configs
]
for resource in await self.sys_run_in_executor(process_configs):
self.webapp.router.register_resource(resource)
await self.start() await self.start()
def _register_advanced_logs(self, path: str, syslog_identifier: str):
"""Register logs endpoint for a given path, returning logs for single syslog identifier."""
self.webapp.add_routes(
[
web.get(
f"{path}/logs",
partial(self._api_host.advanced_logs, identifier=syslog_identifier),
),
web.get(
f"{path}/logs/follow",
partial(
self._api_host.advanced_logs,
identifier=syslog_identifier,
follow=True,
),
),
web.get(
f"{path}/logs/boots/{{bootid}}",
partial(self._api_host.advanced_logs, identifier=syslog_identifier),
),
web.get(
f"{path}/logs/boots/{{bootid}}/follow",
partial(
self._api_host.advanced_logs,
identifier=syslog_identifier,
follow=True,
),
),
]
)
def _register_host(self) -> None: def _register_host(self) -> None:
"""Register hostcontrol functions.""" """Register hostcontrol functions."""
api_host = APIHost() api_host = self._api_host
api_host.coresys = self.coresys
self.webapp.add_routes( self.webapp.add_routes(
[ [
web.get("/host/info", api_host.info), web.get("/host/info", api_host.info),
web.get("/host/logs", api_host.logs), web.get("/host/logs", api_host.advanced_logs),
web.get(
"/host/logs/follow",
partial(api_host.advanced_logs, follow=True),
),
web.get("/host/logs/identifiers", api_host.list_identifiers),
web.get("/host/logs/identifiers/{identifier}", api_host.advanced_logs),
web.get(
"/host/logs/identifiers/{identifier}/follow",
partial(api_host.advanced_logs, follow=True),
),
web.get("/host/logs/boots", api_host.list_boots),
web.get("/host/logs/boots/{bootid}", api_host.advanced_logs),
web.get(
"/host/logs/boots/{bootid}/follow",
partial(api_host.advanced_logs, follow=True),
),
web.get(
"/host/logs/boots/{bootid}/identifiers/{identifier}",
api_host.advanced_logs,
),
web.get(
"/host/logs/boots/{bootid}/identifiers/{identifier}/follow",
partial(api_host.advanced_logs, follow=True),
),
web.post("/host/reboot", api_host.reboot), web.post("/host/reboot", api_host.reboot),
web.post("/host/shutdown", api_host.shutdown), web.post("/host/shutdown", api_host.shutdown),
web.post("/host/reload", api_host.reload), web.post("/host/reload", api_host.reload),
web.post("/host/options", api_host.options), web.post("/host/options", api_host.options),
web.get("/host/services", api_host.services), web.get("/host/services", api_host.services),
web.post("/host/services/{service}/stop", api_host.service_stop),
web.post("/host/services/{service}/start", api_host.service_start),
web.post("/host/services/{service}/restart", api_host.service_restart),
web.post("/host/services/{service}/reload", api_host.service_reload),
] ]
) )
@@ -140,7 +237,37 @@ class RestAPI(CoreSysAttributes):
[ [
web.get("/os/info", api_os.info), web.get("/os/info", api_os.info),
web.post("/os/update", api_os.update), web.post("/os/update", api_os.update),
web.get("/os/config/swap", api_os.config_swap_info),
web.post("/os/config/swap", api_os.config_swap_options),
web.post("/os/config/sync", api_os.config_sync), web.post("/os/config/sync", api_os.config_sync),
web.post("/os/datadisk/move", api_os.migrate_data),
web.get("/os/datadisk/list", api_os.list_data),
web.post("/os/datadisk/wipe", api_os.wipe_data),
web.post("/os/boot-slot", api_os.set_boot_slot),
]
)
# Boards endpoints
self.webapp.add_routes(
[
web.get("/os/boards/green", api_os.boards_green_info),
web.post("/os/boards/green", api_os.boards_green_options),
web.get("/os/boards/yellow", api_os.boards_yellow_info),
web.post("/os/boards/yellow", api_os.boards_yellow_options),
web.get("/os/boards/{board}", api_os.boards_other_info),
]
)
def _register_security(self) -> None:
"""Register Security functions."""
api_security = APISecurity()
api_security.coresys = self.coresys
self.webapp.add_routes(
[
web.get("/security/info", api_security.info),
web.post("/security/options", api_security.options),
web.post("/security/integrity", api_security.integrity_check),
] ]
) )
@@ -154,6 +281,8 @@ class RestAPI(CoreSysAttributes):
web.get("/jobs/info", api_jobs.info), web.get("/jobs/info", api_jobs.info),
web.post("/jobs/options", api_jobs.options), web.post("/jobs/options", api_jobs.options),
web.post("/jobs/reset", api_jobs.reset), web.post("/jobs/reset", api_jobs.reset),
web.get("/jobs/{uuid}", api_jobs.job_info),
web.delete("/jobs/{uuid}", api_jobs.remove_job),
] ]
) )
@@ -192,11 +321,11 @@ class RestAPI(CoreSysAttributes):
[ [
web.get("/multicast/info", api_multicast.info), web.get("/multicast/info", api_multicast.info),
web.get("/multicast/stats", api_multicast.stats), web.get("/multicast/stats", api_multicast.stats),
web.get("/multicast/logs", api_multicast.logs),
web.post("/multicast/update", api_multicast.update), web.post("/multicast/update", api_multicast.update),
web.post("/multicast/restart", api_multicast.restart), web.post("/multicast/restart", api_multicast.restart),
] ]
) )
self._register_advanced_logs("/multicast", "hassio_multicast")
def _register_hardware(self) -> None: def _register_hardware(self) -> None:
"""Register hardware functions.""" """Register hardware functions."""
@@ -207,16 +336,27 @@ class RestAPI(CoreSysAttributes):
[ [
web.get("/hardware/info", api_hardware.info), web.get("/hardware/info", api_hardware.info),
web.get("/hardware/audio", api_hardware.audio), web.get("/hardware/audio", api_hardware.audio),
web.post("/hardware/trigger", api_hardware.trigger),
] ]
) )
def _register_info(self) -> None: def _register_root(self) -> None:
"""Register info functions.""" """Register root functions."""
api_info = APIInfo() api_root = APIRoot()
api_info.coresys = self.coresys api_root.coresys = self.coresys
self.webapp.add_routes([web.get("/info", api_info.info)]) self.webapp.add_routes([web.get("/info", api_root.info)])
self.webapp.add_routes([web.post("/reload_updates", api_root.reload_updates)])
# Discouraged
self.webapp.add_routes([web.post("/refresh_updates", api_root.refresh_updates)])
self.webapp.add_routes(
[web.get("/available_updates", api_root.available_updates)]
)
# Remove: 2023
self.webapp.add_routes(
[web.get("/supervisor/available_updates", api_root.available_updates)]
)
def _register_resolution(self) -> None: def _register_resolution(self) -> None:
"""Register info functions.""" """Register info functions."""
@@ -226,6 +366,10 @@ class RestAPI(CoreSysAttributes):
self.webapp.add_routes( self.webapp.add_routes(
[ [
web.get("/resolution/info", api_resolution.info), web.get("/resolution/info", api_resolution.info),
web.post(
"/resolution/check/{check}/options", api_resolution.options_check
),
web.post("/resolution/check/{check}/run", api_resolution.run_check),
web.post( web.post(
"/resolution/suggestion/{suggestion}", "/resolution/suggestion/{suggestion}",
api_resolution.apply_suggestion, api_resolution.apply_suggestion,
@@ -238,6 +382,11 @@ class RestAPI(CoreSysAttributes):
"/resolution/issue/{issue}", "/resolution/issue/{issue}",
api_resolution.dismiss_issue, api_resolution.dismiss_issue,
), ),
web.get(
"/resolution/issue/{issue}/suggestions",
api_resolution.suggestions_for_issue,
),
web.post("/resolution/healthcheck", api_resolution.healthcheck),
] ]
) )
@@ -252,6 +401,7 @@ class RestAPI(CoreSysAttributes):
web.post("/auth", api_auth.auth), web.post("/auth", api_auth.auth),
web.post("/auth/reset", api_auth.reset), web.post("/auth/reset", api_auth.reset),
web.delete("/auth/cache", api_auth.cache), web.delete("/auth/cache", api_auth.cache),
web.get("/auth/list", api_auth.list_users),
] ]
) )
@@ -265,7 +415,6 @@ class RestAPI(CoreSysAttributes):
web.get("/supervisor/ping", api_supervisor.ping), web.get("/supervisor/ping", api_supervisor.ping),
web.get("/supervisor/info", api_supervisor.info), web.get("/supervisor/info", api_supervisor.info),
web.get("/supervisor/stats", api_supervisor.stats), web.get("/supervisor/stats", api_supervisor.stats),
web.get("/supervisor/logs", api_supervisor.logs),
web.post("/supervisor/update", api_supervisor.update), web.post("/supervisor/update", api_supervisor.update),
web.post("/supervisor/reload", api_supervisor.reload), web.post("/supervisor/reload", api_supervisor.reload),
web.post("/supervisor/restart", api_supervisor.restart), web.post("/supervisor/restart", api_supervisor.restart),
@@ -274,6 +423,39 @@ class RestAPI(CoreSysAttributes):
] ]
) )
async def get_supervisor_logs(*args, **kwargs):
try:
return await self._api_host.advanced_logs_handler(
*args, identifier=SUPERVISOR_DOCKER_NAME, **kwargs
)
except Exception as err: # pylint: disable=broad-exception-caught
# Supervisor logs are critical, so catch everything, log the exception
# and try to return Docker container logs as the fallback
_LOGGER.exception(
"Failed to get supervisor logs using advanced_logs API"
)
if not isinstance(err, HostNotSupportedError):
# No need to capture HostNotSupportedError to Sentry, the cause
# is known and reported to the user using the resolution center.
await async_capture_exception(err)
kwargs.pop("follow", None) # Follow is not supported for Docker logs
return await api_supervisor.logs(*args, **kwargs)
self.webapp.add_routes(
[
web.get("/supervisor/logs", get_supervisor_logs),
web.get(
"/supervisor/logs/follow",
partial(get_supervisor_logs, follow=True),
),
web.get("/supervisor/logs/boots/{bootid}", get_supervisor_logs),
web.get(
"/supervisor/logs/boots/{bootid}/follow",
partial(get_supervisor_logs, follow=True),
),
]
)
def _register_homeassistant(self) -> None: def _register_homeassistant(self) -> None:
"""Register Home Assistant functions.""" """Register Home Assistant functions."""
api_hass = APIHomeAssistant() api_hass = APIHomeAssistant()
@@ -282,7 +464,6 @@ class RestAPI(CoreSysAttributes):
self.webapp.add_routes( self.webapp.add_routes(
[ [
web.get("/core/info", api_hass.info), web.get("/core/info", api_hass.info),
web.get("/core/logs", api_hass.logs),
web.get("/core/stats", api_hass.stats), web.get("/core/stats", api_hass.stats),
web.post("/core/options", api_hass.options), web.post("/core/options", api_hass.options),
web.post("/core/update", api_hass.update), web.post("/core/update", api_hass.update),
@@ -291,20 +472,28 @@ class RestAPI(CoreSysAttributes):
web.post("/core/start", api_hass.start), web.post("/core/start", api_hass.start),
web.post("/core/check", api_hass.check), web.post("/core/check", api_hass.check),
web.post("/core/rebuild", api_hass.rebuild), web.post("/core/rebuild", api_hass.rebuild),
# Remove with old Supervisor fallback ]
)
self._register_advanced_logs("/core", "homeassistant")
# Reroute from legacy
self.webapp.add_routes(
[
web.get("/homeassistant/info", api_hass.info), web.get("/homeassistant/info", api_hass.info),
web.get("/homeassistant/logs", api_hass.logs),
web.get("/homeassistant/stats", api_hass.stats), web.get("/homeassistant/stats", api_hass.stats),
web.post("/homeassistant/options", api_hass.options), web.post("/homeassistant/options", api_hass.options),
web.post("/homeassistant/update", api_hass.update),
web.post("/homeassistant/restart", api_hass.restart), web.post("/homeassistant/restart", api_hass.restart),
web.post("/homeassistant/stop", api_hass.stop), web.post("/homeassistant/stop", api_hass.stop),
web.post("/homeassistant/start", api_hass.start), web.post("/homeassistant/start", api_hass.start),
web.post("/homeassistant/check", api_hass.check), web.post("/homeassistant/update", api_hass.update),
web.post("/homeassistant/rebuild", api_hass.rebuild), web.post("/homeassistant/rebuild", api_hass.rebuild),
web.post("/homeassistant/check", api_hass.check),
] ]
) )
self._register_advanced_logs("/homeassistant", "homeassistant")
def _register_proxy(self) -> None: def _register_proxy(self) -> None:
"""Register Home Assistant API Proxy.""" """Register Home Assistant API Proxy."""
api_proxy = APIProxy() api_proxy = APIProxy()
@@ -318,7 +507,12 @@ class RestAPI(CoreSysAttributes):
web.post("/core/api/{path:.+}", api_proxy.api), web.post("/core/api/{path:.+}", api_proxy.api),
web.get("/core/api/{path:.+}", api_proxy.api), web.get("/core/api/{path:.+}", api_proxy.api),
web.get("/core/api/", api_proxy.api), web.get("/core/api/", api_proxy.api),
# Remove with old Supervisor fallback ]
)
# Reroute from legacy
self.webapp.add_routes(
[
web.get("/homeassistant/api/websocket", api_proxy.websocket), web.get("/homeassistant/api/websocket", api_proxy.websocket),
web.get("/homeassistant/websocket", api_proxy.websocket), web.get("/homeassistant/websocket", api_proxy.websocket),
web.get("/homeassistant/api/stream", api_proxy.stream), web.get("/homeassistant/api/stream", api_proxy.stream),
@@ -335,31 +529,64 @@ class RestAPI(CoreSysAttributes):
self.webapp.add_routes( self.webapp.add_routes(
[ [
web.get("/addons", api_addons.list), web.get("/addons", api_addons.list_addons),
web.post("/addons/reload", api_addons.reload),
web.get("/addons/{addon}/info", api_addons.info),
web.post("/addons/{addon}/install", api_addons.install),
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),
web.post("/addons/{addon}/restart", api_addons.restart), web.post("/addons/{addon}/restart", api_addons.restart),
web.post("/addons/{addon}/update", api_addons.update),
web.post("/addons/{addon}/options", api_addons.options), web.post("/addons/{addon}/options", api_addons.options),
web.post("/addons/{addon}/sys_options", api_addons.sys_options),
web.post( web.post(
"/addons/{addon}/options/validate", api_addons.options_validate "/addons/{addon}/options/validate", api_addons.options_validate
), ),
web.get("/addons/{addon}/options/config", api_addons.options_config),
web.post("/addons/{addon}/rebuild", api_addons.rebuild), web.post("/addons/{addon}/rebuild", api_addons.rebuild),
web.get("/addons/{addon}/logs", api_addons.logs),
web.get("/addons/{addon}/icon", api_addons.icon),
web.get("/addons/{addon}/logo", api_addons.logo),
web.get("/addons/{addon}/changelog", api_addons.changelog),
web.get("/addons/{addon}/documentation", api_addons.documentation),
web.post("/addons/{addon}/stdin", api_addons.stdin), web.post("/addons/{addon}/stdin", api_addons.stdin),
web.post("/addons/{addon}/security", api_addons.security), web.post("/addons/{addon}/security", api_addons.security),
web.get("/addons/{addon}/stats", api_addons.stats), web.get("/addons/{addon}/stats", api_addons.stats),
] ]
) )
@api_process_raw(CONTENT_TYPE_TEXT, error_type=CONTENT_TYPE_TEXT)
async def get_addon_logs(request, *args, **kwargs):
addon = api_addons.get_addon_for_request(request)
kwargs["identifier"] = f"addon_{addon.slug}"
return await self._api_host.advanced_logs(request, *args, **kwargs)
self.webapp.add_routes(
[
web.get("/addons/{addon}/logs", get_addon_logs),
web.get(
"/addons/{addon}/logs/follow",
partial(get_addon_logs, follow=True),
),
web.get("/addons/{addon}/logs/boots/{bootid}", get_addon_logs),
web.get(
"/addons/{addon}/logs/boots/{bootid}/follow",
partial(get_addon_logs, follow=True),
),
]
)
# 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()
@@ -370,34 +597,36 @@ class RestAPI(CoreSysAttributes):
web.post("/ingress/session", api_ingress.create_session), web.post("/ingress/session", api_ingress.create_session),
web.post("/ingress/validate_session", api_ingress.validate_session), web.post("/ingress/validate_session", api_ingress.validate_session),
web.get("/ingress/panels", api_ingress.panels), web.get("/ingress/panels", api_ingress.panels),
web.view("/ingress/{token}/{path:.*}", api_ingress.handler), web.route(
hdrs.METH_ANY, "/ingress/{token}/{path:.*}", api_ingress.handler
),
] ]
) )
def _register_snapshots(self) -> None: def _register_backups(self) -> None:
"""Register snapshots functions.""" """Register backups functions."""
api_snapshots = APISnapshots() api_backups = APIBackups()
api_snapshots.coresys = self.coresys api_backups.coresys = self.coresys
self.webapp.add_routes( self.webapp.add_routes(
[ [
web.get("/snapshots", api_snapshots.list), web.get("/backups", api_backups.list_backups),
web.post("/snapshots/reload", api_snapshots.reload), web.get("/backups/info", api_backups.info),
web.post("/snapshots/new/full", api_snapshots.snapshot_full), web.post("/backups/options", api_backups.options),
web.post("/snapshots/new/partial", api_snapshots.snapshot_partial), web.post("/backups/reload", api_backups.reload),
web.post("/snapshots/new/upload", api_snapshots.upload), web.post("/backups/freeze", api_backups.freeze),
web.get("/snapshots/{snapshot}/info", api_snapshots.info), web.post("/backups/thaw", api_backups.thaw),
web.delete("/snapshots/{snapshot}", api_snapshots.remove), web.post("/backups/new/full", api_backups.backup_full),
web.post("/backups/new/partial", api_backups.backup_partial),
web.post("/backups/new/upload", api_backups.upload),
web.get("/backups/{slug}/info", api_backups.backup_info),
web.delete("/backups/{slug}", api_backups.remove),
web.post("/backups/{slug}/restore/full", api_backups.restore_full),
web.post( web.post(
"/snapshots/{snapshot}/restore/full", api_snapshots.restore_full "/backups/{slug}/restore/partial",
api_backups.restore_partial,
), ),
web.post( web.get("/backups/{slug}/download", api_backups.download),
"/snapshots/{snapshot}/restore/partial",
api_snapshots.restore_partial,
),
web.get("/snapshots/{snapshot}/download", api_snapshots.download),
# Old, remove at end of 2020
web.post("/snapshots/{snapshot}/remove", api_snapshots.remove),
] ]
) )
@@ -408,7 +637,7 @@ class RestAPI(CoreSysAttributes):
self.webapp.add_routes( self.webapp.add_routes(
[ [
web.get("/services", api_services.list), web.get("/services", api_services.list_services),
web.get("/services/{service}", api_services.get_service), web.get("/services/{service}", api_services.get_service),
web.post("/services/{service}", api_services.set_service), web.post("/services/{service}", api_services.set_service),
web.delete("/services/{service}", api_services.del_service), web.delete("/services/{service}", api_services.del_service),
@@ -422,7 +651,7 @@ class RestAPI(CoreSysAttributes):
self.webapp.add_routes( self.webapp.add_routes(
[ [
web.get("/discovery", api_discovery.list), web.get("/discovery", api_discovery.list_discovery),
web.get("/discovery/{uuid}", api_discovery.get_discovery), web.get("/discovery/{uuid}", api_discovery.get_discovery),
web.delete("/discovery/{uuid}", api_discovery.del_discovery), web.delete("/discovery/{uuid}", api_discovery.del_discovery),
web.post("/discovery", api_discovery.set_discovery), web.post("/discovery", api_discovery.set_discovery),
@@ -438,7 +667,6 @@ class RestAPI(CoreSysAttributes):
[ [
web.get("/dns/info", api_dns.info), web.get("/dns/info", api_dns.info),
web.get("/dns/stats", api_dns.stats), web.get("/dns/stats", api_dns.stats),
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), web.post("/dns/restart", api_dns.restart),
@@ -446,6 +674,8 @@ class RestAPI(CoreSysAttributes):
] ]
) )
self._register_advanced_logs("/dns", "hassio_dns")
def _register_audio(self) -> None: def _register_audio(self) -> None:
"""Register Audio functions.""" """Register Audio functions."""
api_audio = APIAudio() api_audio = APIAudio()
@@ -455,7 +685,6 @@ class RestAPI(CoreSysAttributes):
[ [
web.get("/audio/info", api_audio.info), web.get("/audio/info", api_audio.info),
web.get("/audio/stats", api_audio.stats), web.get("/audio/stats", api_audio.stats),
web.get("/audio/logs", api_audio.logs),
web.post("/audio/update", api_audio.update), web.post("/audio/update", api_audio.update),
web.post("/audio/restart", api_audio.restart), web.post("/audio/restart", api_audio.restart),
web.post("/audio/reload", api_audio.reload), web.post("/audio/reload", api_audio.reload),
@@ -468,10 +697,89 @@ class RestAPI(CoreSysAttributes):
] ]
) )
def _register_panel(self) -> None: self._register_advanced_logs("/audio", "hassio_audio")
def _register_mounts(self) -> None:
"""Register mounts endpoints."""
api_mounts = APIMounts()
api_mounts.coresys = self.coresys
self.webapp.add_routes(
[
web.get("/mounts", api_mounts.info),
web.post("/mounts/options", api_mounts.options),
web.post("/mounts", api_mounts.create_mount),
web.put("/mounts/{mount}", api_mounts.update_mount),
web.delete("/mounts/{mount}", api_mounts.delete_mount),
web.post("/mounts/{mount}/reload", api_mounts.reload_mount),
]
)
def _register_store(self) -> None:
"""Register store endpoints."""
api_store = APIStore()
api_store.coresys = self.coresys
self.webapp.add_routes(
[
web.get("/store", api_store.store_info),
web.get("/store/addons", api_store.addons_list),
web.get("/store/addons/{addon}", api_store.addons_addon_info),
web.get("/store/addons/{addon}/icon", api_store.addons_addon_icon),
web.get("/store/addons/{addon}/logo", api_store.addons_addon_logo),
web.get(
"/store/addons/{addon}/changelog", api_store.addons_addon_changelog
),
web.get(
"/store/addons/{addon}/documentation",
api_store.addons_addon_documentation,
),
web.post(
"/store/addons/{addon}/install", api_store.addons_addon_install
),
web.post(
"/store/addons/{addon}/install/{version}",
api_store.addons_addon_install,
),
web.post("/store/addons/{addon}/update", api_store.addons_addon_update),
web.post(
"/store/addons/{addon}/update/{version}",
api_store.addons_addon_update,
),
# Must be below others since it has a wildcard in resource path
web.get("/store/addons/{addon}/{version}", api_store.addons_addon_info),
web.post("/store/reload", api_store.reload),
web.get("/store/repositories", api_store.repositories_list),
web.get(
"/store/repositories/{repository}",
api_store.repositories_repository_info,
),
web.post("/store/repositories", api_store.add_repository),
web.delete(
"/store/repositories/{repository}", api_store.remove_repository
),
]
)
# Reroute from legacy
self.webapp.add_routes(
[
web.post("/addons/reload", api_store.reload),
web.post("/addons/{addon}/install", api_store.addons_addon_install),
web.post("/addons/{addon}/update", api_store.addons_addon_update),
web.get("/addons/{addon}/icon", api_store.addons_addon_icon),
web.get("/addons/{addon}/logo", api_store.addons_addon_logo),
web.get("/addons/{addon}/changelog", api_store.addons_addon_changelog),
web.get(
"/addons/{addon}/documentation",
api_store.addons_addon_documentation,
),
]
)
def _register_panel(self) -> list[StaticResourceConfig]:
"""Register panel for Home Assistant.""" """Register panel for Home Assistant."""
panel_dir = Path(__file__).parent.joinpath("panel") return [StaticResourceConfig("/app", Path(__file__).parent.joinpath("panel"))]
self.webapp.add_routes([web.static("/app", panel_dir)])
def _register_docker(self) -> None: def _register_docker(self) -> None:
"""Register docker configuration functions.""" """Register docker configuration functions."""
@@ -481,6 +789,7 @@ class RestAPI(CoreSysAttributes):
self.webapp.add_routes( self.webapp.add_routes(
[ [
web.get("/docker/info", api_docker.info), web.get("/docker/info", api_docker.info),
web.post("/docker/options", api_docker.options),
web.get("/docker/registries", api_docker.registries), web.get("/docker/registries", api_docker.registries),
web.post("/docker/registries", api_docker.create_registry), web.post("/docker/registries", api_docker.create_registry),
web.delete("/docker/registries/{hostname}", api_docker.remove_registry), web.delete("/docker/registries/{hostname}", api_docker.remove_registry),
@@ -490,9 +799,7 @@ class RestAPI(CoreSysAttributes):
async def start(self) -> None: async def start(self) -> None:
"""Run RESTful API webserver.""" """Run RESTful API webserver."""
await self._runner.setup() await self._runner.setup()
self._site = web.TCPSite( self._site = web.TCPSite(self._runner, host="0.0.0.0", port=80)
self._runner, host="0.0.0.0", port=80, shutdown_timeout=5
)
try: try:
await self._site.start() await self._site.start()

View File

@@ -1,13 +1,14 @@
"""Init file for Supervisor Home Assistant RESTful API.""" """Init file for Supervisor Home Assistant RESTful API."""
import asyncio import asyncio
from collections.abc import Awaitable
import logging import logging
from typing import Any, Awaitable, Dict, List from typing import Any, TypedDict
from aiohttp import web from aiohttp import web
import voluptuous as vol import voluptuous as vol
from voluptuous.humanize import humanize_error from voluptuous.humanize import humanize_error
from ..addons import AnyAddon
from ..addons.addon import Addon from ..addons.addon import Addon
from ..addons.utils import rating_security from ..addons.utils import rating_security
from ..const import ( from ..const import (
@@ -35,6 +36,7 @@ from ..const import (
ATTR_DNS, ATTR_DNS,
ATTR_DOCKER_API, ATTR_DOCKER_API,
ATTR_DOCUMENTATION, ATTR_DOCUMENTATION,
ATTR_FORCE,
ATTR_FULL_ACCESS, ATTR_FULL_ACCESS,
ATTR_GPIO, ATTR_GPIO,
ATTR_HASSIO_API, ATTR_HASSIO_API,
@@ -45,6 +47,7 @@ from ..const import (
ATTR_HOST_IPC, ATTR_HOST_IPC,
ATTR_HOST_NETWORK, ATTR_HOST_NETWORK,
ATTR_HOST_PID, ATTR_HOST_PID,
ATTR_HOST_UTS,
ATTR_HOSTNAME, ATTR_HOSTNAME,
ATTR_ICON, ATTR_ICON,
ATTR_INGRESS, ATTR_INGRESS,
@@ -52,17 +55,14 @@ from ..const import (
ATTR_INGRESS_PANEL, ATTR_INGRESS_PANEL,
ATTR_INGRESS_PORT, ATTR_INGRESS_PORT,
ATTR_INGRESS_URL, ATTR_INGRESS_URL,
ATTR_INSTALLED,
ATTR_IP_ADDRESS, ATTR_IP_ADDRESS,
ATTR_KERNEL_MODULES, ATTR_KERNEL_MODULES,
ATTR_LOGO, ATTR_LOGO,
ATTR_LONG_DESCRIPTION, ATTR_LONG_DESCRIPTION,
ATTR_MACHINE, ATTR_MACHINE,
ATTR_MAINTAINER,
ATTR_MEMORY_LIMIT, ATTR_MEMORY_LIMIT,
ATTR_MEMORY_PERCENT, ATTR_MEMORY_PERCENT,
ATTR_MEMORY_USAGE, ATTR_MEMORY_USAGE,
ATTR_MESSAGE,
ATTR_NAME, ATTR_NAME,
ATTR_NETWORK, ATTR_NETWORK,
ATTR_NETWORK_DESCRIPTION, ATTR_NETWORK_DESCRIPTION,
@@ -72,42 +72,48 @@ from ..const import (
ATTR_PRIVILEGED, ATTR_PRIVILEGED,
ATTR_PROTECTED, ATTR_PROTECTED,
ATTR_RATING, ATTR_RATING,
ATTR_REPOSITORIES,
ATTR_REPOSITORY, ATTR_REPOSITORY,
ATTR_SCHEMA, ATTR_SCHEMA,
ATTR_SERVICES, ATTR_SERVICES,
ATTR_SLUG, ATTR_SLUG,
ATTR_SOURCE,
ATTR_STAGE, ATTR_STAGE,
ATTR_STARTUP, ATTR_STARTUP,
ATTR_STATE, ATTR_STATE,
ATTR_STDIN, ATTR_STDIN,
ATTR_SYSTEM_MANAGED,
ATTR_SYSTEM_MANAGED_CONFIG_ENTRY,
ATTR_TRANSLATIONS,
ATTR_UART,
ATTR_UDEV, ATTR_UDEV,
ATTR_UPDATE_AVAILABLE, ATTR_UPDATE_AVAILABLE,
ATTR_URL, ATTR_URL,
ATTR_USB, ATTR_USB,
ATTR_VALID,
ATTR_VERSION, ATTR_VERSION,
ATTR_VERSION_LATEST, ATTR_VERSION_LATEST,
ATTR_VIDEO, ATTR_VIDEO,
ATTR_WATCHDOG, ATTR_WATCHDOG,
ATTR_WEBUI, ATTR_WEBUI,
CONTENT_TYPE_BINARY,
CONTENT_TYPE_PNG,
CONTENT_TYPE_TEXT,
REQUEST_FROM, REQUEST_FROM,
AddonBoot, AddonBoot,
AddonState, AddonBootConfig,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..docker.stats import DockerStats from ..docker.stats import DockerStats
from ..exceptions import APIError from ..exceptions import (
APIAddonNotInstalled,
APIError,
APIForbidden,
APINotFound,
PwnedError,
PwnedSecret,
)
from ..validate import docker_ports from ..validate import docker_ports
from .utils import api_process, api_process_raw, api_validate from .const import ATTR_BOOT_CONFIG, ATTR_REMOVE_CONFIG, ATTR_SIGNED
from .utils import api_process, api_validate, json_loads
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): vol.Coerce(str)}) SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): str})
# pylint: disable=no-value-for-parameter # pylint: disable=no-value-for-parameter
SCHEMA_OPTIONS = vol.Schema( SCHEMA_OPTIONS = vol.Schema(
@@ -115,23 +121,44 @@ SCHEMA_OPTIONS = vol.Schema(
vol.Optional(ATTR_BOOT): vol.Coerce(AddonBoot), vol.Optional(ATTR_BOOT): vol.Coerce(AddonBoot),
vol.Optional(ATTR_NETWORK): vol.Maybe(docker_ports), vol.Optional(ATTR_NETWORK): vol.Maybe(docker_ports),
vol.Optional(ATTR_AUTO_UPDATE): vol.Boolean(), vol.Optional(ATTR_AUTO_UPDATE): vol.Boolean(),
vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(str),
vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(str),
vol.Optional(ATTR_INGRESS_PANEL): vol.Boolean(), vol.Optional(ATTR_INGRESS_PANEL): vol.Boolean(),
vol.Optional(ATTR_WATCHDOG): vol.Boolean(), vol.Optional(ATTR_WATCHDOG): vol.Boolean(),
} }
) )
# pylint: disable=no-value-for-parameter SCHEMA_SYS_OPTIONS = vol.Schema(
{
vol.Optional(ATTR_SYSTEM_MANAGED): vol.Boolean(),
vol.Optional(ATTR_SYSTEM_MANAGED_CONFIG_ENTRY): vol.Maybe(str),
}
)
SCHEMA_SECURITY = vol.Schema({vol.Optional(ATTR_PROTECTED): vol.Boolean()}) SCHEMA_SECURITY = vol.Schema({vol.Optional(ATTR_PROTECTED): vol.Boolean()})
SCHEMA_UNINSTALL = vol.Schema(
{vol.Optional(ATTR_REMOVE_CONFIG, default=False): vol.Boolean()}
)
SCHEMA_REBUILD = vol.Schema({vol.Optional(ATTR_FORCE, default=False): vol.Boolean()})
# pylint: enable=no-value-for-parameter
class OptionsValidateResponse(TypedDict):
"""Response object for options validate."""
message: str
valid: bool
pwned: bool | None
class APIAddons(CoreSysAttributes): class APIAddons(CoreSysAttributes):
"""Handle RESTful API for add-on functions.""" """Handle RESTful API for add-on functions."""
def _extract_addon(self, request: web.Request) -> AnyAddon: def get_addon_for_request(self, request: web.Request) -> Addon:
"""Return addon, throw an exception it it doesn't exist.""" """Return addon, throw an exception if it doesn't exist."""
addon_slug: str = request.match_info.get("addon") addon_slug: str = request.match_info["addon"]
# Lookup itself # Lookup itself
if addon_slug == "self": if addon_slug == "self":
@@ -142,18 +169,14 @@ class APIAddons(CoreSysAttributes):
addon = self.sys_addons.get(addon_slug) addon = self.sys_addons.get(addon_slug)
if not addon: if not addon:
raise APIError(f"Addon {addon_slug} does not exist") raise APINotFound(f"Addon {addon_slug} does not exist")
return addon
def _extract_addon_installed(self, request: web.Request) -> Addon:
addon = self._extract_addon(request)
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
@api_process @api_process
async def list(self, request: web.Request) -> Dict[str, Any]: async def list_addons(self, request: web.Request) -> dict[str, Any]:
"""Return all add-ons or repositories.""" """Return all add-ons or repositories."""
data_addons = [ data_addons = [
{ {
@@ -162,44 +185,33 @@ class APIAddons(CoreSysAttributes):
ATTR_DESCRIPTON: addon.description, ATTR_DESCRIPTON: addon.description,
ATTR_ADVANCED: addon.advanced, ATTR_ADVANCED: addon.advanced,
ATTR_STAGE: addon.stage, ATTR_STAGE: addon.stage,
ATTR_VERSION: addon.version if addon.is_installed else None, ATTR_VERSION: addon.version,
ATTR_VERSION_LATEST: addon.latest_version, ATTR_VERSION_LATEST: addon.latest_version,
ATTR_UPDATE_AVAILABLE: addon.need_update ATTR_UPDATE_AVAILABLE: addon.need_update,
if addon.is_installed
else False,
ATTR_INSTALLED: addon.is_installed,
ATTR_AVAILABLE: addon.available, ATTR_AVAILABLE: addon.available,
ATTR_DETACHED: addon.is_detached, ATTR_DETACHED: addon.is_detached,
ATTR_HOMEASSISTANT: addon.homeassistant_version,
ATTR_STATE: addon.state,
ATTR_REPOSITORY: addon.repository, ATTR_REPOSITORY: addon.repository,
ATTR_BUILD: addon.need_build, ATTR_BUILD: addon.need_build,
ATTR_URL: addon.url, ATTR_URL: addon.url,
ATTR_ICON: addon.with_icon, ATTR_ICON: addon.with_icon,
ATTR_LOGO: addon.with_logo, ATTR_LOGO: addon.with_logo,
ATTR_SYSTEM_MANAGED: addon.system_managed,
} }
for addon in self.sys_addons.all for addon in self.sys_addons.installed
] ]
data_repositories = [ return {ATTR_ADDONS: data_addons}
{
ATTR_SLUG: repository.slug,
ATTR_NAME: repository.name,
ATTR_SOURCE: repository.source,
ATTR_URL: repository.url,
ATTR_MAINTAINER: repository.maintainer,
}
for repository in self.sys_store.all
]
return {ATTR_ADDONS: data_addons, ATTR_REPOSITORIES: data_repositories}
@api_process @api_process
async def reload(self, request: web.Request) -> None: async def reload(self, request: web.Request) -> None:
"""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: Addon = self.get_addon_for_request(request)
data = { data = {
ATTR_NAME: addon.name, ATTR_NAME: addon.name,
@@ -207,16 +219,14 @@ class APIAddons(CoreSysAttributes):
ATTR_HOSTNAME: addon.hostname, ATTR_HOSTNAME: addon.hostname,
ATTR_DNS: addon.dns, ATTR_DNS: addon.dns,
ATTR_DESCRIPTON: addon.description, ATTR_DESCRIPTON: addon.description,
ATTR_LONG_DESCRIPTION: addon.long_description, ATTR_LONG_DESCRIPTION: await addon.long_description(),
ATTR_ADVANCED: addon.advanced, ATTR_ADVANCED: addon.advanced,
ATTR_STAGE: addon.stage, ATTR_STAGE: addon.stage,
ATTR_AUTO_UPDATE: None,
ATTR_REPOSITORY: addon.repository, ATTR_REPOSITORY: addon.repository,
ATTR_VERSION: None,
ATTR_VERSION_LATEST: addon.latest_version, ATTR_VERSION_LATEST: addon.latest_version,
ATTR_UPDATE_AVAILABLE: False,
ATTR_PROTECTED: addon.protected, ATTR_PROTECTED: addon.protected,
ATTR_RATING: rating_security(addon), ATTR_RATING: rating_security(addon),
ATTR_BOOT_CONFIG: addon.boot_config,
ATTR_BOOT: addon.boot, ATTR_BOOT: addon.boot,
ATTR_OPTIONS: addon.options, ATTR_OPTIONS: addon.options,
ATTR_SCHEMA: addon.schema_ui, ATTR_SCHEMA: addon.schema_ui,
@@ -224,7 +234,6 @@ class APIAddons(CoreSysAttributes):
ATTR_MACHINE: addon.supported_machine, ATTR_MACHINE: addon.supported_machine,
ATTR_HOMEASSISTANT: addon.homeassistant_version, ATTR_HOMEASSISTANT: addon.homeassistant_version,
ATTR_URL: addon.url, ATTR_URL: addon.url,
ATTR_STATE: AddonState.UNKNOWN,
ATTR_DETACHED: addon.is_detached, ATTR_DETACHED: addon.is_detached,
ATTR_AVAILABLE: addon.available, ATTR_AVAILABLE: addon.available,
ATTR_BUILD: addon.need_build, ATTR_BUILD: addon.need_build,
@@ -233,75 +242,67 @@ class APIAddons(CoreSysAttributes):
ATTR_HOST_NETWORK: addon.host_network, ATTR_HOST_NETWORK: addon.host_network,
ATTR_HOST_PID: addon.host_pid, ATTR_HOST_PID: addon.host_pid,
ATTR_HOST_IPC: addon.host_ipc, ATTR_HOST_IPC: addon.host_ipc,
ATTR_HOST_UTS: addon.host_uts,
ATTR_HOST_DBUS: addon.host_dbus, ATTR_HOST_DBUS: addon.host_dbus,
ATTR_PRIVILEGED: addon.privileged, ATTR_PRIVILEGED: addon.privileged,
ATTR_FULL_ACCESS: addon.with_full_access, ATTR_FULL_ACCESS: addon.with_full_access,
ATTR_APPARMOR: addon.apparmor, ATTR_APPARMOR: addon.apparmor,
ATTR_DEVICES: _pretty_devices(addon),
ATTR_ICON: addon.with_icon, ATTR_ICON: addon.with_icon,
ATTR_LOGO: addon.with_logo, ATTR_LOGO: addon.with_logo,
ATTR_CHANGELOG: addon.with_changelog, ATTR_CHANGELOG: addon.with_changelog,
ATTR_DOCUMENTATION: addon.with_documentation, ATTR_DOCUMENTATION: addon.with_documentation,
ATTR_STDIN: addon.with_stdin, ATTR_STDIN: addon.with_stdin,
ATTR_WEBUI: None,
ATTR_HASSIO_API: addon.access_hassio_api, ATTR_HASSIO_API: addon.access_hassio_api,
ATTR_HASSIO_ROLE: addon.hassio_role, ATTR_HASSIO_ROLE: addon.hassio_role,
ATTR_AUTH_API: addon.access_auth_api, ATTR_AUTH_API: addon.access_auth_api,
ATTR_HOMEASSISTANT_API: addon.access_homeassistant_api, ATTR_HOMEASSISTANT_API: addon.access_homeassistant_api,
ATTR_GPIO: addon.with_gpio, ATTR_GPIO: addon.with_gpio,
ATTR_USB: addon.with_usb, ATTR_USB: addon.with_usb,
ATTR_UART: addon.with_uart,
ATTR_KERNEL_MODULES: addon.with_kernel_modules, ATTR_KERNEL_MODULES: addon.with_kernel_modules,
ATTR_DEVICETREE: addon.with_devicetree, ATTR_DEVICETREE: addon.with_devicetree,
ATTR_UDEV: addon.with_udev, ATTR_UDEV: addon.with_udev,
ATTR_DOCKER_API: addon.access_docker_api, ATTR_DOCKER_API: addon.access_docker_api,
ATTR_VIDEO: addon.with_video, ATTR_VIDEO: addon.with_video,
ATTR_AUDIO: addon.with_audio, ATTR_AUDIO: addon.with_audio,
ATTR_AUDIO_INPUT: None,
ATTR_AUDIO_OUTPUT: None,
ATTR_STARTUP: addon.startup, ATTR_STARTUP: addon.startup,
ATTR_SERVICES: _pretty_services(addon), ATTR_SERVICES: _pretty_services(addon),
ATTR_DISCOVERY: addon.discovery, ATTR_DISCOVERY: addon.discovery,
ATTR_IP_ADDRESS: None, ATTR_TRANSLATIONS: addon.translations,
ATTR_INGRESS: addon.with_ingress, ATTR_INGRESS: addon.with_ingress,
ATTR_INGRESS_ENTRY: None, ATTR_SIGNED: addon.signed,
ATTR_INGRESS_URL: None, ATTR_STATE: addon.state,
ATTR_INGRESS_PORT: None, ATTR_WEBUI: addon.webui,
ATTR_INGRESS_PANEL: None, ATTR_INGRESS_ENTRY: addon.ingress_entry,
ATTR_WATCHDOG: None, ATTR_INGRESS_URL: addon.ingress_url,
ATTR_INGRESS_PORT: addon.ingress_port,
ATTR_INGRESS_PANEL: addon.ingress_panel,
ATTR_AUDIO_INPUT: addon.audio_input,
ATTR_AUDIO_OUTPUT: addon.audio_output,
ATTR_AUTO_UPDATE: addon.auto_update,
ATTR_IP_ADDRESS: str(addon.ip_address),
ATTR_VERSION: addon.version,
ATTR_UPDATE_AVAILABLE: addon.need_update,
ATTR_WATCHDOG: addon.watchdog,
ATTR_DEVICES: addon.static_devices
+ [device.path for device in addon.devices],
ATTR_SYSTEM_MANAGED: addon.system_managed,
ATTR_SYSTEM_MANAGED_CONFIG_ENTRY: addon.system_managed_config_entry,
} }
if isinstance(addon, Addon) and addon.is_installed:
data.update(
{
ATTR_STATE: addon.state,
ATTR_WEBUI: addon.webui,
ATTR_INGRESS_ENTRY: addon.ingress_entry,
ATTR_INGRESS_URL: addon.ingress_url,
ATTR_INGRESS_PORT: addon.ingress_port,
ATTR_INGRESS_PANEL: addon.ingress_panel,
ATTR_AUDIO_INPUT: addon.audio_input,
ATTR_AUDIO_OUTPUT: addon.audio_output,
ATTR_AUTO_UPDATE: addon.auto_update,
ATTR_IP_ADDRESS: str(addon.ip_address),
ATTR_VERSION: addon.version,
ATTR_UPDATE_AVAILABLE: addon.need_update,
ATTR_WATCHDOG: addon.watchdog,
}
)
return data return data
@api_process @api_process
async def options(self, request: web.Request) -> None: async def options(self, request: web.Request) -> None:
"""Store user options for add-on.""" """Store user options for add-on."""
addon = self._extract_addon_installed(request) addon = self.get_addon_for_request(request)
# Update secrets for validation # Update secrets for validation
await self.sys_homeassistant.secrets.reload() await self.sys_homeassistant.secrets.reload()
# Extend schema with add-on specific validation # Extend schema with add-on specific validation
addon_schema = SCHEMA_OPTIONS.extend( addon_schema = SCHEMA_OPTIONS.extend(
{vol.Optional(ATTR_OPTIONS): vol.Any(None, addon.schema)} {vol.Optional(ATTR_OPTIONS): vol.Maybe(addon.schema)}
) )
# Validate/Process Body # Validate/Process Body
@@ -309,6 +310,10 @@ class APIAddons(CoreSysAttributes):
if ATTR_OPTIONS in body: if ATTR_OPTIONS in body:
addon.options = body[ATTR_OPTIONS] addon.options = body[ATTR_OPTIONS]
if ATTR_BOOT in body: if ATTR_BOOT in body:
if addon.boot_config == AddonBootConfig.MANUAL_ONLY:
raise APIError(
f"Addon {addon.slug} boot option is set to {addon.boot_config} so it cannot be changed"
)
addon.boot = body[ATTR_BOOT] addon.boot = body[ATTR_BOOT]
if ATTR_AUTO_UPDATE in body: if ATTR_AUTO_UPDATE in body:
addon.auto_update = body[ATTR_AUTO_UPDATE] addon.auto_update = body[ATTR_AUTO_UPDATE]
@@ -324,37 +329,92 @@ class APIAddons(CoreSysAttributes):
if ATTR_WATCHDOG in body: if ATTR_WATCHDOG in body:
addon.watchdog = body[ATTR_WATCHDOG] addon.watchdog = body[ATTR_WATCHDOG]
addon.save_persist() await addon.save_persist()
@api_process @api_process
async def options_validate(self, request: web.Request) -> None: async def sys_options(self, request: web.Request) -> None:
"""Store system options for an add-on."""
addon = self.get_addon_for_request(request)
# Validate/Process Body
body = await api_validate(SCHEMA_SYS_OPTIONS, request)
if ATTR_SYSTEM_MANAGED in body:
addon.system_managed = body[ATTR_SYSTEM_MANAGED]
if ATTR_SYSTEM_MANAGED_CONFIG_ENTRY in body:
addon.system_managed_config_entry = body[ATTR_SYSTEM_MANAGED_CONFIG_ENTRY]
await addon.save_persist()
@api_process
async def options_validate(self, request: web.Request) -> OptionsValidateResponse:
"""Validate user options for add-on.""" """Validate user options for add-on."""
addon = self._extract_addon_installed(request) addon = self.get_addon_for_request(request)
data = {ATTR_MESSAGE: "", ATTR_VALID: True} data = OptionsValidateResponse(message="", valid=True, pwned=False)
options = await request.json(loads=json_loads) or addon.options
# Validate config
options_schema = addon.schema
try: try:
addon.schema(addon.options) options_schema.validate(options)
except vol.Invalid as ex: except vol.Invalid as ex:
data[ATTR_MESSAGE] = humanize_error(addon.options, ex) data["message"] = humanize_error(options, ex)
data[ATTR_VALID] = False data["valid"] = False
if not self.sys_security.pwned:
return data
# Pwned check
for secret in options_schema.pwned:
try:
await self.sys_security.verify_secret(secret)
continue
except PwnedSecret:
data["pwned"] = True
except PwnedError:
data["pwned"] = None
break
if self.sys_security.force and data["pwned"] in (None, True):
data["valid"] = False
if data["pwned"] is None:
data["message"] = "Error happening on pwned secrets check!"
else:
data["message"] = "Add-on uses pwned secrets!"
return data return data
@api_process
async def options_config(self, request: web.Request) -> None:
"""Validate user options for add-on."""
slug: str = request.match_info["addon"]
if slug != "self":
raise APIForbidden("This can be only read by the Add-on itself!")
addon = self.get_addon_for_request(request)
# Lookup/reload secrets
await self.sys_homeassistant.secrets.reload()
try:
return addon.schema.validate(addon.options)
except vol.Invalid:
raise APIError("Invalid configuration data for the add-on") from None
@api_process @api_process
async def security(self, request: web.Request) -> None: async def security(self, request: web.Request) -> None:
"""Store security options for add-on.""" """Store security options for add-on."""
addon = self._extract_addon_installed(request) addon = self.get_addon_for_request(request)
body: Dict[str, Any] = await api_validate(SCHEMA_SECURITY, request) body: dict[str, Any] = await api_validate(SCHEMA_SECURITY, request)
if ATTR_PROTECTED in body: if ATTR_PROTECTED in body:
_LOGGER.warning("Changing protected flag for %s!", addon.slug) _LOGGER.warning("Changing protected flag for %s!", addon.slug)
addon.protected = body[ATTR_PROTECTED] addon.protected = body[ATTR_PROTECTED]
addon.save_persist() await addon.save_persist()
@api_process @api_process
async def stats(self, request: web.Request) -> Dict[str, Any]: async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information.""" """Return resource information."""
addon = self._extract_addon_installed(request) addon = self.get_addon_for_request(request)
stats: DockerStats = await addon.stats() stats: DockerStats = await addon.stats()
@@ -370,97 +430,51 @@ class APIAddons(CoreSysAttributes):
} }
@api_process @api_process
def install(self, request: web.Request) -> Awaitable[None]: async def uninstall(self, request: web.Request) -> Awaitable[None]:
"""Install add-on."""
addon = self._extract_addon(request)
return asyncio.shield(addon.install())
@api_process
def uninstall(self, request: web.Request) -> Awaitable[None]:
"""Uninstall add-on.""" """Uninstall add-on."""
addon = self._extract_addon_installed(request) addon = self.get_addon_for_request(request)
return asyncio.shield(addon.uninstall()) body: dict[str, Any] = await api_validate(SCHEMA_UNINSTALL, request)
return await asyncio.shield(
self.sys_addons.uninstall(
addon.slug, remove_config=body[ATTR_REMOVE_CONFIG]
)
)
@api_process @api_process
def start(self, request: web.Request) -> Awaitable[None]: async def start(self, request: web.Request) -> None:
"""Start add-on.""" """Start add-on."""
addon = self._extract_addon_installed(request) addon = self.get_addon_for_request(request)
return asyncio.shield(addon.start()) if start_task := await asyncio.shield(addon.start()):
await start_task
@api_process @api_process
def stop(self, request: web.Request) -> Awaitable[None]: def stop(self, request: web.Request) -> Awaitable[None]:
"""Stop add-on.""" """Stop add-on."""
addon = self._extract_addon_installed(request) addon = self.get_addon_for_request(request)
return asyncio.shield(addon.stop()) return asyncio.shield(addon.stop())
@api_process @api_process
def update(self, request: web.Request) -> Awaitable[None]: async def restart(self, request: web.Request) -> None:
"""Update add-on."""
addon: Addon = self._extract_addon_installed(request)
return asyncio.shield(addon.update())
@api_process
def restart(self, request: web.Request) -> Awaitable[None]:
"""Restart add-on.""" """Restart add-on."""
addon: Addon = self._extract_addon_installed(request) addon: Addon = self.get_addon_for_request(request)
return asyncio.shield(addon.restart()) if start_task := await asyncio.shield(addon.restart()):
await start_task
@api_process @api_process
def rebuild(self, request: web.Request) -> Awaitable[None]: async def rebuild(self, request: web.Request) -> None:
"""Rebuild local build add-on.""" """Rebuild local build add-on."""
addon = self._extract_addon_installed(request) addon = self.get_addon_for_request(request)
return asyncio.shield(addon.rebuild()) body: dict[str, Any] = await api_validate(SCHEMA_REBUILD, request)
@api_process_raw(CONTENT_TYPE_BINARY) if start_task := await asyncio.shield(
def logs(self, request: web.Request) -> Awaitable[bytes]: self.sys_addons.rebuild(addon.slug, force=body[ATTR_FORCE])
"""Return logs from add-on.""" ):
addon = self._extract_addon_installed(request) await start_task
return addon.logs()
@api_process_raw(CONTENT_TYPE_PNG)
async def icon(self, request: web.Request) -> bytes:
"""Return icon from add-on."""
addon = self._extract_addon(request)
if not addon.with_icon:
raise APIError(f"No icon found for add-on {addon.slug}!")
with addon.path_icon.open("rb") as png:
return png.read()
@api_process_raw(CONTENT_TYPE_PNG)
async def logo(self, request: web.Request) -> bytes:
"""Return logo from add-on."""
addon = self._extract_addon(request)
if not addon.with_logo:
raise APIError(f"No logo found for add-on {addon.slug}!")
with addon.path_logo.open("rb") as png:
return png.read()
@api_process_raw(CONTENT_TYPE_TEXT)
async def changelog(self, request: web.Request) -> str:
"""Return changelog from add-on."""
addon = self._extract_addon(request)
if not addon.with_changelog:
raise APIError(f"No changelog found for add-on {addon.slug}!")
with addon.path_changelog.open("r") as changelog:
return changelog.read()
@api_process_raw(CONTENT_TYPE_TEXT)
async def documentation(self, request: web.Request) -> str:
"""Return documentation from add-on."""
addon = self._extract_addon(request)
if not addon.with_documentation:
raise APIError(f"No documentation found for add-on {addon.slug}!")
with addon.path_documentation.open("r") as documentation:
return documentation.read()
@api_process @api_process
async def stdin(self, request: web.Request) -> None: async def stdin(self, request: web.Request) -> None:
"""Write to stdin of add-on.""" """Write to stdin of add-on."""
addon = self._extract_addon_installed(request) addon = self.get_addon_for_request(request)
if not addon.with_stdin: if not addon.with_stdin:
raise APIError(f"STDIN not supported the {addon.slug} add-on") raise APIError(f"STDIN not supported the {addon.slug} add-on")
@@ -468,14 +482,6 @@ class APIAddons(CoreSysAttributes):
await asyncio.shield(addon.write_stdin(data)) await asyncio.shield(addon.write_stdin(data))
def _pretty_devices(addon: AnyAddon) -> List[str]: def _pretty_services(addon: Addon) -> list[str]:
"""Return a simplified device list."""
dev_list = addon.devices
if not dev_list:
return []
return [row.split(":")[0] for row in dev_list]
def _pretty_services(addon: AnyAddon) -> List[str]:
"""Return a simplified services role list.""" """Return a simplified services role list."""
return [f"{name}:{access}" for name, access in addon.services_role.items()] return [f"{name}:{access}" for name, access in addon.services_role.items()]

View File

@@ -1,10 +1,12 @@
"""Init file for Supervisor Audio RESTful API.""" """Init file for Supervisor Audio RESTful API."""
import asyncio import asyncio
from collections.abc import Awaitable
from dataclasses import asdict
import logging import logging
from typing import Any, Awaitable, Dict from typing import Any
from aiohttp import web from aiohttp import web
import attr
import voluptuous as vol import voluptuous as vol
from ..const import ( from ..const import (
@@ -29,13 +31,12 @@ from ..const import (
ATTR_VERSION, ATTR_VERSION,
ATTR_VERSION_LATEST, ATTR_VERSION_LATEST,
ATTR_VOLUME, ATTR_VOLUME,
CONTENT_TYPE_BINARY,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..exceptions import APIError from ..exceptions import APIError
from ..host.sound import StreamType from ..host.sound import StreamType
from ..validate import version_tag from ..validate import version_tag
from .utils import api_process, api_process_raw, api_validate from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -56,10 +57,10 @@ SCHEMA_MUTE = vol.Schema(
} }
) )
SCHEMA_DEFAULT = vol.Schema({vol.Required(ATTR_NAME): vol.Coerce(str)}) SCHEMA_DEFAULT = vol.Schema({vol.Required(ATTR_NAME): str})
SCHEMA_PROFILE = vol.Schema( SCHEMA_PROFILE = vol.Schema(
{vol.Required(ATTR_CARD): vol.Coerce(str), vol.Required(ATTR_NAME): vol.Coerce(str)} {vol.Required(ATTR_CARD): str, vol.Required(ATTR_NAME): str}
) )
@@ -67,7 +68,7 @@ class APIAudio(CoreSysAttributes):
"""Handle RESTful API for Audio functions.""" """Handle RESTful API for Audio functions."""
@api_process @api_process
async def info(self, request: web.Request) -> Dict[str, Any]: async def info(self, request: web.Request) -> dict[str, Any]:
"""Return Audio information.""" """Return Audio information."""
return { return {
ATTR_VERSION: self.sys_plugins.audio.version, ATTR_VERSION: self.sys_plugins.audio.version,
@@ -75,21 +76,17 @@ class APIAudio(CoreSysAttributes):
ATTR_UPDATE_AVAILABLE: self.sys_plugins.audio.need_update, ATTR_UPDATE_AVAILABLE: self.sys_plugins.audio.need_update,
ATTR_HOST: str(self.sys_docker.network.audio), ATTR_HOST: str(self.sys_docker.network.audio),
ATTR_AUDIO: { ATTR_AUDIO: {
ATTR_CARD: [attr.asdict(card) for card in self.sys_host.sound.cards], ATTR_CARD: [asdict(card) for card in self.sys_host.sound.cards],
ATTR_INPUT: [ ATTR_INPUT: [asdict(stream) for stream in self.sys_host.sound.inputs],
attr.asdict(stream) for stream in self.sys_host.sound.inputs ATTR_OUTPUT: [asdict(stream) for stream in self.sys_host.sound.outputs],
],
ATTR_OUTPUT: [
attr.asdict(stream) for stream in self.sys_host.sound.outputs
],
ATTR_APPLICATION: [ ATTR_APPLICATION: [
attr.asdict(stream) for stream in self.sys_host.sound.applications asdict(stream) for stream in self.sys_host.sound.applications
], ],
}, },
} }
@api_process @api_process
async def stats(self, request: web.Request) -> Dict[str, Any]: async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information.""" """Return resource information."""
stats = await self.sys_plugins.audio.stats() stats = await self.sys_plugins.audio.stats()
@@ -114,11 +111,6 @@ class APIAudio(CoreSysAttributes):
raise APIError(f"Version {version} is already in use") raise APIError(f"Version {version} is already in use")
await asyncio.shield(self.sys_plugins.audio.update(version)) await asyncio.shield(self.sys_plugins.audio.update(version))
@api_process_raw(CONTENT_TYPE_BINARY)
def logs(self, request: web.Request) -> Awaitable[bytes]:
"""Return Audio Docker logs."""
return self.sys_plugins.audio.logs()
@api_process @api_process
def restart(self, request: web.Request) -> Awaitable[None]: def restart(self, request: web.Request) -> Awaitable[None]:
"""Restart Audio plugin.""" """Restart Audio plugin."""
@@ -132,7 +124,7 @@ class APIAudio(CoreSysAttributes):
@api_process @api_process
async def set_volume(self, request: web.Request) -> None: async def set_volume(self, request: web.Request) -> None:
"""Set audio volume on stream.""" """Set audio volume on stream."""
source: StreamType = StreamType(request.match_info.get("source")) source: StreamType = StreamType(request.match_info["source"])
application: bool = request.path.endswith("application") application: bool = request.path.endswith("application")
body = await api_validate(SCHEMA_VOLUME, request) body = await api_validate(SCHEMA_VOLUME, request)
@@ -145,7 +137,7 @@ class APIAudio(CoreSysAttributes):
@api_process @api_process
async def set_mute(self, request: web.Request) -> None: async def set_mute(self, request: web.Request) -> None:
"""Mute audio volume on stream.""" """Mute audio volume on stream."""
source: StreamType = StreamType(request.match_info.get("source")) source: StreamType = StreamType(request.match_info["source"])
application: bool = request.path.endswith("application") application: bool = request.path.endswith("application")
body = await api_validate(SCHEMA_MUTE, request) body = await api_validate(SCHEMA_MUTE, request)
@@ -158,7 +150,7 @@ class APIAudio(CoreSysAttributes):
@api_process @api_process
async def set_default(self, request: web.Request) -> None: async def set_default(self, request: web.Request) -> None:
"""Set audio default stream.""" """Set audio default stream."""
source: StreamType = StreamType(request.match_info.get("source")) source: StreamType = StreamType(request.match_info["source"])
body = await api_validate(SCHEMA_DEFAULT, request) body = await api_validate(SCHEMA_DEFAULT, request)
await asyncio.shield(self.sys_host.sound.set_default(source, body[ATTR_NAME])) await asyncio.shield(self.sys_host.sound.set_default(source, body[ATTR_NAME]))

View File

@@ -1,35 +1,42 @@
"""Init file for Supervisor auth/SSO RESTful API.""" """Init file for Supervisor auth/SSO RESTful API."""
import asyncio import asyncio
from collections.abc import Awaitable
import logging import logging
from typing import Dict from typing import Any, cast
from aiohttp import BasicAuth, web from aiohttp import BasicAuth, web
from aiohttp.hdrs import AUTHORIZATION, CONTENT_TYPE, WWW_AUTHENTICATE from aiohttp.hdrs import AUTHORIZATION, CONTENT_TYPE, WWW_AUTHENTICATE
from aiohttp.web import FileField
from aiohttp.web_exceptions import HTTPUnauthorized from aiohttp.web_exceptions import HTTPUnauthorized
from multidict import MultiDictProxy
import voluptuous as vol import voluptuous as vol
from ..addons.addon import Addon from ..addons.addon import Addon
from ..const import ( from ..const import ATTR_NAME, ATTR_PASSWORD, ATTR_USERNAME, REQUEST_FROM
ATTR_PASSWORD,
ATTR_USERNAME,
CONTENT_TYPE_JSON,
CONTENT_TYPE_URL,
REQUEST_FROM,
)
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..exceptions import APIForbidden from ..exceptions import APIForbidden
from .utils import api_process, api_validate from .const import (
ATTR_GROUP_IDS,
ATTR_IS_ACTIVE,
ATTR_IS_OWNER,
ATTR_LOCAL_ONLY,
ATTR_USERS,
CONTENT_TYPE_JSON,
CONTENT_TYPE_URL,
)
from .utils import api_process, api_validate, json_loads
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_PASSWORD_RESET = vol.Schema( SCHEMA_PASSWORD_RESET = vol.Schema(
{ {
vol.Required(ATTR_USERNAME): vol.Coerce(str), vol.Required(ATTR_USERNAME): str,
vol.Required(ATTR_PASSWORD): vol.Coerce(str), vol.Required(ATTR_PASSWORD): str,
} }
) )
REALM_HEADER: Dict[str, str] = { REALM_HEADER: dict[str, str] = {
WWW_AUTHENTICATE: 'Basic realm="Home Assistant Authentication"' WWW_AUTHENTICATE: 'Basic realm="Home Assistant Authentication"'
} }
@@ -37,7 +44,7 @@ REALM_HEADER: Dict[str, str] = {
class APIAuth(CoreSysAttributes): class APIAuth(CoreSysAttributes):
"""Handle RESTful API for auth functions.""" """Handle RESTful API for auth functions."""
def _process_basic(self, request: web.Request, addon: Addon) -> bool: def _process_basic(self, request: web.Request, addon: Addon) -> Awaitable[bool]:
"""Process login request with basic auth. """Process login request with basic auth.
Return a coroutine. Return a coroutine.
@@ -46,8 +53,11 @@ class APIAuth(CoreSysAttributes):
return self.sys_auth.check_login(addon, auth.login, auth.password) return self.sys_auth.check_login(addon, auth.login, auth.password)
def _process_dict( def _process_dict(
self, request: web.Request, addon: Addon, data: Dict[str, str] self,
) -> bool: request: web.Request,
addon: Addon,
data: dict[str, Any] | MultiDictProxy[str | bytes | FileField],
) -> Awaitable[bool]:
"""Process login with dict data. """Process login with dict data.
Return a coroutine. Return a coroutine.
@@ -55,14 +65,22 @@ class APIAuth(CoreSysAttributes):
username = data.get("username") or data.get("user") username = data.get("username") or data.get("user")
password = data.get("password") password = data.get("password")
return self.sys_auth.check_login(addon, username, password) # Test that we did receive strings and not something else, raise if so
try:
_ = username.encode and password.encode # type: ignore
except AttributeError:
raise HTTPUnauthorized(headers=REALM_HEADER) from None
return self.sys_auth.check_login(
addon, cast(str, username), cast(str, password)
)
@api_process @api_process
async def auth(self, request: web.Request) -> bool: async def auth(self, request: web.Request) -> bool:
"""Process login request.""" """Process login request."""
addon = request[REQUEST_FROM] addon = request[REQUEST_FROM]
if not addon.access_auth_api: if not isinstance(addon, Addon) or not addon.access_auth_api:
raise APIForbidden("Can't use Home Assistant auth!") raise APIForbidden("Can't use Home Assistant auth!")
# BasicAuth # BasicAuth
@@ -73,20 +91,25 @@ class APIAuth(CoreSysAttributes):
# Json # Json
if request.headers.get(CONTENT_TYPE) == CONTENT_TYPE_JSON: if request.headers.get(CONTENT_TYPE) == CONTENT_TYPE_JSON:
data = await request.json() data = await request.json(loads=json_loads)
return await self._process_dict(request, addon, data) if not await self._process_dict(request, addon, data):
raise HTTPUnauthorized()
return True
# URL encoded # URL encoded
if request.headers.get(CONTENT_TYPE) == CONTENT_TYPE_URL: if request.headers.get(CONTENT_TYPE) == CONTENT_TYPE_URL:
data = await request.post() data = await request.post()
return await self._process_dict(request, addon, data) if not await self._process_dict(request, addon, data):
raise HTTPUnauthorized()
return True
# Advertise Basic authentication by default
raise HTTPUnauthorized(headers=REALM_HEADER) raise HTTPUnauthorized(headers=REALM_HEADER)
@api_process @api_process
async def reset(self, request: web.Request) -> None: async def reset(self, request: web.Request) -> None:
"""Process reset password request.""" """Process reset password request."""
body: Dict[str, str] = await api_validate(SCHEMA_PASSWORD_RESET, request) body: dict[str, str] = await api_validate(SCHEMA_PASSWORD_RESET, request)
await asyncio.shield( await asyncio.shield(
self.sys_auth.change_password(body[ATTR_USERNAME], body[ATTR_PASSWORD]) self.sys_auth.change_password(body[ATTR_USERNAME], body[ATTR_PASSWORD])
) )
@@ -94,4 +117,22 @@ class APIAuth(CoreSysAttributes):
@api_process @api_process
async def cache(self, request: web.Request) -> None: async def cache(self, request: web.Request) -> None:
"""Process cache reset request.""" """Process cache reset request."""
self.sys_auth.reset_data() await self.sys_auth.reset_data()
@api_process
async def list_users(self, request: web.Request) -> dict[str, list[dict[str, Any]]]:
"""List users on the Home Assistant instance."""
return {
ATTR_USERS: [
{
ATTR_USERNAME: user[ATTR_USERNAME],
ATTR_NAME: user[ATTR_NAME],
ATTR_IS_OWNER: user[ATTR_IS_OWNER],
ATTR_IS_ACTIVE: user[ATTR_IS_ACTIVE],
ATTR_LOCAL_ONLY: user[ATTR_LOCAL_ONLY],
ATTR_GROUP_IDS: user[ATTR_GROUP_IDS],
}
for user in await self.sys_auth.list_users()
if user[ATTR_USERNAME]
]
}

579
supervisor/api/backups.py Normal file
View File

@@ -0,0 +1,579 @@
"""Backups RESTful API."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
import errno
from io import IOBase
import logging
from pathlib import Path
import re
from tempfile import TemporaryDirectory
from typing import Any, cast
from aiohttp import BodyPartReader, web
from aiohttp.hdrs import CONTENT_DISPOSITION
import voluptuous as vol
from voluptuous.humanize import humanize_error
from ..backups.backup import Backup
from ..backups.const import LOCATION_CLOUD_BACKUP, LOCATION_TYPE
from ..backups.validate import ALL_FOLDERS, FOLDER_HOMEASSISTANT, days_until_stale
from ..const import (
ATTR_ADDONS,
ATTR_BACKUPS,
ATTR_COMPRESSED,
ATTR_CONTENT,
ATTR_DATE,
ATTR_DAYS_UNTIL_STALE,
ATTR_EXTRA,
ATTR_FILENAME,
ATTR_FOLDERS,
ATTR_HOMEASSISTANT,
ATTR_HOMEASSISTANT_EXCLUDE_DATABASE,
ATTR_JOB_ID,
ATTR_LOCATION,
ATTR_NAME,
ATTR_PASSWORD,
ATTR_PROTECTED,
ATTR_REPOSITORIES,
ATTR_SIZE,
ATTR_SIZE_BYTES,
ATTR_SLUG,
ATTR_SUPERVISOR_VERSION,
ATTR_TIMEOUT,
ATTR_TYPE,
ATTR_VERSION,
REQUEST_FROM,
BusEvent,
CoreState,
)
from ..coresys import CoreSysAttributes
from ..exceptions import APIError, APIForbidden, APINotFound
from ..jobs import JobSchedulerOptions, SupervisorJob
from ..mounts.const import MountUsage
from ..resolution.const import UnhealthyReason
from .const import (
ATTR_ADDITIONAL_LOCATIONS,
ATTR_BACKGROUND,
ATTR_LOCATION_ATTRIBUTES,
ATTR_LOCATIONS,
CONTENT_TYPE_TAR,
)
from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__)
ALL_ADDONS_FLAG = "ALL"
LOCATION_LOCAL = ".local"
RE_SLUGIFY_NAME = re.compile(r"[^A-Za-z0-9]+")
RE_BACKUP_FILENAME = re.compile(r"^[^\\\/]+\.tar$")
# Backwards compatible
# Remove: 2022.08
_ALL_FOLDERS = ALL_FOLDERS + [FOLDER_HOMEASSISTANT]
def _ensure_list(item: Any) -> list:
"""Ensure value is a list."""
if not isinstance(item, list):
return [item]
return item
def _convert_local_location(item: str | None) -> str | None:
"""Convert local location value."""
if item in {LOCATION_LOCAL, ""}:
return None
return item
# pylint: disable=no-value-for-parameter
SCHEMA_FOLDERS = vol.All([vol.In(_ALL_FOLDERS)], vol.Unique())
SCHEMA_LOCATION = vol.All(vol.Maybe(str), _convert_local_location)
SCHEMA_LOCATION_LIST = vol.All(_ensure_list, [SCHEMA_LOCATION], vol.Unique())
SCHEMA_RESTORE_FULL = vol.Schema(
{
vol.Optional(ATTR_PASSWORD): vol.Maybe(str),
vol.Optional(ATTR_BACKGROUND, default=False): vol.Boolean(),
vol.Optional(ATTR_LOCATION): SCHEMA_LOCATION,
}
)
SCHEMA_RESTORE_PARTIAL = SCHEMA_RESTORE_FULL.extend(
{
vol.Optional(ATTR_HOMEASSISTANT): vol.Boolean(),
vol.Optional(ATTR_ADDONS): vol.All([str], vol.Unique()),
vol.Optional(ATTR_FOLDERS): SCHEMA_FOLDERS,
}
)
SCHEMA_BACKUP_FULL = vol.Schema(
{
vol.Optional(ATTR_NAME): str,
vol.Optional(ATTR_FILENAME): vol.Match(RE_BACKUP_FILENAME),
vol.Optional(ATTR_PASSWORD): vol.Maybe(str),
vol.Optional(ATTR_COMPRESSED): vol.Maybe(vol.Boolean()),
vol.Optional(ATTR_LOCATION): SCHEMA_LOCATION_LIST,
vol.Optional(ATTR_HOMEASSISTANT_EXCLUDE_DATABASE): vol.Boolean(),
vol.Optional(ATTR_BACKGROUND, default=False): vol.Boolean(),
vol.Optional(ATTR_EXTRA): dict,
}
)
SCHEMA_BACKUP_PARTIAL = SCHEMA_BACKUP_FULL.extend(
{
vol.Optional(ATTR_ADDONS): vol.Or(
ALL_ADDONS_FLAG, vol.All([str], vol.Unique())
),
vol.Optional(ATTR_FOLDERS): SCHEMA_FOLDERS,
vol.Optional(ATTR_HOMEASSISTANT): vol.Boolean(),
}
)
SCHEMA_OPTIONS = vol.Schema({vol.Optional(ATTR_DAYS_UNTIL_STALE): days_until_stale})
SCHEMA_FREEZE = vol.Schema({vol.Optional(ATTR_TIMEOUT): vol.All(int, vol.Range(min=1))})
SCHEMA_REMOVE = vol.Schema({vol.Optional(ATTR_LOCATION): SCHEMA_LOCATION_LIST})
class APIBackups(CoreSysAttributes):
"""Handle RESTful API for backups functions."""
def _extract_slug(self, request):
"""Return backup, throw an exception if it doesn't exist."""
backup = self.sys_backups.get(request.match_info.get("slug"))
if not backup:
raise APINotFound("Backup does not exist")
return backup
def _make_location_attributes(self, backup: Backup) -> dict[str, dict[str, Any]]:
"""Make location attributes dictionary."""
return {
loc if loc else LOCATION_LOCAL: {
ATTR_PROTECTED: backup.all_locations[loc].protected,
ATTR_SIZE_BYTES: backup.all_locations[loc].size_bytes,
}
for loc in backup.locations
}
def _list_backups(self):
"""Return list of backups."""
return [
{
ATTR_SLUG: backup.slug,
ATTR_NAME: backup.name,
ATTR_DATE: backup.date,
ATTR_TYPE: backup.sys_type,
ATTR_SIZE: backup.size,
ATTR_SIZE_BYTES: backup.size_bytes,
ATTR_LOCATION: backup.location,
ATTR_LOCATIONS: backup.locations,
ATTR_PROTECTED: backup.protected,
ATTR_LOCATION_ATTRIBUTES: self._make_location_attributes(backup),
ATTR_COMPRESSED: backup.compressed,
ATTR_CONTENT: {
ATTR_HOMEASSISTANT: backup.homeassistant_version is not None,
ATTR_ADDONS: backup.addon_list,
ATTR_FOLDERS: backup.folders,
},
}
for backup in self.sys_backups.list_backups
if backup.location != LOCATION_CLOUD_BACKUP
]
@api_process
async def list_backups(self, request):
"""Return backup list."""
data_backups = self._list_backups()
if request.path == "/snapshots":
# Kept for backwards compability
return {"snapshots": data_backups}
return {ATTR_BACKUPS: data_backups}
@api_process
async def info(self, request):
"""Return backup list and manager info."""
return {
ATTR_BACKUPS: self._list_backups(),
ATTR_DAYS_UNTIL_STALE: self.sys_backups.days_until_stale,
}
@api_process
async def options(self, request):
"""Set backup manager options."""
body = await api_validate(SCHEMA_OPTIONS, request)
if ATTR_DAYS_UNTIL_STALE in body:
self.sys_backups.days_until_stale = body[ATTR_DAYS_UNTIL_STALE]
await self.sys_backups.save_data()
@api_process
async def reload(self, _):
"""Reload backup list."""
await asyncio.shield(self.sys_backups.reload())
return True
@api_process
async def backup_info(self, request):
"""Return backup info."""
backup = self._extract_slug(request)
data_addons = []
for addon_data in backup.addons:
data_addons.append(
{
ATTR_SLUG: addon_data[ATTR_SLUG],
ATTR_NAME: addon_data[ATTR_NAME],
ATTR_VERSION: addon_data[ATTR_VERSION],
ATTR_SIZE: addon_data[ATTR_SIZE],
}
)
return {
ATTR_SLUG: backup.slug,
ATTR_TYPE: backup.sys_type,
ATTR_NAME: backup.name,
ATTR_DATE: backup.date,
ATTR_SIZE: backup.size,
ATTR_SIZE_BYTES: backup.size_bytes,
ATTR_COMPRESSED: backup.compressed,
ATTR_PROTECTED: backup.protected,
ATTR_LOCATION_ATTRIBUTES: self._make_location_attributes(backup),
ATTR_SUPERVISOR_VERSION: backup.supervisor_version,
ATTR_HOMEASSISTANT: backup.homeassistant_version,
ATTR_LOCATION: backup.location,
ATTR_LOCATIONS: backup.locations,
ATTR_ADDONS: data_addons,
ATTR_REPOSITORIES: backup.repositories,
ATTR_FOLDERS: backup.folders,
ATTR_HOMEASSISTANT_EXCLUDE_DATABASE: backup.homeassistant_exclude_database,
ATTR_EXTRA: backup.extra,
}
def _location_to_mount(self, location: str | None) -> LOCATION_TYPE:
"""Convert a single location to a mount if possible."""
if not location or location == LOCATION_CLOUD_BACKUP:
return cast(LOCATION_TYPE, location)
mount = self.sys_mounts.get(location)
if mount.usage != MountUsage.BACKUP:
raise APIError(
f"Mount {mount.name} is not used for backups, cannot backup to there"
)
return mount
def _location_field_to_mount(self, body: dict[str, Any]) -> dict[str, Any]:
"""Change location field to mount if necessary."""
body[ATTR_LOCATION] = self._location_to_mount(body.get(ATTR_LOCATION))
return body
def _validate_cloud_backup_location(
self, request: web.Request, location: list[str | None] | str | None
) -> None:
"""Cloud backup location is only available to Home Assistant."""
if not isinstance(location, list):
location = [location]
if (
LOCATION_CLOUD_BACKUP in location
and request.get(REQUEST_FROM) != self.sys_homeassistant
):
raise APIForbidden(
f"Location {LOCATION_CLOUD_BACKUP} is only available for Home Assistant"
)
async def _background_backup_task(
self, backup_method: Callable, *args, **kwargs
) -> tuple[asyncio.Task, str]:
"""Start backup task in background and return task and job ID."""
event = asyncio.Event()
job, backup_task = cast(
tuple[SupervisorJob, asyncio.Task],
self.sys_jobs.schedule_job(
backup_method, JobSchedulerOptions(), *args, **kwargs
),
)
async def release_on_freeze(new_state: CoreState):
if new_state == CoreState.FREEZE:
event.set()
# Wait for system to get into freeze state before returning
# If the backup fails validation it will raise before getting there
listener = self.sys_bus.register_event(
BusEvent.SUPERVISOR_STATE_CHANGE, release_on_freeze
)
try:
event_task = self.sys_create_task(event.wait())
_, pending = await asyncio.wait(
(backup_task, event_task),
return_when=asyncio.FIRST_COMPLETED,
)
# It seems backup returned early (error or something), make sure to cancel
# the event task to avoid "Task was destroyed but it is pending!" errors.
if event_task in pending:
event_task.cancel()
return (backup_task, job.uuid)
finally:
self.sys_bus.remove_listener(listener)
@api_process
async def backup_full(self, request: web.Request):
"""Create full backup."""
body = await api_validate(SCHEMA_BACKUP_FULL, request)
locations: list[LOCATION_TYPE] | None = None
if ATTR_LOCATION in body:
location_names: list[str | None] = body.pop(ATTR_LOCATION)
self._validate_cloud_backup_location(request, location_names)
locations = [
self._location_to_mount(location) for location in location_names
]
body[ATTR_LOCATION] = locations.pop(0)
if locations:
body[ATTR_ADDITIONAL_LOCATIONS] = locations
background = body.pop(ATTR_BACKGROUND)
backup_task, job_id = await self._background_backup_task(
self.sys_backups.do_backup_full, **body
)
if background and not backup_task.done():
return {ATTR_JOB_ID: job_id}
backup: Backup = await backup_task
if backup:
return {ATTR_JOB_ID: job_id, ATTR_SLUG: backup.slug}
raise APIError(
f"An error occurred while making backup, check job '{job_id}' or supervisor logs for details",
job_id=job_id,
)
@api_process
async def backup_partial(self, request: web.Request):
"""Create a partial backup."""
body = await api_validate(SCHEMA_BACKUP_PARTIAL, request)
locations: list[LOCATION_TYPE] | None = None
if ATTR_LOCATION in body:
location_names: list[str | None] = body.pop(ATTR_LOCATION)
self._validate_cloud_backup_location(request, location_names)
locations = [
self._location_to_mount(location) for location in location_names
]
body[ATTR_LOCATION] = locations.pop(0)
if locations:
body[ATTR_ADDITIONAL_LOCATIONS] = locations
if body.get(ATTR_ADDONS) == ALL_ADDONS_FLAG:
body[ATTR_ADDONS] = list(self.sys_addons.local)
background = body.pop(ATTR_BACKGROUND)
backup_task, job_id = await self._background_backup_task(
self.sys_backups.do_backup_partial, **body
)
if background and not backup_task.done():
return {ATTR_JOB_ID: job_id}
backup: Backup = await backup_task
if backup:
return {ATTR_JOB_ID: job_id, ATTR_SLUG: backup.slug}
raise APIError(
f"An error occurred while making backup, check job '{job_id}' or supervisor logs for details",
job_id=job_id,
)
@api_process
async def restore_full(self, request: web.Request):
"""Full restore of a backup."""
backup = self._extract_slug(request)
body = await api_validate(SCHEMA_RESTORE_FULL, request)
self._validate_cloud_backup_location(
request, body.get(ATTR_LOCATION, backup.location)
)
background = body.pop(ATTR_BACKGROUND)
restore_task, job_id = await self._background_backup_task(
self.sys_backups.do_restore_full, backup, **body
)
if background and not restore_task.done() or await restore_task:
return {ATTR_JOB_ID: job_id}
raise APIError(
f"An error occurred during restore of {backup.slug}, check job '{job_id}' or supervisor logs for details",
job_id=job_id,
)
@api_process
async def restore_partial(self, request: web.Request):
"""Partial restore a backup."""
backup = self._extract_slug(request)
body = await api_validate(SCHEMA_RESTORE_PARTIAL, request)
self._validate_cloud_backup_location(
request, body.get(ATTR_LOCATION, backup.location)
)
background = body.pop(ATTR_BACKGROUND)
restore_task, job_id = await self._background_backup_task(
self.sys_backups.do_restore_partial, backup, **body
)
if background and not restore_task.done() or await restore_task:
return {ATTR_JOB_ID: job_id}
raise APIError(
f"An error occurred during restore of {backup.slug}, check job '{job_id}' or supervisor logs for details",
job_id=job_id,
)
@api_process
async def freeze(self, request: web.Request):
"""Initiate manual freeze for external backup."""
body = await api_validate(SCHEMA_FREEZE, request)
await asyncio.shield(self.sys_backups.freeze_all(**body))
@api_process
async def thaw(self, request: web.Request):
"""Begin thaw after manual freeze."""
await self.sys_backups.thaw_all()
@api_process
async def remove(self, request: web.Request):
"""Remove a backup."""
backup = self._extract_slug(request)
body = await api_validate(SCHEMA_REMOVE, request)
locations: list[LOCATION_TYPE] | None = None
if ATTR_LOCATION in body:
self._validate_cloud_backup_location(request, body[ATTR_LOCATION])
locations = [self._location_to_mount(name) for name in body[ATTR_LOCATION]]
else:
self._validate_cloud_backup_location(request, backup.location)
await self.sys_backups.remove(backup, locations=locations)
@api_process
async def download(self, request: web.Request):
"""Download a backup file."""
backup = self._extract_slug(request)
# Query will give us '' for /backups, convert value to None
location = _convert_local_location(
request.query.get(ATTR_LOCATION, backup.location)
)
self._validate_cloud_backup_location(request, location)
if location not in backup.all_locations:
raise APIError(f"Backup {backup.slug} is not in location {location}")
_LOGGER.info("Downloading backup %s", backup.slug)
filename = backup.all_locations[location].path
# If the file is missing, return 404 and trigger reload of location
if not await self.sys_run_in_executor(filename.is_file):
self.sys_create_task(self.sys_backups.reload(location))
return web.Response(status=404)
response = web.FileResponse(filename)
response.content_type = CONTENT_TYPE_TAR
download_filename = filename.name
if download_filename == f"{backup.slug}.tar":
download_filename = f"{RE_SLUGIFY_NAME.sub('_', backup.name)}.tar"
response.headers[CONTENT_DISPOSITION] = (
f"attachment; filename={download_filename}"
)
return response
@api_process
async def upload(self, request: web.Request):
"""Upload a backup file."""
location: LOCATION_TYPE = None
locations: list[LOCATION_TYPE] | None = None
if ATTR_LOCATION in request.query:
location_names: list[str] = request.query.getall(ATTR_LOCATION, [])
self._validate_cloud_backup_location(
request, cast(list[str | None], location_names)
)
# Convert empty string to None if necessary
locations = [
self._location_to_mount(location)
if _convert_local_location(location)
else None
for location in location_names
]
location = locations.pop(0)
filename: str | None = None
if ATTR_FILENAME in request.query:
filename = request.query.get(ATTR_FILENAME)
try:
vol.Match(RE_BACKUP_FILENAME)(filename)
except vol.Invalid as ex:
raise APIError(humanize_error(filename, ex)) from None
tmp_path = await self.sys_backups.get_upload_path_for_location(location)
temp_dir: TemporaryDirectory | None = None
backup_file_stream: IOBase | None = None
def open_backup_file() -> Path:
nonlocal temp_dir, backup_file_stream
temp_dir = TemporaryDirectory(dir=tmp_path.as_posix())
tar_file = Path(temp_dir.name, "upload.tar")
backup_file_stream = tar_file.open("wb")
return tar_file
def close_backup_file() -> None:
if backup_file_stream:
# Make sure it got closed, in case of exception. It is safe to
# close the file stream twice.
backup_file_stream.close()
if temp_dir:
temp_dir.cleanup()
try:
reader = await request.multipart()
contents = await reader.next()
if not isinstance(contents, BodyPartReader):
raise APIError("Improperly formatted upload, could not read backup")
tar_file = await self.sys_run_in_executor(open_backup_file)
while chunk := await contents.read_chunk(size=2**16):
await self.sys_run_in_executor(
cast(IOBase, backup_file_stream).write, chunk
)
await self.sys_run_in_executor(cast(IOBase, backup_file_stream).close)
backup = await asyncio.shield(
self.sys_backups.import_backup(
tar_file,
filename,
location=location,
additional_locations=locations,
)
)
except OSError as err:
if err.errno == errno.EBADMSG and location in {
LOCATION_CLOUD_BACKUP,
None,
}:
self.sys_resolution.add_unhealthy_reason(
UnhealthyReason.OSERROR_BAD_MESSAGE
)
_LOGGER.error("Can't write new backup file: %s", err)
return False
except asyncio.CancelledError:
return False
finally:
await self.sys_run_in_executor(close_backup_file)
if backup:
return {ATTR_SLUG: backup.slug}
return False

View File

@@ -1,7 +1,8 @@
"""Init file for Supervisor HA cli RESTful API.""" """Init file for Supervisor HA cli RESTful API."""
import asyncio import asyncio
import logging import logging
from typing import Any, Dict from typing import Any
from aiohttp import web from aiohttp import web
import voluptuous as vol import voluptuous as vol
@@ -32,7 +33,7 @@ class APICli(CoreSysAttributes):
"""Handle RESTful API for HA Cli functions.""" """Handle RESTful API for HA Cli functions."""
@api_process @api_process
async def info(self, request: web.Request) -> Dict[str, Any]: async def info(self, request: web.Request) -> dict[str, Any]:
"""Return HA cli information.""" """Return HA cli information."""
return { return {
ATTR_VERSION: self.sys_plugins.cli.version, ATTR_VERSION: self.sys_plugins.cli.version,
@@ -41,7 +42,7 @@ class APICli(CoreSysAttributes):
} }
@api_process @api_process
async def stats(self, request: web.Request) -> Dict[str, Any]: async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information.""" """Return resource information."""
stats = await self.sys_plugins.cli.stats() stats = await self.sys_plugins.cli.stats()

90
supervisor/api/const.py Normal file
View File

@@ -0,0 +1,90 @@
"""Const for API."""
from enum import StrEnum
CONTENT_TYPE_BINARY = "application/octet-stream"
CONTENT_TYPE_JSON = "application/json"
CONTENT_TYPE_PNG = "image/png"
CONTENT_TYPE_TAR = "application/tar"
CONTENT_TYPE_TEXT = "text/plain"
CONTENT_TYPE_URL = "application/x-www-form-urlencoded"
CONTENT_TYPE_X_LOG = "text/x-log"
COOKIE_INGRESS = "ingress_session"
ATTR_ADDITIONAL_LOCATIONS = "additional_locations"
ATTR_AGENT_VERSION = "agent_version"
ATTR_APPARMOR_VERSION = "apparmor_version"
ATTR_ATTRIBUTES = "attributes"
ATTR_AVAILABLE_UPDATES = "available_updates"
ATTR_BACKGROUND = "background"
ATTR_BOOT_CONFIG = "boot_config"
ATTR_BOOT_SLOT = "boot_slot"
ATTR_BOOT_SLOTS = "boot_slots"
ATTR_BOOT_TIMESTAMP = "boot_timestamp"
ATTR_BOOTS = "boots"
ATTR_BROADCAST_LLMNR = "broadcast_llmnr"
ATTR_BROADCAST_MDNS = "broadcast_mdns"
ATTR_BY_ID = "by_id"
ATTR_CHILDREN = "children"
ATTR_CONNECTION_BUS = "connection_bus"
ATTR_DATA_DISK = "data_disk"
ATTR_DEVICE = "device"
ATTR_DEV_PATH = "dev_path"
ATTR_DISKS = "disks"
ATTR_DRIVES = "drives"
ATTR_DT_SYNCHRONIZED = "dt_synchronized"
ATTR_DT_UTC = "dt_utc"
ATTR_EJECTABLE = "ejectable"
ATTR_FALLBACK = "fallback"
ATTR_FILESYSTEMS = "filesystems"
ATTR_FORCE = "force"
ATTR_GROUP_IDS = "group_ids"
ATTR_IDENTIFIERS = "identifiers"
ATTR_IS_ACTIVE = "is_active"
ATTR_IS_OWNER = "is_owner"
ATTR_JOBS = "jobs"
ATTR_LLMNR = "llmnr"
ATTR_LLMNR_HOSTNAME = "llmnr_hostname"
ATTR_LOCAL_ONLY = "local_only"
ATTR_LOCATION_ATTRIBUTES = "location_attributes"
ATTR_LOCATIONS = "locations"
ATTR_MDNS = "mdns"
ATTR_MODEL = "model"
ATTR_MOUNTS = "mounts"
ATTR_MOUNT_POINTS = "mount_points"
ATTR_PANEL_PATH = "panel_path"
ATTR_REMOVABLE = "removable"
ATTR_REMOVE_CONFIG = "remove_config"
ATTR_REVISION = "revision"
ATTR_SAFE_MODE = "safe_mode"
ATTR_SEAT = "seat"
ATTR_SIGNED = "signed"
ATTR_STARTUP_TIME = "startup_time"
ATTR_STATUS = "status"
ATTR_SUBSYSTEM = "subsystem"
ATTR_SYSFS = "sysfs"
ATTR_SYSTEM_HEALTH_LED = "system_health_led"
ATTR_TIME_DETECTED = "time_detected"
ATTR_UPDATE_TYPE = "update_type"
ATTR_USAGE = "usage"
ATTR_USE_NTP = "use_ntp"
ATTR_USERS = "users"
ATTR_USER_PATH = "user_path"
ATTR_VENDOR = "vendor"
ATTR_VIRTUALIZATION = "virtualization"
class BootSlot(StrEnum):
"""Boot slots used by HAOS."""
A = "A"
B = "B"
class DetectBlockingIO(StrEnum):
"""Enable/Disable detection for blocking I/O in event loop."""
OFF = "off"
ON = "on"
ON_AT_STARTUP = "on-at-startup"

View File

@@ -1,6 +1,12 @@
"""Init file for Supervisor network RESTful API.""" """Init file for Supervisor network RESTful API."""
import logging
from typing import Any
from aiohttp import web
import voluptuous as vol import voluptuous as vol
from ..addons.addon import Addon
from ..const import ( from ..const import (
ATTR_ADDON, ATTR_ADDON,
ATTR_CONFIG, ATTR_CONFIG,
@@ -9,16 +15,19 @@ from ..const import (
ATTR_SERVICES, ATTR_SERVICES,
ATTR_UUID, ATTR_UUID,
REQUEST_FROM, REQUEST_FROM,
AddonState,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..discovery.validate import valid_discovery_service from ..discovery import Message
from ..exceptions import APIError, APIForbidden from ..exceptions import APIForbidden, APINotFound
from .utils import api_process, api_validate from .utils import api_process, api_validate, require_home_assistant
_LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_DISCOVERY = vol.Schema( SCHEMA_DISCOVERY = vol.Schema(
{ {
vol.Required(ATTR_SERVICE): valid_discovery_service, vol.Required(ATTR_SERVICE): str,
vol.Optional(ATTR_CONFIG): vol.Maybe(dict), vol.Required(ATTR_CONFIG): dict,
} }
) )
@@ -26,37 +35,36 @@ SCHEMA_DISCOVERY = vol.Schema(
class APIDiscovery(CoreSysAttributes): class APIDiscovery(CoreSysAttributes):
"""Handle RESTful API for discovery functions.""" """Handle RESTful API for discovery functions."""
def _extract_message(self, request): def _extract_message(self, request: web.Request) -> Message:
"""Extract discovery message from URL.""" """Extract discovery message from URL."""
message = self.sys_discovery.get(request.match_info.get("uuid")) message = self.sys_discovery.get(request.match_info["uuid"])
if not message: if not message:
raise APIError("Discovery message not found") raise APINotFound("Discovery message not found")
return message return message
def _check_permission_ha(self, request):
"""Check permission for API call / Home Assistant."""
if request[REQUEST_FROM] != self.sys_homeassistant:
raise APIForbidden("Only HomeAssistant can use this API!")
@api_process @api_process
async def list(self, request): @require_home_assistant
"""Show register services.""" async def list_discovery(self, request: web.Request) -> dict[str, Any]:
self._check_permission_ha(request) """Show registered and available services."""
# Get available discovery # Get available discovery
discovery = [] discovery = [
for message in self.sys_discovery.list_messages: {
discovery.append( ATTR_ADDON: message.addon,
{ ATTR_SERVICE: message.service,
ATTR_ADDON: message.addon, ATTR_UUID: message.uuid,
ATTR_SERVICE: message.service, ATTR_CONFIG: message.config,
ATTR_UUID: message.uuid, }
ATTR_CONFIG: message.config, for message in self.sys_discovery.list_messages
} if (
discovered := self.sys_addons.get_local_only(
message.addon,
)
) )
and discovered.state == AddonState.STARTED
]
# Get available services/add-ons # Get available services/add-ons
services = {} services: dict[str, list[str]] = {}
for addon in self.sys_addons.all: for addon in self.sys_addons.all:
for name in addon.discovery: for name in addon.discovery:
services.setdefault(name, []).append(addon.slug) services.setdefault(name, []).append(addon.slug)
@@ -64,28 +72,34 @@ class APIDiscovery(CoreSysAttributes):
return {ATTR_DISCOVERY: discovery, ATTR_SERVICES: services} return {ATTR_DISCOVERY: discovery, ATTR_SERVICES: services}
@api_process @api_process
async def set_discovery(self, request): async def set_discovery(self, request: web.Request) -> dict[str, str]:
"""Write data into a discovery pipeline.""" """Write data into a discovery pipeline."""
body = await api_validate(SCHEMA_DISCOVERY, request) body = await api_validate(SCHEMA_DISCOVERY, request)
addon = request[REQUEST_FROM] addon: Addon = request[REQUEST_FROM]
service = body[ATTR_SERVICE]
# Access? # Access?
if body[ATTR_SERVICE] not in addon.discovery: if body[ATTR_SERVICE] not in addon.discovery:
raise APIForbidden("Can't use discovery!") _LOGGER.error(
"Add-on %s attempted to send discovery for service %s which is not listed in its config. Please report this to the maintainer of the add-on",
addon.name,
service,
)
raise APIForbidden(
"Add-ons must list services they provide via discovery in their config!"
)
# Process discovery message # Process discovery message
message = self.sys_discovery.send(addon, **body) message = await self.sys_discovery.send(addon, **body)
return {ATTR_UUID: message.uuid} return {ATTR_UUID: message.uuid}
@api_process @api_process
async def get_discovery(self, request): @require_home_assistant
async def get_discovery(self, request: web.Request) -> dict[str, Any]:
"""Read data into a discovery message.""" """Read data into a discovery message."""
message = self._extract_message(request) message = self._extract_message(request)
# HomeAssistant?
self._check_permission_ha(request)
return { return {
ATTR_ADDON: message.addon, ATTR_ADDON: message.addon,
ATTR_SERVICE: message.service, ATTR_SERVICE: message.service,
@@ -94,7 +108,7 @@ class APIDiscovery(CoreSysAttributes):
} }
@api_process @api_process
async def del_discovery(self, request): async def del_discovery(self, request: web.Request) -> None:
"""Delete data into a discovery message.""" """Delete data into a discovery message."""
message = self._extract_message(request) message = self._extract_message(request)
addon = request[REQUEST_FROM] addon = request[REQUEST_FROM]
@@ -103,5 +117,4 @@ class APIDiscovery(CoreSysAttributes):
if message.addon != addon.slug: if message.addon != addon.slug:
raise APIForbidden("Can't remove discovery message") raise APIForbidden("Can't remove discovery message")
self.sys_discovery.remove(message) await self.sys_discovery.remove(message)
return True

View File

@@ -1,7 +1,9 @@
"""Init file for Supervisor DNS RESTful API.""" """Init file for Supervisor DNS RESTful API."""
import asyncio import asyncio
from collections.abc import Awaitable
import logging import logging
from typing import Any, Awaitable, Dict from typing import Any
from aiohttp import web from aiohttp import web
import voluptuous as vol import voluptuous as vol
@@ -21,17 +23,22 @@ from ..const import (
ATTR_UPDATE_AVAILABLE, ATTR_UPDATE_AVAILABLE,
ATTR_VERSION, ATTR_VERSION,
ATTR_VERSION_LATEST, ATTR_VERSION_LATEST,
CONTENT_TYPE_BINARY,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..exceptions import APIError from ..exceptions import APIError
from ..validate import dns_server_list, version_tag from ..validate import dns_server_list, version_tag
from .utils import api_process, api_process_raw, api_validate from .const import ATTR_FALLBACK, ATTR_LLMNR, ATTR_MDNS
from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
# pylint: disable=no-value-for-parameter # pylint: disable=no-value-for-parameter
SCHEMA_OPTIONS = vol.Schema({vol.Optional(ATTR_SERVERS): dns_server_list}) SCHEMA_OPTIONS = vol.Schema(
{
vol.Optional(ATTR_SERVERS): dns_server_list,
vol.Optional(ATTR_FALLBACK): vol.Boolean(),
}
)
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): version_tag}) SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): version_tag})
@@ -40,7 +47,7 @@ class APICoreDNS(CoreSysAttributes):
"""Handle RESTful API for DNS functions.""" """Handle RESTful API for DNS functions."""
@api_process @api_process
async def info(self, request: web.Request) -> Dict[str, Any]: async def info(self, request: web.Request) -> dict[str, Any]:
"""Return DNS information.""" """Return DNS information."""
return { return {
ATTR_VERSION: self.sys_plugins.dns.version, ATTR_VERSION: self.sys_plugins.dns.version,
@@ -49,21 +56,32 @@ class APICoreDNS(CoreSysAttributes):
ATTR_HOST: str(self.sys_docker.network.dns), ATTR_HOST: str(self.sys_docker.network.dns),
ATTR_SERVERS: self.sys_plugins.dns.servers, ATTR_SERVERS: self.sys_plugins.dns.servers,
ATTR_LOCALS: self.sys_plugins.dns.locals, ATTR_LOCALS: self.sys_plugins.dns.locals,
ATTR_MDNS: self.sys_plugins.dns.mdns,
ATTR_LLMNR: self.sys_plugins.dns.llmnr,
ATTR_FALLBACK: self.sys_plugins.dns.fallback,
} }
@api_process @api_process
async def options(self, request: web.Request) -> None: async def options(self, request: web.Request) -> None:
"""Set DNS options.""" """Set DNS options."""
body = await api_validate(SCHEMA_OPTIONS, request) body = await api_validate(SCHEMA_OPTIONS, request)
restart_required = False
if ATTR_SERVERS in body: if ATTR_SERVERS in body:
self.sys_plugins.dns.servers = body[ATTR_SERVERS] self.sys_plugins.dns.servers = body[ATTR_SERVERS]
restart_required = True
if ATTR_FALLBACK in body:
self.sys_plugins.dns.fallback = body[ATTR_FALLBACK]
restart_required = True
if restart_required:
self.sys_create_task(self.sys_plugins.dns.restart()) self.sys_create_task(self.sys_plugins.dns.restart())
self.sys_plugins.dns.save_data() await self.sys_plugins.dns.save_data()
@api_process @api_process
async def stats(self, request: web.Request) -> Dict[str, Any]: async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information.""" """Return resource information."""
stats = await self.sys_plugins.dns.stats() stats = await self.sys_plugins.dns.stats()
@@ -88,11 +106,6 @@ class APICoreDNS(CoreSysAttributes):
raise APIError(f"Version {version} is already in use") raise APIError(f"Version {version} is already in use")
await asyncio.shield(self.sys_plugins.dns.update(version)) await asyncio.shield(self.sys_plugins.dns.update(version))
@api_process_raw(CONTENT_TYPE_BINARY)
def logs(self, request: web.Request) -> Awaitable[bytes]:
"""Return DNS Docker logs."""
return self.sys_plugins.dns.logs()
@api_process @api_process
def restart(self, request: web.Request) -> Awaitable[None]: def restart(self, request: web.Request) -> Awaitable[None]:
"""Restart CoreDNS plugin.""" """Restart CoreDNS plugin."""

View File

@@ -1,11 +1,15 @@
"""Init file for Supervisor Home Assistant RESTful API.""" """Init file for Supervisor Home Assistant RESTful API."""
import logging import logging
from typing import Any, Dict from typing import Any
from aiohttp import web from aiohttp import web
import voluptuous as vol import voluptuous as vol
from supervisor.resolution.const import ContextType, IssueType, SuggestionType
from ..const import ( from ..const import (
ATTR_ENABLE_IPV6,
ATTR_HOSTNAME, ATTR_HOSTNAME,
ATTR_LOGGING, ATTR_LOGGING,
ATTR_PASSWORD, ATTR_PASSWORD,
@@ -15,25 +19,64 @@ from ..const import (
ATTR_VERSION, ATTR_VERSION,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..exceptions import APINotFound
from .utils import api_process, api_validate from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_DOCKER_REGISTRY = vol.Schema( SCHEMA_DOCKER_REGISTRY = vol.Schema(
{ {
vol.Coerce(str): { str: {
vol.Required(ATTR_USERNAME): str, vol.Required(ATTR_USERNAME): str,
vol.Required(ATTR_PASSWORD): str, vol.Required(ATTR_PASSWORD): str,
} }
} }
) )
# pylint: disable=no-value-for-parameter
SCHEMA_OPTIONS = vol.Schema({vol.Optional(ATTR_ENABLE_IPV6): vol.Maybe(vol.Boolean())})
class APIDocker(CoreSysAttributes): class APIDocker(CoreSysAttributes):
"""Handle RESTful API for Docker configuration.""" """Handle RESTful API for Docker configuration."""
@api_process @api_process
async def registries(self, request) -> Dict[str, Any]: async def info(self, request: web.Request):
"""Get docker info."""
data_registries = {}
for hostname, registry in self.sys_docker.config.registries.items():
data_registries[hostname] = {
ATTR_USERNAME: registry[ATTR_USERNAME],
}
return {
ATTR_VERSION: self.sys_docker.info.version,
ATTR_ENABLE_IPV6: self.sys_docker.config.enable_ipv6,
ATTR_STORAGE: self.sys_docker.info.storage,
ATTR_LOGGING: self.sys_docker.info.logging,
ATTR_REGISTRIES: data_registries,
}
@api_process
async def options(self, request: web.Request) -> None:
"""Set docker options."""
body = await api_validate(SCHEMA_OPTIONS, request)
if (
ATTR_ENABLE_IPV6 in body
and self.sys_docker.config.enable_ipv6 != body[ATTR_ENABLE_IPV6]
):
self.sys_docker.config.enable_ipv6 = body[ATTR_ENABLE_IPV6]
_LOGGER.info("Host system reboot required to apply new IPv6 configuration")
self.sys_resolution.create_issue(
IssueType.REBOOT_REQUIRED,
ContextType.SYSTEM,
suggestions=[SuggestionType.EXECUTE_REBOOT],
)
await self.sys_docker.config.save_data()
@api_process
async def registries(self, request) -> dict[str, Any]:
"""Return the list of registries.""" """Return the list of registries."""
data_registries = {} data_registries = {}
for hostname, registry in self.sys_docker.config.registries.items(): for hostname, registry in self.sys_docker.config.registries.items():
@@ -51,26 +94,14 @@ class APIDocker(CoreSysAttributes):
for hostname, registry in body.items(): for hostname, registry in body.items():
self.sys_docker.config.registries[hostname] = registry self.sys_docker.config.registries[hostname] = registry
self.sys_docker.config.save_data() await self.sys_docker.config.save_data()
@api_process @api_process
async def remove_registry(self, request: web.Request): async def remove_registry(self, request: web.Request):
"""Delete a docker registry.""" """Delete a docker registry."""
hostname = request.match_info.get(ATTR_HOSTNAME) hostname = request.match_info.get(ATTR_HOSTNAME)
del self.sys_docker.config.registries[hostname] if hostname not in self.sys_docker.config.registries:
self.sys_docker.config.save_data() raise APINotFound(f"Hostname {hostname} does not exist in registries")
@api_process del self.sys_docker.config.registries[hostname]
async def info(self, request: web.Request): await self.sys_docker.config.save_data()
"""Get docker info."""
data_registries = {}
for hostname, registry in self.sys_docker.config.registries.items():
data_registries[hostname] = {
ATTR_USERNAME: registry[ATTR_USERNAME],
}
return {
ATTR_VERSION: self.sys_docker.info.version,
ATTR_STORAGE: self.sys_docker.info.storage,
ATTR_LOGGING: self.sys_docker.info.logging,
ATTR_REGISTRIES: data_registries,
}

View File

@@ -1,54 +1,121 @@
"""Init file for Supervisor hardware RESTful API.""" """Init file for Supervisor hardware RESTful API."""
import asyncio
import logging import logging
from typing import Any, Awaitable, Dict, List from typing import Any
from aiohttp import web from aiohttp import web
from ..const import ( from ..const import (
ATTR_AUDIO, ATTR_AUDIO,
ATTR_DISK, ATTR_DEVICES,
ATTR_GPIO, ATTR_ID,
ATTR_INPUT, ATTR_INPUT,
ATTR_NAME,
ATTR_OUTPUT, ATTR_OUTPUT,
ATTR_SERIAL, ATTR_SERIAL,
ATTR_USB, ATTR_SIZE,
ATTR_SYSTEM,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..dbus.udisks2 import UDisks2Manager
from ..dbus.udisks2.block import UDisks2Block
from ..dbus.udisks2.drive import UDisks2Drive
from ..hardware.data import Device
from .const import (
ATTR_ATTRIBUTES,
ATTR_BY_ID,
ATTR_CHILDREN,
ATTR_CONNECTION_BUS,
ATTR_DEV_PATH,
ATTR_DEVICE,
ATTR_DRIVES,
ATTR_EJECTABLE,
ATTR_FILESYSTEMS,
ATTR_MODEL,
ATTR_MOUNT_POINTS,
ATTR_REMOVABLE,
ATTR_REVISION,
ATTR_SEAT,
ATTR_SUBSYSTEM,
ATTR_SYSFS,
ATTR_TIME_DETECTED,
ATTR_VENDOR,
)
from .utils import api_process from .utils import api_process
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
def device_struct(device: Device) -> dict[str, Any]:
"""Return a dict with information of a interface to be used in the API."""
return {
ATTR_NAME: device.name,
ATTR_SYSFS: device.sysfs,
ATTR_DEV_PATH: device.path,
ATTR_SUBSYSTEM: device.subsystem,
ATTR_BY_ID: device.by_id,
ATTR_ATTRIBUTES: device.attributes,
ATTR_CHILDREN: device.children,
}
def filesystem_struct(fs_block: UDisks2Block) -> dict[str, Any]:
"""Return a dict with information of a filesystem block device to be used in the API."""
return {
ATTR_DEVICE: str(fs_block.device),
ATTR_ID: fs_block.id,
ATTR_SIZE: fs_block.size,
ATTR_NAME: fs_block.id_label,
ATTR_SYSTEM: fs_block.hint_system,
ATTR_MOUNT_POINTS: [
str(mount_point)
for mount_point in (
fs_block.filesystem.mount_points if fs_block.filesystem else []
)
],
}
def drive_struct(udisks2: UDisks2Manager, drive: UDisks2Drive) -> dict[str, Any]:
"""Return a dict with information of a disk to be used in the API."""
return {
ATTR_VENDOR: drive.vendor,
ATTR_MODEL: drive.model,
ATTR_REVISION: drive.revision,
ATTR_SERIAL: drive.serial,
ATTR_ID: drive.id,
ATTR_SIZE: drive.size,
ATTR_TIME_DETECTED: drive.time_detected.isoformat(),
ATTR_CONNECTION_BUS: drive.connection_bus,
ATTR_SEAT: drive.seat,
ATTR_REMOVABLE: drive.removable,
ATTR_EJECTABLE: drive.ejectable,
ATTR_FILESYSTEMS: [
filesystem_struct(block)
for block in udisks2.block_devices
if block.filesystem and block.drive == drive.object_path
],
}
class APIHardware(CoreSysAttributes): class APIHardware(CoreSysAttributes):
"""Handle RESTful API for hardware functions.""" """Handle RESTful API for hardware functions."""
@api_process @api_process
async def info(self, request: web.Request) -> Dict[str, Any]: async def info(self, request: web.Request) -> dict[str, Any]:
"""Show hardware info.""" """Show hardware info."""
serial: List[str] = []
# Create Serial list with device links
for device in self.sys_hardware.serial_devices:
serial.append(device.path.as_posix())
for link in device.links:
serial.append(link.as_posix())
return { return {
ATTR_SERIAL: serial, ATTR_DEVICES: [
ATTR_INPUT: list(self.sys_hardware.input_devices), device_struct(device) for device in self.sys_hardware.devices
ATTR_DISK: [
device.path.as_posix() for device in self.sys_hardware.disk_devices
], ],
ATTR_GPIO: list(self.sys_hardware.gpio_devices), ATTR_DRIVES: [
ATTR_USB: [ drive_struct(self.sys_dbus.udisks2, drive)
device.path.as_posix() for device in self.sys_hardware.usb_devices for drive in self.sys_dbus.udisks2.drives
], ],
ATTR_AUDIO: self.sys_hardware.audio_devices,
} }
@api_process @api_process
async def audio(self, request: web.Request) -> Dict[str, Any]: async def audio(self, request: web.Request) -> dict[str, Any]:
"""Show pulse audio profiles.""" """Show pulse audio profiles."""
return { return {
ATTR_AUDIO: { ATTR_AUDIO: {
@@ -62,8 +129,3 @@ class APIHardware(CoreSysAttributes):
}, },
} }
} }
@api_process
def trigger(self, request: web.Request) -> Awaitable[None]:
"""Trigger a udev device reload."""
return asyncio.shield(self.sys_hardware.udev_trigger())

View File

@@ -1,7 +1,9 @@
"""Init file for Supervisor Home Assistant RESTful API.""" """Init file for Supervisor Home Assistant RESTful API."""
import asyncio import asyncio
from collections.abc import Awaitable
import logging import logging
from typing import Any, Awaitable, Dict from typing import Any
from aiohttp import web from aiohttp import web
import voluptuous as vol import voluptuous as vol
@@ -10,6 +12,8 @@ from ..const import (
ATTR_ARCH, ATTR_ARCH,
ATTR_AUDIO_INPUT, ATTR_AUDIO_INPUT,
ATTR_AUDIO_OUTPUT, ATTR_AUDIO_OUTPUT,
ATTR_BACKUP,
ATTR_BACKUPS_EXCLUDE_DATABASE,
ATTR_BLK_READ, ATTR_BLK_READ,
ATTR_BLK_WRITE, ATTR_BLK_WRITE,
ATTR_BOOT, ATTR_BOOT,
@@ -28,14 +32,13 @@ from ..const import (
ATTR_UPDATE_AVAILABLE, ATTR_UPDATE_AVAILABLE,
ATTR_VERSION, ATTR_VERSION,
ATTR_VERSION_LATEST, ATTR_VERSION_LATEST,
ATTR_WAIT_BOOT,
ATTR_WATCHDOG, ATTR_WATCHDOG,
CONTENT_TYPE_BINARY,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..exceptions import APIError from ..exceptions import APIDBMigrationInProgress, APIError
from ..validate import docker_image, network_port, version_tag from ..validate import docker_image, network_port, version_tag
from .utils import api_process, api_process_raw, api_validate from .const import ATTR_FORCE, ATTR_SAFE_MODE
from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -43,25 +46,54 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_OPTIONS = vol.Schema( SCHEMA_OPTIONS = vol.Schema(
{ {
vol.Optional(ATTR_BOOT): vol.Boolean(), vol.Optional(ATTR_BOOT): vol.Boolean(),
vol.Optional(ATTR_IMAGE): docker_image, vol.Optional(ATTR_IMAGE): vol.Maybe(docker_image),
vol.Optional(ATTR_PORT): network_port, vol.Optional(ATTR_PORT): network_port,
vol.Optional(ATTR_SSL): vol.Boolean(), vol.Optional(ATTR_SSL): vol.Boolean(),
vol.Optional(ATTR_WATCHDOG): vol.Boolean(), vol.Optional(ATTR_WATCHDOG): vol.Boolean(),
vol.Optional(ATTR_WAIT_BOOT): vol.All(vol.Coerce(int), vol.Range(min=60)), vol.Optional(ATTR_REFRESH_TOKEN): vol.Maybe(str),
vol.Optional(ATTR_REFRESH_TOKEN): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(str),
vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(str),
vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_BACKUPS_EXCLUDE_DATABASE): vol.Boolean(),
} }
) )
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): version_tag}) SCHEMA_UPDATE = vol.Schema(
{
vol.Optional(ATTR_VERSION): version_tag,
vol.Optional(ATTR_BACKUP): bool,
}
)
SCHEMA_RESTART = vol.Schema(
{
vol.Optional(ATTR_SAFE_MODE, default=False): vol.Boolean(),
vol.Optional(ATTR_FORCE, default=False): vol.Boolean(),
}
)
SCHEMA_STOP = vol.Schema(
{
vol.Optional(ATTR_FORCE, default=False): vol.Boolean(),
}
)
class APIHomeAssistant(CoreSysAttributes): class APIHomeAssistant(CoreSysAttributes):
"""Handle RESTful API for Home Assistant functions.""" """Handle RESTful API for Home Assistant functions."""
async def _check_offline_migration(self, force: bool = False) -> None:
"""Check and raise if there's an offline DB migration in progress."""
if (
not force
and (state := await self.sys_homeassistant.api.get_api_state())
and state.offline_db_migration
):
raise APIDBMigrationInProgress(
"Offline database migration in progress, try again after it has completed"
)
@api_process @api_process
async def info(self, request: web.Request) -> Dict[str, Any]: async def info(self, request: web.Request) -> dict[str, Any]:
"""Return host information.""" """Return host information."""
return { return {
ATTR_VERSION: self.sys_homeassistant.version, ATTR_VERSION: self.sys_homeassistant.version,
@@ -75,11 +107,9 @@ class APIHomeAssistant(CoreSysAttributes):
ATTR_PORT: self.sys_homeassistant.api_port, ATTR_PORT: self.sys_homeassistant.api_port,
ATTR_SSL: self.sys_homeassistant.api_ssl, ATTR_SSL: self.sys_homeassistant.api_ssl,
ATTR_WATCHDOG: self.sys_homeassistant.watchdog, ATTR_WATCHDOG: self.sys_homeassistant.watchdog,
ATTR_WAIT_BOOT: self.sys_homeassistant.wait_boot,
ATTR_AUDIO_INPUT: self.sys_homeassistant.audio_input, ATTR_AUDIO_INPUT: self.sys_homeassistant.audio_input,
ATTR_AUDIO_OUTPUT: self.sys_homeassistant.audio_output, ATTR_AUDIO_OUTPUT: self.sys_homeassistant.audio_output,
# Remove end of Q3 2020 ATTR_BACKUPS_EXCLUDE_DATABASE: self.sys_homeassistant.backups_exclude_database,
"last_version": self.sys_homeassistant.latest_version,
} }
@api_process @api_process
@@ -88,7 +118,10 @@ class APIHomeAssistant(CoreSysAttributes):
body = await api_validate(SCHEMA_OPTIONS, request) body = await api_validate(SCHEMA_OPTIONS, request)
if ATTR_IMAGE in body: if ATTR_IMAGE in body:
self.sys_homeassistant.image = body[ATTR_IMAGE] self.sys_homeassistant.set_image(body[ATTR_IMAGE])
self.sys_homeassistant.override_image = (
self.sys_homeassistant.image != self.sys_homeassistant.default_image
)
if ATTR_BOOT in body: if ATTR_BOOT in body:
self.sys_homeassistant.boot = body[ATTR_BOOT] self.sys_homeassistant.boot = body[ATTR_BOOT]
@@ -102,9 +135,6 @@ class APIHomeAssistant(CoreSysAttributes):
if ATTR_WATCHDOG in body: if ATTR_WATCHDOG in body:
self.sys_homeassistant.watchdog = body[ATTR_WATCHDOG] self.sys_homeassistant.watchdog = body[ATTR_WATCHDOG]
if ATTR_WAIT_BOOT in body:
self.sys_homeassistant.wait_boot = body[ATTR_WAIT_BOOT]
if ATTR_REFRESH_TOKEN in body: if ATTR_REFRESH_TOKEN in body:
self.sys_homeassistant.refresh_token = body[ATTR_REFRESH_TOKEN] self.sys_homeassistant.refresh_token = body[ATTR_REFRESH_TOKEN]
@@ -114,10 +144,15 @@ class APIHomeAssistant(CoreSysAttributes):
if ATTR_AUDIO_OUTPUT in body: if ATTR_AUDIO_OUTPUT in body:
self.sys_homeassistant.audio_output = body[ATTR_AUDIO_OUTPUT] self.sys_homeassistant.audio_output = body[ATTR_AUDIO_OUTPUT]
self.sys_homeassistant.save_data() if ATTR_BACKUPS_EXCLUDE_DATABASE in body:
self.sys_homeassistant.backups_exclude_database = body[
ATTR_BACKUPS_EXCLUDE_DATABASE
]
await self.sys_homeassistant.save_data()
@api_process @api_process
async def stats(self, request: web.Request) -> Dict[Any, str]: async def stats(self, request: web.Request) -> dict[Any, str]:
"""Return resource information.""" """Return resource information."""
stats = await self.sys_homeassistant.core.stats() stats = await self.sys_homeassistant.core.stats()
if not stats: if not stats:
@@ -137,15 +172,23 @@ class APIHomeAssistant(CoreSysAttributes):
@api_process @api_process
async def update(self, request: web.Request) -> None: async def update(self, request: web.Request) -> None:
"""Update Home Assistant.""" """Update Home Assistant."""
body = await api_validate(SCHEMA_VERSION, request) body = await api_validate(SCHEMA_UPDATE, request)
version = body.get(ATTR_VERSION, self.sys_homeassistant.latest_version) await self._check_offline_migration()
await asyncio.shield(self.sys_homeassistant.core.update(version)) await asyncio.shield(
self.sys_homeassistant.core.update(
version=body.get(ATTR_VERSION, self.sys_homeassistant.latest_version),
backup=body.get(ATTR_BACKUP),
)
)
@api_process @api_process
def stop(self, request: web.Request) -> Awaitable[None]: async def stop(self, request: web.Request) -> Awaitable[None]:
"""Stop Home Assistant.""" """Stop Home Assistant."""
return asyncio.shield(self.sys_homeassistant.core.stop()) body = await api_validate(SCHEMA_STOP, request)
await self._check_offline_migration(force=body[ATTR_FORCE])
return await asyncio.shield(self.sys_homeassistant.core.stop())
@api_process @api_process
def start(self, request: web.Request) -> Awaitable[None]: def start(self, request: web.Request) -> Awaitable[None]:
@@ -153,19 +196,24 @@ class APIHomeAssistant(CoreSysAttributes):
return asyncio.shield(self.sys_homeassistant.core.start()) return asyncio.shield(self.sys_homeassistant.core.start())
@api_process @api_process
def restart(self, request: web.Request) -> Awaitable[None]: async def restart(self, request: web.Request) -> None:
"""Restart Home Assistant.""" """Restart Home Assistant."""
return asyncio.shield(self.sys_homeassistant.core.restart()) body = await api_validate(SCHEMA_RESTART, request)
await self._check_offline_migration(force=body[ATTR_FORCE])
await asyncio.shield(
self.sys_homeassistant.core.restart(safe_mode=body[ATTR_SAFE_MODE])
)
@api_process @api_process
def rebuild(self, request: web.Request) -> Awaitable[None]: async def rebuild(self, request: web.Request) -> None:
"""Rebuild Home Assistant.""" """Rebuild Home Assistant."""
return asyncio.shield(self.sys_homeassistant.core.rebuild()) body = await api_validate(SCHEMA_RESTART, request)
await self._check_offline_migration(force=body[ATTR_FORCE])
@api_process_raw(CONTENT_TYPE_BINARY) await asyncio.shield(
def logs(self, request: web.Request) -> Awaitable[bytes]: self.sys_homeassistant.core.rebuild(safe_mode=body[ATTR_SAFE_MODE])
"""Return Home Assistant Docker logs.""" )
return self.sys_homeassistant.core.logs()
@api_process @api_process
async def check(self, request: web.Request) -> None: async def check(self, request: web.Request) -> None:

View File

@@ -1,9 +1,14 @@
"""Init file for Supervisor host RESTful API.""" """Init file for Supervisor host RESTful API."""
import asyncio
from typing import Awaitable
from aiohttp import web import asyncio
from contextlib import suppress
import logging
from typing import Any
from aiohttp import ClientConnectionResetError, ClientPayloadError, web
from aiohttp.hdrs import ACCEPT, RANGE
import voluptuous as vol import voluptuous as vol
from voluptuous.error import CoerceInvalid
from ..const import ( from ..const import (
ATTR_CHASSIS, ATTR_CHASSIS,
@@ -11,6 +16,7 @@ from ..const import (
ATTR_DEPLOYMENT, ATTR_DEPLOYMENT,
ATTR_DESCRIPTON, ATTR_DESCRIPTON,
ATTR_DISK_FREE, ATTR_DISK_FREE,
ATTR_DISK_LIFE_TIME,
ATTR_DISK_TOTAL, ATTR_DISK_TOTAL,
ATTR_DISK_USED, ATTR_DISK_USED,
ATTR_FEATURES, ATTR_FEATURES,
@@ -20,33 +26,97 @@ from ..const import (
ATTR_OPERATING_SYSTEM, ATTR_OPERATING_SYSTEM,
ATTR_SERVICES, ATTR_SERVICES,
ATTR_STATE, ATTR_STATE,
CONTENT_TYPE_BINARY, ATTR_TIMEZONE,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..exceptions import APIDBMigrationInProgress, APIError, HostLogError
from ..host.const import (
PARAM_BOOT_ID,
PARAM_FOLLOW,
PARAM_SYSLOG_IDENTIFIER,
LogFormat,
LogFormatter,
)
from ..host.logs import SYSTEMD_JOURNAL_GATEWAYD_LINES_MAX
from ..utils.systemd_journal import journal_logs_reader
from .const import (
ATTR_AGENT_VERSION,
ATTR_APPARMOR_VERSION,
ATTR_BOOT_TIMESTAMP,
ATTR_BOOTS,
ATTR_BROADCAST_LLMNR,
ATTR_BROADCAST_MDNS,
ATTR_DT_SYNCHRONIZED,
ATTR_DT_UTC,
ATTR_FORCE,
ATTR_IDENTIFIERS,
ATTR_LLMNR_HOSTNAME,
ATTR_STARTUP_TIME,
ATTR_USE_NTP,
ATTR_VIRTUALIZATION,
CONTENT_TYPE_TEXT,
CONTENT_TYPE_X_LOG,
)
from .utils import api_process, api_process_raw, api_validate from .utils import api_process, api_process_raw, api_validate
SERVICE = "service" _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_OPTIONS = vol.Schema({vol.Optional(ATTR_HOSTNAME): vol.Coerce(str)}) IDENTIFIER = "identifier"
BOOTID = "bootid"
DEFAULT_LINES = 100
SCHEMA_OPTIONS = vol.Schema({vol.Optional(ATTR_HOSTNAME): str})
# pylint: disable=no-value-for-parameter
SCHEMA_SHUTDOWN = vol.Schema(
{
vol.Optional(ATTR_FORCE, default=False): vol.Boolean(),
}
)
# pylint: enable=no-value-for-parameter
class APIHost(CoreSysAttributes): class APIHost(CoreSysAttributes):
"""Handle RESTful API for host functions.""" """Handle RESTful API for host functions."""
async def _check_ha_offline_migration(self, force: bool) -> None:
"""Check if HA has an offline migration in progress and raise if not forced."""
if (
not force
and (state := await self.sys_homeassistant.api.get_api_state())
and state.offline_db_migration
):
raise APIDBMigrationInProgress(
"Home Assistant offline database migration in progress, please wait until complete before shutting down host"
)
@api_process @api_process
async def info(self, request): async def info(self, request):
"""Return host information.""" """Return host information."""
return { return {
ATTR_AGENT_VERSION: self.sys_dbus.agent.version,
ATTR_APPARMOR_VERSION: self.sys_host.apparmor.version,
ATTR_CHASSIS: self.sys_host.info.chassis, ATTR_CHASSIS: self.sys_host.info.chassis,
ATTR_VIRTUALIZATION: self.sys_host.info.virtualization,
ATTR_CPE: self.sys_host.info.cpe, ATTR_CPE: self.sys_host.info.cpe,
ATTR_DEPLOYMENT: self.sys_host.info.deployment, ATTR_DEPLOYMENT: self.sys_host.info.deployment,
ATTR_DISK_FREE: self.sys_host.info.free_space, ATTR_DISK_FREE: await self.sys_host.info.free_space(),
ATTR_DISK_TOTAL: self.sys_host.info.total_space, ATTR_DISK_TOTAL: await self.sys_host.info.total_space(),
ATTR_DISK_USED: self.sys_host.info.used_space, ATTR_DISK_USED: await self.sys_host.info.used_space(),
ATTR_DISK_LIFE_TIME: await self.sys_host.info.disk_life_time(),
ATTR_FEATURES: self.sys_host.features, ATTR_FEATURES: self.sys_host.features,
ATTR_HOSTNAME: self.sys_host.info.hostname, ATTR_HOSTNAME: self.sys_host.info.hostname,
ATTR_LLMNR_HOSTNAME: self.sys_host.info.llmnr_hostname,
ATTR_KERNEL: self.sys_host.info.kernel, ATTR_KERNEL: self.sys_host.info.kernel,
ATTR_OPERATING_SYSTEM: self.sys_host.info.operating_system, ATTR_OPERATING_SYSTEM: self.sys_host.info.operating_system,
ATTR_TIMEZONE: self.sys_host.info.timezone,
ATTR_DT_UTC: self.sys_host.info.dt_utc,
ATTR_DT_SYNCHRONIZED: self.sys_host.info.dt_synchronized,
ATTR_USE_NTP: self.sys_host.info.use_ntp,
ATTR_STARTUP_TIME: self.sys_host.info.startup_time,
ATTR_BOOT_TIMESTAMP: self.sys_host.info.boot_timestamp,
ATTR_BROADCAST_LLMNR: self.sys_host.info.broadcast_llmnr,
ATTR_BROADCAST_MDNS: self.sys_host.info.broadcast_mdns,
} }
@api_process @api_process
@@ -61,23 +131,25 @@ class APIHost(CoreSysAttributes):
) )
@api_process @api_process
def reboot(self, request): async def reboot(self, request):
"""Reboot host.""" """Reboot host."""
return asyncio.shield(self.sys_host.control.reboot()) body = await api_validate(SCHEMA_SHUTDOWN, request)
await self._check_ha_offline_migration(force=body[ATTR_FORCE])
return await asyncio.shield(self.sys_host.control.reboot())
@api_process @api_process
def shutdown(self, request): async def shutdown(self, request):
"""Poweroff host.""" """Poweroff host."""
return asyncio.shield(self.sys_host.control.shutdown()) body = await api_validate(SCHEMA_SHUTDOWN, request)
await self._check_ha_offline_migration(force=body[ATTR_FORCE])
return await asyncio.shield(self.sys_host.control.shutdown())
@api_process @api_process
def reload(self, request): def reload(self, request):
"""Reload host data.""" """Reload host data."""
return asyncio.shield( return asyncio.shield(self.sys_host.reload())
asyncio.wait(
[self.sys_host.reload(), self.sys_resolution.evaluate.evaluate_system()]
)
)
@api_process @api_process
async def services(self, request): async def services(self, request):
@@ -95,30 +167,125 @@ class APIHost(CoreSysAttributes):
return {ATTR_SERVICES: services} return {ATTR_SERVICES: services}
@api_process @api_process
def service_start(self, request): async def list_boots(self, _: web.Request):
"""Start a service.""" """Return a list of boot IDs."""
unit = request.match_info.get(SERVICE) boot_ids = await self.sys_host.logs.get_boot_ids()
return asyncio.shield(self.sys_host.services.start(unit)) return {
ATTR_BOOTS: {
str(1 + i - len(boot_ids)): boot_id
for i, boot_id in enumerate(boot_ids)
}
}
@api_process @api_process
def service_stop(self, request): async def list_identifiers(self, _: web.Request):
"""Stop a service.""" """Return a list of syslog identifiers."""
unit = request.match_info.get(SERVICE) return {ATTR_IDENTIFIERS: await self.sys_host.logs.get_identifiers()}
return asyncio.shield(self.sys_host.services.stop(unit))
@api_process async def _get_boot_id(self, possible_offset: str) -> str:
def service_reload(self, request): """Convert offset into boot ID if required."""
"""Reload a service.""" with suppress(CoerceInvalid):
unit = request.match_info.get(SERVICE) offset = vol.Coerce(int)(possible_offset)
return asyncio.shield(self.sys_host.services.reload(unit)) try:
return await self.sys_host.logs.get_boot_id(offset)
except (ValueError, HostLogError) as err:
raise APIError() from err
return possible_offset
@api_process async def advanced_logs_handler(
def service_restart(self, request): self, request: web.Request, identifier: str | None = None, follow: bool = False
"""Restart a service.""" ) -> web.StreamResponse:
unit = request.match_info.get(SERVICE) """Return systemd-journald logs."""
return asyncio.shield(self.sys_host.services.restart(unit)) log_formatter = LogFormatter.PLAIN
params: dict[str, Any] = {}
if identifier:
params[PARAM_SYSLOG_IDENTIFIER] = identifier
elif IDENTIFIER in request.match_info:
params[PARAM_SYSLOG_IDENTIFIER] = request.match_info[IDENTIFIER]
else:
params[PARAM_SYSLOG_IDENTIFIER] = self.sys_host.logs.default_identifiers
# host logs should be always verbose, no matter what Accept header is used
log_formatter = LogFormatter.VERBOSE
@api_process_raw(CONTENT_TYPE_BINARY) if BOOTID in request.match_info:
def logs(self, request: web.Request) -> Awaitable[bytes]: params[PARAM_BOOT_ID] = await self._get_boot_id(request.match_info[BOOTID])
"""Return host kernel logs.""" if follow:
return self.sys_host.info.get_dmesg() params[PARAM_FOLLOW] = ""
if ACCEPT in request.headers and request.headers[ACCEPT] not in [
CONTENT_TYPE_TEXT,
CONTENT_TYPE_X_LOG,
"*/*",
]:
raise APIError(
"Invalid content type requested. Only text/plain and text/x-log "
"supported for now."
)
if "verbose" in request.query or request.headers[ACCEPT] == CONTENT_TYPE_X_LOG:
log_formatter = LogFormatter.VERBOSE
if "lines" in request.query:
lines = request.query.get("lines", DEFAULT_LINES)
try:
lines = int(lines)
except ValueError:
# If the user passed a non-integer value, just use the default instead of error.
lines = DEFAULT_LINES
finally:
# We can't use the entries= Range header syntax to refer to the last 1 line,
# and passing 1 to the calculation below would return the 1st line of the logs
# instead. Since this is really an edge case that doesn't matter much, we'll just
# return 2 lines at minimum.
lines = max(2, lines)
# entries=cursor[[:num_skip]:num_entries]
range_header = f"entries=:-{lines - 1}:{SYSTEMD_JOURNAL_GATEWAYD_LINES_MAX if follow else lines}"
elif RANGE in request.headers:
range_header = request.headers[RANGE]
else:
range_header = f"entries=:-{DEFAULT_LINES - 1}:{SYSTEMD_JOURNAL_GATEWAYD_LINES_MAX if follow else DEFAULT_LINES}"
async with self.sys_host.logs.journald_logs(
params=params, range_header=range_header, accept=LogFormat.JOURNAL
) as resp:
try:
response = web.StreamResponse()
response.content_type = CONTENT_TYPE_TEXT
headers_returned = False
async for cursor, line in journal_logs_reader(resp, log_formatter):
try:
if not headers_returned:
if cursor:
response.headers["X-First-Cursor"] = cursor
response.headers["X-Accel-Buffering"] = "no"
await response.prepare(request)
headers_returned = True
await response.write(line.encode("utf-8") + b"\n")
except ClientConnectionResetError as err:
# When client closes the connection while reading busy logs, we
# sometimes get this exception. It should be safe to ignore it.
_LOGGER.debug(
"ClientConnectionResetError raised when returning journal logs: %s",
err,
)
break
except ConnectionError as err:
_LOGGER.warning(
"%s raised when returning journal logs: %s",
type(err).__name__,
err,
)
break
except (ConnectionResetError, ClientPayloadError) as ex:
# ClientPayloadError is most likely caused by the closing the connection
raise APIError(
"Connection reset when trying to fetch data from systemd-journald."
) from ex
return response
@api_process_raw(CONTENT_TYPE_TEXT, error_type=CONTENT_TYPE_TEXT)
async def advanced_logs(
self, request: web.Request, identifier: str | None = None, follow: bool = False
) -> web.StreamResponse:
"""Return systemd-journald logs. Wrapped as standard API handler."""
return await self.advanced_logs_handler(request, identifier, follow)

View File

@@ -1,50 +0,0 @@
"""Init file for Supervisor info RESTful API."""
import logging
from typing import Any, Dict
from aiohttp import web
from ..const import (
ATTR_ARCH,
ATTR_CHANNEL,
ATTR_DOCKER,
ATTR_FEATURES,
ATTR_HASSOS,
ATTR_HOMEASSISTANT,
ATTR_HOSTNAME,
ATTR_LOGGING,
ATTR_MACHINE,
ATTR_OPERATING_SYSTEM,
ATTR_SUPERVISOR,
ATTR_SUPPORTED,
ATTR_SUPPORTED_ARCH,
ATTR_TIMEZONE,
)
from ..coresys import CoreSysAttributes
from .utils import api_process
_LOGGER: logging.Logger = logging.getLogger(__name__)
class APIInfo(CoreSysAttributes):
"""Handle RESTful API for info functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
"""Show system info."""
return {
ATTR_SUPERVISOR: self.sys_supervisor.version,
ATTR_HOMEASSISTANT: self.sys_homeassistant.version,
ATTR_HASSOS: self.sys_hassos.version,
ATTR_DOCKER: self.sys_docker.info.version,
ATTR_HOSTNAME: self.sys_host.info.hostname,
ATTR_OPERATING_SYSTEM: self.sys_host.info.operating_system,
ATTR_FEATURES: self.sys_host.features,
ATTR_MACHINE: self.sys_machine,
ATTR_ARCH: self.sys_arch.default,
ATTR_SUPPORTED_ARCH: self.sys_arch.supported,
ATTR_SUPPORTED: self.sys_core.supported,
ATTR_CHANNEL: self.sys_updater.channel,
ATTR_LOGGING: self.sys_config.logging,
ATTR_TIMEZONE: self.sys_config.timezone,
}

View File

@@ -1,11 +1,12 @@
"""Supervisor Add-on ingress service.""" """Supervisor Add-on ingress service."""
import asyncio import asyncio
from ipaddress import ip_address from ipaddress import ip_address
import logging import logging
from typing import Any, Dict, Union from typing import Any
import aiohttp import aiohttp
from aiohttp import hdrs, web from aiohttp import ClientTimeout, hdrs, web
from aiohttp.web_exceptions import ( from aiohttp.web_exceptions import (
HTTPBadGateway, HTTPBadGateway,
HTTPServiceUnavailable, HTTPServiceUnavailable,
@@ -21,26 +22,68 @@ from ..const import (
ATTR_ICON, ATTR_ICON,
ATTR_PANELS, ATTR_PANELS,
ATTR_SESSION, ATTR_SESSION,
ATTR_SESSION_DATA_USER_ID,
ATTR_TITLE, ATTR_TITLE,
COOKIE_INGRESS, HEADER_REMOTE_USER_DISPLAY_NAME,
HEADER_REMOTE_USER_ID,
HEADER_REMOTE_USER_NAME,
HEADER_TOKEN, HEADER_TOKEN,
HEADER_TOKEN_OLD, HEADER_TOKEN_OLD,
REQUEST_FROM, IngressSessionData,
IngressSessionDataUser,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from .utils import api_process, api_validate from ..exceptions import HomeAssistantAPIError
from .const import COOKIE_INGRESS
from .utils import api_process, api_validate, require_home_assistant
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
VALIDATE_SESSION_DATA = vol.Schema({ATTR_SESSION: str}) VALIDATE_SESSION_DATA = vol.Schema({ATTR_SESSION: str})
"""Expected optional payload of create session request"""
SCHEMA_INGRESS_CREATE_SESSION_DATA = vol.Schema(
{
vol.Optional(ATTR_SESSION_DATA_USER_ID): str,
}
)
# from https://github.com/aio-libs/aiohttp/blob/8ae650bee4add9f131d49b96a0a150311ea58cd1/aiohttp/helpers.py#L1059C1-L1079C1
def must_be_empty_body(method: str, code: int) -> bool:
"""Check if a request must return an empty body."""
return (
status_code_must_be_empty_body(code)
or method_must_be_empty_body(method)
or (200 <= code < 300 and method.upper() == hdrs.METH_CONNECT)
)
def method_must_be_empty_body(method: str) -> bool:
"""Check if a method must return an empty body."""
# https://datatracker.ietf.org/doc/html/rfc9112#section-6.3-2.1
# https://datatracker.ietf.org/doc/html/rfc9112#section-6.3-2.2
return method.upper() == hdrs.METH_HEAD
def status_code_must_be_empty_body(code: int) -> bool:
"""Check if a status code must return an empty body."""
# https://datatracker.ietf.org/doc/html/rfc9112#section-6.3-2.1
return code in {204, 304} or 100 <= code < 200
class APIIngress(CoreSysAttributes): class APIIngress(CoreSysAttributes):
"""Ingress view to handle add-on webui routing.""" """Ingress view to handle add-on webui routing."""
_list_of_users: list[IngressSessionDataUser]
def __init__(self) -> None:
"""Initialize APIIngress."""
self._list_of_users = []
def _extract_addon(self, request: web.Request) -> Addon: def _extract_addon(self, request: web.Request) -> Addon:
"""Return addon, throw an exception it it doesn't exist.""" """Return addon, throw an exception it it doesn't exist."""
token = request.match_info.get("token") token = request.match_info["token"]
# Find correct add-on # Find correct add-on
addon = self.sys_ingress.get(token) addon = self.sys_ingress.get(token)
@@ -50,17 +93,12 @@ class APIIngress(CoreSysAttributes):
return addon return addon
def _check_ha_access(self, request: web.Request) -> None:
if request[REQUEST_FROM] != self.sys_homeassistant:
_LOGGER.warning("Ingress is only available behind Home Assistant")
raise HTTPUnauthorized()
def _create_url(self, addon: Addon, path: str) -> str: def _create_url(self, addon: Addon, path: str) -> str:
"""Create URL to container.""" """Create URL to container."""
return f"http://{addon.ip_address}:{addon.ingress_port}/{path}" return f"http://{addon.ip_address}:{addon.ingress_port}/{path}"
@api_process @api_process
async def panels(self, request: web.Request) -> Dict[str, Any]: async def panels(self, request: web.Request) -> dict[str, Any]:
"""Create a list of panel data.""" """Create a list of panel data."""
addons = {} addons = {}
for addon in self.sys_ingress.addons: for addon in self.sys_ingress.addons:
@@ -74,18 +112,28 @@ class APIIngress(CoreSysAttributes):
return {ATTR_PANELS: addons} return {ATTR_PANELS: addons}
@api_process @api_process
async def create_session(self, request: web.Request) -> Dict[str, Any]: @require_home_assistant
async def create_session(self, request: web.Request) -> dict[str, Any]:
"""Create a new session.""" """Create a new session."""
self._check_ha_access(request) schema_ingress_config_session_data = await api_validate(
SCHEMA_INGRESS_CREATE_SESSION_DATA, request
)
data: IngressSessionData | None = None
session = self.sys_ingress.create_session() if ATTR_SESSION_DATA_USER_ID in schema_ingress_config_session_data:
user = await self._find_user_by_id(
schema_ingress_config_session_data[ATTR_SESSION_DATA_USER_ID]
)
if user:
data = IngressSessionData(user)
session = self.sys_ingress.create_session(data)
return {ATTR_SESSION: session} return {ATTR_SESSION: session}
@api_process @api_process
async def validate_session(self, request: web.Request) -> Dict[str, Any]: @require_home_assistant
async def validate_session(self, request: web.Request) -> None:
"""Validate session and extending how long it's valid for.""" """Validate session and extending how long it's valid for."""
self._check_ha_access(request)
data = await api_validate(VALIDATE_SESSION_DATA, request) data = await api_validate(VALIDATE_SESSION_DATA, request)
# Check Ingress Session # Check Ingress Session
@@ -95,26 +143,26 @@ class APIIngress(CoreSysAttributes):
async def handler( async def handler(
self, request: web.Request self, request: web.Request
) -> Union[web.Response, web.StreamResponse, web.WebSocketResponse]: ) -> web.Response | web.StreamResponse | web.WebSocketResponse:
"""Route data to Supervisor ingress service.""" """Route data to Supervisor ingress service."""
self._check_ha_access(request)
# Check Ingress Session # Check Ingress Session
session = request.cookies.get(COOKIE_INGRESS) session = request.cookies.get(COOKIE_INGRESS, "")
if not self.sys_ingress.validate_session(session): if not self.sys_ingress.validate_session(session):
_LOGGER.warning("No valid ingress session %s", session) _LOGGER.warning("No valid ingress session %s", session)
raise HTTPUnauthorized() raise HTTPUnauthorized()
# Process requests # Process requests
addon = self._extract_addon(request) addon = self._extract_addon(request)
path = request.match_info.get("path") path = request.match_info.get("path", "")
session_data = self.sys_ingress.get_session_data(session)
try: try:
# Websocket # Websocket
if _is_websocket(request): if _is_websocket(request):
return await self._handle_websocket(request, addon, path) return await self._handle_websocket(request, addon, path, session_data)
# Request # Request
return await self._handle_request(request, addon, path) return await self._handle_request(request, addon, path, session_data)
except aiohttp.ClientError as err: except aiohttp.ClientError as err:
_LOGGER.error("Ingress error: %s", err) _LOGGER.error("Ingress error: %s", err)
@@ -122,7 +170,11 @@ class APIIngress(CoreSysAttributes):
raise HTTPBadGateway() raise HTTPBadGateway()
async def _handle_websocket( async def _handle_websocket(
self, request: web.Request, addon: Addon, path: str self,
request: web.Request,
addon: Addon,
path: str,
session_data: IngressSessionData | None,
) -> web.WebSocketResponse: ) -> web.WebSocketResponse:
"""Ingress route for websocket.""" """Ingress route for websocket."""
if hdrs.SEC_WEBSOCKET_PROTOCOL in request.headers: if hdrs.SEC_WEBSOCKET_PROTOCOL in request.headers:
@@ -131,7 +183,7 @@ class APIIngress(CoreSysAttributes):
for proto in request.headers[hdrs.SEC_WEBSOCKET_PROTOCOL].split(",") for proto in request.headers[hdrs.SEC_WEBSOCKET_PROTOCOL].split(",")
] ]
else: else:
req_protocols = () req_protocols = []
ws_server = web.WebSocketResponse( ws_server = web.WebSocketResponse(
protocols=req_protocols, autoclose=False, autoping=False protocols=req_protocols, autoclose=False, autoping=False
@@ -140,7 +192,7 @@ class APIIngress(CoreSysAttributes):
# Preparing # Preparing
url = self._create_url(addon, path) url = self._create_url(addon, path)
source_header = _init_header(request, addon) source_header = _init_header(request, addon, session_data)
# Support GET query # Support GET query
if request.query_string: if request.query_string:
@@ -157,8 +209,8 @@ class APIIngress(CoreSysAttributes):
# Proxy requests # Proxy requests
await asyncio.wait( await asyncio.wait(
[ [
_websocket_forward(ws_server, ws_client), self.sys_create_task(_websocket_forward(ws_server, ws_client)),
_websocket_forward(ws_client, ws_server), self.sys_create_task(_websocket_forward(ws_client, ws_server)),
], ],
return_when=asyncio.FIRST_COMPLETED, return_when=asyncio.FIRST_COMPLETED,
) )
@@ -166,12 +218,25 @@ class APIIngress(CoreSysAttributes):
return ws_server return ws_server
async def _handle_request( async def _handle_request(
self, request: web.Request, addon: Addon, path: str self,
) -> Union[web.Response, web.StreamResponse]: request: web.Request,
addon: Addon,
path: str,
session_data: IngressSessionData | None,
) -> web.Response | web.StreamResponse:
"""Ingress route for request.""" """Ingress route for request."""
url = self._create_url(addon, path) url = self._create_url(addon, path)
data = await request.read() source_header = _init_header(request, addon, session_data)
source_header = _init_header(request, addon)
# Passing the raw stream breaks requests for some webservers
# since we just need it for POST requests really, for all other methods
# we read the bytes and pass that to the request to the add-on
# add-ons needs to add support with that in the configuration
data = (
request.content
if request.method == "POST" and addon.ingress_stream
else await request.read()
)
async with self.sys_websession.request( async with self.sys_websession.request(
request.method, request.method,
@@ -180,12 +245,22 @@ class APIIngress(CoreSysAttributes):
params=request.query, params=request.query,
allow_redirects=False, allow_redirects=False,
data=data, data=data,
timeout=ClientTimeout(total=None),
skip_auto_headers={hdrs.CONTENT_TYPE},
) as result: ) as result:
headers = _response_header(result) headers = _response_header(result)
# Avoid parsing content_type in simple cases for better performance
if maybe_content_type := result.headers.get(hdrs.CONTENT_TYPE):
content_type = (maybe_content_type.partition(";"))[0].strip()
else:
content_type = result.content_type
# Simple request # Simple request
if ( if (
hdrs.CONTENT_LENGTH in result.headers # empty body responses should not be streamed,
# otherwise aiohttp < 3.9.0 may generate
# an invalid "0\r\n\r\n" chunk instead of an empty response.
must_be_empty_body(request.method, result.status)
or hdrs.CONTENT_LENGTH in result.headers
and int(result.headers.get(hdrs.CONTENT_LENGTH, 0)) < 4_194_000 and int(result.headers.get(hdrs.CONTENT_LENGTH, 0)) < 4_194_000
): ):
# Return Response # Return Response
@@ -193,17 +268,18 @@ class APIIngress(CoreSysAttributes):
return web.Response( return web.Response(
headers=headers, headers=headers,
status=result.status, status=result.status,
content_type=result.content_type, content_type=content_type,
body=body, body=body,
) )
# Stream response # Stream response
response = web.StreamResponse(status=result.status, headers=headers) response = web.StreamResponse(status=result.status, headers=headers)
response.content_type = result.content_type response.content_type = content_type
try: try:
response.headers["X-Accel-Buffering"] = "no"
await response.prepare(request) await response.prepare(request)
async for data in result.content.iter_chunked(4096): async for data, _ in result.content.iter_chunks():
await response.write(data) await response.write(data)
except ( except (
@@ -215,39 +291,66 @@ class APIIngress(CoreSysAttributes):
return response return response
async def _find_user_by_id(self, user_id: str) -> IngressSessionDataUser | None:
"""Find user object by the user's ID."""
try:
list_of_users = await self.sys_homeassistant.get_users()
except (HomeAssistantAPIError, TypeError) as err:
_LOGGER.error(
"%s error occurred while requesting list of users: %s", type(err), err
)
return None
if list_of_users is not None:
self._list_of_users = list_of_users
return next((user for user in self._list_of_users if user.id == user_id), None)
def _init_header( def _init_header(
request: web.Request, addon: str request: web.Request, addon: Addon, session_data: IngressSessionData | None
) -> Union[CIMultiDict, Dict[str, str]]: ) -> CIMultiDict[str]:
"""Create initial header.""" """Create initial header."""
headers = {} headers = CIMultiDict[str]()
if session_data is not None:
headers[HEADER_REMOTE_USER_ID] = session_data.user.id
if session_data.user.username is not None:
headers[HEADER_REMOTE_USER_NAME] = session_data.user.username
if session_data.user.display_name is not None:
headers[HEADER_REMOTE_USER_DISPLAY_NAME] = session_data.user.display_name
# filter flags # filter flags
for name, value in request.headers.items(): for name, value in request.headers.items():
if name in ( if name in (
hdrs.CONTENT_LENGTH, hdrs.CONTENT_LENGTH,
hdrs.CONTENT_ENCODING, hdrs.CONTENT_ENCODING,
hdrs.TRANSFER_ENCODING,
hdrs.SEC_WEBSOCKET_EXTENSIONS, hdrs.SEC_WEBSOCKET_EXTENSIONS,
hdrs.SEC_WEBSOCKET_PROTOCOL, hdrs.SEC_WEBSOCKET_PROTOCOL,
hdrs.SEC_WEBSOCKET_VERSION, hdrs.SEC_WEBSOCKET_VERSION,
hdrs.SEC_WEBSOCKET_KEY, hdrs.SEC_WEBSOCKET_KEY,
istr(HEADER_TOKEN), istr(HEADER_TOKEN),
istr(HEADER_TOKEN_OLD), istr(HEADER_TOKEN_OLD),
istr(HEADER_REMOTE_USER_ID),
istr(HEADER_REMOTE_USER_NAME),
istr(HEADER_REMOTE_USER_DISPLAY_NAME),
): ):
continue continue
headers[name] = value headers.add(name, value)
# Update X-Forwarded-For # Update X-Forwarded-For
forward_for = request.headers.get(hdrs.X_FORWARDED_FOR) if request.transport:
connected_ip = ip_address(request.transport.get_extra_info("peername")[0]) forward_for = request.headers.get(hdrs.X_FORWARDED_FOR)
headers[hdrs.X_FORWARDED_FOR] = f"{forward_for}, {connected_ip!s}" connected_ip = ip_address(request.transport.get_extra_info("peername")[0])
headers[hdrs.X_FORWARDED_FOR] = f"{forward_for}, {connected_ip!s}"
return headers return headers
def _response_header(response: aiohttp.ClientResponse) -> Dict[str, str]: def _response_header(response: aiohttp.ClientResponse) -> CIMultiDict[str]:
"""Create response header.""" """Create response header."""
headers = {} headers = CIMultiDict[str]()
for name, value in response.headers.items(): for name, value in response.headers.items():
if name in ( if name in (
@@ -257,7 +360,7 @@ def _response_header(response: aiohttp.ClientResponse) -> Dict[str, str]:
hdrs.CONTENT_ENCODING, hdrs.CONTENT_ENCODING,
): ):
continue continue
headers[name] = value headers.add(name, value)
return headers return headers

View File

@@ -1,12 +1,16 @@
"""Init file for Supervisor Jobs RESTful API.""" """Init file for Supervisor Jobs RESTful API."""
import logging import logging
from typing import Any, Dict from typing import Any
from aiohttp import web from aiohttp import web
import voluptuous as vol import voluptuous as vol
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..exceptions import APIError, APINotFound, JobNotFound
from ..jobs import SupervisorJob
from ..jobs.const import ATTR_IGNORE_CONDITIONS, JobCondition from ..jobs.const import ATTR_IGNORE_CONDITIONS, JobCondition
from .const import ATTR_JOBS
from .utils import api_process, api_validate from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -19,11 +23,68 @@ SCHEMA_OPTIONS = vol.Schema(
class APIJobs(CoreSysAttributes): class APIJobs(CoreSysAttributes):
"""Handle RESTful API for OS functions.""" """Handle RESTful API for OS functions."""
def _extract_job(self, request: web.Request) -> SupervisorJob:
"""Extract job from request or raise."""
try:
return self.sys_jobs.get_job(request.match_info["uuid"])
except JobNotFound:
raise APINotFound("Job does not exist") from None
def _list_jobs(self, start: SupervisorJob | None = None) -> list[dict[str, Any]]:
"""Return current job tree.
Jobs are added to cache as they are created so by default they are in oldest to newest.
This is correct ordering for child jobs as it makes logical sense to present those in
the order they occurred within the parent. For the list as a whole, sort from newest
to oldest as its likely any client is most interested in the newer ones.
"""
# Initially sort oldest to newest so all child lists end up in correct order
jobs_by_parent: dict[str | None, list[SupervisorJob]] = {}
for job in sorted(self.sys_jobs.jobs):
if job.internal:
continue
if job.parent_id not in jobs_by_parent:
jobs_by_parent[job.parent_id] = [job]
else:
jobs_by_parent[job.parent_id].append(job)
# After parent-child organization, sort the root jobs only from newest to oldest
job_list: list[dict[str, Any]] = []
queue: list[tuple[list[dict[str, Any]], SupervisorJob]] = (
[(job_list, start)]
if start
else [
(job_list, job)
for job in sorted(jobs_by_parent.get(None, []), reverse=True)
]
)
while queue:
(current_list, current_job) = queue.pop(0)
child_jobs: list[dict[str, Any]] = []
# We remove parent_id and instead use that info to represent jobs as a tree
job_dict = current_job.as_dict() | {"child_jobs": child_jobs}
job_dict.pop("parent_id")
current_list.append(job_dict)
if current_job.uuid in jobs_by_parent:
queue.extend(
[
(child_jobs, job)
for job in jobs_by_parent.get(current_job.uuid, [])
]
)
return job_list
@api_process @api_process
async def info(self, request: web.Request) -> Dict[str, Any]: async def info(self, request: web.Request) -> dict[str, Any]:
"""Return JobManager information.""" """Return JobManager information."""
return { return {
ATTR_IGNORE_CONDITIONS: self.sys_jobs.ignore_conditions, ATTR_IGNORE_CONDITIONS: self.sys_jobs.ignore_conditions,
ATTR_JOBS: self._list_jobs(),
} }
@api_process @api_process
@@ -34,9 +95,27 @@ class APIJobs(CoreSysAttributes):
if ATTR_IGNORE_CONDITIONS in body: if ATTR_IGNORE_CONDITIONS in body:
self.sys_jobs.ignore_conditions = body[ATTR_IGNORE_CONDITIONS] self.sys_jobs.ignore_conditions = body[ATTR_IGNORE_CONDITIONS]
self.sys_jobs.save_data() await self.sys_jobs.save_data()
await self.sys_resolution.evaluate.evaluate_system()
@api_process @api_process
async def reset(self, request: web.Request) -> None: async def reset(self, request: web.Request) -> None:
"""Reset options for JobManager.""" """Reset options for JobManager."""
self.sys_jobs.reset_data() await self.sys_jobs.reset_data()
@api_process
async def job_info(self, request: web.Request) -> dict[str, Any]:
"""Get details of a job by ID."""
job = self._extract_job(request)
return self._list_jobs(job)[0]
@api_process
async def remove_job(self, request: web.Request) -> None:
"""Remove a completed job."""
job = self._extract_job(request)
if not job.done:
raise APIError(f"Job {job.uuid} is not done!")
self.sys_jobs.remove_job(job)

View File

@@ -0,0 +1 @@
"""API middleware for aiohttp."""

View File

@@ -0,0 +1,322 @@
"""Handle security part of this API."""
from collections.abc import Callable
import logging
import re
from typing import Final
from urllib.parse import unquote
from aiohttp.web import Request, Response, middleware
from aiohttp.web_exceptions import HTTPBadRequest, HTTPForbidden, HTTPUnauthorized
from awesomeversion import AwesomeVersion
from supervisor.homeassistant.const import LANDINGPAGE
from ...addons.const import RE_SLUG
from ...const import (
REQUEST_FROM,
ROLE_ADMIN,
ROLE_BACKUP,
ROLE_DEFAULT,
ROLE_HOMEASSISTANT,
ROLE_MANAGER,
VALID_API_STATES,
)
from ...coresys import CoreSys, CoreSysAttributes
from ...utils import version_is_new_enough
from ..utils import api_return_error, extract_supervisor_token
_LOGGER: logging.Logger = logging.getLogger(__name__)
_CORE_VERSION: Final = AwesomeVersion("2023.3.4")
# fmt: off
_CORE_FRONTEND_PATHS: Final = (
r"|/app/.*\.(?:js|gz|json|map|woff2)"
r"|/(store/)?addons/" + RE_SLUG + r"/(logo|icon)"
)
CORE_FRONTEND: Final = re.compile(
r"^(?:" + _CORE_FRONTEND_PATHS + r")$"
)
# Block Anytime
BLACKLIST: Final = re.compile(
r"^(?:"
r"|/homeassistant/api/hassio/.*"
r"|/core/api/hassio/.*"
r")$"
)
# Free to call or have own security concepts
NO_SECURITY_CHECK: Final = re.compile(
r"^(?:"
r"|/homeassistant/api/.*"
r"|/homeassistant/websocket"
r"|/core/api/.*"
r"|/core/websocket"
r"|/supervisor/ping"
r"|/ingress/[-_A-Za-z0-9]+/.*"
+ _CORE_FRONTEND_PATHS
+ r")$"
)
# Observer allow API calls
OBSERVER_CHECK: Final = re.compile(
r"^(?:"
r"|/.+/info"
r")$"
)
# Can called by every add-on
ADDONS_API_BYPASS: Final = re.compile(
r"^(?:"
r"|/addons/self/(?!security|update)[^/]+"
r"|/addons/self/options/config"
r"|/info"
r"|/services.*"
r"|/discovery.*"
r"|/auth"
r")$"
)
# Home Assistant only
CORE_ONLY_PATHS: Final = re.compile(
r"^(?:"
r"/addons/" + RE_SLUG + "/sys_options"
r")$"
)
# Policy role add-on API access
ADDONS_ROLE_ACCESS: dict[str, re.Pattern] = {
ROLE_DEFAULT: re.compile(
r"^(?:"
r"|/.+/info"
r")$"
),
ROLE_HOMEASSISTANT: re.compile(
r"^(?:"
r"|/.+/info"
r"|/core/.+"
r"|/homeassistant/.+"
r")$"
),
ROLE_BACKUP: re.compile(
r"^(?:"
r"|/.+/info"
r"|/backups.*"
r")$"
),
ROLE_MANAGER: re.compile(
r"^(?:"
r"|/.+/info"
r"|/addons(?:/" + RE_SLUG + r"/(?!security).+|/reload)?"
r"|/audio/.+"
r"|/auth/cache"
r"|/available_updates"
r"|/backups.*"
r"|/cli/.+"
r"|/core/.+"
r"|/dns/.+"
r"|/docker/.+"
r"|/jobs/.+"
r"|/hardware/.+"
r"|/hassos/.+"
r"|/homeassistant/.+"
r"|/host/.+"
r"|/mounts.*"
r"|/multicast/.+"
r"|/network/.+"
r"|/observer/.+"
r"|/os/(?!datadisk/wipe).+"
r"|/refresh_updates"
r"|/resolution/.+"
r"|/security/.+"
r"|/snapshots.*"
r"|/store.*"
r"|/supervisor/.+"
r")$"
),
ROLE_ADMIN: re.compile(
r".*"
),
}
FILTERS: Final = re.compile(
r"(?:"
# Common exploits
r"proc/self/environ"
r"|(<|%3C).*script.*(>|%3E)"
# File Injections
r"|(\.\.//?)+" # ../../anywhere
r"|[a-zA-Z0-9_]=/([a-z0-9_.]//?)+" # .html?v=/.//test
# SQL Injections
r"|union.*select.*\("
r"|union.*all.*select.*"
r"|concat.*\("
r")",
flags=re.IGNORECASE,
)
# fmt: on
class SecurityMiddleware(CoreSysAttributes):
"""Security middleware functions."""
def __init__(self, coresys: CoreSys):
"""Initialize security middleware."""
self.coresys: CoreSys = coresys
def _recursive_unquote(self, value: str) -> str:
"""Handle values that are encoded multiple times."""
if (unquoted := unquote(value)) != value:
unquoted = self._recursive_unquote(unquoted)
return unquoted
@middleware
async def block_bad_requests(self, request: Request, handler: Callable) -> Response:
"""Process request and tblock commonly known exploit attempts."""
if FILTERS.search(self._recursive_unquote(request.path)):
_LOGGER.warning(
"Filtered a potential harmful request to: %s", request.raw_path
)
raise HTTPBadRequest
if FILTERS.search(self._recursive_unquote(request.query_string)):
_LOGGER.warning(
"Filtered a request with a potential harmful query string: %s",
request.raw_path,
)
raise HTTPBadRequest
return await handler(request)
@middleware
async def system_validation(self, request: Request, handler: Callable) -> Response:
"""Check if core is ready to response."""
if self.sys_core.state not in VALID_API_STATES:
return api_return_error(
message=f"System is not ready with state: {self.sys_core.state}"
)
return await handler(request)
@middleware
async def token_validation(self, request: Request, handler: Callable) -> Response:
"""Check security access of this layer."""
request_from: CoreSysAttributes | None = None
supervisor_token = extract_supervisor_token(request)
# Blacklist
if BLACKLIST.match(request.path):
_LOGGER.error("%s is blacklisted!", request.path)
raise HTTPForbidden()
# Ignore security check
if NO_SECURITY_CHECK.match(request.path):
_LOGGER.debug("Passthrough %s", request.path)
request[REQUEST_FROM] = None
return await handler(request)
# Not token
if not supervisor_token:
_LOGGER.warning("No API token provided for %s", request.path)
raise HTTPUnauthorized()
# Home-Assistant
if supervisor_token == self.sys_homeassistant.supervisor_token:
_LOGGER.debug("%s access from Home Assistant", request.path)
request_from = self.sys_homeassistant
elif CORE_ONLY_PATHS.match(request.path):
_LOGGER.warning("Attempted access to %s from client besides Home Assistant")
raise HTTPForbidden()
# Host
if supervisor_token == self.sys_plugins.cli.supervisor_token:
_LOGGER.debug("%s access from Host", request.path)
request_from = self.sys_host
# Observer
if supervisor_token == self.sys_plugins.observer.supervisor_token:
if not OBSERVER_CHECK.match(request.path):
_LOGGER.warning("%s invalid Observer access", request.path)
raise HTTPForbidden()
_LOGGER.debug("%s access from Observer", request.path)
request_from = self.sys_plugins.observer
# Add-on
addon = None
if supervisor_token and not request_from:
addon = self.sys_addons.from_token(supervisor_token)
# Check Add-on API access
if addon and ADDONS_API_BYPASS.match(request.path):
_LOGGER.debug("Passthrough %s from %s", request.path, addon.slug)
request_from = addon
elif addon and addon.access_hassio_api:
# Check Role
if ADDONS_ROLE_ACCESS[addon.hassio_role].match(request.path):
_LOGGER.info("%s access from %s", request.path, addon.slug)
request_from = addon
else:
_LOGGER.warning("%s no role for %s", request.path, addon.slug)
elif addon:
_LOGGER.warning(
"%s missing API permission for %s", addon.slug, request.path
)
if request_from:
request[REQUEST_FROM] = request_from
return await handler(request)
_LOGGER.error("Invalid token for access %s", request.path)
raise HTTPForbidden()
@middleware
async def core_proxy(self, request: Request, handler: Callable) -> Response:
"""Validate user from Core API proxy."""
if (
request[REQUEST_FROM] != self.sys_homeassistant
or self.sys_homeassistant.version == LANDINGPAGE
or version_is_new_enough(self.sys_homeassistant.version, _CORE_VERSION)
):
return await handler(request)
authorization_index: int | None = None
content_type_index: int | None = None
user_request: bool = False
admin_request: bool = False
ingress_request: bool = False
for idx, (key, value) in enumerate(request.raw_headers):
if key in (b"Authorization", b"X-Hassio-Key"):
authorization_index = idx
elif key == b"Content-Type":
content_type_index = idx
elif key == b"X-Hass-User-ID":
user_request = True
elif key == b"X-Hass-Is-Admin":
admin_request = value == b"1"
elif key == b"X-Ingress-Path":
ingress_request = True
if (user_request or admin_request) and not ingress_request:
return await handler(request)
is_proxy_request = (
authorization_index is not None
and content_type_index is not None
and content_type_index - authorization_index == 1
)
if (
not CORE_FRONTEND.match(request.path) and is_proxy_request
) or ingress_request:
raise HTTPBadRequest()
return await handler(request)

138
supervisor/api/mounts.py Normal file
View File

@@ -0,0 +1,138 @@
"""Inits file for supervisor mounts REST API."""
from typing import Any, cast
from aiohttp import web
import voluptuous as vol
from ..const import ATTR_NAME, ATTR_STATE
from ..coresys import CoreSysAttributes
from ..exceptions import APIError, APINotFound
from ..mounts.const import ATTR_DEFAULT_BACKUP_MOUNT, MountUsage
from ..mounts.mount import Mount
from ..mounts.validate import SCHEMA_MOUNT_CONFIG, MountData
from .const import ATTR_MOUNTS, ATTR_USER_PATH
from .utils import api_process, api_validate
SCHEMA_OPTIONS = vol.Schema(
{
vol.Optional(ATTR_DEFAULT_BACKUP_MOUNT): vol.Maybe(str),
}
)
class APIMounts(CoreSysAttributes):
"""Handle REST API for mounting options."""
def _extract_mount(self, request: web.Request) -> Mount:
"""Extract mount from request or raise."""
name = request.match_info["mount"]
if name not in self.sys_mounts:
raise APINotFound(f"No mount exists with name {name}")
return self.sys_mounts.get(name)
@api_process
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return MountManager info."""
return {
ATTR_DEFAULT_BACKUP_MOUNT: self.sys_mounts.default_backup_mount.name
if self.sys_mounts.default_backup_mount
else None,
ATTR_MOUNTS: [
mount.to_dict()
| {
ATTR_STATE: mount.state,
ATTR_USER_PATH: mount.container_where.as_posix()
if mount.container_where
else None,
}
for mount in self.sys_mounts.mounts
],
}
@api_process
async def options(self, request: web.Request) -> None:
"""Set Mount Manager options."""
body = await api_validate(SCHEMA_OPTIONS, request)
if ATTR_DEFAULT_BACKUP_MOUNT in body:
name: str | None = body[ATTR_DEFAULT_BACKUP_MOUNT]
if name is None:
self.sys_mounts.default_backup_mount = None
elif (mount := self.sys_mounts.get(name)).usage != MountUsage.BACKUP:
raise APIError(
f"Mount {name} is not used for backups, cannot use it as default backup mount"
)
else:
self.sys_mounts.default_backup_mount = mount
await self.sys_mounts.save_data()
@api_process
async def create_mount(self, request: web.Request) -> None:
"""Create a new mount in supervisor."""
body = cast(MountData, await api_validate(SCHEMA_MOUNT_CONFIG, request))
if body["name"] in self.sys_mounts:
raise APIError(f"A mount already exists with name {body['name']}")
mount = Mount.from_dict(self.coresys, body)
await self.sys_mounts.create_mount(mount)
# If it's a backup mount, reload backups
if mount.usage == MountUsage.BACKUP:
self.sys_create_task(self.sys_backups.reload())
# If there's no default backup mount, set it to the new mount
if not self.sys_mounts.default_backup_mount:
self.sys_mounts.default_backup_mount = mount
await self.sys_mounts.save_data()
@api_process
async def update_mount(self, request: web.Request) -> None:
"""Update an existing mount in supervisor."""
current = self._extract_mount(request)
name_schema = vol.Schema(
{vol.Optional(ATTR_NAME, default=current.name): current.name},
extra=vol.ALLOW_EXTRA,
)
body = cast(
MountData,
await api_validate(vol.All(name_schema, SCHEMA_MOUNT_CONFIG), request),
)
mount = Mount.from_dict(self.coresys, body)
await self.sys_mounts.create_mount(mount)
# If it's a backup mount, reload backups
if mount.usage == MountUsage.BACKUP:
self.sys_create_task(self.sys_backups.reload())
# If this mount was the default backup mount and isn't for backups any more, remove it
elif self.sys_mounts.default_backup_mount == mount:
self.sys_mounts.default_backup_mount = None
await self.sys_mounts.save_data()
@api_process
async def delete_mount(self, request: web.Request) -> None:
"""Delete an existing mount in supervisor."""
current = self._extract_mount(request)
mount = await self.sys_mounts.remove_mount(current.name)
# If it was a backup mount, reload backups
if mount.usage == MountUsage.BACKUP:
self.sys_create_task(self.sys_backups.reload())
await self.sys_mounts.save_data()
@api_process
async def reload_mount(self, request: web.Request) -> None:
"""Reload an existing mount in supervisor."""
mount = self._extract_mount(request)
await self.sys_mounts.reload_mount(mount.name)
# If it's a backup mount, reload backups
if mount.usage == MountUsage.BACKUP:
self.sys_create_task(self.sys_backups.reload())

View File

@@ -1,7 +1,9 @@
"""Init file for Supervisor Multicast RESTful API.""" """Init file for Supervisor Multicast RESTful API."""
import asyncio import asyncio
from collections.abc import Awaitable
import logging import logging
from typing import Any, Awaitable, Dict from typing import Any
from aiohttp import web from aiohttp import web
import voluptuous as vol import voluptuous as vol
@@ -18,12 +20,11 @@ from ..const import (
ATTR_UPDATE_AVAILABLE, ATTR_UPDATE_AVAILABLE,
ATTR_VERSION, ATTR_VERSION,
ATTR_VERSION_LATEST, ATTR_VERSION_LATEST,
CONTENT_TYPE_BINARY,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..exceptions import APIError from ..exceptions import APIError
from ..validate import version_tag from ..validate import version_tag
from .utils import api_process, api_process_raw, api_validate from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -34,7 +35,7 @@ class APIMulticast(CoreSysAttributes):
"""Handle RESTful API for Multicast functions.""" """Handle RESTful API for Multicast functions."""
@api_process @api_process
async def info(self, request: web.Request) -> Dict[str, Any]: async def info(self, request: web.Request) -> dict[str, Any]:
"""Return Multicast information.""" """Return Multicast information."""
return { return {
ATTR_VERSION: self.sys_plugins.multicast.version, ATTR_VERSION: self.sys_plugins.multicast.version,
@@ -43,7 +44,7 @@ class APIMulticast(CoreSysAttributes):
} }
@api_process @api_process
async def stats(self, request: web.Request) -> Dict[str, Any]: async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information.""" """Return resource information."""
stats = await self.sys_plugins.multicast.stats() stats = await self.sys_plugins.multicast.stats()
@@ -68,11 +69,6 @@ class APIMulticast(CoreSysAttributes):
raise APIError(f"Version {version} is already in use") raise APIError(f"Version {version} is already in use")
await asyncio.shield(self.sys_plugins.multicast.update(version)) await asyncio.shield(self.sys_plugins.multicast.update(version))
@api_process_raw(CONTENT_TYPE_BINARY)
def logs(self, request: web.Request) -> Awaitable[bytes]:
"""Return Multicast Docker logs."""
return self.sys_plugins.multicast.logs()
@api_process @api_process
def restart(self, request: web.Request) -> Awaitable[None]: def restart(self, request: web.Request) -> Awaitable[None]:
"""Restart Multicast plugin.""" """Restart Multicast plugin."""

View File

@@ -1,14 +1,16 @@
"""REST API for network.""" """REST API for network."""
import asyncio import asyncio
from ipaddress import ip_address, ip_interface from collections.abc import Awaitable
from typing import Any, Awaitable, Dict from ipaddress import IPv4Address, IPv4Interface, IPv6Address, IPv6Interface
from typing import Any
from aiohttp import web from aiohttp import web
import attr
import voluptuous as vol import voluptuous as vol
from ..const import ( from ..const import (
ATTR_ACCESSPOINTS, ATTR_ACCESSPOINTS,
ATTR_ADDR_GEN_MODE,
ATTR_ADDRESS, ATTR_ADDRESS,
ATTR_AUTH, ATTR_AUTH,
ATTR_CONNECTED, ATTR_CONNECTED,
@@ -21,6 +23,7 @@ from ..const import (
ATTR_ID, ATTR_ID,
ATTR_INTERFACE, ATTR_INTERFACE,
ATTR_INTERFACES, ATTR_INTERFACES,
ATTR_IP6_PRIVACY,
ATTR_IPV4, ATTR_IPV4,
ATTR_IPV6, ATTR_IPV6,
ATTR_MAC, ATTR_MAC,
@@ -30,34 +33,50 @@ from ..const import (
ATTR_PARENT, ATTR_PARENT,
ATTR_PRIMARY, ATTR_PRIMARY,
ATTR_PSK, ATTR_PSK,
ATTR_READY,
ATTR_SIGNAL, ATTR_SIGNAL,
ATTR_SSID, ATTR_SSID,
ATTR_SUPERVISOR_INTERNET, ATTR_SUPERVISOR_INTERNET,
ATTR_TYPE, ATTR_TYPE,
ATTR_VLAN, ATTR_VLAN,
ATTR_WIFI, ATTR_WIFI,
DOCKER_IPV4_NETWORK_MASK,
DOCKER_NETWORK, DOCKER_NETWORK,
DOCKER_NETWORK_MASK,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..exceptions import APIError, HostNetworkNotFound from ..exceptions import APIError, APINotFound, HostNetworkNotFound
from ..host.const import AuthMethod, InterfaceType, WifiMode from ..host.configuration import (
from ..host.network import (
AccessPoint, AccessPoint,
Interface, Interface,
InterfaceAddrGenMode,
InterfaceIp6Privacy,
InterfaceMethod, InterfaceMethod,
Ip6Setting,
IpConfig, IpConfig,
IpSetting,
VlanConfig, VlanConfig,
WifiConfig, WifiConfig,
) )
from ..host.const import AuthMethod, InterfaceType, WifiMode
from .utils import api_process, api_validate from .utils import api_process, api_validate
_SCHEMA_IP_CONFIG = vol.Schema( _SCHEMA_IPV4_CONFIG = vol.Schema(
{ {
vol.Optional(ATTR_ADDRESS): [vol.Coerce(ip_interface)], vol.Optional(ATTR_ADDRESS): [vol.Coerce(IPv4Interface)],
vol.Optional(ATTR_METHOD): vol.Coerce(InterfaceMethod), vol.Optional(ATTR_METHOD): vol.Coerce(InterfaceMethod),
vol.Optional(ATTR_GATEWAY): vol.Coerce(ip_address), vol.Optional(ATTR_GATEWAY): vol.Coerce(IPv4Address),
vol.Optional(ATTR_NAMESERVERS): [vol.Coerce(ip_address)], vol.Optional(ATTR_NAMESERVERS): [vol.Coerce(IPv4Address)],
}
)
_SCHEMA_IPV6_CONFIG = vol.Schema(
{
vol.Optional(ATTR_ADDRESS): [vol.Coerce(IPv6Interface)],
vol.Optional(ATTR_METHOD): vol.Coerce(InterfaceMethod),
vol.Optional(ATTR_ADDR_GEN_MODE): vol.Coerce(InterfaceAddrGenMode),
vol.Optional(ATTR_IP6_PRIVACY): vol.Coerce(InterfaceIp6Privacy),
vol.Optional(ATTR_GATEWAY): vol.Coerce(IPv6Address),
vol.Optional(ATTR_NAMESERVERS): [vol.Coerce(IPv6Address)],
} }
) )
@@ -74,25 +93,39 @@ _SCHEMA_WIFI_CONFIG = vol.Schema(
# pylint: disable=no-value-for-parameter # pylint: disable=no-value-for-parameter
SCHEMA_UPDATE = vol.Schema( SCHEMA_UPDATE = vol.Schema(
{ {
vol.Optional(ATTR_IPV4): _SCHEMA_IP_CONFIG, vol.Optional(ATTR_IPV4): _SCHEMA_IPV4_CONFIG,
vol.Optional(ATTR_IPV6): _SCHEMA_IP_CONFIG, vol.Optional(ATTR_IPV6): _SCHEMA_IPV6_CONFIG,
vol.Optional(ATTR_WIFI): _SCHEMA_WIFI_CONFIG, vol.Optional(ATTR_WIFI): _SCHEMA_WIFI_CONFIG,
vol.Optional(ATTR_ENABLED): vol.Boolean(), vol.Optional(ATTR_ENABLED): vol.Boolean(),
} }
) )
def ipconfig_struct(config: IpConfig) -> Dict[str, Any]: def ip4config_struct(config: IpConfig, setting: IpSetting) -> dict[str, Any]:
"""Return a dict with information about ip configuration.""" """Return a dict with information about IPv4 configuration."""
return { return {
ATTR_METHOD: config.method, ATTR_METHOD: setting.method,
ATTR_ADDRESS: [address.with_prefixlen for address in config.address], ATTR_ADDRESS: [address.with_prefixlen for address in config.address],
ATTR_NAMESERVERS: [str(address) for address in config.nameservers], ATTR_NAMESERVERS: [str(address) for address in config.nameservers],
ATTR_GATEWAY: str(config.gateway) if config.gateway else None, ATTR_GATEWAY: str(config.gateway) if config.gateway else None,
ATTR_READY: config.ready,
} }
def wifi_struct(config: WifiConfig) -> Dict[str, Any]: def ip6config_struct(config: IpConfig, setting: Ip6Setting) -> dict[str, Any]:
"""Return a dict with information about IPv6 configuration."""
return {
ATTR_METHOD: setting.method,
ATTR_ADDR_GEN_MODE: setting.addr_gen_mode,
ATTR_IP6_PRIVACY: setting.ip6_privacy,
ATTR_ADDRESS: [address.with_prefixlen for address in config.address],
ATTR_NAMESERVERS: [str(address) for address in config.nameservers],
ATTR_GATEWAY: str(config.gateway) if config.gateway else None,
ATTR_READY: config.ready,
}
def wifi_struct(config: WifiConfig) -> dict[str, Any]:
"""Return a dict with information about wifi configuration.""" """Return a dict with information about wifi configuration."""
return { return {
ATTR_MODE: config.mode, ATTR_MODE: config.mode,
@@ -102,7 +135,7 @@ def wifi_struct(config: WifiConfig) -> Dict[str, Any]:
} }
def vlan_struct(config: VlanConfig) -> Dict[str, Any]: def vlan_struct(config: VlanConfig) -> dict[str, Any]:
"""Return a dict with information about VLAN configuration.""" """Return a dict with information about VLAN configuration."""
return { return {
ATTR_ID: config.id, ATTR_ID: config.id,
@@ -110,7 +143,7 @@ def vlan_struct(config: VlanConfig) -> Dict[str, Any]:
} }
def interface_struct(interface: Interface) -> Dict[str, Any]: def interface_struct(interface: Interface) -> dict[str, Any]:
"""Return a dict with information of a interface to be used in th API.""" """Return a dict with information of a interface to be used in th API."""
return { return {
ATTR_INTERFACE: interface.name, ATTR_INTERFACE: interface.name,
@@ -118,14 +151,19 @@ def interface_struct(interface: Interface) -> Dict[str, Any]:
ATTR_ENABLED: interface.enabled, ATTR_ENABLED: interface.enabled,
ATTR_CONNECTED: interface.connected, ATTR_CONNECTED: interface.connected,
ATTR_PRIMARY: interface.primary, ATTR_PRIMARY: interface.primary,
ATTR_IPV4: ipconfig_struct(interface.ipv4) if interface.ipv4 else None, ATTR_MAC: interface.mac,
ATTR_IPV6: ipconfig_struct(interface.ipv6) if interface.ipv6 else None, ATTR_IPV4: ip4config_struct(interface.ipv4, interface.ipv4setting)
if interface.ipv4 and interface.ipv4setting
else None,
ATTR_IPV6: ip6config_struct(interface.ipv6, interface.ipv6setting)
if interface.ipv6 and interface.ipv6setting
else None,
ATTR_WIFI: wifi_struct(interface.wifi) if interface.wifi else None, ATTR_WIFI: wifi_struct(interface.wifi) if interface.wifi else None,
ATTR_VLAN: vlan_struct(interface.vlan) if interface.vlan else None, ATTR_VLAN: vlan_struct(interface.vlan) if interface.vlan else None,
} }
def accesspoint_struct(accesspoint: AccessPoint) -> Dict[str, Any]: def accesspoint_struct(accesspoint: AccessPoint) -> dict[str, Any]:
"""Return a dict for AccessPoint.""" """Return a dict for AccessPoint."""
return { return {
ATTR_MODE: accesspoint.mode, ATTR_MODE: accesspoint.mode,
@@ -141,9 +179,7 @@ class APINetwork(CoreSysAttributes):
def _get_interface(self, name: str) -> Interface: def _get_interface(self, name: str) -> Interface:
"""Get Interface by name or default.""" """Get Interface by name or default."""
name = name.lower() if name.lower() == "default":
if name == "default":
for interface in self.sys_host.network.interfaces: for interface in self.sys_host.network.interfaces:
if not interface.primary: if not interface.primary:
continue continue
@@ -155,10 +191,10 @@ class APINetwork(CoreSysAttributes):
except HostNetworkNotFound: except HostNetworkNotFound:
pass pass
raise APIError(f"Interface {name} does not exsist") from None raise APINotFound(f"Interface {name} does not exist") from None
@api_process @api_process
async def info(self, request: web.Request) -> Dict[str, Any]: async def info(self, request: web.Request) -> dict[str, Any]:
"""Return network information.""" """Return network information."""
return { return {
ATTR_INTERFACES: [ ATTR_INTERFACES: [
@@ -167,7 +203,7 @@ class APINetwork(CoreSysAttributes):
], ],
ATTR_DOCKER: { ATTR_DOCKER: {
ATTR_INTERFACE: DOCKER_NETWORK, ATTR_INTERFACE: DOCKER_NETWORK,
ATTR_ADDRESS: str(DOCKER_NETWORK_MASK), ATTR_ADDRESS: str(DOCKER_IPV4_NETWORK_MASK),
ATTR_GATEWAY: str(self.sys_docker.network.gateway), ATTR_GATEWAY: str(self.sys_docker.network.gateway),
ATTR_DNS: str(self.sys_docker.network.dns), ATTR_DNS: str(self.sys_docker.network.dns),
}, },
@@ -176,16 +212,16 @@ class APINetwork(CoreSysAttributes):
} }
@api_process @api_process
async def interface_info(self, request: web.Request) -> Dict[str, Any]: async def interface_info(self, request: web.Request) -> dict[str, Any]:
"""Return network information for a interface.""" """Return network information for a interface."""
interface = self._get_interface(request.match_info.get(ATTR_INTERFACE)) interface = self._get_interface(request.match_info[ATTR_INTERFACE])
return interface_struct(interface) return interface_struct(interface)
@api_process @api_process
async def interface_update(self, request: web.Request) -> None: async def interface_update(self, request: web.Request) -> None:
"""Update the configuration of an interface.""" """Update the configuration of an interface."""
interface = self._get_interface(request.match_info.get(ATTR_INTERFACE)) interface = self._get_interface(request.match_info[ATTR_INTERFACE])
# Validate data # Validate data
body = await api_validate(SCHEMA_UPDATE, request) body = await api_validate(SCHEMA_UPDATE, request)
@@ -195,22 +231,32 @@ class APINetwork(CoreSysAttributes):
# Apply config # Apply config
for key, config in body.items(): for key, config in body.items():
if key == ATTR_IPV4: if key == ATTR_IPV4:
interface.ipv4 = attr.evolve( interface.ipv4setting = IpSetting(
interface.ipv4 or IpConfig(InterfaceMethod.STATIC, [], None, []), method=config.get(ATTR_METHOD, InterfaceMethod.STATIC),
**config, address=config.get(ATTR_ADDRESS, []),
gateway=config.get(ATTR_GATEWAY),
nameservers=config.get(ATTR_NAMESERVERS, []),
) )
elif key == ATTR_IPV6: elif key == ATTR_IPV6:
interface.ipv6 = attr.evolve( interface.ipv6setting = Ip6Setting(
interface.ipv6 or IpConfig(InterfaceMethod.STATIC, [], None, []), method=config.get(ATTR_METHOD, InterfaceMethod.STATIC),
**config, addr_gen_mode=config.get(
ATTR_ADDR_GEN_MODE, InterfaceAddrGenMode.DEFAULT
),
ip6_privacy=config.get(
ATTR_IP6_PRIVACY, InterfaceIp6Privacy.DEFAULT
),
address=config.get(ATTR_ADDRESS, []),
gateway=config.get(ATTR_GATEWAY),
nameservers=config.get(ATTR_NAMESERVERS, []),
) )
elif key == ATTR_WIFI: elif key == ATTR_WIFI:
interface.wifi = attr.evolve( interface.wifi = WifiConfig(
interface.wifi mode=config.get(ATTR_MODE, WifiMode.INFRASTRUCTURE),
or WifiConfig( ssid=config.get(ATTR_SSID, ""),
WifiMode.INFRASTRUCTURE, "", AuthMethod.OPEN, None, None auth=config.get(ATTR_AUTH, AuthMethod.OPEN),
), psk=config.get(ATTR_PSK, None),
**config, signal=None,
) )
elif key == ATTR_ENABLED: elif key == ATTR_ENABLED:
interface.enabled = config interface.enabled = config
@@ -220,12 +266,14 @@ class APINetwork(CoreSysAttributes):
@api_process @api_process
def reload(self, request: web.Request) -> Awaitable[None]: def reload(self, request: web.Request) -> Awaitable[None]:
"""Reload network data.""" """Reload network data."""
return asyncio.shield(self.sys_host.network.update()) return asyncio.shield(
self.sys_host.network.update(force_connectivity_check=True)
)
@api_process @api_process
async def scan_accesspoints(self, request: web.Request) -> Dict[str, Any]: async def scan_accesspoints(self, request: web.Request) -> dict[str, Any]:
"""Scan and return a list of available networks.""" """Scan and return a list of available networks."""
interface = self._get_interface(request.match_info.get(ATTR_INTERFACE)) interface = self._get_interface(request.match_info[ATTR_INTERFACE])
# Only wlan is supported # Only wlan is supported
if interface.type != InterfaceType.WIRELESS: if interface.type != InterfaceType.WIRELESS:
@@ -238,8 +286,10 @@ class APINetwork(CoreSysAttributes):
@api_process @api_process
async def create_vlan(self, request: web.Request) -> None: async def create_vlan(self, request: web.Request) -> None:
"""Create a new vlan.""" """Create a new vlan."""
interface = self._get_interface(request.match_info.get(ATTR_INTERFACE)) interface = self._get_interface(request.match_info[ATTR_INTERFACE])
vlan = int(request.match_info.get(ATTR_VLAN)) vlan = int(request.match_info.get(ATTR_VLAN, -1))
if vlan < 0:
raise APIError(f"Invalid vlan specified: {vlan}")
# Only ethernet is supported # Only ethernet is supported
if interface.type != InterfaceType.ETHERNET: if interface.type != InterfaceType.ETHERNET:
@@ -250,32 +300,42 @@ class APINetwork(CoreSysAttributes):
vlan_config = VlanConfig(vlan, interface.name) vlan_config = VlanConfig(vlan, interface.name)
ipv4_config = None ipv4_setting = None
if ATTR_IPV4 in body: if ATTR_IPV4 in body:
ipv4_config = IpConfig( ipv4_setting = IpSetting(
body[ATTR_IPV4].get(ATTR_METHOD, InterfaceMethod.AUTO), method=body[ATTR_IPV4].get(ATTR_METHOD, InterfaceMethod.AUTO),
body[ATTR_IPV4].get(ATTR_ADDRESS, []), address=body[ATTR_IPV4].get(ATTR_ADDRESS, []),
body[ATTR_IPV4].get(ATTR_GATEWAY, None), gateway=body[ATTR_IPV4].get(ATTR_GATEWAY, None),
body[ATTR_IPV4].get(ATTR_NAMESERVERS, []), nameservers=body[ATTR_IPV4].get(ATTR_NAMESERVERS, []),
) )
ipv6_config = None ipv6_setting = None
if ATTR_IPV6 in body: if ATTR_IPV6 in body:
ipv6_config = IpConfig( ipv6_setting = Ip6Setting(
body[ATTR_IPV6].get(ATTR_METHOD, InterfaceMethod.AUTO), method=body[ATTR_IPV6].get(ATTR_METHOD, InterfaceMethod.AUTO),
body[ATTR_IPV6].get(ATTR_ADDRESS, []), addr_gen_mode=body[ATTR_IPV6].get(
body[ATTR_IPV6].get(ATTR_GATEWAY, None), ATTR_ADDR_GEN_MODE, InterfaceAddrGenMode.DEFAULT
body[ATTR_IPV6].get(ATTR_NAMESERVERS, []), ),
ip6_privacy=body[ATTR_IPV6].get(
ATTR_IP6_PRIVACY, InterfaceIp6Privacy.DEFAULT
),
address=body[ATTR_IPV6].get(ATTR_ADDRESS, []),
gateway=body[ATTR_IPV6].get(ATTR_GATEWAY, None),
nameservers=body[ATTR_IPV6].get(ATTR_NAMESERVERS, []),
) )
vlan_interface = Interface( vlan_interface = Interface(
"",
"",
"", "",
True, True,
True, True,
False, False,
InterfaceType.VLAN, InterfaceType.VLAN,
ipv4_config, None,
ipv6_config, ipv4_setting,
None,
ipv6_setting,
None, None,
vlan_config, vlan_config,
) )

View File

@@ -1,7 +1,8 @@
"""Init file for Supervisor Observer RESTful API.""" """Init file for Supervisor Observer RESTful API."""
import asyncio import asyncio
import logging import logging
from typing import Any, Dict from typing import Any
from aiohttp import web from aiohttp import web
import voluptuous as vol import voluptuous as vol
@@ -33,7 +34,7 @@ class APIObserver(CoreSysAttributes):
"""Handle RESTful API for Observer functions.""" """Handle RESTful API for Observer functions."""
@api_process @api_process
async def info(self, request: web.Request) -> Dict[str, Any]: async def info(self, request: web.Request) -> dict[str, Any]:
"""Return HA Observer information.""" """Return HA Observer information."""
return { return {
ATTR_HOST: str(self.sys_docker.network.observer), ATTR_HOST: str(self.sys_docker.network.observer),
@@ -43,7 +44,7 @@ class APIObserver(CoreSysAttributes):
} }
@api_process @api_process
async def stats(self, request: web.Request) -> Dict[str, Any]: async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information.""" """Return resource information."""
stats = await self.sys_plugins.observer.stats() stats = await self.sys_plugins.observer.stats()

View File

@@ -1,50 +1,276 @@
"""Init file for Supervisor HassOS RESTful API.""" """Init file for Supervisor HassOS RESTful API."""
import asyncio import asyncio
from collections.abc import Awaitable
import logging import logging
from typing import Any, Awaitable, Dict import re
from typing import Any
from aiohttp import web from aiohttp import web
import voluptuous as vol import voluptuous as vol
from ..const import ( from ..const import (
ATTR_ACTIVITY_LED,
ATTR_BOARD, ATTR_BOARD,
ATTR_BOOT, ATTR_BOOT,
ATTR_DEVICES,
ATTR_DISK_LED,
ATTR_HEARTBEAT_LED,
ATTR_ID,
ATTR_NAME,
ATTR_POWER_LED,
ATTR_SERIAL,
ATTR_SIZE,
ATTR_STATE,
ATTR_SWAP_SIZE,
ATTR_SWAPPINESS,
ATTR_UPDATE_AVAILABLE, ATTR_UPDATE_AVAILABLE,
ATTR_VERSION, ATTR_VERSION,
ATTR_VERSION_LATEST, ATTR_VERSION_LATEST,
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..exceptions import APINotFound, BoardInvalidError
from ..resolution.const import ContextType, IssueType, SuggestionType
from ..validate import version_tag from ..validate import version_tag
from .const import (
ATTR_BOOT_SLOT,
ATTR_BOOT_SLOTS,
ATTR_DATA_DISK,
ATTR_DEV_PATH,
ATTR_DEVICE,
ATTR_DISKS,
ATTR_MODEL,
ATTR_STATUS,
ATTR_SYSTEM_HEALTH_LED,
ATTR_VENDOR,
BootSlot,
)
from .utils import api_process, api_validate from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
# pylint: disable=no-value-for-parameter
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): version_tag}) SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): version_tag})
SCHEMA_SET_BOOT_SLOT = vol.Schema({vol.Required(ATTR_BOOT_SLOT): vol.Coerce(BootSlot)})
SCHEMA_DISK = vol.Schema({vol.Required(ATTR_DEVICE): str})
SCHEMA_YELLOW_OPTIONS = vol.Schema(
{
vol.Optional(ATTR_DISK_LED): vol.Boolean(),
vol.Optional(ATTR_HEARTBEAT_LED): vol.Boolean(),
vol.Optional(ATTR_POWER_LED): vol.Boolean(),
}
)
SCHEMA_GREEN_OPTIONS = vol.Schema(
{
vol.Optional(ATTR_ACTIVITY_LED): vol.Boolean(),
vol.Optional(ATTR_POWER_LED): vol.Boolean(),
vol.Optional(ATTR_SYSTEM_HEALTH_LED): vol.Boolean(),
}
)
RE_SWAP_SIZE = re.compile(r"^\d+([KMG](i?B)?|B)?$", re.IGNORECASE)
SCHEMA_SWAP_OPTIONS = vol.Schema(
{
vol.Optional(ATTR_SWAP_SIZE): vol.Match(RE_SWAP_SIZE),
vol.Optional(ATTR_SWAPPINESS): vol.All(int, vol.Range(min=0, max=200)),
}
)
# pylint: enable=no-value-for-parameter
class APIOS(CoreSysAttributes): class APIOS(CoreSysAttributes):
"""Handle RESTful API for OS functions.""" """Handle RESTful API for OS functions."""
@api_process @api_process
async def info(self, request: web.Request) -> Dict[str, Any]: async def info(self, request: web.Request) -> dict[str, Any]:
"""Return OS information.""" """Return OS information."""
return { return {
ATTR_VERSION: self.sys_hassos.version, ATTR_VERSION: self.sys_os.version,
ATTR_VERSION_LATEST: self.sys_hassos.latest_version, ATTR_VERSION_LATEST: self.sys_os.latest_version,
ATTR_UPDATE_AVAILABLE: self.sys_hassos.need_update, ATTR_UPDATE_AVAILABLE: self.sys_os.need_update,
ATTR_BOARD: self.sys_hassos.board, ATTR_BOARD: self.sys_os.board,
ATTR_BOOT: self.sys_dbus.rauc.boot_slot, ATTR_BOOT: self.sys_dbus.rauc.boot_slot,
ATTR_DATA_DISK: self.sys_os.datadisk.disk_used_id,
ATTR_BOOT_SLOTS: {
slot.bootname: {
ATTR_STATE: slot.state,
ATTR_STATUS: slot.boot_status,
ATTR_VERSION: slot.bundle_version,
}
for slot in self.sys_os.slots
if slot.bootname
},
} }
@api_process @api_process
async def update(self, request: web.Request) -> None: async def update(self, request: web.Request) -> None:
"""Update OS.""" """Update OS."""
body = await api_validate(SCHEMA_VERSION, request) body = await api_validate(SCHEMA_VERSION, request)
version = body.get(ATTR_VERSION, self.sys_hassos.latest_version) version = body.get(ATTR_VERSION, self.sys_os.latest_version)
await asyncio.shield(self.sys_hassos.update(version)) await asyncio.shield(self.sys_os.update(version))
@api_process @api_process
def config_sync(self, request: web.Request) -> Awaitable[None]: def config_sync(self, request: web.Request) -> Awaitable[None]:
"""Trigger config reload on OS.""" """Trigger config reload on OS."""
return asyncio.shield(self.sys_hassos.config_sync()) return asyncio.shield(self.sys_os.config_sync())
@api_process
async def migrate_data(self, request: web.Request) -> None:
"""Trigger data disk migration on Host."""
body = await api_validate(SCHEMA_DISK, request)
await asyncio.shield(self.sys_os.datadisk.migrate_disk(body[ATTR_DEVICE]))
@api_process
def wipe_data(self, request: web.Request) -> Awaitable[None]:
"""Trigger data disk wipe on Host."""
return asyncio.shield(self.sys_os.datadisk.wipe_disk())
@api_process
async def set_boot_slot(self, request: web.Request) -> None:
"""Change the active boot slot and reboot into it."""
body = await api_validate(SCHEMA_SET_BOOT_SLOT, request)
await asyncio.shield(self.sys_os.set_boot_slot(body[ATTR_BOOT_SLOT]))
@api_process
async def list_data(self, request: web.Request) -> dict[str, Any]:
"""Return possible data targets."""
return {
ATTR_DEVICES: [disk.id for disk in self.sys_os.datadisk.available_disks],
ATTR_DISKS: [
{
ATTR_NAME: disk.name,
ATTR_VENDOR: disk.vendor,
ATTR_MODEL: disk.model,
ATTR_SERIAL: disk.serial,
ATTR_SIZE: disk.size,
ATTR_ID: disk.id,
ATTR_DEV_PATH: disk.device_path.as_posix(),
}
for disk in self.sys_os.datadisk.available_disks
],
}
@api_process
async def boards_green_info(self, request: web.Request) -> dict[str, Any]:
"""Get green board settings."""
return {
ATTR_ACTIVITY_LED: self.sys_dbus.agent.board.green.activity_led,
ATTR_POWER_LED: self.sys_dbus.agent.board.green.power_led,
ATTR_SYSTEM_HEALTH_LED: self.sys_dbus.agent.board.green.user_led,
}
@api_process
async def boards_green_options(self, request: web.Request) -> None:
"""Update green board settings."""
body = await api_validate(SCHEMA_GREEN_OPTIONS, request)
if ATTR_ACTIVITY_LED in body:
await self.sys_dbus.agent.board.green.set_activity_led(
body[ATTR_ACTIVITY_LED]
)
if ATTR_POWER_LED in body:
await self.sys_dbus.agent.board.green.set_power_led(body[ATTR_POWER_LED])
if ATTR_SYSTEM_HEALTH_LED in body:
await self.sys_dbus.agent.board.green.set_user_led(
body[ATTR_SYSTEM_HEALTH_LED]
)
await self.sys_dbus.agent.board.green.save_data()
@api_process
async def boards_yellow_info(self, request: web.Request) -> dict[str, Any]:
"""Get yellow board settings."""
return {
ATTR_DISK_LED: self.sys_dbus.agent.board.yellow.disk_led,
ATTR_HEARTBEAT_LED: self.sys_dbus.agent.board.yellow.heartbeat_led,
ATTR_POWER_LED: self.sys_dbus.agent.board.yellow.power_led,
}
@api_process
async def boards_yellow_options(self, request: web.Request) -> None:
"""Update yellow board settings."""
body = await api_validate(SCHEMA_YELLOW_OPTIONS, request)
if ATTR_DISK_LED in body:
await self.sys_dbus.agent.board.yellow.set_disk_led(body[ATTR_DISK_LED])
if ATTR_HEARTBEAT_LED in body:
await self.sys_dbus.agent.board.yellow.set_heartbeat_led(
body[ATTR_HEARTBEAT_LED]
)
if ATTR_POWER_LED in body:
await self.sys_dbus.agent.board.yellow.set_power_led(body[ATTR_POWER_LED])
await self.sys_dbus.agent.board.yellow.save_data()
self.sys_resolution.create_issue(
IssueType.REBOOT_REQUIRED,
ContextType.SYSTEM,
suggestions=[SuggestionType.EXECUTE_REBOOT],
)
@api_process
async def boards_other_info(self, request: web.Request) -> dict[str, Any]:
"""Empty success return if board is in use, error otherwise."""
if request.match_info["board"] != self.sys_os.board:
raise BoardInvalidError(
f"{request.match_info['board']} board is not in use", _LOGGER.error
)
return {}
@api_process
async def config_swap_info(self, request: web.Request) -> dict[str, Any]:
"""Get swap settings."""
if (
not self.coresys.os.available
or not self.coresys.os.version
or self.coresys.os.version < "15.0"
):
raise APINotFound(
"Home Assistant OS 15.0 or newer required for swap settings"
)
return {
ATTR_SWAP_SIZE: self.sys_dbus.agent.swap.swap_size,
ATTR_SWAPPINESS: self.sys_dbus.agent.swap.swappiness,
}
@api_process
async def config_swap_options(self, request: web.Request) -> None:
"""Update swap settings."""
if (
not self.coresys.os.available
or not self.coresys.os.version
or self.coresys.os.version < "15.0"
):
raise APINotFound(
"Home Assistant OS 15.0 or newer required for swap settings"
)
body = await api_validate(SCHEMA_SWAP_OPTIONS, request)
reboot_required = False
if ATTR_SWAP_SIZE in body:
old_size = self.sys_dbus.agent.swap.swap_size
await self.sys_dbus.agent.swap.set_swap_size(body[ATTR_SWAP_SIZE])
reboot_required = reboot_required or old_size != body[ATTR_SWAP_SIZE]
if ATTR_SWAPPINESS in body:
old_swappiness = self.sys_dbus.agent.swap.swappiness
await self.sys_dbus.agent.swap.set_swappiness(body[ATTR_SWAPPINESS])
reboot_required = reboot_required or old_swappiness != body[ATTR_SWAPPINESS]
if reboot_required:
self.sys_resolution.create_issue(
IssueType.REBOOT_REQUIRED,
ContextType.SYSTEM,
suggestions=[SuggestionType.EXECUTE_REBOOT],
)

View File

@@ -1,9 +1 @@
!function(){function d(d){var e=document.createElement("script");e.src=d,document.body.appendChild(e)}if(/Edge?\/(12[89]|1[3-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Firefox\/(12[89]|1[3-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Chrom(ium|e)\/(109|1[1-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|(Maci|X1{2}).+ Version\/(18\.\d+|(19|[2-9]\d|\d{3,})\.\d+)([,.]\d+|)( \(\w+\)|)( Mobile\/\w+|) Safari\/|Chrome.+OPR\/(1{2}[3-9]|1[2-9]\d|[2-9]\d{2}|\d{4,})\.\d+\.\d+|(CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS|CPU iPad OS)[ +]+(16[._]([6-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[._]\d+)([._]\d+|)|Android:?[ /-](12[89]|1[3-9]\d|[2-9]\d{2}|\d{4,})(\.\d+|)(\.\d+|)|Mobile Safari.+OPR\/([89]\d|\d{3,})\.\d+\.\d+|Android.+Firefox\/(13\d|1[4-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Android.+Chrom(ium|e)\/(12[89]|1[3-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|SamsungBrowser\/(2[7-9]|[3-9]\d|\d{3,})\.\d+|Home As{2}istant\/[\d.]+ \(.+; macOS (1[3-9]|[2-9]\d|\d{3,})\.\d+(\.\d+)?\)/.test(navigator.userAgent))try{new Function("import('/api/hassio/app/frontend_latest/entrypoint.9b475c5882bbf15f.js')")()}catch(e){d("/api/hassio/app/frontend_es5/entrypoint.73551a66a38f3359.js")}else d("/api/hassio/app/frontend_es5/entrypoint.73551a66a38f3359.js")}()
try {
new Function("import('/api/hassio/app/frontend_latest/entrypoint.2471a57c.js')")();
} catch (err) {
var el = document.createElement('script');
el.src = '/api/hassio/app/frontend_es5/entrypoint.43c7c12c.js';
document.body.appendChild(el);
}

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @license
* Copyright 2021 Google LLC
* SPDX-LIcense-Identifier: Apache-2.0
*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["113"],{51383:function(t,o,e){e.r(o),e.d(o,{HaIconButtonArrowNext:function(){return c}});e(26847),e(27530);var n=e(73742),a=e(59048),i=e(7616),r=e(88479);e(81777);let s,d=t=>t;class c extends a.oi{render(){var t;return(0,a.dy)(s||(s=d` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.next"))||"Next",this._icon)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===r.E.document.dir?"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z":"M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"}}(0,n.__decorate)([(0,i.Cb)({attribute:!1})],c.prototype,"hass",void 0),(0,n.__decorate)([(0,i.Cb)({type:Boolean})],c.prototype,"disabled",void 0),(0,n.__decorate)([(0,i.Cb)()],c.prototype,"label",void 0),(0,n.__decorate)([(0,i.SB)()],c.prototype,"_icon",void 0),c=(0,n.__decorate)([(0,i.Mo)("ha-icon-button-arrow-next")],c)}}]);
//# sourceMappingURL=113.13cc15fa81bd492f.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"113.13cc15fa81bd492f.js","sources":["https://raw.githubusercontent.com/home-assistant/frontend/20250806.0/src/components/ha-icon-button-arrow-next.ts"],"names":["HaIconButtonArrowNext","LitElement","render","_this$hass","html","_t","_","this","disabled","label","hass","localize","_icon","args","mainWindow","attribute","type","Boolean"],"mappings":"4RASO,MAAMA,UAA8BC,EAAAA,GAU/BC,MAAAA,GAAyB,IAAAC,EACjC,OAAOC,EAAAA,EAAAA,IAAIC,IAAAA,EAAAC,CAAA,mFAEKC,KAAKC,SACRD,KAAKE,QAAkB,QAAbN,EAAII,KAAKG,YAAI,IAAAP,OAAA,EAATA,EAAWQ,SAAS,oBAAqB,OACxDJ,KAAKK,MAGnB,C,kBAlBK,SAAAC,GAAA,KAG+BL,UAAW,OAI9BI,MACa,QAA5BE,EAAAA,EAAAA,SAAAA,I,gLAPUC,WAAW,K,uDAEXC,KAAMC,W"}

Some files were not shown because too many files have changed in this diff Show More