4302 Commits

Author SHA1 Message Date
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.2
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.1 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.0
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 7c576da32ceef53814e83bdf3d06b416eed7fe9e.

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.1
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 b1010c3c6167c127510a5021fb7dd03995f8b24e.

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