Commit Graph

1057 Commits

Author SHA1 Message Date
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
Stefan Agner 7a6663ba80
Use Python dbus-next D-Bus library (#3234)
* Use the correct interface name to get properties of systemd

It seems that gdbus (or systemd) automatically pick the correct
interface and return the properties. However, dbussy requires the
correct interface name to get all properties.

* Don't expect array from Strength property

The property returns a type "y" which equates to "guchar":
https://developer-old.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.AccessPoint.html#gdbus-property-org-freedesktop-NetworkManager-AccessPoint.Strength

It seems that the old D-Bus implementation returned an array. With
dbus-next a integer is returned, so no list indexing required.

* Support signals and remove no longer used tests and code

* Pass rauc update file path as string

That is what the interface is expecting, otherwise the new lib chocks on
the Pathlib type.

* Support Network configuration with dbus-next

Assemble Python native objects and pass them to dbus-next. Use dbus-next
specific Variant class where necessary.

* Use org.freedesktop.NetworkManager.Connection.Active.StateChanged

org.freedesktop.NetworkManager.Connection.Active.PropertyChanged is
depricated. Also it seems that StateChanged leads to fewer and more
accurate signals.

* Pass correct data type to RequestScan.

RequestScan expects an option dictionary. Pass an empty option
dictionary to it.

* Update unit tests

Replace gdbus specific fixtures with json files representing the return
values. Those can be easily converted into native Python objects.

* Rename D-Bus utils module gdbus to dbus
2021-10-18 23:06:44 +02:00
Stefan Agner 9dd5eee1ae
Update to isort 5.9.3 (#3238) 2021-10-18 20:28:38 +02:00
Joakim Sørensen bb474a5c14
Only run container evaluation when system is running (#3239)
* Only run container evaluation when system is running

* adjust test
2021-10-18 20:25:50 +02:00
Joakim Sørensen 6ab4dda5e8
Set agent diagnostics (#3203)
* Set agent diagnostics

* Add AttributeError to dbus_property wrapper

* Use dbus_property instead of dbus_connected

* Move sync to core setup
2021-10-18 14:48:47 +02:00
Joakim Sørensen 8a553dbb59
Adjust container evaluation (#3174)
* Adjust container evaluation

* remove test
2021-10-18 13:58:51 +02:00
Vighnesh Kadam a90f70e017
Use new format for logging exceptions - docker/network.py (#3220) 2021-10-18 10:09:21 +02:00
Anand Borkar 15f62837c8
Use new format for logging exceptions - docker/supervisor.py (#3221) 2021-10-08 16:03:30 +02:00
Anand Borkar 394d66290d
Use new format for logging exceptions - host/services.py (#3213)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-10-08 10:21:47 +02:00
Samprit | Nekrós 4b0278fee8
Use new format for logging exceptions - store/repository.py (#3212) 2021-10-08 09:46:52 +02:00
Joakim Sørensen 8c59e6d05a
Bump frontend to 910cd98a (#3211) 2021-10-07 13:11:03 +02:00
Joakim Sørensen 5c66278a1c
Bump frontend to 066a0771 (#3210) 2021-10-07 11:37:16 +02:00
Vedant Bhamare 7abe9487a0
Use new format for logging exceptions - resolution/module.py (#3207) 2021-10-06 20:03:48 +02:00
Vedant Bhamare 73832dd6d6
Use new format for logging exceptions - plugins/multicast.py (#3206) 2021-10-06 19:52:07 +02:00
Vedant Bhamare 6cc3df54e9
Use new format for logging exceptions - plugins/audio.py (#3205) 2021-10-06 19:42:45 +02:00
Samprit | Nekrós c07c7c5146
Use new format for logging exceptions - host/info.py (#3204)
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-10-06 13:01:04 +02:00
Balamurugan P a6d1078fe3
Use new format for logging exceptions - docker/interface.py (#3184)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-10-04 22:49:55 +02:00
Joakim Sørensen eba6da485d
Rename disk_data to data_disk (#3200) 2021-10-04 22:46:28 +02:00
Prathamesh Gawas de880e24ed
Use new format for logging exceptions - host/apparmor.py (#3197) 2021-10-04 22:29:20 +02:00
Prathamesh Gawas f344df9e5c
Use new format for logging exceptions - host/network.py (#3196) 2021-10-04 22:23:55 +02:00
Prathamesh Gawas 5af62a8834
Use new format for logging exceptions - dbus/network/__init__.py (#3195) 2021-10-04 22:20:39 +02:00
Vighnesh Kadam 800fb683f8
Use new format for logging exceptions - plugins/dns.py (#3191)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-10-03 18:33:30 +02:00
Vedant Bhamare ad2566d58a
Use new format for logging exceptions - docker/init.py (#3189) 2021-10-03 12:33:55 +02:00
Vedant Bhamare 6c679b07e1
Use new format for logging exceptions - utils/apparmor.py (#3190) 2021-10-03 12:31:51 +02:00
Vighnesh Kadam aa4f4c8d47
Use new format for logging exceptions - plugins/cli.py (#3188) 2021-10-03 10:16:49 +02:00
Anand Borkar b83da5d89f
Use new format for logging exceptions - api/proxy.py (#3187) 2021-10-02 11:29:12 +02:00
Vedant Bhamare 0afff9a9e2
Use new format for logging exceptions - services/modules/mqtt.py (#3183) 2021-10-01 14:46:36 +02:00
Finn 0433d72ae6
Use new format for logging exception - homeassistent/api.py (#3182) 2021-10-01 14:18:23 +02:00
Vedant Bhamare d33beb06cd
Use new format for logging exceptions - services/modules/mysql.py (#3180) 2021-10-01 14:03:16 +02:00
Prathamesh Gawas 279d6ccd79
Use new format for logging exceptions - host/sound.py (#3176) 2021-10-01 14:01:12 +02:00
Finn af628293f3
Use new format for logging exceptions - addons/init.py (#3179)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-10-01 13:46:46 +02:00
Finn df6b815175
Use new format for logging exceptions - addons/addon.py (#3178) 2021-10-01 13:23:57 +02:00
Finn d6127832a7
Use new format for logging exceptions - auth.py (#3177) 2021-10-01 13:23:38 +02:00
Joakim Sørensen 8240623806
Fix observer security filter (#3173) 2021-09-30 15:12:04 +02:00
Joakim Sørensen 2b4527fa64
Return early in validate (#3168)
* Return early in validate

* pylint
2021-09-29 18:33:45 +02:00
Joakim Sørensen 23143aede4
Add all_plugins to cleanup code (#3166) 2021-09-29 18:23:25 +02:00
Stefan Agner 5cc4a9a929
Use `=` instead of deprecated `:` as security option separator (#3167)
Docker reports:
Sep 23 08:16:31 homeassistant dockerd[467]: time="2021-09-23T08:16:31.771717436Z" level=warning msg="Security options with `:` as a separator are deprecated and will be completely unsupported in 17.04, use `=` instead."

Since it seems that Docker supports `=` since quite a while, we should
use `=` only.
2021-09-29 16:42:41 +02:00
Pascal Vizeli 288d2e5bdb
Use deepmerge for options (#3162)
* Use deepmerge for options

* fix issue

* Update supervisor/addons/addon.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Add tests

* Fix merge schema

* Make save for overwrites

* drop community

* more cleanup

* Fix tests

* Fix lists

* revert strategy

* protect overwritten lists

* Update tests/api/test_store.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-09-29 09:37:04 +02:00
Joakim Sørensen bb991b69bb
Bmp frontend to b6344eb6 (#3161) 2021-09-28 09:33:38 +02:00
Pascal Vizeli 7c9f6067c0
Fix pyupgrade precommit (#3155)
* Fix pyupgrade precommit

* address comments
2021-09-27 11:05:21 +02:00
Pascal Vizeli b03c8c24dd
Fix UnboundLocalError (#3153) 2021-09-27 09:44:15 +02:00
Pascal Vizeli 4416b6524e
Bump voluptuous from 0.12.1 to 0.12.2 (#3147) 2021-09-27 08:28:34 +02:00
Joakim Sørensen 6df7a88666
Bump frontend to 03dc3e52 (#3142) 2021-09-25 10:59:53 +02:00
Pascal Vizeli 5933b66b1c
Add os-agent to evaluations for supported systems (#3138) 2021-09-22 15:59:35 +02:00
dependabot[bot] a85e816cd7
Bump pylint from 2.10.2 to 2.11.1 (#3128)
* Bump pylint from 2.10.2 to 2.11.1

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.10.2 to 2.11.1.
- [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.10.2...v2.11.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 linter issues

* fix tests lint

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-22 14:33:32 +02:00
Joakim Sørensen 40bcee38f3
Add startup time and boot_timestamp (#3136)
* Add startup time

* Add boot_timestamp

* Fix type

* patch and rename properties fixture
2021-09-22 11:15:38 +02:00
dependabot[bot] dafc2cfec2
Bump pyupgrade from 2.26.0 to 2.26.0.post1 (#3131)
* Bump pyupgrade from 2.26.0 to 2.26.0.post1

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.26.0 to 2.26.0.post1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/commits)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Update .pre-commit-config.yaml

* Fixes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-21 18:22:56 +02:00
Pascal Vizeli 04f36e92e1
Return list of possible data disk targets (#3133)
* Return list of possible data disk targets

* fix path

* fix tests

* Add test

* Fix tests

* Add tests

* Add more tests

* Remove debug

* Address comments

* more clear
2021-09-21 14:51:58 +02:00
Pascal Vizeli 53eae96a98
DataDisk reload devices (#3129)
* DataDisk reload devices

* improve loading

* simplify

* validate input device

* add comments

* Add agent version to API

* more tests

* fix test lint
2021-09-20 12:52:51 +02:00
Joakim Sørensen 74530baeb7
Detect if frontend is not loaded (#3124)
* Detect if frontend is not loaded

* update
2021-09-18 14:30:01 +02:00
Pascal Vizeli 271e4f0cc4
Support OS-Agent Data disk (#3120)
* Support OS-Agent Data disk

* fix lint

* add tests

* Fix empty path

* revert change

* Using as_posix()

* clean not needed cast

* rename

* Rename files
2021-09-17 15:01:07 +02:00
Joakim Sørensen f4c7f2cae1
Update frontend to cb11c6b3 (#3125) 2021-09-15 10:54:12 +02:00
Joakim Sørensen 4beaf571c2
Bump frontend to d5a16176 (#3101) 2021-09-03 12:49:33 +02:00
Pascal Vizeli 32af7ef28b
Support USB discovery (#3100)
* Support USB discovery

* fix policy

* Fix scan command

* address comments

Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-09-02 20:34:18 +02:00
Joakim Sørensen 208fb549b7
Update translations as a part of updating the frontend (#3096)
* Update translations as a part of updating the frontend

* Update frontend to ac64d293 with translations
2021-09-01 13:59:12 +02:00
Joakim Sørensen ab704c11cf
Ignore rootfs (#3097) 2021-09-01 13:58:48 +02:00
Joakim Sørensen 966b962ccf
Ignore all files and directories that starts with . (#3094)
* Ignore all files and directories that starts with .

* pylint

* Check all parts
2021-09-01 12:50:44 +02:00
Pascal Vizeli b2abe37d72
Add check for plugin trust (#3080)
* Add check for plugin trust

* Update supervisor/resolution/checks/plugin_trust.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-08-30 10:56:05 +02:00
Joakim Sørensen ad8d850ed7
Update frontend to 67ab63f0 (#3083) 2021-08-28 10:08:15 +02:00
Pascal Vizeli d54c23952f
Codenotary vcn 0.9.8 - System trust check (#3070)
* Update codenotary 0.9.8

* Fix lint

* ditch wrong code

* Fix run health check

* remove old code

* better structured

* more cleaner

* Fix core

* Add tests

* addjust test

* Split checks

* Update supervisor/resolution/checks/core_trust.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Fix line end

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-08-24 12:19:08 +02:00
Franck Nijhof 8894984c12
Add Debian 11: Bulleyes to support systems check (#3066) 2021-08-23 11:07:15 +02:00
foreign-sub 49fbdedf6b
Relax check_system_runtime timeout to 10 seconds (#3037)
Probably related to https://github.com/home-assistant/plugin-observer/issues/22

Sometimes i notice my supervisor logs shows a random : 

WARNING (MainThread) [supervisor.misc.tasks] Watchdog/Application found a problem with observer plugin!

i believe the cause to be related to the timeout being too short on a "busy" system, thus my proposal to relax it to 10 seconds.
2021-08-21 16:15:31 +02:00
Joakim Sørensen 0899c16895
Update frontend to 44548fdc (#3061) 2021-08-21 10:41:59 +02:00
Pascal Vizeli 034606cd0f
Give audio plugin machine data for mixer evaluation (#3056) 2021-08-10 13:36:48 +02:00
Pascal Vizeli 31001280c8
Add bus system for handling events hw/pulse/docker (#2999)
* Add bus system for handling events hw/pulse/docker

* give sound update back

* register events

* Add tests

* Add debug logger

* Update supervisor/coresys.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-08-09 19:30:26 +02:00
Joakim Sørensen e7b5864c03
Replace abstractproperty with abstractmethod (#3049) 2021-08-05 15:28:32 +02:00
Joakim Sørensen 9497f85db9
Use custom user agent string for aiohttp (#3033) 2021-07-28 14:46:37 +02:00
Joakim Sørensen 419f603571
Rename snapshot -> backup (#2940) 2021-07-27 10:06:09 +02:00
dependabot[bot] cd07bde307
Bump pylint from 2.8.3 to 2.9.1 (#2988)
* Bump pylint from 2.8.3 to 2.9.1

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.8.3 to 2.9.1.
- [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.8.3...v2.9.1)

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

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

* Update pylintrc

* Update base.py

* Update base.py

* Fix black

* fix helper

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-07-01 18:07:15 +02:00
Joakim Sørensen 3057df3181
Update frontend to 30d6c689 (#2989) 2021-07-01 17:40:42 +02:00
Joakim Sørensen fe785622ec
Format log as string (#2984) 2021-06-30 12:31:56 +02:00
Pascal Vizeli 2b6829a786
OS-Agent support (#2811)
* OS-Agent support

* add agent to host feature

* Add support for os-agent on devcontainer

* Rename core

* fix tests

* add setter

* add cgroup / apparmor

* all interfaces added

* fix import

* Add tests

* More tests

* Finish tests

* reformating xml files

* fix doc string

* address comments

* change return value

* fix tests

* Update supervisor/dbus/agent/__init__.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Update scripts/supervisor.sh

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-06-30 11:55:53 +02:00
Joakim Sørensen 7c6c982414
Add ingress_stream add-on option (#2982) 2021-06-30 09:28:29 +02:00
Joakim Sørensen 07eeb2eaf2
Only use .content for POST (#2981)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-06-29 11:29:47 +02:00
Joakim Sørensen 8a9657c452
Stream requests to ingress (#2979)
* Chunk large requests to ingress

* Remove timout for POST

* No timeout

* stream

* Remove chunked
2021-06-26 19:31:15 +02:00
Pascal Vizeli b944b52b21
Add running job condition to OS update (#2976) 2021-06-24 16:06:06 +02:00
Stefan Agner 7bbfb60039
Allow upgrade when using {os_name} in URL (#2974)
Once {os_name} is part of the update URL we also need to set the OS name
explicitly for upgrades: A user might use a new Supervisor version on a
OS release 5 device. The device will still use "hassos" as OS name.
Before introducing {os_name}, the new OS name was part of the URL. Now
when {os_name} is used, we need to adjust the name for upgrade as well.
2021-06-24 08:39:50 +02:00
Pascal Vizeli ece40008c7
Logging in local timezone (#2971)
* Logging in local timezone

* fix convert

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-06-21 13:42:39 +02:00
Pascal Vizeli 0177b38ded
Support HOT/COLD snapshots for Add-ons (#2943)
* Support HOT/COLD snapshots for Add-ons

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Add warning

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-06-21 09:07:54 +02:00
Stefan Agner 16f2f63081
Allow downgrade to "hassos" from "haos" (#2970)
* Add "os_name" as possible URL variable

* Replace "os_name" for downgrades to OS versions before 6.0
2021-06-19 18:50:54 +02:00
Pascal Vizeli 5f376c2a27
Using images data from version file (#2969)
* Using images data from version file

* fix tests
2021-06-18 22:59:11 +02:00
Joakim Sørensen d46ab56901
Update frontend to 446a9b5c (#2962) 2021-06-16 11:45:28 +02:00
Pascal Vizeli 3b1ad5c0cd
Run API watchdog only if core is running (#2961)
* Run API watchdog only if core is running

* negate

* fix comment
2021-06-16 11:45:06 +02:00
Joakim Sørensen de8a241e72
When validating add-ons transform core-addons url (#2960) 2021-06-15 15:06:40 +02:00
Pascal Vizeli a4a0b43d91
Using ghcr.io/home-assistant + fallback (#2959) 2021-06-14 20:07:44 +02:00
Pascal Vizeli adf355e54f
Fix API watchdog never trigger (#2958) 2021-06-14 14:11:22 +02:00
Joakim Sørensen 4f9e646b4c
Fix addon_pwned enabled setter (#2952)
* Fix addon_pwned enabled setter

* whatever

* adjust
2021-06-14 11:33:53 +02:00
Pascal Vizeli d53d526673
Add-on: Block update itself (#2956)
* Add-on: Block update itself

* Better logging

* Update
2021-06-14 10:37:59 +02:00
Pascal Vizeli cd8fc16bcb
Cleanup security layer - Add-on default access role (#2954)
* Allow access to network info (add-on)

* fix check

* make it nice

* cleanup

* cleanup

* fix tests

* Add warning

* allow access to addons/store/snapshot infos

* revert
2021-06-14 10:05:37 +02:00
Pascal Vizeli bcef34012d
Time handling (#2901)
* Add new time handling

* migrate date for python3.9

* add timedate

* add tests & simplify it

* better testing

* use ssl

* use hostname with new interface

* expose to API

* update data

* add base handler

* new timezone handling

* improve handling

* Improve handling

* Add tests

* Time adjustment function

* Fix logging

* tweak condition

* don't adjust synchronized time

* Guard

* ignore UTC

* small cleanup

* like that, we can leaf it

* add URL

* add comment

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-06-09 09:38:32 +02:00
Stefan Agner 2f18c177ae
Introduce pre-/post-snapshot commands (#2941)
Introduce commands which are run before and after a snapshot is being
taken. This is useful for e.g. for database add-ons to suspend write
operations during snapshot.
2021-06-08 21:44:31 +02:00
Joakim Sørensen e629bab8ee
Fix setting audio profile (#2934) 2021-06-04 14:18:23 +02:00
Joakim Sørensen e85d7c3d2e
Update frontend to a45b8ca8 (#2936) 2021-06-04 14:05:50 +02:00
Joakim Sørensen 64c59d0fe9
Lmit ensure_access_token (#2931) 2021-06-03 11:03:46 +02:00
Sergio Oller fd185fc326
Minor spelling fixes (#2929) 2021-06-02 11:50:07 +02:00
Pascal Vizeli b425d21d05
Adjust content-trust core version (#2923) 2021-05-31 11:48:37 +02:00
Stefan Agner a99bfa2926
Update OS on intel-nuc to generic-x86-64 image (#2909)
* Add architectures supported by generic-x86-64 board

* Follow intel-nuc to generic-x86-64 rename when updating

Home Assistant OS renamed the intel-nuc board to generic-x86-64. Make
sure to download the generic-x86-64 raucb OS update when updating a
intel-nuc machine.

* Don't explicit use section, rely on AwesomeVersion's comparision

* Remove unecessary global variable TEST_URL

* Fix version comparision

* Remove rate limiter on updater.fetch_data()

* Update tests/test_hassos.py

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>

* Fix black issue

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2021-05-27 14:25:16 +02:00
Joakim Sørensen bb127a614b
Bump frontend to 59f3f819 (#2915) 2021-05-27 10:53:14 +02:00
Joakim Sørensen 6f2f005897
Update frontend to fa9c6a76 (#2914) 2021-05-26 15:35:20 +02:00
Franck Nijhof fb81946240
Fix Watchdog port being used as string (#2903) 2021-05-19 17:32:31 +02:00
Joakim Sørensen 6dadb933bd
Bump frontend to 245bb639 (#2897) 2021-05-19 11:34:49 +02:00
Joakim Sørensen 3834cead07
Update frontend to fe2fe746 (#2887) 2021-05-14 14:09:04 +02:00
Pascal Vizeli cb9f998ef1
Python 3.9 (#2886)
* Python 3.9

* Fix lint

* fix lint
2021-05-14 13:57:56 +02:00
Pascal Vizeli a5ed68b641
Cleanup websession with new aiohttp ssl (#2861) 2021-05-14 10:07:00 +02:00
Pascal Vizeli b234c18664
Enable connectivity on startup (#2879)
* Check connectivity on system startup

* move it
2021-05-12 16:02:51 +02:00
Joakim Sørensen 95ef7d4508
Add snapshot content to list API (#2870) 2021-05-11 10:17:37 -07:00
Pascal Vizeli b59f741162
Validate secrets on options/validate UI check (#2854)
* Validate secrets on options/validate UI check

* Allow schema as payload

* Update supervisor/api/addons.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Offload into a module

* using new function

* disable check

* fix options value

* generated return value

* add debug logging

Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-05-10 14:27:50 +02:00
Pascal Vizeli 682ee4529e
Check integritiy of core (#2851) 2021-05-03 11:44:46 +02:00
Franck Nijhof cee520f0b5
Add discovery support for motionEye (#2850) 2021-04-29 23:35:57 +02:00
Pascal Vizeli b97e33f5d5
Ignore version on supervisor update (#2840)
* Ignore version on supervisor update

* fix property
2021-04-26 19:48:57 +02:00
Pascal Vizeli 29e55d3664
Clean env on remove-folder (#2839) 2021-04-26 19:47:46 +02:00
Joakim Sørensen 9112f27dc0
Update frontend to 4d287a1f (#2838) 2021-04-26 17:01:15 +02:00
eparla774 9e67df26b3
Fix for bug in host network info collector (#2821)
* Fix for bug in host network info collector

Fixed bug in host network info collector (Issue #2779)

* Added psk to authentification

* Fixed error

* Fixed error

* Update network.py
2021-04-26 16:37:06 +02:00