4302 Commits

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