Commit Graph

1166 Commits

Author SHA1 Message Date
Mike Degatano 1f92ab42ca
Reduce executor code for docker (#4438)
* Reduce executor code for docker

* Fix pylint errors and move import/export image

* Fix test and a couple other risky executor calls

* Fix dataclass and return

* Fix test case and add one for corrupt docker

* Add some coverage

* Undo changes to docker manager startup
2023-07-18 11:39:39 -04:00
Mike Degatano abbf8b9b65
Identify network interfaces by mac over name (#4416)
* Identify network interfaces by mac over name

* Refactor long if statement into method
2023-07-06 16:26:19 -04:00
Mike Degatano 96d5fc244e
Separate startup event from update check event (#4425)
* Separate startup event from update check event

* Add a queue for messages sent during startup
2023-07-06 12:45:37 -04:00
Bram Kragten 355961a1eb
Update frontend (#4423) 2023-07-05 10:16:49 +02:00
Bram Kragten e68190b6b6
Bump frontend (#4420) 2023-07-04 10:21:32 +02:00
Mike Degatano c2123f0903
Ensure addon.start always returns coroutine (#4409) 2023-06-27 19:43:49 +02:00
Mike Degatano 9fbeb2a769
Add support for apparmor channels (#4408) 2023-06-27 19:12:42 +02:00
Mike Degatano 9a7d547394
Allow all characters in mount credentials (#4399)
* Allow all characters in mount credentials

* Fix permissions on credential files

* Fix pylint issue
2023-06-22 15:55:13 -04:00
Mike Degatano d3031e2eae
Use noserverino option in cifs mounts (#4398) 2023-06-21 18:49:03 +02:00
Joakim Sørensen 35bd66119a
Allow specifying CIFS version (#4395)
* Allow specifying cifs_version

* cifs_version -> version
2023-06-21 12:08:56 -04:00
Joakim Sørensen 4bed8c1327
Allow mounting CIFS as guest (#4384) 2023-06-20 10:20:06 -04:00
Mike Degatano 254ec2d1af
Addon startup waits for healthy (#4376)
* Addon startup waits for healthy

* fix import for pylint

* wait_for to 5 in tests

* Adjust tests to simplify async tasks

* Remove wait_boot time from addons.boot tests

* Eliminate async task race conditions in tests
2023-06-20 10:13:15 -04:00
Joakim Sørensen 65545e7218
Bump frontend to 3be601a3 (#4382) 2023-06-16 14:02:41 +02:00
Joakim Sørensen 8b4e8e9804
Add backup location to info/list API calls (#4346)
* Add backup location to info/list API calls

* Requested adjustments
2023-06-15 16:00:37 +02:00
cociweb 5d1ef34f17
Fix propagation mode of mounts to allow Ha-Core to start (#4374)
* Fix propagation mode of mounts to allow Ha-Core to start

Change the mount propagation mode from SLAVE to RSLAVE in case of /media and /share

* Check /share and /media to use RSLAVE as a propagation mode of mount

* Fix mount propagation mode of /share and /media

* Check /share and /media for rslave propagation mode
2023-06-14 17:40:46 -04:00
Matheson Steplock 9504eff889
Support Debian Bookworm (#4377) 2023-06-14 20:31:30 +02:00
Stefan Agner 6c0415163b
Fix Audio mounts for Add-ons (#4379) 2023-06-13 12:30:58 +02:00
Mike Degatano f4df298cb3
Exit reload early if no mounts (#4338)
* Exit reload early if no mounts

* Formatting
2023-06-05 10:40:16 -04:00
Mike Degatano c896b60410
Fix asyncio.wait in supervisor.reload (#4333)
* Fix asyncio.wait in supervisor.reload

* Unwrap to prevent throttling across tests
2023-06-01 18:38:42 -04:00
Joakim Sørensen 0200c72db1
Bump the frontend to efa02c30 (#4332) 2023-06-01 16:49:30 +02:00
Mike Degatano 3c3846240d
Protect backup manager from setup failures for mount down (#4327) 2023-05-31 11:51:52 -04:00
Mike Degatano b86a6d292f
Null check for meta in meta_mounts (#4326) 2023-05-31 10:50:28 -04:00
Mike Degatano 73d795e05e
Improve handling of NFS mounts and backup manager errors (#4323) 2023-05-30 17:29:51 -04:00
Mike Degatano e449205863
Add share to docker config issue (#4322) 2023-05-30 15:36:06 -04:00
Mike Degatano 841f68c175
Make issue for problem with config for containers (#4317)
* Make issue for problem with config for containers

* Mount propagation in tests

* Fixes from rebase and feedback
2023-05-30 13:25:38 -04:00
Joakim Sørensen 0df19cee91
Bump frontend to e0c1f988 (#4320)
* Bump frontend to 0ab7934c

* Bump frontend to e0c1f988
2023-05-30 14:20:03 +02:00
Joakim Sørensen d3f490bcc3
Adjust regex to allow woff2 files to be served (#4321) 2023-05-30 13:08:26 +02:00
Mike Degatano e984797f3c
Support share mounts (#4318) 2023-05-29 11:40:03 +02:00
Joakim Sørensen f542c8e790
Bump frontend to 9111f58e (#4313) 2023-05-24 10:27:06 -04:00
Mike Degatano a7c1693911
Set bind propagation mode for media (#4308)
* Set bind propagation mode for media

* Add some test cases
2023-05-24 09:12:35 -04:00
Joakim Sørensen bb497c0c9f
Add missing default_backup_mount to mount config (#4312) 2023-05-24 12:01:47 +02:00
Mike Degatano f6c3bdb6a8
Add mount to supported features (#4301)
* Add mount to supported features

* Typo in enable

* Fix places mocking os available without version

* Increase resilence of problematic repeat task test
2023-05-23 14:00:15 +02:00
Mike Degatano 5ced4e2f3b
Update to python 3.11 (#4296) 2023-05-22 19:12:34 +02:00
Felipe Santos 88d25fc14e
Add support for CAP_BPF and CAP_PERFMON privileges (#4259)
Co-authored-by: Stefan Agner <stefan@agner.ch>
2023-05-21 15:19:05 +02:00
Mike Degatano b4fd5b28f6
Use backup mounts (#4289)
* Add support for backup mounts

* Fix tests

* Allow backups to local when there's a default location
2023-05-16 14:08:22 -04:00
Bram Kragten b017fed329
Bump frontend to d46201ebd (#4288) 2023-05-15 23:00:44 +02:00
Mike Degatano 7688e1b9cb
Fix bind mounting and remove on create failure (#4274)
* Fix bind mounting and remove on create failure

* Fix test and make update fully fail on dbus error
2023-05-02 08:33:01 +02:00
Mike Degatano 34c394c3d1
Add support for network mounts (#4269)
* Add support for network mounts

* Handle backups and save data

* fix pylint issues
2023-05-01 08:45:52 +02:00
Franck Nijhof 9635c70f2b
Add support for NET_RAW privileges (#4242) 2023-04-20 11:03:08 -04:00
Franck Nijhof ed2f57f3ca
Add Wyoming Protocol add-on/integration discovery (#4248)
* Add Wyoming Protocol add-on/integration discovery

* Use URIs instead

* Use unix socket in bad test

* Address pylint warning
2023-04-19 11:35:05 -04:00
J. Nick Koston 744cd4ea39
Speed up backups by increasing buffer size (#4229)
* Speed up backups by increasing buffer size

This is the same change as https://github.com/home-assistant/core/pull/90613
but for supervisor

If the backup takes too long, core will release the lock on the database
and the backup will be no good

2fc34e7cce/homeassistant/components/recorder/core.py (L926)

cpython uses copyfileobj under the hood for fast copies but the default buffer size is quite low which increases the amount of time in python code when copying the sqlite database. As this is the usually the bulk of the backup, increasing the buffer can help reduce the backup time quite a bit.

Ideally this would all use sendfile under the hood as it would shift nearly all the burden out of userspace but tarfile doesn't currently try that 4664a7cf68/Lib/shutil.py (L106)

related:
In testing (non encrypted) improvement was at least as good as https://github.com/python/cpython/issues/71386

* add the const
2023-04-19 14:01:44 +02:00
Joakim Sørensen a54e0a8401
Bump frontend to 3a1fff81 (#4241) 2023-04-14 09:07:42 -04:00
Mike Degatano dc4a753fe3
Add start transient unit dbus method (#4237) 2023-04-12 13:08:02 -04:00
Mike Degatano 8cf71ffa81
Issue changed messages include suggestions (#4225)
* Issue changed messages include suggestions

* Fix test so ordering of suggestions doesn't matter
2023-04-03 14:00:01 -04:00
Mike Degatano fce0d2aaed
Prevent multiple data disks with name hassos-data-external (#4222)
* Prevent multiple data disks with name hassos-data-external

* Fix pylint issues

* Do rename before format
2023-04-01 08:40:19 +02:00
Mike Degatano 842e550dda
Create issue for multiple data disks detected (#4218) 2023-03-31 11:31:39 -04:00
Mike Degatano c9ee76f1d3
Strip null character off udisks2 paths (#4215)
* Strip null character off udisks2 paths

* Fix circular import
2023-03-31 10:23:30 -04:00
Stefan Agner 852771fbcf
Ignore non-existing data disk (#4221) 2023-03-31 10:20:25 -04:00
Pascal Vizeli de1f3555b1
Disable codenotary until rework of cosign (#4217)
* Disable codenotary until rework of cosign

* Skip code notary tests

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-03-31 11:11:29 +02:00
Mike Degatano c0b75edfb7
Format data disk in Supervisor instead of OS Agent (#4212)
* Supervisor formats data disk instead of os agent

* Fix issues occurring during tests

* Can't migrate if target is too small
2023-03-30 14:15:07 -04:00
Mike Degatano a3204f4ebd
Use Udisks2 for available data disks (#4202)
* Use Udisks2 for available data disks

* pylint issues
2023-03-27 12:09:16 -04:00
dependabot[bot] 84e4d70a37
Bump pylint from 2.15.10 to 2.17.1 (#4204)
* Bump pylint from 2.15.10 to 2.17.1

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.10 to 2.17.1.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.15.10...v2.17.1)

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

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

* Fix new pylint issues

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-03-27 12:08:40 -04:00
Mike Degatano cede47e95c Increase middleware range 2023-03-27 12:08:01 -04:00
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