4381 Commits

Author SHA1 Message Date
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.6
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 c0868d9dac32cd1e073cb39e9b0b19ca1e1f9ff3.

* 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 f8f51740c11838067bf7046a342abb7154c01844.
2023.11.5
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.4 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.3 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.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