374 Commits

Author SHA1 Message Date
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
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
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
Mike Degatano
a6caccd845
Use session dbus mocks for all tests (#4198)
* Use session dbus mocks for all tests

* func instead of fn for pylint
2023-03-21 07:30:31 +01:00
Mike Degatano
d9b86fa2ab
Use session dbus for udisks2 tests (#4194)
* Use session dbus for udisks2 tests

* Don't redefine type
2023-03-17 20:56:34 +01: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
Mike Degatano
2a625defc0
Use session dbus for os agent tests (#4180) 2023-03-14 08:32:25 +01:00
Stefan Agner
e4e9dee02c
Add ODROID-M1 (#4177) 2023-03-09 16:20:19 -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
Mike Degatano
3887fcfc93
Test discovery message deleted on uninstall (#4174)
* Test discovery message deleted on uninstall

* Test data is correct since core looks at it
2023-03-08 11:08:55 +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
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
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
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
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
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
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
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
7c1f03932e
Fix host reload test (#3945) 2022-10-12 15:46:51 -04:00
Mike Degatano
618c89c4d8
Don't sync unmanaged interfaces (#3925) 2022-10-04 20:17:30 +02:00
Mike Degatano
c0a409b25f
No unpack variants for property sets (#3911) 2022-09-29 18:13:02 +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