Commit Graph

1169 Commits

Author SHA1 Message Date
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
Mike Degatano 3646ae070e Increase middleware range 2023-03-21 14:35:23 -04: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
Mike Degatano 8fc036874a
Improve addon slug validation (#4188) 2023-03-14 08:38:12 +01: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
Pascal Vizeli 2ae2d0e107 Performance tweaks middleware
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
2023-03-07 08:14:53 +00: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
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] 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
Mike Degatano 9024085712
Don't log error for addon unavailable (#4115) 2023-01-24 18:41:00 +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
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
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
Franck Nijhof 92408bb893
Add support for ESPHome dashboard discovery (#4084) 2023-01-05 19:58:55 +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
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
Stefan Agner b044095e57
Prevent multiple primary interfaces (#4046) 2022-12-09 12:56:52 +01:00
Pascal Vizeli 2ddb5ca53f
Support arch specific dockerfiles (#4022) 2022-11-28 09:09:22 +01: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
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 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] 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
Mike Degatano 672b220f69
Add boards APIs (#3984)
* Add boards APIs

* Move boards to agent
2022-11-04 08:22:24 +01:00
Mike Degatano 5f04e4fb6a
Fix addon image changed on update (#3971) 2022-11-03 14:21:57 +01: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
Joakim Sørensen 80248dc36d
Bump forntend to 5bb95388 (#3968) 2022-10-25 15:17:53 +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
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
Mike Degatano b36316416b
Fix property change debug log (#3926) 2022-10-05 09:40:59 +02:00
Mike Degatano 618c89c4d8
Don't sync unmanaged interfaces (#3925) 2022-10-04 20:17:30 +02:00
Pascal Vizeli 18b43ce767
Catch OS-Error (#3924) 2022-10-04 11:48:53 -04:00
Mike Degatano c0a409b25f
No unpack variants for property sets (#3911) 2022-09-29 18:13:02 +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
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 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
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 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
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
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
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 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
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
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
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
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
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 09d60b4957
Store load ignores supervisor updated condition (#3823) 2022-08-26 10:22:55 +02: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
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
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
Mike Degatano c3f7a45d61
Fix memory calculation for cgroupv2 (#3802) 2022-08-17 16:50:08 -04: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
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
Mike Degatano 3eac3a6178
Absolute imports to relative imports (#3787) 2022-08-12 10:42:40 +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
Joakim Sørensen 29a1e6f68b
Bump frontend to ca28feca (#3777) 2022-08-08 10:34:23 +02:00
Mike Degatano 13c10dbb47
Healthy/Unhealthy state means addon started (#3773) 2022-08-05 10:04:34 -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
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
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
Mike Degatano ebeff31bf6
Pass supervisor debug value to audio (#3752) 2022-07-27 17:15:54 +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
Mike Degatano 48c5dd064c
Fix addons always unknown after install (#3746) 2022-07-18 15:11:55 -04: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
Joakim Sørensen a8dc842f97
Bump frontend to 414db833 (#3729) 2022-07-11 16:53:59 +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
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
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
Pascal Vizeli 1f69cf0fe6
Verify the cgroup supported level (#3688)
* Verify the cgroup supported level

* add tests
2022-06-22 11:22:27 -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
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
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
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
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
Mike Degatano 5bc7255756
Catch assertion error on git pull (#3651) 2022-05-20 11:40:33 +02:00
Stefan Agner 2fe358fb1e
Resepect capitialization of network interfaces (#3646) 2022-05-19 17:47:50 +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
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
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
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
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
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
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
Mike Degatano a553ba5d24
Update resolved information with host info (#3560) 2022-04-12 09:21:35 +02:00
Joakim Sørensen 7feab2e31a
Bump frontend to d900e40d (#3559) 2022-04-11 10:28:12 -04: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
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] 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
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
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
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
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
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
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
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
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 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 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
Mike Degatano 8683d46ab6
Add dbus support to plugin-dns (#3459) 2022-02-21 20:31:15 +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
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 597a27ba33
Fix source-mod check (#3439)
* Fix source-mod check

* Fix stderr

* make handling robust
2022-02-10 13:23:05 +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
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
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
Pascal Vizeli 8d8704e049
Fixing IO on the loop with docker HW events (#3422) 2022-01-26 17:41:00 +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
Joakim Sørensen b651d63758
Add backup size to list API (#3409) 2022-01-19 08:59:30 -08: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
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
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
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
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
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
Joakim Sørensen d9ed58696b
Bump frontend to 6877fd9e (#3338) 2021-12-02 20:42:42 +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
Joakim Sørensen 4cf970e37a
WS connection fix (#3317) 2021-11-29 17:21:09 +01:00
Joakim Sørensen d0e2c8b694
Split homeassistant watchdog conditions (#3318) 2021-11-29 17:03:49 +01:00
Joakim Sørensen 2066aefd6d
Bump frontend to e91d1777 (#3326) 2021-11-29 15:45:14 +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
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
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
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
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