Compare commits

..

396 Commits

Author SHA1 Message Date
Pascal Vizeli
bfb0a961cd Add chidlren to the HW output (#3690) 2022-06-22 14:55:19 -04:00
dependabot[bot]
b1a23f3980 Bump pylint from 2.13.9 to 2.14.3 (#3685)
* Bump pylint from 2.13.9 to 2.14.3

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.13.9 to 2.14.3.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.13.9...v2.14.3)

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

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

* Remove non-existent or optional checkers

- `abstract-class-little-used` was removed in pylint [1.4.3](https://pylint.pycqa.org/en/latest/whatsnew/1/1.4.html#what-s-new-in-pylint-1-4-3)
- `no-self-use` became optional in pylint [2.14](https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers)
- `redefined-variable-type` doesn't exist. It's actually [`multiple_types`](https://pylint.pycqa.org/en/latest/user_guide/checkers/extensions.html#pylint-extensions-redefined-variable-type) and it's optional.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-06-22 14:30:57 -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
dependabot[bot]
b001aa882a Bump pyupgrade from 2.32.1 to 2.34.0 (#3669)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.32.1 to 2.34.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.32.1...v2.34.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-22 11:15:02 -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
dependabot[bot]
acfa686bb6 Bump home-assistant/builder from 2022.03.1 to 2022.06.1 (#3683)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2022.03.1 to 2022.06.1.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2022.03.1...2022.06.1)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-14 16:26:44 +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
dependabot[bot]
8d1a5c5d6a Bump actions/setup-python from 3.1.2 to 4.0.0 (#3677)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-09 09:41:37 +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
dependabot[bot]
e048c71dc8 Bump actions/cache from 3.0.3 to 3.0.4 (#3673)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-08 09:10:05 +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
dependabot[bot]
deeaf2133b Bump coverage from 6.4 to 6.4.1 (#3666)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.4 to 6.4.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.4...6.4.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-06 18:17:52 -04:00
dependabot[bot]
d004093a1e Bump actions/cache from 3.0.2 to 3.0.3 (#3662)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.2...v3.0.3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-01 14:35:34 -04:00
dependabot[bot]
9275c6af34 Bump awesomeversion from 22.5.1 to 22.5.2 (#3659)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-30 10:58:53 +02:00
dependabot[bot]
890313701c Bump coverage from 6.3.3 to 6.4 (#3653)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.3.3 to 6.4.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.3.3...6.4)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-24 18:22:59 -04: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
dependabot[bot]
6e017a36c4 Bump actions/upload-artifact from 3.0.0 to 3.1.0 (#3652)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-23 09:14:45 +02:00
Mike Degatano
5bc7255756 Catch assertion error on git pull (#3651) 2022-05-20 11:40:33 +02:00
dependabot[bot]
8c7c2fca28 Bump time-machine from 2.6.0 to 2.7.0 (#3637)
Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/adamchainz/time-machine/releases)
- [Changelog](https://github.com/adamchainz/time-machine/blob/main/HISTORY.rst)
- [Commits](https://github.com/adamchainz/time-machine/compare/2.6.0...2.7.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-19 11:52:51 -04:00
Stefan Agner
2fe358fb1e Resepect capitialization of network interfaces (#3646) 2022-05-19 17:47:50 +02:00
dependabot[bot]
2c09021427 Bump pylint from 2.13.8 to 2.13.9 (#3640)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.13.8 to 2.13.9.
- [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.13.8...v2.13.9)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-16 19:59:25 -04:00
Pascal Vizeli
5297edb57d Support new s6 overlay (#3630)
* Support new s6 overlay

* fix permission

* using bashio
2022-05-13 18:07:16 +02:00
dependabot[bot]
1b8ad44833 Bump coverage from 6.3.2 to 6.3.3 (#3638)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-13 08:56:12 +02:00
dependabot[bot]
1b53ca92c5 Bump release-drafter/release-drafter from 5.19.0 to 5.20.0 (#3636)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-12 10:13:06 +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
Stefan Agner
eabd976d33 Use volume as Docker storage location (#3337) 2022-05-11 12:23:28 +02:00
Joakim Sørensen
99023b9522 Bump awesomeversion to 22.5.1 (#3634) 2022-05-11 12:16:19 +02:00
dependabot[bot]
129a79ae24 Bump sentry-sdk from 1.5.11 to 1.5.12 (#3633)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.11 to 1.5.12.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.11...1.5.12)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 09:20:15 +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
dependabot[bot]
aa8910280d Bump pre-commit from 2.18.1 to 2.19.0 (#3625)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.18.1 to 2.19.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.18.1...v2.19.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-06 16:37:36 -04:00
dependabot[bot]
1d5806d0c7 Bump docker/login-action from 1.14.1 to 2.0.0 (#3624)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.14.1 to 2.0.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.14.1...v2.0.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-06 16:36:57 -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
dependabot[bot]
ae00ea178d Bump pyupgrade from 2.32.0 to 2.32.1 (#3621)
* Bump pyupgrade from 2.32.0 to 2.32.1

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.32.0 to 2.32.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.32.0...v2.32.1)

---
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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-05-05 09:53:35 +02:00
dependabot[bot]
7971be51b7 Bump sentry-sdk from 1.5.10 to 1.5.11 (#3617)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.10 to 1.5.11.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.10...1.5.11)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-04 09:30:37 +02:00
dependabot[bot]
4ad69dc038 Bump pylint from 2.13.7 to 2.13.8 (#3615)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.13.7 to 2.13.8.
- [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.13.7...v2.13.8)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-03 15:21:01 -04: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
dependabot[bot]
1c75b515e0 Bump jinja2 from 3.1.1 to 3.1.2 (#3607)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.1...3.1.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-29 09:20:17 -04:00
dependabot[bot]
5e266e58ac Bump awesomeversion from 22.4.1 to 22.4.2 (#3606)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 22.4.1 to 22.4.2.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/22.4.1...22.4.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-29 09:19:31 -04:00
dependabot[bot]
31401674d0 Bump codecov/codecov-action from 3.0.0 to 3.1.0 (#3588)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-28 14:32:42 -04:00
dependabot[bot]
04ff9f431a Bump awesomeversion from 22.4.0 to 22.4.1 (#3603)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 22.4.0 to 22.4.1.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/22.4.0...22.4.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-28 11:26:10 +02:00
Pascal Vizeli
7b46c4759d Tuning Jemalloc (#3600) 2022-04-28 11:25:38 +02:00
dependabot[bot]
e73809d350 Bump pytest from 7.1.1 to 7.1.2 (#3593)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.1 to 7.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.1...7.1.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-27 20:40:10 -04: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
dependabot[bot]
0440437369 Bump actions/checkout from 3.0.1 to 3.0.2 (#3587)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-22 08:57:12 +02:00
dependabot[bot]
46d0cc9777 Bump pylint from 2.13.5 to 2.13.7 (#3584)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-21 13:09:52 +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
dependabot[bot]
32d3a5224e Bump sentry-sdk from 1.5.9 to 1.5.10 (#3580)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-18 11:07:02 +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
dependabot[bot]
88795c56f0 Bump actions/checkout from 3.0.0 to 3.0.1 (#3574)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-15 08:41:14 +02:00
dependabot[bot]
6a075a49e3 Bump actions/cache from 3.0.1 to 3.0.2 (#3563)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-14 20:57:26 -04:00
dependabot[bot]
6395be5b68 Bump actions/setup-python from 3.1.1 to 3.1.2 (#3562)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3.1.1...v3.1.2)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-14 19:28:34 -04:00
dependabot[bot]
8c528f7ec5 Bump sentry-sdk from 1.5.8 to 1.5.9 (#3564)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.8 to 1.5.9.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.8...1.5.9)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-12 17:38:43 +02:00
Mike Degatano
a553ba5d24 Update resolved information with host info (#3560) 2022-04-12 09:21:35 +02:00
dependabot[bot]
61d79b6b9c Bump pyupgrade from 2.31.1 to 2.32.0 (#3558)
* Bump pyupgrade from 2.31.1 to 2.32.0

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.31.1 to 2.32.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.31.1...v2.32.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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-04-11 10:30:07 -04:00
Joakim Sørensen
7feab2e31a Bump frontend to d900e40d (#3559) 2022-04-11 10:28:12 -04:00
dependabot[bot]
5dd0a7611b Bump actions/download-artifact from 2 to 3 (#3557)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 13:14:17 +02:00
dependabot[bot]
8eba766f77 Bump voluptuous from 0.13.0 to 0.13.1 (#3554)
Bumps [voluptuous](https://github.com/alecthomas/voluptuous) from 0.13.0 to 0.13.1.
- [Release notes](https://github.com/alecthomas/voluptuous/releases)
- [Changelog](https://github.com/alecthomas/voluptuous/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alecthomas/voluptuous/compare/0.13.0...0.13.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 12:09:47 +02: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
dependabot[bot]
6666637a77 Bump actions/setup-python from 3.1.0 to 3.1.1 (#3553)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-08 10:15:43 +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]
19de0a22be Bump codecov/codecov-action from 2.1.0 to 3 (#3546)
* Bump codecov/codecov-action from 2.1.0 to 3

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.1.0 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2.1.0...v3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Exact version

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-04-07 11:14:58 -04:00
dependabot[bot]
b67ee216ae Bump pylint from 2.13.4 to 2.13.5 (#3549)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.13.4 to 2.13.5.
- [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.13.4...v2.13.5)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 11:12:03 -04:00
Stefan Agner
939c3f1b4a Use black 22.3.0 (#3550)
This fixes an issue with latest click versions
(see https://github.com/psf/black/issues/2964).

It also synchronizes pre-commit black version with what
requirements_tests.txt installs.
2022-04-07 15:27:57 +02: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
dependabot[bot]
f57aeab9ae Bump pre-commit from 2.17.0 to 2.18.1 (#3543)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.17.0 to 2.18.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.17.0...v2.18.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 12:15:01 -04:00
dependabot[bot]
383ea277b7 Bump actions/setup-python from 3.0.0 to 3.1.0 (#3541)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 12:10:24 -04:00
dependabot[bot]
a32d1668ee Bump awesomeversion from 22.2.0 to 22.4.0 (#3542)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 22.2.0 to 22.4.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/22.2.0...22.4.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 12:08:44 -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
dependabot[bot]
0de190268f Bump voluptuous from 0.12.2 to 0.13.0 (#3538)
Bumps [voluptuous](https://github.com/alecthomas/voluptuous) from 0.12.2 to 0.13.0.
- [Release notes](https://github.com/alecthomas/voluptuous/releases)
- [Changelog](https://github.com/alecthomas/voluptuous/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alecthomas/voluptuous/compare/0.12.2...0.13.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-31 16:55:13 +02:00
dependabot[bot]
9e5101aa39 Bump actions/cache from 3.0.0 to 3.0.1 (#3537)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-31 14:21:01 +02: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
dependabot[bot]
bfe1cb073c Bump pulsectl from 22.1.3 to 22.3.2 (#3527)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 22.1.3 to 22.3.2.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-29 20:12:13 -04:00
dependabot[bot]
3a1364dfcd Bump black from 22.1.0 to 22.3.0 (#3535)
Bumps [black](https://github.com/psf/black) from 22.1.0 to 22.3.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.1.0...22.3.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-29 18:53:45 -04:00
dependabot[bot]
3f63414bb3 Bump debugpy from 1.5.1 to 1.6.0 (#3530)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.5.1...v1.6.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-29 10:26:35 +02:00
dependabot[bot]
8b3a09e5b8 Bump jinja2 from 3.0.3 to 3.1.1 (#3534)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.3 to 3.1.1.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.3...3.1.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-29 10:26:16 +02:00
dependabot[bot]
ca7dc8113b Bump actions/cache from 2.1.7 to 3 (#3525)
* Bump actions/cache from 2.1.7 to 3

Bumps [actions/cache](https://github.com/actions/cache) from 2.1.7 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.7...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Fix 3 -> 3.0.0

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-22 14:01:15 +01:00
dependabot[bot]
6d2a603cf9 Bump sentry-sdk from 1.5.7 to 1.5.8 (#3523)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 08:13:38 +01:00
dependabot[bot]
d536ac8604 Bump pytest from 7.1.0 to 7.1.1 (#3522)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-18 08:42:05 +01: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
dependabot[bot]
d93def7f22 Bump cryptography from 36.0.1 to 36.0.2 (#3520)
Bumps [cryptography](https://github.com/pyca/cryptography) from 36.0.1 to 36.0.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/36.0.1...36.0.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-16 11:23:21 +01:00
dependabot[bot]
20e45e3c00 Bump pytest from 7.0.1 to 7.1.0 (#3516)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.0.1 to 7.1.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.0.1...7.1.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-14 17:42:07 +01:00
dependabot[bot]
5758d42c91 Bump pyupgrade from 2.31.0 to 2.31.1 (#3515)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.31.0 to 2.31.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-14 13:38:15 +01:00
Joakim Sørensen
d2dc78ae6a Add backup and restore to CI (#3509)
* Add backup and restore to CI

* Update .github/workflows/builder.yml

* -r

* restore ssl

* restart between

* Make sure it actually installed

* access .data
2022-03-11 09:43:50 -05: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
dependabot[bot]
4339cae241 Bump sentry-sdk from 1.5.6 to 1.5.7 (#3494)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.6 to 1.5.7.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.6...1.5.7)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-09 12:53:56 +01:00
Joakim Sørensen
4f2469fd98 Add collapse-after for dependencies (#3493)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-08 08:19:16 +01:00
dependabot[bot]
a90e8be6bc Bump actions/stale from 4.1.0 to 5.0.0 (#3492)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2022-03-08 07:50:16 +01:00
dependabot[bot]
dcaf36a8e5 Bump release-drafter/release-drafter from 5.18.1 to 5.19.0 (#3491)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-08 07:48:42 +01:00
dependabot[bot]
908df3b234 Bump home-assistant/builder from 2022.01.0 to 2022.03.1 (#3481)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2022.01.0 to 2022.03.1.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2022.01.0...2022.03.1)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-07 12:41:12 -05:00
Mike Degatano
1b445feaaa Use full version in actions to prevent auto-updates (#3490) 2022-03-07 12:22:47 -05:00
dependabot[bot]
c05504a069 Bump actions/upload-artifact from 2.3.1 to 3 (#3484)
* Bump actions/upload-artifact from 2.3.1 to 3

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.3.1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.3.1...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Use full version to prevent auto-updates

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-03-07 12:07:58 -05: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
dependabot[bot]
5fb2b99917 Bump actions/checkout from 2.4.0 to 3 (#3478)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-02 16:11:44 +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
dependabot[bot]
7ae8dfe587 Bump docker/login-action from 1.14.0 to 1.14.1 (#3479)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.14.0 to 1.14.1.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.14.0...v1.14.1)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-02 10:14:53 +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
dependabot[bot]
557f029aa0 Bump actions/setup-python from 2.3.2 to 3 (#3472)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2.3.2 to 3.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2.3.2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-01 09:39:34 +01:00
dependabot[bot]
e8e3cc2f67 Bump docker/login-action from 1.13.0 to 1.14.0 (#3471)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-01 09:39:24 +01: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
205f3a74dd Fix CI warning "[: =~: binary operator expected" (#3470) 2022-02-28 12:26:38 +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
36f4e494a2 Add CAS configs to image (#3462) 2022-02-23 17:31:16 -05: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
dependabot[bot]
244005471b Bump pytest-timeout from 2.0.2 to 2.1.0 (#3408)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-23 10:19:45 +01:00
dependabot[bot]
0ca837903f Bump sentry-sdk from 1.5.5 to 1.5.6 (#3460)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-23 10:19:12 +01:00
Mike Degatano
8683d46ab6 Add dbus support to plugin-dns (#3459) 2022-02-21 20:31:15 +01:00
dependabot[bot]
c17006cc37 Bump coverage from 6.3.1 to 6.3.2 (#3456)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.3.1 to 6.3.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.3.1...6.3.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 18:36:26 +01:00
dependabot[bot]
136d8613a5 Bump gitpython from 3.1.26 to 3.1.27 (#3457)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.26 to 3.1.27.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.26...3.1.27)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 14:20:45 +01:00
dependabot[bot]
670d05df95 Bump awesomeversion from 22.1.0 to 22.2.0 (#3458)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 22.1.0 to 22.2.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/22.1.0...22.2.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 08:37:02 +01:00
dependabot[bot]
93fc4e97a0 Bump docker/login-action from 1.12.0 to 1.13.0 (#3454)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-18 08:45:33 +01:00
dependabot[bot]
b86df0696e Bump actions/setup-python from 2.3.1 to 2.3.2 (#3443)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2.3.1...v2.3.2)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 18:43:29 +01:00
dependabot[bot]
b0af73b0b5 Bump coverage from 6.2 to 6.3.1 (#3427)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.2 to 6.3.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.2...6.3.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 18:42:58 +01:00
dependabot[bot]
f1e884b264 Bump pytest from 6.2.5 to 7.0.1 (#3445)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.5 to 7.0.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.5...7.0.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 18:42:47 +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
Pascal Vizeli
2a006ae76d Update CAS to 1.0.2 (#3448) 2022-02-15 16:27:18 +01:00
dependabot[bot]
40812450df Bump sentry-sdk from 1.5.4 to 1.5.5 (#3446)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.4 to 1.5.5.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.4...1.5.5)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 11:28:12 +01:00
Mike Degatano
d2e0b0417c Hash correct folder in source_mods tests (#3442)
Source mods test was corrected to start from `supervisor` folder within repo and not include tests. The patch here was still starting from the workspace directory since that's what it used to do
2022-02-10 11:33:47 -05: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
199b57c833 Fix source-mod detection calculation (#3440) 2022-02-10 14:07:17 +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
dependabot[bot]
d6e44b43b4 Bump attrs from 21.2.0 to 21.4.0 (#3386)
Bumps [attrs](https://github.com/python-attrs/attrs) from 21.2.0 to 21.4.0.
- [Release notes](https://github.com/python-attrs/attrs/releases)
- [Changelog](https://github.com/python-attrs/attrs/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/python-attrs/attrs/compare/21.2.0...21.4.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-10 10:23:34 +01:00
Pascal Vizeli
84c2053b57 Add suffix hash on CAS CI (#3438) 2022-02-10 10:21:34 +01:00
dependabot[bot]
2df3678fef Bump pyudev from 0.23.1 to 0.23.2 (#3434)
Bumps [pyudev](https://github.com/pyudev/pyudev) from 0.23.1 to 0.23.2.
- [Release notes](https://github.com/pyudev/pyudev/releases)
- [Changelog](https://github.com/pyudev/pyudev/blob/master/CHANGES.rst)
- [Commits](https://github.com/pyudev/pyudev/compare/v0.23.1...v0.23.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-10 10:14:14 +01:00
Pascal Vizeli
920f9846ac Fix asset name (#3437) 2022-02-10 10:13:22 +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
Matheson Steplock
e5d64f6c75 Fix bashio-typo in watchdog service (#3436) 2022-02-09 10:01:26 +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
dependabot[bot]
a495fd6b3a Bump actions/setup-python from 2.3.1 to 2.3.2 (#3433)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-07 08:57:19 +01: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
dependabot[bot]
a52272a7fe Bump home-assistant/builder from 2021.12.0 to 2022.01.0 (#3424)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-31 09:18:18 +01:00
dependabot[bot]
fb24ed3f1a Bump pyudev from 0.22.0 to 0.23.1 (#3423)
Bumps [pyudev](https://github.com/pyudev/pyudev) from 0.22.0 to 0.23.1.
- [Release notes](https://github.com/pyudev/pyudev/releases)
- [Changelog](https://github.com/pyudev/pyudev/blob/master/CHANGES.rst)
- [Commits](https://github.com/pyudev/pyudev/compare/v0.22...v0.23.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-27 15:15:09 +01:00
Pascal Vizeli
8d8704e049 Fixing IO on the loop with docker HW events (#3422) 2022-01-26 17:41:00 +01:00
dependabot[bot]
a60f25100d Bump sentry-sdk from 1.5.3 to 1.5.4 (#3419)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.3...1.5.4)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 16:49:55 +01:00
dependabot[bot]
5be4a1f4dc Bump pulsectl from 21.10.5 to 22.1.3 (#3416)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.10.5 to 22.1.3.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 16:49:28 +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
dependabot[bot]
4ae61814d4 Bump sentry-sdk from 1.5.2 to 1.5.3 (#3412)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-21 21:12:11 +01:00
Joakim Sørensen
b651d63758 Add backup size to list API (#3409) 2022-01-19 08:59:30 -08:00
dependabot[bot]
400d3981a2 Bump pre-commit from 2.16.0 to 2.17.0 (#3407)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-19 09:16:13 +01: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
dependabot[bot]
603d19b075 Bump sentry-sdk from 1.5.1 to 1.5.2 (#3398)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 09:04:24 +01:00
dependabot[bot]
a5ce2ef7cb Bump gitpython from 3.1.25 to 3.1.26 (#3399)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 08:36:23 +01:00
dependabot[bot]
f392dc5492 Bump awesomeversion from 21.12.0 to 22.1.0 (#3397)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 09:04:58 +01:00
dependabot[bot]
0c63883269 Bump gitpython from 3.1.24 to 3.1.25 (#3394)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.24 to 3.1.25.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.24...3.1.25)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-09 21:47:50 +01:00
dependabot[bot]
612d4f950b Bump pyupgrade from 2.30.0 to 2.31.0 (#3390)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-01-06 16:14:24 +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
Allen Porter
fefc99e825 Fix copy/paste issues in tests (#3393) 2022-01-05 10:01:00 +01:00
Allen Porter
d994170a9d Fix copy-paste error in pydoc for test_almond.py (#3389) 2022-01-02 16:09:46 +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
dependabot[bot]
22238c9c0e Bump awesomeversion from 21.11.0 to 21.12.0 (#3379)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.11.0 to 21.12.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.11.0...21.12.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-28 11:10:36 +01:00
dependabot[bot]
5ff96cfa5e Bump pyupgrade from 2.29.1 to 2.30.0 (#3381)
* Bump pyupgrade from 2.29.1 to 2.30.0

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.29.1 to 2.30.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.29.1...v2.30.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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-12-28 11:09:28 +01:00
dependabot[bot]
e22a19df1a Bump cryptography from 35.0.0 to 36.0.1 (#3365)
Bumps [cryptography](https://github.com/pyca/cryptography) from 35.0.0 to 36.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/35.0.0...36.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-23 14:09:19 +01:00
dependabot[bot]
f57bc0db25 Bump async-timeout from 4.0.1 to 4.0.2 (#3376)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:57:51 +01:00
dependabot[bot]
6ba6b5ea56 Bump pylint from 2.12.1 to 2.12.2 (#3341)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:52:58 +01:00
dependabot[bot]
5dc9f9235e Bump docker/login-action from 1.10.0 to 1.12.0 (#3375)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:51:43 +01:00
Franck Nijhof
323fa2e637 Change CI cache restore policy (#3377) 2021-12-21 10:47:20 +01:00
dependabot[bot]
0986419b2f Bump deepmerge from 0.3.0 to 1.0.1 (#3373)
Bumps [deepmerge](https://github.com/toumorokoshi/deepmerge) from 0.3.0 to 1.0.1.
- [Release notes](https://github.com/toumorokoshi/deepmerge/releases)
- [Commits](https://github.com/toumorokoshi/deepmerge/commits)

---
updated-dependencies:
- dependency-name: deepmerge
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:26:03 +01:00
dependabot[bot]
f0bc952269 Bump home-assistant/builder from 2021.11.4 to 2021.12.0 (#3359)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.11.4 to 2021.12.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.11.4...2021.12.0)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:25:20 +01:00
dependabot[bot]
9266997482 Bump sentry-sdk from 1.5.0 to 1.5.1 (#3360)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.0...1.5.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:24:54 +01:00
dependabot[bot]
75d252e21a Bump pytest-timeout from 2.0.1 to 2.0.2 (#3361)
Bumps [pytest-timeout](https://github.com/pytest-dev/pytest-timeout) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/pytest-dev/pytest-timeout/releases)
- [Commits](https://github.com/pytest-dev/pytest-timeout/compare/2.0.1...2.0.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:24:24 +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
dependabot[bot]
54e6ae5fd9 Bump actions/upload-artifact from 2.3.0 to 2.3.1 (#3368)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-16 08:24:10 +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
dependabot[bot]
86bd16b2ba Bump black from 21.11b1 to 21.12b0 (#3342)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-12-14 02:14:38 +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
dependabot[bot]
3511c19726 Bump actions/upload-artifact from 2.2.4 to 2.3.0 (#3344)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-08 08:34:50 +01:00
Joakim Sørensen
d9ed58696b Bump frontend to 6877fd9e (#3338) 2021-12-02 20:42:42 +01:00
Joakim Sørensen
373f452774 Fix path name for build file (#3328) 2021-12-02 11:54:49 +01:00
dependabot[bot]
e54efa681f Bump pre-commit from 2.15.0 to 2.16.0 (#3335)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-01 07:49:54 +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
dependabot[bot]
dc24f332f8 Bump actions/setup-python from 2.3.0 to 2.3.1 (#3332)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-30 09:11:28 +01:00
dependabot[bot]
99cdf7b028 Bump sentry-sdk from 1.4.3 to 1.5.0 (#3316)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 23:01:27 +01:00
Joakim Sørensen
54edfa53bc Bump pylint from 2.11.1 to 2.12.1 (#3330) 2021-11-29 22:56:38 +01:00
Joakim Sørensen
571c9a05c6 Bump aiohttp and friends (#3329) 2021-11-29 22:34:42 +01:00
dependabot[bot]
864b7bf023 Bump jinja2 from 3.0.2 to 3.0.3 (#3296)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 17:40:34 +01:00
dependabot[bot]
e303431d74 Bump awesomeversion from 21.10.1 to 21.11.0 (#3308)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 17:27:52 +01:00
dependabot[bot]
19dd40275c Bump black from 21.9b0 to 21.11b1 (#3278)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-11-29 17:22:07 +01:00
Joakim Sørensen
4cf970e37a WS connection fix (#3317) 2021-11-29 17:21:09 +01:00
dependabot[bot]
7947c27089 Bump pytest-timeout from 1.4.2 to 2.0.1 (#3227)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 17:08:42 +01:00
Joakim Sørensen
d0e2c8b694 Split homeassistant watchdog conditions (#3318) 2021-11-29 17:03:49 +01:00
dependabot[bot]
19e3a859b0 Bump pyupgrade from 2.29.0 to 2.29.1 (#3306)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-11-29 16:59:46 +01:00
dependabot[bot]
e6557ded34 Bump actions/cache from 2.1.6 to 2.1.7 (#3320)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 16:54:08 +01:00
dependabot[bot]
f4aae4522d Bump actions/setup-python from 2.2.2 to 2.3.0 (#3315)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 16:50:40 +01:00
Joakim Sørensen
2066aefd6d Bump frontend to e91d1777 (#3326) 2021-11-29 15:45:14 +01:00
dependabot[bot]
2f56cab953 Bump home-assistant/builder from 2021.09.0 to 2021.11.4 (#3323)
* Bump home-assistant/builder from 2021.09.0 to 2021.11.4

Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.09.0 to 2021.11.4.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.09.0...2021.11.4)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

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

* CAS fixes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-11-29 15:43:04 +01:00
dependabot[bot]
883399f583 Bump pytest-cov from 2.12.1 to 3.0.0 (#3192)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 15:16:41 +01:00
dependabot[bot]
47f53501e5 Bump coverage from 5.5 to 6.2 (#3324)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 14:46:12 +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
dependabot[bot]
8f263ab345 Bump colorlog from 6.5.0 to 6.6.0 (#3294)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 6.5.0 to 6.6.0.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v6.5.0...v6.6.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-09 09:54:22 +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
dependabot[bot]
9ee0efe6c0 Bump actions/checkout from 2.3.5 to 2.4.0 (#3285)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-03 08:17:16 +01:00
dependabot[bot]
a2af63d050 Bump flake8 from 3.9.2 to 4.0.1 (#3228)
Bumps [flake8](https://github.com/pycqa/flake8) from 3.9.2 to 4.0.1.
- [Release notes](https://github.com/pycqa/flake8/releases)
- [Commits](https://github.com/pycqa/flake8/compare/3.9.2...4.0.1)

---
updated-dependencies:
- dependency-name: flake8
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-01 16:36:00 +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
Joakim Sørensen
df9d62f874 Fix update frontend script (#3244) 2021-10-19 19:42:47 +02:00
dependabot[bot]
4a6aaa8559 Bump pulsectl from 21.9.1 to 21.10.5 (#3237)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.9.1 to 21.10.5.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 18:22:28 +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
dependabot[bot]
e2f39059c6 Bump cryptography from 3.4.6 to 35.0.0 (#3170)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.6 to 35.0.0.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.6...35.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 15:05:25 +02:00
dependabot[bot]
531073d5ec Bump debugpy from 1.5.0 to 1.5.1 (#3242)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.5.0...v1.5.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 14:52:11 +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
Joakim Sørensen
03f0a136ab Remove vcn from Dockerfile (#3241) 2021-10-19 10:08:53 +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
dependabot[bot]
1ee6c0491c Bump sentry-sdk from 1.4.2 to 1.4.3 (#3171)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.4.2 to 1.4.3.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.4.2...1.4.3)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 10:59:45 +02:00
dependabot[bot]
cc50a91a42 Bump debugpy from 1.4.3 to 1.5.0 (#3202)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.4.3 to 1.5.0.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.4.3...v1.5.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 10:57:08 +02:00
Joakim Sørensen
637377f81d Replace devcontainer (#3175) 2021-10-18 10:44:28 +02:00
Vighnesh Kadam
a90f70e017 Use new format for logging exceptions - docker/network.py (#3220) 2021-10-18 10:09:21 +02:00
dependabot[bot]
949ecb255d Bump actions/checkout from 2.3.4 to 2.3.5 (#3236)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 08:33:53 +02:00
Anand Borkar
15f62837c8 Use new format for logging exceptions - docker/supervisor.py (#3221) 2021-10-08 16:03:30 +02:00
dependabot[bot]
e5246a5b1d Bump jinja2 from 3.0.1 to 3.0.2 (#3201)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 10:51:09 +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
dependabot[bot]
79d541185f Bump colorlog from 6.4.1 to 6.5.0 (#3216)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 10:09:10 +02:00
dependabot[bot]
b433d129ef Bump docker from 5.0.2 to 5.0.3 (#3215)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 10:08:24 +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
dependabot[bot]
8b93f0aee7 Bump pyupgrade from 2.28.1 to 2.29.0 (#3165)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-29 17:47:04 +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
dependabot[bot]
73d84113ea Bump sentry-sdk from 1.4.1 to 1.4.2 (#3159)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.4.1...1.4.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-28 09:57:17 +02:00
dependabot[bot]
4b15945ca1 Bump pyupgrade from 2.28.0 to 2.28.1 (#3160)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-28 09:43:00 +02:00
dependabot[bot]
10720b2988 Bump dessant/lock-threads from 2.1.2 to 3 (#3158)
* Bump dessant/lock-threads from 2.1.2 to 3

Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 2.1.2 to 3.
- [Release notes](https://github.com/dessant/lock-threads/releases)
- [Changelog](https://github.com/dessant/lock-threads/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dessant/lock-threads/compare/v2.1.2...v3)

---
updated-dependencies:
- dependency-name: dessant/lock-threads
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Adjust config for breaking change

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-09-28 09:41:20 +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
dependabot[bot]
e960a70217 Bump pyupgrade from 2.26.0.post1 to 2.28.0 (#3151)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 10:37:21 +02:00
dependabot[bot]
9b0a2e6da9 Bump sentry-sdk from 1.4.0 to 1.4.1 (#3140)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 10:36:58 +02:00
Joakim Sørensen
cd0c151bd9 Fix typo in vcn_version (#3154) 2021-09-27 10:25:03 +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
dependabot[bot]
c9d3f65cc8 Bump home-assistant/builder from 2021.07.0 to 2021.09.0 (#3150)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 08:07:28 +02:00
Pascal Vizeli
0407122fbe Revert "Bump voluptuous from 0.12.1 to 0.12.2 (#3141)" (#3145)
This reverts commit 5e871d9399.
2021-09-25 14:50:01 +02:00
dependabot[bot]
5e871d9399 Bump voluptuous from 0.12.1 to 0.12.2 (#3141)
Bumps [voluptuous](https://github.com/alecthomas/voluptuous) from 0.12.1 to 0.12.2.
- [Release notes](https://github.com/alecthomas/voluptuous/releases)
- [Changelog](https://github.com/alecthomas/voluptuous/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alecthomas/voluptuous/compare/0.12.1...v0.12.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-25 11:02:48 +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
dependabot[bot]
96f6c07912 Bump sentry-sdk from 1.3.1 to 1.4.0 (#3135)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.3.1...1.4.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-22 12:18:33 +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]
6d2a38c96e Bump gitpython from 3.1.18 to 3.1.24 (#3130)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.18 to 3.1.24.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.18...3.1.24)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-21 18:23:56 +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
4f97013df4 Using git token + pull image from ghcr.io for tests (#3132) 2021-09-20 13:41:35 +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
dependabot[bot]
24cdb4787a Bump black from 21.8b0 to 21.9b0 (#3123)
* Bump black from 21.8b0 to 21.9b0

Bumps [black](https://github.com/psf/black) from 21.8b0 to 21.9b0.
- [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)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

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

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-14 12:01:10 +02:00
dependabot[bot]
57b1c21af4 Bump codecov/codecov-action from 2.0.3 to 2.1.0 (#3122)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.3 to 2.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2.0.3...v2.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-14 09:02:30 +02:00
dependabot[bot]
f0eddb6926 Bump debugpy from 1.4.1 to 1.4.3 (#3116)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.4.1 to 1.4.3.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.4.1...v1.4.3)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-13 16:06:59 +02:00
dependabot[bot]
7c74c1bd8c Bump pyupgrade from 2.25.0 to 2.26.0 (#3118)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.25.0 to 2.26.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.25.0...v2.26.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-13 16:06:42 +02:00
dependabot[bot]
2d4a85ae43 Bump pulsectl from 21.5.18 to 21.9.1 (#3108)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.5.18 to 21.9.1.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-13 14:00:08 +02:00
Joakim Sørensen
d48c439737 Print supervisor container logs on failure (#3110) 2021-09-09 13:21:22 +02:00
dependabot[bot]
874c50d3e8 Bump docker from 5.0.0 to 5.0.2 (#3099)
Bumps [docker](https://github.com/docker/docker-py) from 5.0.0 to 5.0.2.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/5.0.0...5.0.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-06 08:50:42 +02:00
Joakim Sørensen
4beaf571c2 Bump frontend to d5a16176 (#3101) 2021-09-03 12:49:33 +02:00
dependabot[bot]
58a948447e Bump pre-commit from 2.14.1 to 2.15.0 (#3103)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.14.1 to 2.15.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.14.1...v2.15.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-03 10:37:19 +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
dependabot[bot]
4ea3695982 Bump pytest from 6.2.4 to 6.2.5 (#3092)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.4 to 6.2.5.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.4...6.2.5)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-31 08:19:36 +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
dependabot[bot]
9bf8d15b01 Bump black from 21.7b0 to 21.8b0 (#3088)
* Bump black from 21.7b0 to 21.8b0

Bumps [black](https://github.com/psf/black) from 21.7b0 to 21.8b0.
- [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)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

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

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-08-30 10:20:14 +02:00
dependabot[bot]
70acbffc23 Bump pyupgrade from 2.24.0 to 2.25.0 (#3086)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.24.0 to 2.25.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.24.0...v2.25.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 10:06:44 +02:00
dependabot[bot]
c9b1eb751e Bump pre-commit from 2.14.0 to 2.14.1 (#3087)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.14.0 to 2.14.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.14.0...v2.14.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 10:06:24 +02:00
Joakim Sørensen
ad8d850ed7 Update frontend to 67ab63f0 (#3083) 2021-08-28 10:08:15 +02:00
Pascal Vizeli
1b0eb9397d Fix command for disable content-trust (#3078) 2021-08-26 17:18:00 +02:00
dependabot[bot]
8572f8c4e5 Bump awesomeversion from 21.8.0 to 21.8.1 (#3074)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.8.0 to 21.8.1.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.8.0...21.8.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-26 14:51:24 +02:00
dependabot[bot]
66565dde87 Bump codecov/codecov-action from 2.0.2 to 2.0.3 (#3073)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-25 08:38:20 +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
dependabot[bot]
62b364ea29 Bump colorlog from 5.0.1 to 6.4.1 (#3072)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 5.0.1 to 6.4.1.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v5.0.1...v6.4.1)

---
updated-dependencies:
- dependency-name: colorlog
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-24 11:20:21 +02:00
dependabot[bot]
e6f00144f2 Bump pylint from 2.9.6 to 2.10.2 (#3069)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.6 to 2.10.2.
- [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.9.6...v2.10.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-23 11:07:28 +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
dependabot[bot]
0747a7e4b2 Bump pyupgrade from 2.23.3 to 2.24.0 (#3065)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.23.3 to 2.24.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.23.3...v2.24.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-20 08:06:51 +02:00
dependabot[bot]
0123d7935d Bump dessant/lock-threads from 2.1.1 to 2.1.2 (#3063)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-18 08:59:51 +02:00
dependabot[bot]
7a1009446b Bump awesomeversion from 21.6.0 to 21.8.0 (#3059)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.6.0 to 21.8.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.6.0...21.8.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-12 16:21:14 +02:00
Pascal Vizeli
034606cd0f Give audio plugin machine data for mixer evaluation (#3056) 2021-08-10 13:36:48 +02:00
dependabot[bot]
ddc30cfd7d Bump pylint from 2.9.4 to 2.9.6 (#3036)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.4 to 2.9.6.
- [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.9.4...v2.9.6)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-10 10:42:51 +02:00
Pascal Vizeli
f10fccaff8 Fix vcn install on CI (#3055)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-08-10 10:36:57 +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
dependabot[bot]
9638775944 Bump debugpy from 1.3.0 to 1.4.1 (#3028)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.3.0 to 1.4.1.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.3.0...v1.4.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 19:29:12 +02:00
dependabot[bot]
fbec0befde Bump ciso8601 from 2.1.3 to 2.2.0 (#3052)
Bumps [ciso8601](https://github.com/closeio/ciso8601) from 2.1.3 to 2.2.0.
- [Release notes](https://github.com/closeio/ciso8601/releases)
- [Changelog](https://github.com/closeio/ciso8601/blob/master/CHANGELOG.md)
- [Commits](https://github.com/closeio/ciso8601/compare/v2.1.3...v2.2.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 19:28:51 +02:00
Joakim Sørensen
81e7fac848 Fix flaky tests when CI did not have access to /run/supervisor (#3054) 2021-08-09 19:26:37 +02:00
dependabot[bot]
97599b3e70 Bump sentry-sdk from 1.2.0 to 1.3.1 (#3031)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 17:44:44 +02:00
dependabot[bot]
c94b23a3fd Bump getsentry/action-release from 1.1.5 to 1.1.6 (#3030)
Bumps [getsentry/action-release](https://github.com/getsentry/action-release) from 1.1.5 to 1.1.6.
- [Release notes](https://github.com/getsentry/action-release/releases)
- [Commits](https://github.com/getsentry/action-release/compare/v1.1.5...v1.1.6)

---
updated-dependencies:
- dependency-name: getsentry/action-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 17:05:31 +02:00
dependabot[bot]
9758980ae0 Bump pyupgrade from 2.21.2 to 2.23.3 (#3050)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.21.2 to 2.23.3.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.21.2...v2.23.3)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 17:04:18 +02:00
dependabot[bot]
6ab3fbaab3 Bump pre-commit from 2.13.0 to 2.14.0 (#3053)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.13.0 to 2.14.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.13.0...v2.14.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 17:03:20 +02:00
dependabot[bot]
4933ff83df Bump codecov from 2.1.11 to 2.1.12 (#3045)
Bumps [codecov](https://github.com/codecov/codecov-python) from 2.1.11 to 2.1.12.
- [Release notes](https://github.com/codecov/codecov-python/releases)
- [Changelog](https://github.com/codecov/codecov-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-python/compare/v2.1.11...v2.1.12)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 17:02:50 +02:00
dependabot[bot]
71e12ecb2b Bump home-assistant/builder from 2021.06.2 to 2021.07.0 (#3035)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.06.2 to 2021.07.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.06.2...2021.07.0)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 16:51:28 +02:00
dependabot[bot]
36687530e0 Bump black from 21.6b0 to 21.7b0 (#3013)
Bumps [black](https://github.com/psf/black) from 21.6b0 to 21.7b0.
- [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)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 16:40:21 +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]
f4f1fc524d Bump codecov/codecov-action from 2.0.1 to 2.0.2 (#3027)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-26 10:21:00 +02:00
dependabot[bot]
6d9f44a900 Bump pylint from 2.9.3 to 2.9.4 (#3020)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.3 to 2.9.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.9.3...v2.9.4)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-21 15:50:00 +02:00
Pascal Vizeli
aeb9b26d44 Alpine 3.14 (#3019)
* Alpine 3.14

* revert trigger
2021-07-20 18:30:08 +02:00
dependabot[bot]
631f78f468 Bump codecov/codecov-action from 1.5.2 to 2.0.1 (#3018)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1.5.2 to 2.0.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.5.2...v2.0.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-20 11:11:51 +02:00
dependabot[bot]
13cedb308e Bump pyupgrade from 2.21.1 to 2.21.2 (#3012)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.21.1 to 2.21.2.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.21.1...v2.21.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-19 09:59:09 +02:00
dependabot[bot]
82c183e1a8 Bump pyupgrade from 2.21.0 to 2.21.1 (#3010)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.21.0 to 2.21.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.21.0...v2.21.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-16 09:07:49 +02:00
dependabot[bot]
25cf1e7394 Bump actions/stale from 3.0.19 to 4 (#3009)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-15 09:36:18 +02:00
dependabot[bot]
91509a4205 Bump dessant/lock-threads from 2.0.3 to 2.1.1 (#3007)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-12 11:44:53 +02:00
dependabot[bot]
d93ebd15a2 Bump pyupgrade from 2.20.0 to 2.21.0 (#3008)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.20.0 to 2.21.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.20.0...v2.21.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-12 11:40:34 +02:00
dependabot[bot]
85e7f817e6 Bump sentry-sdk from 1.1.0 to 1.2.0 (#2997)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.1.0...1.2.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-08 11:40:45 +02:00
dependabot[bot]
772cadb435 Bump pylint from 2.9.1 to 2.9.3 (#2992)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.1 to 2.9.3.
- [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.9.1...v2.9.3)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-05 09:39:25 +02:00
dependabot[bot]
853aeef583 Bump pyupgrade from 2.19.4 to 2.20.0 (#2993)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.19.4 to 2.20.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.19.4...v2.20.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-05 09:39:13 +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
1047 changed files with 26475 additions and 14722 deletions

View File

@@ -1,60 +0,0 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.9
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]
WORKDIR /workspaces
# Set Docker daemon config
RUN \
mkdir -p /etc/docker \
&& echo '{"storage-driver": "vfs"}' > /etc/docker/daemon.json
# Install Node/Yarn for Frontent
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& apt-get update \
&& apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
apt-utils \
apt-transport-https \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update && apt-get install -y --no-install-recommends \
nodejs \
yarn \
&& curl -o - https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \
&& rm -rf /var/lib/apt/lists/*
ENV NVM_DIR /root/.nvm
# Install docker
# https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
gpg-agent \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
&& apt-get update && apt-get install -y --no-install-recommends \
docker-ce \
docker-ce-cli \
containerd.io \
&& rm -rf /var/lib/apt/lists/*
# Install tools
RUN apt-get update && apt-get install -y --no-install-recommends \
jq \
dbus \
network-manager \
libpulse0 \
&& bash <(curl https://getvcn.codenotary.com -L) \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies from requirements.txt if it exists
COPY requirements.txt requirements_tests.txt ./
RUN pip3 install -U setuptools pip \
&& pip3 install -r requirements.txt -r requirements_tests.txt \
&& pip3 install tox \
&& rm -f requirements.txt requirements_tests.txt

View File

@@ -1,19 +1,23 @@
{
"name": "Supervisor dev",
"context": "..",
"dockerFile": "Dockerfile",
"appPort": "9123:8123",
"postCreateCommand": "pre-commit install",
"image": "ghcr.io/home-assistant/devcontainer:supervisor",
"appPort": ["9123:8123", "7357:4357"],
"postCreateCommand": "bash devcontainer_bootstrap",
"runArgs": ["-e", "GIT_EDITOR=code --wait", "--privileged"],
"containerEnv": {"NVM_DIR":"/usr/local/share/nvm"},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"visualstudioexptteam.vscodeintellicode",
"esbenp.prettier-vscode"
],
"mounts": [ "type=volume,target=/var/lib/docker" ],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
}
},
"terminal.integrated.defaultProfile.linux": "zsh",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
@@ -22,7 +26,7 @@
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--target-version", "py38"],
"python.formatting.blackArgs": ["--target-version", "py39"],
"python.formatting.blackPath": "/usr/local/bin/black",
"python.linting.banditPath": "/usr/local/bin/bandit",
"python.linting.flake8Path": "/usr/local/bin/flake8",

View File

@@ -31,6 +31,7 @@ categories:
- title: ":arrow_up: Dependency Updates"
label: "dependencies"
collapse-after: 1
include-labels:
- "breaking-change"

View File

@@ -27,15 +27,16 @@ on:
paths:
- "rootfs/**"
- "supervisor/**"
- build.json
- build.yaml
- Dockerfile
- requirements.txt
- setup.py
env:
DEFAULT_PYTHON: 3.9
BUILD_NAME: supervisor
BUILD_TYPE: supervisor
WHEELS_TAG: 3.9-alpine3.13
WHEELS_TAG: 3.9-alpine3.14
jobs:
init:
@@ -49,7 +50,7 @@ jobs:
requirements: ${{ steps.requirements.outputs.changed }}
steps:
- name: Checkout the repository
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
with:
fetch-depth: 0
@@ -84,7 +85,7 @@ jobs:
arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps:
- name: Checkout the repository
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
with:
fetch-depth: 0
@@ -109,59 +110,72 @@ jobs:
- name: Login to DockerHub
if: needs.init.outputs.publish == 'true'
uses: docker/login-action@v1.10.0
uses: docker/login-action@v2.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: needs.init.outputs.publish == 'true'
uses: docker/login-action@v1.10.0
uses: docker/login-action@v2.0.0
with:
registry: ghcr.io
username: ${{ secrets.GIT_USER }}
password: ${{ secrets.GIT_TOKEN }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set build arguments
if: needs.init.outputs.publish == 'false'
run: echo "BUILD_ARGS=--test" >> $GITHUB_ENV
- name: Build supervisor
uses: home-assistant/builder@2021.06.2
uses: home-assistant/builder@2022.06.1
with:
args: |
$BUILD_ARGS \
--${{ matrix.arch }} \
--target /data \
--with-codenotary "${{ secrets.VCN_USER }}" "${{ secrets.VCN_PASSWORD }}" "${{ secrets.VCN_ORG }}" \
--validate-from "${{ secrets.VCN_ORG }}" \
--generic ${{ needs.init.outputs.version }}
env:
CAS_API_KEY: ${{ secrets.CAS_TOKEN }}
codenotary:
name: CodeNotary signature
name: CAS signature
needs: init
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
if: needs.init.outputs.publish == 'true'
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
with:
fetch-depth: 0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
if: needs.init.outputs.publish == 'true'
uses: actions/setup-python@v4.0.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Set version
if: needs.init.outputs.publish == 'true'
uses: home-assistant/actions/helpers/version@master
with:
type: ${{ env.BUILD_TYPE }}
- name: Signing image
- name: Install dirhash and calc hash
if: needs.init.outputs.publish == 'true'
id: dirhash
run: |
pip3 install dirhash
dir_hash="$(dirhash "${{ github.workspace }}/supervisor" -a sha256 --match "*.py")"
echo "::set-output name=dirhash::${dir_hash}"
- name: Signing Source
if: needs.init.outputs.publish == 'true'
uses: home-assistant/actions/helpers/codenotary@master
with:
source: dir://${{ github.workspace }}
user: ${{ secrets.VCN_USER }}
password: ${{ secrets.VCN_PASSWORD }}
organisation: ${{ secrets.VCN_ORG }}
source: hash://${{ steps.dirhash.outputs.dirhash }}
asset: supervisor-${{ needs.init.outputs.version }}
token: ${{ secrets.CAS_TOKEN }}
version:
name: Update version
@@ -170,7 +184,7 @@ jobs:
steps:
- name: Checkout the repository
if: needs.init.outputs.publish == 'true'
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Initialize git
if: needs.init.outputs.publish == 'true'
@@ -192,13 +206,14 @@ jobs:
runs-on: ubuntu-latest
name: Run the Supervisor
needs: ["build", "codenotary", "init"]
timeout-minutes: 60
steps:
- name: Checkout the repository
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Build the Supervisor
if: needs.init.outputs.publish != 'true'
uses: home-assistant/builder@2021.06.2
uses: home-assistant/builder@2022.06.1
with:
args: |
--test \
@@ -209,8 +224,8 @@ jobs:
- name: Pull Supervisor
if: needs.init.outputs.publish == 'true'
run: |
docker pull homeassistant/amd64-hassio-supervisor:${{ needs.init.outputs.version }}
docker tag homeassistant/amd64-hassio-supervisor:${{ needs.init.outputs.version }} homeassistant/amd64-hassio-supervisor:runner
docker pull ghcr.io/home-assistant/amd64-hassio-supervisor:${{ needs.init.outputs.version }}
docker tag ghcr.io/home-assistant/amd64-hassio-supervisor:${{ needs.init.outputs.version }} homeassistant/amd64-hassio-supervisor:runner
- name: Create the Supervisor
run: |
@@ -218,7 +233,7 @@ jobs:
docker create --name hassio_supervisor \
--privileged \
--security-opt seccomp=unconfined \
--security-opt apparmor:unconfined \
--security-opt apparmor=unconfined \
-v /run/docker.sock:/run/docker.sock \
-v /run/dbus:/run/dbus \
-v /tmp/supervisor/data:/data \
@@ -240,21 +255,18 @@ jobs:
ping=$(curl -sSL "http://$SUPERVISOR/supervisor/ping" | jq -r '.result')
sleep 5
done
docker logs hassio_supervisor
- name: Check the Supervisor
run: |
echo "Checking supervisor info"
test=$(docker exec hassio_cli ha supervisor info --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ];then
docker logs hassio_supervisor
if [ "$test" != "ok" ]; then
exit 1
fi
echo "Checking supervisor network info"
test=$(docker exec hassio_cli ha network info --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ];then
docker logs hassio_supervisor
if [ "$test" != "ok" ]; then
exit 1
fi
@@ -262,15 +274,19 @@ jobs:
run: |
echo "Install Core SSH Add-on"
test=$(docker exec hassio_cli ha addons install core_ssh --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ];then
docker logs hassio_supervisor
if [ "$test" != "ok" ]; then
exit 1
fi
# Make sure it actually installed
test=$(docker exec hassio_cli ha addons info core_ssh --no-progress --raw-json | jq -r '.data.version')
if [[ "$test" == "null" ]]; then
exit 1
fi
echo "Start Core SSH Add-on"
test=$(docker exec hassio_cli ha addons start core_ssh --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ];then
docker logs hassio_supervisor
if [ "$test" != "ok" ]; then
exit 1
fi
@@ -278,22 +294,81 @@ jobs:
if: needs.init.outputs.publish == 'true'
run: |
echo "Enable Content-Trust"
test=$(docker exec hassio_cli ha supervisor options --content-trust=true --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ];then
docker logs hassio_supervisor
test=$(docker exec hassio_cli ha security options --content-trust=true --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
echo "Run supervisor health check"
test=$(docker exec hassio_cli ha resolution healthcheck --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ];then
docker logs hassio_supervisor
if [ "$test" != "ok" ]; then
exit 1
fi
echo "Check supervisor unhealthy"
test=$(docker exec hassio_cli ha resolution info --no-progress --raw-json | jq -r '.data.unhealthy[]')
if [ "$test" != "" ];then
docker logs hassio_supervisor
if [ "$test" != "" ]; then
exit 1
fi
echo "Check supervisor supported"
test=$(docker exec hassio_cli ha resolution info --no-progress --raw-json | jq -r '.data.unsupported[]')
if [[ "$test" =~ source_mods ]]; then
exit 1
fi
- name: Create full backup
id: backup
run: |
test=$(docker exec hassio_cli ha backups new --no-progress --raw-json)
if [ "$(echo $test | jq -r '.result')" != "ok" ]; then
exit 1
fi
echo "::set-output name=slug::$(echo $test | jq -r '.data.slug')"
- name: Uninstall SSH add-on
run: |
test=$(docker exec hassio_cli ha addons uninstall core_ssh --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
- name: Restart supervisor
run: |
test=$(docker exec hassio_cli ha supervisor restart --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
- name: Wait for Supervisor to come up
run: |
SUPERVISOR=$(docker inspect --format='{{.NetworkSettings.IPAddress}}' hassio_supervisor)
ping="error"
while [ "$ping" != "ok" ]; do
ping=$(curl -sSL "http://$SUPERVISOR/supervisor/ping" | jq -r '.result')
sleep 5
done
- name: Restore SSH add-on from backup
run: |
test=$(docker exec hassio_cli ha backups restore ${{ steps.backup.outputs.slug }} --addons core_ssh --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
# Make sure it actually installed
test=$(docker exec hassio_cli ha addons info core_ssh --no-progress --raw-json | jq -r '.data.version')
if [[ "$test" == "null" ]]; then
exit 1
fi
- name: Restore SSL directory from backup
run: |
test=$(docker exec hassio_cli ha backups restore ${{ steps.backup.outputs.slug }} --folders ssl --no-progress --raw-json | jq -r '.result')
if [ "$test" != "ok" ]; then
exit 1
fi
- name: Get supervisor logs on failiure
if: ${{ cancelled() || failure() }}
run: docker logs hassio_supervisor

View File

@@ -10,6 +10,7 @@ on:
env:
DEFAULT_PYTHON: 3.9
PRE_COMMIT_HOME: ~/.cache/pre-commit
DEFAULT_CAS: v1.0.2
jobs:
# Separate job to pre-populate the base dependency cache
@@ -22,22 +23,19 @@ jobs:
name: Prepare Python ${{ matrix.python-version }} dependencies
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
restore-keys: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -47,7 +45,7 @@ jobs:
pip install -r requirements.txt -r requirements_tests.txt
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
@@ -66,15 +64,15 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.0.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: venv
key: |
@@ -95,7 +93,7 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Register hadolint problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/hadolint.json"
@@ -110,15 +108,15 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.0.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: venv
key: |
@@ -130,7 +128,7 @@ jobs:
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
@@ -154,15 +152,15 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.0.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: venv
key: |
@@ -186,15 +184,15 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.0.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: venv
key: |
@@ -206,7 +204,7 @@ jobs:
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
@@ -227,15 +225,15 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.0.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: venv
key: |
@@ -247,7 +245,7 @@ jobs:
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
@@ -271,15 +269,15 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.0.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: venv
key: |
@@ -303,15 +301,15 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.0.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: venv
key: |
@@ -323,7 +321,7 @@ jobs:
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
@@ -347,19 +345,19 @@ jobs:
name: Run tests Python ${{ matrix.python-version }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.0.0
id: python
with:
python-version: ${{ matrix.python-version }}
- name: Install CodeNotary
shell: bash
run: |
bash <(curl https://getvcn.codenotary.com -L)
- name: Install CAS tools
uses: home-assistant/actions/helpers/cas@master
with:
version: ${{ env.DEFAULT_CAS }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: venv
key: |
@@ -394,7 +392,7 @@ jobs:
-o console_output_style=count \
tests
- name: Upload coverage artifact
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v3.1.0
with:
name: coverage-${{ matrix.python-version }}
path: .coverage
@@ -405,15 +403,15 @@ jobs:
needs: pytest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.0.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.4
with:
path: venv
key: |
@@ -424,7 +422,7 @@ jobs:
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Download all coverage artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Combine coverage results
run: |
. venv/bin/activate
@@ -432,4 +430,4 @@ jobs:
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.5.2
uses: codecov/codecov-action@v3.1.0

View File

@@ -9,12 +9,12 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2.0.3
- uses: dessant/lock-threads@v3.0.0
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: "30"
issue-exclude-created-before: "2020-10-01T00:00:00Z"
issue-inactive-days: "30"
exclude-issue-created-before: "2020-10-01T00:00:00Z"
issue-lock-reason: ""
pr-lock-inactive-days: "1"
pr-exclude-created-before: "2020-11-01T00:00:00Z"
pr-inactive-days: "1"
exclude-pr-created-before: "2020-11-01T00:00:00Z"
pr-lock-reason: ""

View File

@@ -11,7 +11,7 @@ jobs:
name: Release Drafter
steps:
- name: Checkout the repository
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
with:
fetch-depth: 0
@@ -36,7 +36,7 @@ jobs:
echo "::set-output name=version::$datepre.$newpost"
- name: Run Release Drafter
uses: release-drafter/release-drafter@v5
uses: release-drafter/release-drafter@v5.20.0
with:
tag: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}

View File

@@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3.0.2
- name: Sentry Release
uses: getsentry/action-release@v1.1.5
uses: getsentry/action-release@v1.1.6
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}

View File

@@ -9,7 +9,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3.0.19
- uses: actions/stale@v5.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 60

View File

@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/psf/black
rev: 21.6b0
rev: 22.3.0
hooks:
- id: black
args:
- --safe
- --quiet
- --target-version
- py38
- py39
files: ^((supervisor|tests)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
@@ -23,12 +23,12 @@ repos:
- id: check-executables-have-shebangs
stages: [manual]
- id: check-json
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v2.6.2
rev: v2.32.1
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py39-plus]

11
.vscode/tasks.json vendored
View File

@@ -4,7 +4,7 @@
{
"label": "Run Supervisor",
"type": "shell",
"command": "./scripts/supervisor.sh",
"command": "supervisor_run",
"group": {
"kind": "test",
"isDefault": true
@@ -32,7 +32,7 @@
{
"label": "Update Supervisor Panel",
"type": "shell",
"command": "./scripts/update-frontend.sh",
"command": "LOKALISE_TOKEN='${input:localiseToken}' ./scripts/update-frontend.sh",
"group": {
"kind": "build",
"isDefault": true
@@ -86,5 +86,12 @@
},
"problemMatcher": []
}
],
"inputs": [
{
"id": "localiseToken",
"type": "promptString",
"description": "Paste your lokalise token to download frontend translations"
}
]
}

View File

@@ -5,18 +5,18 @@ ENV \
S6_SERVICES_GRACETIME=10000 \
SUPERVISOR_API=http://localhost
ARG BUILD_ARCH
ARG VCN_VERSION
WORKDIR /usr/src
ARG \
BUILD_ARCH \
CAS_VERSION
# Install base
WORKDIR /usr/src
RUN \
set -x \
&& apk add --no-cache \
eudev \
eudev-libs \
git \
glib \
libffi \
libpulse \
musl \
@@ -25,32 +25,15 @@ RUN \
build-base \
go \
\
&& git clone -b v${VCN_VERSION} --depth 1 \
https://github.com/codenotary/vcn \
&& cd vcn \
\
# Fix: https://github.com/codenotary/vcn/issues/131
&& go get github.com/codenotary/immudb@4cf9e2ae06ac2e6ec98a60364c3de3eab5524757 \
\
&& if [ "${BUILD_ARCH}" = "armhf" ]; then \
GOARM=6 GOARCH=arm go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then \
GOARM=7 GOARCH=arm go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "aarch64" ]; then \
GOARCH=arm64 go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "i386" ]; then \
GOARCH=386 go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "amd64" ]; then \
GOARCH=amd64 go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
else \
exit 1; \
fi \
\
&& rm -rf /root/go /root/.cache \
&& mv vcn /usr/bin/vcn \
&& git clone -b "v${CAS_VERSION}" --depth 1 \
https://github.com/codenotary/cas \
&& cd cas \
&& make cas \
&& mv cas /usr/bin/cas \
\
&& apk del .build-dependencies \
&& rm -rf /usr/src/vcn
&& rm -rf /root/go /root/.cache \
&& rm -rf /usr/src/cas
# Install requirements
COPY requirements.txt .

View File

@@ -1,24 +0,0 @@
{
"image": "homeassistant/{arch}-hassio-supervisor",
"shadow_repository": "ghcr.io/home-assistant",
"build_from": {
"aarch64": "ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.13",
"armhf": "ghcr.io/home-assistant/armhf-base-python:3.9-alpine3.13",
"armv7": "ghcr.io/home-assistant/armv7-base-python:3.9-alpine3.13",
"amd64": "ghcr.io/home-assistant/amd64-base-python:3.9-alpine3.13",
"i386": "ghcr.io/home-assistant/i386-base-python:3.9-alpine3.13"
},
"args": {
"VCN_VERSION": "0.9.4"
},
"labels": {
"io.hass.type": "supervisor",
"org.opencontainers.image.title": "Home Assistant Supervisor",
"org.opencontainers.image.description": "Container-based system for managing Home Assistant Core installation",
"org.opencontainers.image.source": "https://github.com/home-assistant/supervisor",
"org.opencontainers.image.authors": "The Home Assistant Authors",
"org.opencontainers.image.url": "https://www.home-assistant.io/",
"org.opencontainers.image.documentation": "https://www.home-assistant.io/docs/",
"org.opencontainers.image.licenses": "Apache License 2.0"
}
}

22
build.yaml Normal file
View File

@@ -0,0 +1,22 @@
image: homeassistant/{arch}-hassio-supervisor
shadow_repository: ghcr.io/home-assistant
build_from:
aarch64: ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.14
armhf: ghcr.io/home-assistant/armhf-base-python:3.9-alpine3.14
armv7: ghcr.io/home-assistant/armv7-base-python:3.9-alpine3.14
amd64: ghcr.io/home-assistant/amd64-base-python:3.9-alpine3.14
i386: ghcr.io/home-assistant/i386-base-python:3.9-alpine3.14
codenotary:
signer: notary@home-assistant.io
base_image: notary@home-assistant.io
args:
CAS_VERSION: 1.0.2
labels:
io.hass.type: supervisor
org.opencontainers.image.title: Home Assistant Supervisor
org.opencontainers.image.description: Container-based system for managing Home Assistant Core installation
org.opencontainers.image.source: https://github.com/home-assistant/supervisor
org.opencontainers.image.authors: The Home Assistant Authors
org.opencontainers.image.url: https://www.home-assistant.io/
org.opencontainers.image.documentation: https://www.home-assistant.io/docs/
org.opencontainers.image.licenses: Apache License 2.0

View File

@@ -2,31 +2,29 @@
reports=no
jobs=2
good-names=id,i,j,k,ex,Run,_,fp,T
good-names=id,i,j,k,ex,Run,_,fp,T,os
extension-pkg-whitelist=
ciso8601
# Reasons disabled:
# format - handled by black
# locally-disabled - it spams too much
# duplicate-code - unavoidable
# cyclic-import - doesn't test if both import on load
# abstract-class-little-used - prevents from setting right foundation
# abstract-class-not-used - is flaky, should not show up but does
# unused-argument - generic callbacks and setup methods create a lot of warnings
# redefined-variable-type - this is Python, we're duck typing!
# too-many-* - are not enforced for the sake of readability
# too-few-* - same as too-many-*
# abstract-method - with intro of async there are always methods missing
disable=
format,
abstract-class-little-used,
abstract-method,
cyclic-import,
duplicate-code,
locally-disabled,
no-else-return,
no-self-use,
not-context-manager,
redefined-variable-type,
too-few-public-methods,
too-many-arguments,
too-many-branches,

View File

@@ -1,20 +1,25 @@
aiohttp==3.7.4.post0
async_timeout==3.0.1
aiodns==3.0.0
aiohttp==3.8.1
async_timeout==4.0.2
atomicwrites==1.4.0
attrs==21.2.0
awesomeversion==21.6.0
brotlipy==0.7.0
attrs==21.4.0
awesomeversion==22.5.2
brotli==1.0.9
cchardet==2.1.7
ciso8601==2.1.3
colorlog==5.0.1
ciso8601==2.2.0
colorlog==6.6.0
cpe==1.2.1
cryptography==3.4.6
debugpy==1.3.0
docker==5.0.0
gitpython==3.1.18
jinja2==3.0.1
pulsectl==21.5.18
pyudev==0.22.0
ruamel.yaml==0.15.100
sentry-sdk==1.1.0
voluptuous==0.12.1
cryptography==36.0.2
debugpy==1.6.0
deepmerge==1.0.1
dirhash==0.2.1
docker==5.0.3
gitpython==3.1.27
jinja2==3.1.2
pulsectl==22.3.2
pyudev==0.23.2
ruamel.yaml==0.17.17
securetar==2022.2.0
sentry-sdk==1.5.12
voluptuous==0.13.1
dbus-next==0.2.3

View File

@@ -1,14 +1,15 @@
black==21.6b0
codecov==2.1.11
coverage==5.5
black==22.3.0
codecov==2.1.12
coverage==6.4.1
flake8-docstrings==1.6.0
flake8==3.9.2
pre-commit==2.13.0
flake8==4.0.1
pre-commit==2.19.0
pydocstyle==6.1.1
pylint==2.8.3
pylint==2.14.3
pytest-aiohttp==0.3.0
pytest-asyncio==0.12.0 # NB!: Versions over 0.12.0 breaks pytest-aiohttp (https://github.com/aio-libs/pytest-aiohttp/issues/16)
pytest-cov==2.12.1
pytest-timeout==1.4.2
pytest==6.2.4
pyupgrade==2.19.4
pytest-cov==3.0.0
pytest-timeout==2.1.0
pytest==7.1.2
pyupgrade==2.34.0
time-machine==2.7.0

0
rootfs/etc/cont-init.d/udev.sh Normal file → Executable file
View File

11
rootfs/etc/services.d/supervisor/finish Normal file → Executable file
View File

@@ -1,8 +1,11 @@
#!/usr/bin/execlineb -S1
#!/usr/bin/env bashio
# ==============================================================================
# Take down the S6 supervision tree when Supervisor fails
# ==============================================================================
if { s6-test ${1} -ne 100 }
if { s6-test ${1} -ne 256 }
redirfd -w 2 /dev/null s6-svscanctl -t /var/run/s6/services
if [[ "$1" -ne 100 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "Halt Supervisor"
/run/s6/basedir/bin/halt
fi
bashio::log.info "Supervisor restart after closing"

1
rootfs/etc/services.d/supervisor/run Normal file → Executable file
View File

@@ -3,5 +3,6 @@
# Start Supervisor service
# ==============================================================================
export LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
export MALLOC_CONF="background_thread:true,metadata_thp:auto"
exec python3 -m supervisor

11
rootfs/etc/services.d/watchdog/finish Normal file → Executable file
View File

@@ -1,8 +1,11 @@
#!/usr/bin/execlineb -S1
#!/usr/bin/env bashio
# ==============================================================================
# Take down the S6 supervision tree when Watchdog fails
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services
if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "Halt Supervisor (Wuff)"
/run/s6/basedir/bin/halt
fi
bashio::log.info "Watchdog restart after closing"

2
rootfs/etc/services.d/watchdog/run Normal file → Executable file
View File

@@ -31,4 +31,4 @@ do
done
basio::exit.nok "Watchdog detected issue with Supervisor - taking container down!"
bashio::exit.nok "Watchdog detected issue with Supervisor - taking container down!"

View File

@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE03LvYuz79GTJx4uKp3w6NrSe5JZI
iBtgzzYi0YQYtZO/r+xFpgDJEa0gLHkXtl94fpqrFiN89In83lzaszbZtA==
-----END PUBLIC KEY-----

View File

@@ -0,0 +1,8 @@
{
"currentcontext": {
"LcHost": "cas.codenotary.com",
"LcPort": "443"
},
"schemaversion": 3,
"users": null
}

View File

@@ -1,61 +0,0 @@
#!/bin/bash
function start_docker() {
local starttime
local endtime
update-alternatives --set iptables /usr/sbin/iptables-legacy || echo "Fails adjust iptables"
update-alternatives --set ip6tables /usr/sbin/iptables-legacy || echo "Fails adjust ip6tables"
echo "Starting docker."
dockerd 2> /dev/null &
DOCKER_PID=$!
echo "Waiting for docker to initialize..."
starttime="$(date +%s)"
endtime="$(date +%s)"
until docker info >/dev/null 2>&1; do
if [ $((endtime - starttime)) -le $DOCKER_TIMEOUT ]; then
sleep 1
endtime=$(date +%s)
else
echo "Timeout while waiting for docker to come up"
exit 1
fi
done
echo "Docker was initialized"
}
function stop_docker() {
local starttime
local endtime
echo "Stopping in container docker..."
if [ "$DOCKER_PID" -gt 0 ] && kill -0 "$DOCKER_PID" 2> /dev/null; then
starttime="$(date +%s)"
endtime="$(date +%s)"
# Now wait for it to die
kill "$DOCKER_PID"
while kill -0 "$DOCKER_PID" 2> /dev/null; do
if [ $((endtime - starttime)) -le $DOCKER_TIMEOUT ]; then
sleep 1
endtime=$(date +%s)
else
echo "Timeout while waiting for container docker to die"
exit 1
fi
done
else
echo "Your host might have been left with unreleased resources"
fi
}
function cleanup_lastboot() {
if [[ -f /workspaces/test_supervisor/config.json ]]; then
echo "Cleaning up last boot"
cp /workspaces/test_supervisor/config.json /tmp/config.json
jq -rM 'del(.last_boot)' /tmp/config.json > /workspaces/test_supervisor/config.json
rm /tmp/config.json
fi
}

View File

@@ -1,116 +0,0 @@
#!/bin/bash
source "${BASH_SOURCE[0]%/*}/common.sh"
set -eE
DOCKER_TIMEOUT=30
DOCKER_PID=0
function build_supervisor() {
docker pull homeassistant/amd64-builder:dev
docker run --rm \
--privileged \
-v /run/docker.sock:/run/docker.sock \
-v "$(pwd):/data" \
homeassistant/amd64-builder:dev \
--generic latest \
--target /data \
--test \
--amd64 \
--no-cache
}
function cleanup_docker() {
echo "Cleaning up stopped containers..."
docker rm $(docker ps -a -q) || true
}
function run_supervisor() {
mkdir -p /workspaces/test_supervisor
echo "Start Supervisor"
docker run --rm --privileged \
--name hassio_supervisor \
--privileged \
--security-opt seccomp=unconfined \
--security-opt apparmor:unconfined \
-v /run/docker.sock:/run/docker.sock:rw \
-v /run/dbus:/run/dbus:ro \
-v /run/udev:/run/udev:ro \
-v "/workspaces/test_supervisor":/data:rw \
-v /etc/machine-id:/etc/machine-id:ro \
-v /workspaces/supervisor:/usr/src/supervisor \
-e SUPERVISOR_SHARE="/workspaces/test_supervisor" \
-e SUPERVISOR_NAME=hassio_supervisor \
-e SUPERVISOR_DEV=1 \
-e SUPERVISOR_MACHINE="qemux86-64" \
homeassistant/amd64-hassio-supervisor:latest
}
function init_dbus() {
if pgrep dbus-daemon; then
echo "Dbus is running"
return 0
fi
echo "Startup dbus"
mkdir -p /var/lib/dbus
cp -f /etc/machine-id /var/lib/dbus/machine-id
# cleanups
mkdir -p /run/dbus
rm -f /run/dbus/pid
# run
dbus-daemon --system --print-address
}
function init_udev() {
if pgrep systemd-udevd; then
echo "udev is running"
return 0
fi
echo "Startup udev"
# cleanups
mkdir -p /run/udev
# run
/lib/systemd/systemd-udevd --daemon
sleep 3
udevadm trigger && udevadm settle
}
echo "Run Supervisor"
start_docker
trap "stop_docker" ERR
if [ "$( docker container inspect -f '{{.State.Status}}' hassio_supervisor )" == "running" ]; then
echo "Restarting Supervisor"
docker rm -f hassio_supervisor
init_dbus
init_udev
cleanup_lastboot
run_supervisor
stop_docker
else
echo "Starting Supervisor"
docker system prune -f
build_supervisor
cleanup_lastboot
cleanup_docker
init_dbus
init_udev
run_supervisor
stop_docker
fi

View File

@@ -1,4 +1,6 @@
#!/bin/bash
source "/etc/supervisor_scripts/common"
set -e
# Update frontend
@@ -9,6 +11,10 @@ cd home-assistant-polymer
nvm install
script/bootstrap
# Download translations
start_docker
./script/translations_download
# build frontend
cd hassio
./script/build_hassio
@@ -16,3 +22,9 @@ cd hassio
# Copy frontend
rm -rf ../../supervisor/api/panel/*
cp -rf build/* ../../supervisor/api/panel/
# Reset frontend git
cd ..
git reset --hard HEAD
stop_docker

View File

@@ -4,9 +4,8 @@ include_trailing_comma=True
force_grid_wrap=0
line_length=88
indent = " "
not_skip = __init__.py
force_sort_within_sections = true
sections = FUTURE,STDLIB,INBETWEENS,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
default_section = THIRDPARTY
forced_separate = tests
combine_as_imports = true

View File

@@ -33,8 +33,9 @@ setup(
packages=[
"supervisor.addons",
"supervisor.api",
"supervisor.backups",
"supervisor.dbus.network",
"supervisor.dbus.payloads",
"supervisor.dbus.network.setting",
"supervisor.dbus",
"supervisor.discovery.services",
"supervisor.discovery",
@@ -48,9 +49,9 @@ setup(
"supervisor.resolution.evaluations",
"supervisor.resolution.fixups",
"supervisor.resolution",
"supervisor.security",
"supervisor.services.modules",
"supervisor.services",
"supervisor.snapshots",
"supervisor.store",
"supervisor.utils",
"supervisor",

View File

@@ -39,6 +39,7 @@ if __name__ == "__main__":
_LOGGER.info("Initializing Supervisor setup")
coresys = loop.run_until_complete(bootstrap.initialize_coresys())
loop.set_debug(coresys.config.debug)
loop.run_until_complete(coresys.core.connect())
bootstrap.supervisor_debugger(coresys)

View File

@@ -3,7 +3,7 @@ import asyncio
from contextlib import suppress
import logging
import tarfile
from typing import Dict, List, Optional, Union
from typing import Optional, Union
from ..const import AddonBoot, AddonStartup, AddonState
from ..coresys import CoreSys, CoreSysAttributes
@@ -38,17 +38,17 @@ class AddonManager(CoreSysAttributes):
"""Initialize Docker base wrapper."""
self.coresys: CoreSys = coresys
self.data: AddonsData = AddonsData(coresys)
self.local: Dict[str, Addon] = {}
self.store: Dict[str, AddonStore] = {}
self.local: dict[str, Addon] = {}
self.store: dict[str, AddonStore] = {}
@property
def all(self) -> List[AnyAddon]:
def all(self) -> list[AnyAddon]:
"""Return a list of all add-ons."""
addons: Dict[str, AnyAddon] = {**self.store, **self.local}
addons: dict[str, AnyAddon] = {**self.store, **self.local}
return list(addons.values())
@property
def installed(self) -> List[Addon]:
def installed(self) -> list[Addon]:
"""Return a list of all installed add-ons."""
return list(self.local.values())
@@ -89,7 +89,7 @@ class AddonManager(CoreSysAttributes):
async def boot(self, stage: AddonStartup) -> None:
"""Boot add-ons with mode auto."""
tasks: List[Addon] = []
tasks: list[Addon] = []
for addon in self.installed:
if addon.boot != AddonBoot.AUTO or addon.startup != stage:
continue
@@ -123,7 +123,7 @@ class AddonManager(CoreSysAttributes):
async def shutdown(self, stage: AddonStartup) -> None:
"""Shutdown addons."""
tasks: List[Addon] = []
tasks: list[Addon] = []
for addon in self.installed:
if addon.state != AddonState.STARTED or addon.startup != stage:
continue
@@ -158,11 +158,11 @@ class AddonManager(CoreSysAttributes):
store = self.store.get(slug)
if not store:
raise AddonsError(f"Add-on {slug} not exists", _LOGGER.error)
raise AddonsError(f"Add-on {slug} does not exist", _LOGGER.error)
if not store.available:
raise AddonsNotSupportedError(
f"Add-on {slug} not supported on that platform", _LOGGER.error
f"Add-on {slug} not supported on this platform", _LOGGER.error
)
self.data.install(store)
@@ -178,7 +178,7 @@ class AddonManager(CoreSysAttributes):
await addon.install_apparmor()
try:
await addon.instance.install(store.version, store.image)
await addon.instance.install(store.version, store.image, arch=addon.arch)
except DockerError as err:
self.data.uninstall(addon)
raise AddonsError() from err
@@ -252,7 +252,7 @@ class AddonManager(CoreSysAttributes):
],
on_condition=AddonsJobError,
)
async def update(self, slug: str) -> None:
async def update(self, slug: str, backup: Optional[bool] = False) -> None:
"""Update add-on."""
if slug not in self.local:
raise AddonsError(f"Add-on {slug} is not installed", _LOGGER.error)
@@ -273,6 +273,13 @@ class AddonManager(CoreSysAttributes):
f"Add-on {slug} not supported on that platform", _LOGGER.error
)
if backup:
await self.sys_backups.do_backup_partial(
name=f"addon_{addon.slug}_{addon.version}",
homeassistant=False,
addons=[addon.slug],
)
# Update instance
last_state: AddonState = addon.state
old_image = addon.image
@@ -306,22 +313,24 @@ class AddonManager(CoreSysAttributes):
async def rebuild(self, slug: str) -> None:
"""Perform a rebuild of local build add-on."""
if slug not in self.local:
_LOGGER.error("Add-on %s is not installed", slug)
raise AddonsError()
raise AddonsError(f"Add-on {slug} is not installed", _LOGGER.error)
addon = self.local[slug]
if addon.is_detached:
_LOGGER.error("Add-on %s is not available inside store", slug)
raise AddonsError()
raise AddonsError(
f"Add-on {slug} is not available inside store", _LOGGER.error
)
store = self.store[slug]
# Check if a rebuild is possible now
if addon.version != store.version:
_LOGGER.error("Version changed, use Update instead Rebuild")
raise AddonsError()
raise AddonsError(
"Version changed, use Update instead Rebuild", _LOGGER.error
)
if not addon.need_build:
_LOGGER.error("Can't rebuild a image based add-on")
raise AddonsNotSupportedError()
raise AddonsNotSupportedError(
"Can't rebuild a image based add-on", _LOGGER.error
)
# remove docker container but not addon config
last_state: AddonState = addon.state
@@ -371,7 +380,7 @@ class AddonManager(CoreSysAttributes):
@Job(conditions=[JobCondition.FREE_SPACE, JobCondition.INTERNET_HOST])
async def repair(self) -> None:
"""Repair local add-ons."""
needs_repair: List[Addon] = []
needs_repair: list[Addon] = []
# Evaluate Add-ons to repair
for addon in self.installed:

View File

@@ -10,9 +10,11 @@ import secrets
import shutil
import tarfile
from tempfile import TemporaryDirectory
from typing import Any, Awaitable, Dict, List, Optional, Set
from typing import Any, Awaitable, Final, Optional
import aiohttp
from deepmerge import Merger
from securetar import atomic_contents_add, secure_path
import voluptuous as vol
from voluptuous.humanize import humanize_error
@@ -64,12 +66,11 @@ from ..homeassistant.const import WSEvent, WSType
from ..utils import check_port
from ..utils.apparmor import adjust_profile
from ..utils.json import read_json_file, write_json_file
from ..utils.tar import atomic_contents_add, secure_path
from .const import SnapshotAddonMode
from .const import AddonBackupMode
from .model import AddonModel, Data
from .options import AddonOptions
from .utils import remove_data
from .validate import SCHEMA_ADDON_SNAPSHOT
from .validate import SCHEMA_ADDON_BACKUP
_LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -83,10 +84,14 @@ RE_WATCHDOG = re.compile(
r":\/\/\[HOST\]:(?:\[PORT:)?(?P<t_port>\d+)\]?(?P<s_suffix>.*)$"
)
RE_OLD_AUDIO = re.compile(r"\d+,\d+")
WATCHDOG_TIMEOUT = aiohttp.ClientTimeout(total=10)
_OPTIONS_MERGER: Final = Merger(
type_strategies=[(dict, ["merge"])],
fallback_strategies=["override"],
type_conflict_strategies=["override"],
)
class Addon(AddonModel):
"""Hold data for add-on inside Supervisor."""
@@ -112,7 +117,7 @@ class Addon(AddonModel):
if self._state == new_state:
return
self._state = new_state
self.sys_homeassistant.websocket.send_command(
self.sys_homeassistant.websocket.send_message(
{
ATTR_TYPE: WSType.SUPERVISOR_EVENT,
ATTR_DATA: {
@@ -187,17 +192,19 @@ class Addon(AddonModel):
return self.version != self.latest_version
@property
def dns(self) -> List[str]:
def dns(self) -> list[str]:
"""Return list of DNS name for that add-on."""
return [f"{self.hostname}.{DNS_SUFFIX}"]
@property
def options(self) -> Dict[str, Any]:
def options(self) -> dict[str, Any]:
"""Return options with local changes."""
return {**self.data[ATTR_OPTIONS], **self.persist[ATTR_OPTIONS]}
return _OPTIONS_MERGER.merge(
deepcopy(self.data[ATTR_OPTIONS]), deepcopy(self.persist[ATTR_OPTIONS])
)
@options.setter
def options(self, value: Optional[Dict[str, Any]]) -> None:
def options(self, value: Optional[dict[str, Any]]) -> None:
"""Store user add-on options."""
self.persist[ATTR_OPTIONS] = {} if value is None else deepcopy(value)
@@ -274,12 +281,12 @@ class Addon(AddonModel):
self.persist[ATTR_PROTECTED] = value
@property
def ports(self) -> Optional[Dict[str, Optional[int]]]:
def ports(self) -> Optional[dict[str, Optional[int]]]:
"""Return ports of add-on."""
return self.persist.get(ATTR_NETWORK, super().ports)
@ports.setter
def ports(self, value: Optional[Dict[str, Optional[int]]]) -> None:
def ports(self, value: Optional[dict[str, Optional[int]]]) -> None:
"""Set custom ports of add-on."""
if value is None:
self.persist.pop(ATTR_NETWORK, None)
@@ -358,13 +365,7 @@ class Addon(AddonModel):
"""Return a pulse profile for output or None."""
if not self.with_audio:
return None
# Fallback with old audio settings
# Remove after 210
output_data = self.persist.get(ATTR_AUDIO_OUTPUT)
if output_data and RE_OLD_AUDIO.fullmatch(output_data):
return None
return output_data
return self.persist.get(ATTR_AUDIO_OUTPUT)
@audio_output.setter
def audio_output(self, value: Optional[str]):
@@ -377,12 +378,7 @@ class Addon(AddonModel):
if not self.with_audio:
return None
# Fallback with old audio settings
# Remove after 210
input_data = self.persist.get(ATTR_AUDIO_INPUT)
if input_data and RE_OLD_AUDIO.fullmatch(input_data):
return None
return input_data
return self.persist.get(ATTR_AUDIO_INPUT)
@audio_input.setter
def audio_input(self, value: Optional[str]) -> None:
@@ -425,7 +421,7 @@ class Addon(AddonModel):
return Path(self.sys_config.path_extern_tmp, f"{self.slug}_pulse")
@property
def devices(self) -> Set[Device]:
def devices(self) -> set[Device]:
"""Extract devices from add-on options."""
options_schema = self.schema
with suppress(vol.Invalid):
@@ -434,7 +430,7 @@ class Addon(AddonModel):
return options_schema.devices
@property
def pwned(self) -> Set[str]:
def pwned(self) -> set[str]:
"""Extract pwned data for add-on options."""
options_schema = self.schema
with suppress(vol.Invalid):
@@ -530,8 +526,7 @@ class Addon(AddonModel):
# Write pulse config
try:
with self.path_pulse.open("w") as config_file:
config_file.write(pulse_config)
self.path_pulse.write_text(pulse_config, encoding="utf-8")
except OSError as err:
_LOGGER.error(
"Add-on %s can't write pulse/client.config: %s", self.slug, err
@@ -579,7 +574,9 @@ class Addon(AddonModel):
return True
# merge options
options = {**self.persist[ATTR_OPTIONS], **default_options}
options = _OPTIONS_MERGER.merge(
deepcopy(default_options), deepcopy(self.persist[ATTR_OPTIONS])
)
# create voluptuous
new_schema = vol.Schema(
@@ -671,31 +668,32 @@ class Addon(AddonModel):
Return a coroutine.
"""
if not self.with_stdin:
_LOGGER.error("Add-on %s does not support writing to stdin!", self.slug)
raise AddonsNotSupportedError()
raise AddonsNotSupportedError(
f"Add-on {self.slug} does not support writing to stdin!", _LOGGER.error
)
try:
return await self.instance.write_stdin(data)
except DockerError as err:
raise AddonsError() from err
async def _snapshot_command(self, command: str) -> None:
async def _backup_command(self, command: str) -> None:
try:
command_return = await self.instance.run_inside(command)
if command_return.exit_code != 0:
_LOGGER.error(
"Pre-/Post-Snapshot command returned error code: %s",
"Pre-/Post backup command returned error code: %s",
command_return.exit_code,
)
raise AddonsError()
except DockerError as err:
_LOGGER.error(
"Failed running pre-/post-snapshot command %s: %s", command, err
"Failed running pre-/post backup command %s: %s", command, err
)
raise AddonsError() from err
async def snapshot(self, tar_file: tarfile.TarFile) -> None:
"""Snapshot state of an add-on."""
async def backup(self, tar_file: tarfile.TarFile) -> None:
"""Backup state of an add-on."""
is_running = await self.is_running()
with TemporaryDirectory(dir=self.sys_config.path_tmp) as temp:
@@ -719,79 +717,82 @@ class Addon(AddonModel):
try:
write_json_file(temp_path.joinpath("addon.json"), data)
except ConfigurationFileError as err:
_LOGGER.error("Can't save meta for %s", self.slug)
raise AddonsError() from err
raise AddonsError(
f"Can't save meta for {self.slug}", _LOGGER.error
) from err
# Store AppArmor Profile
if self.sys_host.apparmor.exists(self.slug):
profile = temp_path.joinpath("apparmor.txt")
try:
self.sys_host.apparmor.backup_profile(self.slug, profile)
await self.sys_host.apparmor.backup_profile(self.slug, profile)
except HostAppArmorError as err:
_LOGGER.error("Can't backup AppArmor profile")
raise AddonsError() from err
raise AddonsError(
"Can't backup AppArmor profile", _LOGGER.error
) from err
# write into tarfile
def _write_tarfile():
"""Write tar inside loop."""
with tar_file as snapshot:
# Snapshot system
with tar_file as backup:
# Backup metadata
backup.add(temp, arcname=".")
snapshot.add(temp, arcname=".")
# Snapshot data
# Backup data
atomic_contents_add(
snapshot,
backup,
self.path_data,
excludes=self.snapshot_exclude,
excludes=self.backup_exclude,
arcname="data",
)
if (
is_running
and self.snapshot_mode == SnapshotAddonMode.HOT
and self.snapshot_pre is not None
and self.backup_mode == AddonBackupMode.HOT
and self.backup_pre is not None
):
await self._snapshot_command(self.snapshot_pre)
elif is_running and self.snapshot_mode == SnapshotAddonMode.COLD:
_LOGGER.info("Shutdown add-on %s for cold snapshot", self.slug)
await self._backup_command(self.backup_pre)
elif is_running and self.backup_mode == AddonBackupMode.COLD:
_LOGGER.info("Shutdown add-on %s for cold backup", self.slug)
await self.instance.stop()
try:
_LOGGER.info("Building snapshot for add-on %s", self.slug)
_LOGGER.info("Building backup for add-on %s", self.slug)
await self.sys_run_in_executor(_write_tarfile)
except (tarfile.TarError, OSError) as err:
_LOGGER.error("Can't write tarfile %s: %s", tar_file, err)
raise AddonsError() from err
raise AddonsError(
f"Can't write tarfile {tar_file}: {err}", _LOGGER.error
) from err
finally:
if (
is_running
and self.snapshot_mode == SnapshotAddonMode.HOT
and self.snapshot_post is not None
and self.backup_mode == AddonBackupMode.HOT
and self.backup_post is not None
):
await self._snapshot_command(self.snapshot_post)
elif is_running and self.snapshot_mode is SnapshotAddonMode.COLD:
await self._backup_command(self.backup_post)
elif is_running and self.backup_mode is AddonBackupMode.COLD:
_LOGGER.info("Starting add-on %s again", self.slug)
await self.start()
_LOGGER.info("Finish snapshot for addon %s", self.slug)
_LOGGER.info("Finish backup for addon %s", self.slug)
async def restore(self, tar_file: tarfile.TarFile) -> None:
"""Restore state of an add-on."""
with TemporaryDirectory(dir=self.sys_config.path_tmp) as temp:
# extract snapshot
# extract backup
def _extract_tarfile():
"""Extract tar snapshot."""
with tar_file as snapshot:
snapshot.extractall(path=Path(temp), members=secure_path(snapshot))
"""Extract tar backup."""
with tar_file as backup:
backup.extractall(path=Path(temp), members=secure_path(backup))
try:
await self.sys_run_in_executor(_extract_tarfile)
except tarfile.TarError as err:
_LOGGER.error("Can't read tarfile %s: %s", tar_file, err)
raise AddonsError() from err
raise AddonsError(
f"Can't read tarfile {tar_file}: {err}", _LOGGER.error
) from err
# Read snapshot data
# Read backup data
try:
data = read_json_file(Path(temp, "addon.json"))
except ConfigurationFileError as err:
@@ -799,19 +800,19 @@ class Addon(AddonModel):
# Validate
try:
data = SCHEMA_ADDON_SNAPSHOT(data)
data = SCHEMA_ADDON_BACKUP(data)
except vol.Invalid as err:
_LOGGER.error(
"Can't validate %s, snapshot data: %s",
self.slug,
humanize_error(data, err),
)
raise AddonsError() from err
raise AddonsError(
f"Can't validate {self.slug}, backup data: {humanize_error(data, err)}",
_LOGGER.error,
) from err
# If available
if not self._available(data[ATTR_SYSTEM]):
_LOGGER.error("Add-on %s is not available for this platform", self.slug)
raise AddonsNotSupportedError()
raise AddonsNotSupportedError(
f"Add-on {self.slug} is not available for this platform",
_LOGGER.error,
)
# Restore local add-on information
_LOGGER.info("Restore config for addon %s", self.slug)
@@ -844,7 +845,11 @@ class Addon(AddonModel):
# Restore data
def _restore_data():
"""Restore data."""
shutil.copytree(Path(temp, "data"), self.path_data, symlinks=True)
temp_data = Path(temp, "data")
if temp_data.is_dir():
shutil.copytree(temp_data, self.path_data, symlinks=True)
else:
self.path_data.mkdir()
_LOGGER.info("Restoring data for addon %s", self.slug)
if self.path_data.is_dir():
@@ -852,8 +857,9 @@ class Addon(AddonModel):
try:
await self.sys_run_in_executor(_restore_data)
except shutil.Error as err:
_LOGGER.error("Can't restore origin data: %s", err)
raise AddonsError() from err
raise AddonsError(
f"Can't restore origin data: {err}", _LOGGER.error
) from err
# Restore AppArmor
profile_file = Path(temp, "apparmor.txt")
@@ -871,3 +877,10 @@ class Addon(AddonModel):
return await self.start()
_LOGGER.info("Finished restore for add-on %s", self.slug)
def check_trust(self) -> Awaitable[None]:
"""Calculate Addon docker content trust.
Return Coroutine.
"""
return self.instance.check_trust()

View File

@@ -2,7 +2,7 @@
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING, Dict
from typing import TYPE_CHECKING
from awesomeversion import AwesomeVersion
@@ -60,12 +60,12 @@ class AddonBuild(FileConfiguration, CoreSysAttributes):
return self._data[ATTR_SQUASH]
@property
def additional_args(self) -> Dict[str, str]:
def additional_args(self) -> dict[str, str]:
"""Return additional Docker build arguments."""
return self._data[ATTR_ARGS]
@property
def additional_labels(self) -> Dict[str, str]:
def additional_labels(self) -> dict[str, str]:
"""Return additional Docker labels."""
return self._data[ATTR_LABELS]

View File

@@ -2,11 +2,12 @@
from enum import Enum
class SnapshotAddonMode(str, Enum):
"""Snapshot mode of an Add-on."""
class AddonBackupMode(str, Enum):
"""Backup mode of an Add-on."""
HOT = "hot"
COLD = "cold"
ATTR_SNAPSHOT = "snapshot"
ATTR_BACKUP = "backup"
ATTR_CODENOTARY = "codenotary"

View File

@@ -1,6 +1,6 @@
"""Init file for Supervisor add-on data."""
from copy import deepcopy
from typing import Any, Dict
from typing import Any
from ..const import (
ATTR_IMAGE,
@@ -16,7 +16,7 @@ from ..utils.common import FileConfiguration
from .addon import Addon
from .validate import SCHEMA_ADDONS_FILE
Config = Dict[str, Any]
Config = dict[str, Any]
class AddonsData(FileConfiguration, CoreSysAttributes):

View File

@@ -1,11 +1,11 @@
"""Init file for Supervisor add-ons."""
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Awaitable, Dict, List, Optional
from typing import Any, Awaitable, Optional
from awesomeversion import AwesomeVersion, AwesomeVersionException
from supervisor.addons.const import SnapshotAddonMode
from supervisor.addons.const import AddonBackupMode
from ..const import (
ATTR_ADVANCED,
@@ -13,6 +13,9 @@ from ..const import (
ATTR_ARCH,
ATTR_AUDIO,
ATTR_AUTH_API,
ATTR_BACKUP_EXCLUDE,
ATTR_BACKUP_POST,
ATTR_BACKUP_PRE,
ATTR_BOOT,
ATTR_DESCRIPTON,
ATTR_DEVICES,
@@ -53,9 +56,6 @@ from ..const import (
ATTR_SCHEMA,
ATTR_SERVICES,
ATTR_SLUG,
ATTR_SNAPSHOT_EXCLUDE,
ATTR_SNAPSHOT_POST,
ATTR_SNAPSHOT_PRE,
ATTR_STAGE,
ATTR_STARTUP,
ATTR_STDIN,
@@ -79,11 +79,11 @@ from ..const import (
)
from ..coresys import CoreSys, CoreSysAttributes
from ..docker.const import Capabilities
from .const import ATTR_SNAPSHOT
from .const import ATTR_BACKUP, ATTR_CODENOTARY
from .options import AddonOptions, UiOptions
from .validate import RE_SERVICE, RE_VOLUME
Data = Dict[str, Any]
Data = dict[str, Any]
class AddonModel(CoreSysAttributes, ABC):
@@ -115,7 +115,7 @@ class AddonModel(CoreSysAttributes, ABC):
return self._available(self.data)
@property
def options(self) -> Dict[str, Any]:
def options(self) -> dict[str, Any]:
"""Return options with local changes."""
return self.data[ATTR_OPTIONS]
@@ -140,7 +140,7 @@ class AddonModel(CoreSysAttributes, ABC):
return self.slug.replace("_", "-")
@property
def dns(self) -> List[str]:
def dns(self) -> list[str]:
"""Return list of DNS name for that add-on."""
return []
@@ -184,8 +184,7 @@ class AddonModel(CoreSysAttributes, ABC):
return None
# Return data
with readme.open("r") as readme_file:
return readme_file.read()
return readme.read_text(encoding="utf-8")
@property
def repository(self) -> str:
@@ -228,7 +227,7 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_STAGE]
@property
def services_role(self) -> Dict[str, str]:
def services_role(self) -> dict[str, str]:
"""Return dict of services with rights."""
services_list = self.data.get(ATTR_SERVICES, [])
@@ -241,17 +240,17 @@ class AddonModel(CoreSysAttributes, ABC):
return services
@property
def discovery(self) -> List[str]:
def discovery(self) -> list[str]:
"""Return list of discoverable components/platforms."""
return self.data.get(ATTR_DISCOVERY, [])
@property
def ports_description(self) -> Optional[Dict[str, str]]:
def ports_description(self) -> Optional[dict[str, str]]:
"""Return descriptions of ports."""
return self.data.get(ATTR_PORTS_DESCRIPTION)
@property
def ports(self) -> Optional[Dict[str, Optional[int]]]:
def ports(self) -> Optional[dict[str, Optional[int]]]:
"""Return ports of add-on."""
return self.data.get(ATTR_PORTS)
@@ -311,17 +310,17 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_HOST_DBUS]
@property
def static_devices(self) -> List[Path]:
def static_devices(self) -> list[Path]:
"""Return static devices of add-on."""
return [Path(node) for node in self.data.get(ATTR_DEVICES, [])]
@property
def environment(self) -> Optional[Dict[str, str]]:
def environment(self) -> Optional[dict[str, str]]:
"""Return environment of add-on."""
return self.data.get(ATTR_ENVIRONMENT)
@property
def privileged(self) -> List[Capabilities]:
def privileged(self) -> list[Capabilities]:
"""Return list of privilege."""
return self.data.get(ATTR_PRIVILEGED, [])
@@ -360,24 +359,24 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_HASSIO_ROLE]
@property
def snapshot_exclude(self) -> List[str]:
"""Return Exclude list for snapshot."""
return self.data.get(ATTR_SNAPSHOT_EXCLUDE, [])
def backup_exclude(self) -> list[str]:
"""Return Exclude list for backup."""
return self.data.get(ATTR_BACKUP_EXCLUDE, [])
@property
def snapshot_pre(self) -> Optional[str]:
"""Return pre-snapshot command."""
return self.data.get(ATTR_SNAPSHOT_PRE)
def backup_pre(self) -> Optional[str]:
"""Return pre-backup command."""
return self.data.get(ATTR_BACKUP_PRE)
@property
def snapshot_post(self) -> Optional[str]:
"""Return post-snapshot command."""
return self.data.get(ATTR_SNAPSHOT_POST)
def backup_post(self) -> Optional[str]:
"""Return post-backup command."""
return self.data.get(ATTR_BACKUP_POST)
@property
def snapshot_mode(self) -> SnapshotAddonMode:
"""Return if snapshot is hot/cold."""
return self.data[ATTR_SNAPSHOT]
def backup_mode(self) -> AddonBackupMode:
"""Return if backup is hot/cold."""
return self.data[ATTR_BACKUP]
@property
def default_init(self) -> bool:
@@ -495,15 +494,23 @@ class AddonModel(CoreSysAttributes, ABC):
return self.path_documentation.exists()
@property
def supported_arch(self) -> List[str]:
def supported_arch(self) -> list[str]:
"""Return list of supported arch."""
return self.data[ATTR_ARCH]
@property
def supported_machine(self) -> List[str]:
def supported_machine(self) -> list[str]:
"""Return list of supported machine."""
return self.data.get(ATTR_MACHINE, [])
@property
def arch(self) -> str:
"""Return architecture to use for the addon's image."""
if ATTR_IMAGE in self.data:
return self.sys_arch.match(self.data[ATTR_ARCH])
return self.sys_arch.default
@property
def image(self) -> Optional[str]:
"""Generate image name from data."""
@@ -515,7 +522,7 @@ class AddonModel(CoreSysAttributes, ABC):
return ATTR_IMAGE not in self.data
@property
def map_volumes(self) -> Dict[str, str]:
def map_volumes(self) -> dict[str, str]:
"""Return a dict of {volume: policy} from add-on."""
volumes = {}
for volume in self.data[ATTR_MAP]:
@@ -566,7 +573,7 @@ class AddonModel(CoreSysAttributes, ABC):
return AddonOptions(self.coresys, raw_schema, self.name, self.slug)
@property
def schema_ui(self) -> Optional[List[Dict[any, any]]]:
def schema_ui(self) -> Optional[list[dict[any, any]]]:
"""Create a UI schema for add-on options."""
raw_schema = self.data[ATTR_SCHEMA]
@@ -579,6 +586,16 @@ class AddonModel(CoreSysAttributes, ABC):
"""Return True if the add-on accesses the system journal."""
return self.data[ATTR_JOURNALD]
@property
def signed(self) -> bool:
"""Return True if the image is signed."""
return ATTR_CODENOTARY in self.data
@property
def codenotary(self) -> Optional[str]:
"""Return Signer email address for CAS."""
return self.data.get(ATTR_CODENOTARY)
def __eq__(self, other):
"""Compaired add-on objects."""
if not isinstance(other, AddonModel):
@@ -623,9 +640,9 @@ class AddonModel(CoreSysAttributes, ABC):
"""Uninstall this add-on."""
return self.sys_addons.uninstall(self.slug)
def update(self) -> Awaitable[None]:
def update(self, backup: Optional[bool] = False) -> Awaitable[None]:
"""Update this add-on."""
return self.sys_addons.update(self.slug)
return self.sys_addons.update(self.slug, backup=backup)
def rebuild(self) -> Awaitable[None]:
"""Rebuild this add-on."""

View File

@@ -3,7 +3,7 @@ import hashlib
import logging
from pathlib import Path
import re
from typing import Any, Dict, List, Set, Union
from typing import Any, Union
import voluptuous as vol
@@ -59,13 +59,13 @@ class AddonOptions(CoreSysAttributes):
"""Validate Add-ons Options."""
def __init__(
self, coresys: CoreSys, raw_schema: Dict[str, Any], name: str, slug: str
self, coresys: CoreSys, raw_schema: dict[str, Any], name: str, slug: str
):
"""Validate schema."""
self.coresys: CoreSys = coresys
self.raw_schema: Dict[str, Any] = raw_schema
self.devices: Set[Device] = set()
self.pwned: Set[str] = set()
self.raw_schema: dict[str, Any] = raw_schema
self.devices: set[Device] = set()
self.pwned: set[str] = set()
self._name = name
self._slug = slug
@@ -167,7 +167,7 @@ class AddonOptions(CoreSysAttributes):
device = self.sys_hardware.get_by_path(Path(value))
except HardwareNotFound:
raise vol.Invalid(
f"Device '{value}' does not exists! in {self._name} ({self._slug})"
f"Device '{value}' does not exist in {self._name} ({self._slug})"
) from None
# Have filter
@@ -187,7 +187,7 @@ class AddonOptions(CoreSysAttributes):
f"Fatal error for option '{key}' with type '{typ}' in {self._name} ({self._slug})"
) from None
def _nested_validate_list(self, typ: Any, data_list: List[Any], key: str):
def _nested_validate_list(self, typ: Any, data_list: list[Any], key: str):
"""Validate nested items."""
options = []
@@ -209,7 +209,7 @@ class AddonOptions(CoreSysAttributes):
return options
def _nested_validate_dict(
self, typ: Dict[Any, Any], data_dict: Dict[Any, Any], key: str
self, typ: dict[Any, Any], data_dict: dict[Any, Any], key: str
):
"""Validate nested items."""
options = {}
@@ -241,7 +241,7 @@ class AddonOptions(CoreSysAttributes):
return options
def _check_missing_options(
self, origin: Dict[Any, Any], exists: Dict[Any, Any], root: str
self, origin: dict[Any, Any], exists: dict[Any, Any], root: str
) -> None:
"""Check if all options are exists."""
missing = set(origin) - set(exists)
@@ -267,9 +267,9 @@ class UiOptions(CoreSysAttributes):
"""Initialize UI option render."""
self.coresys = coresys
def __call__(self, raw_schema: Dict[str, Any]) -> List[Dict[str, Any]]:
def __call__(self, raw_schema: dict[str, Any]) -> list[dict[str, Any]]:
"""Generate UI schema."""
ui_schema: List[Dict[str, Any]] = []
ui_schema: list[dict[str, Any]] = []
# read options
for key, value in raw_schema.items():
@@ -287,13 +287,13 @@ class UiOptions(CoreSysAttributes):
def _single_ui_option(
self,
ui_schema: List[Dict[str, Any]],
ui_schema: list[dict[str, Any]],
value: str,
key: str,
multiple: bool = False,
) -> None:
"""Validate a single element."""
ui_node: Dict[str, Union[str, bool, float, List[str]]] = {"name": key}
ui_node: dict[str, Union[str, bool, float, list[str]]] = {"name": key}
# If multiple
if multiple:
@@ -365,8 +365,8 @@ class UiOptions(CoreSysAttributes):
def _nested_ui_list(
self,
ui_schema: List[Dict[str, Any]],
option_list: List[Any],
ui_schema: list[dict[str, Any]],
option_list: list[Any],
key: str,
) -> None:
"""UI nested list items."""
@@ -383,8 +383,8 @@ class UiOptions(CoreSysAttributes):
def _nested_ui_dict(
self,
ui_schema: List[Dict[str, Any]],
option_dict: Dict[str, Any],
ui_schema: list[dict[str, Any]],
option_dict: dict[str, Any],
key: str,
multiple: bool = False,
) -> None:
@@ -408,7 +408,7 @@ class UiOptions(CoreSysAttributes):
ui_schema.append(ui_node)
def _create_device_filter(str_filter: str) -> Dict[str, Any]:
def _create_device_filter(str_filter: str) -> dict[str, Any]:
"""Generate device Filter."""
raw_filter = dict(value.split("=") for value in str_filter.split(";"))

View File

@@ -16,10 +16,10 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
def rating_security(addon: AddonModel) -> int:
"""Return 1-6 for security rating.
"""Return 1-8 for security rating.
1 = not secure
6 = high secure
8 = high secure
"""
rating = 5
@@ -35,6 +35,10 @@ def rating_security(addon: AddonModel) -> int:
elif addon.access_auth_api:
rating += 1
# Signed
if addon.signed:
rating += 1
# Privileged options
if (
any(
@@ -70,7 +74,7 @@ def rating_security(addon: AddonModel) -> int:
if addon.access_docker_api or addon.with_full_access:
rating = 1
return max(min(6, rating), 1)
return max(min(8, rating), 1)
async def remove_data(folder: Path) -> None:

View File

@@ -2,12 +2,12 @@
import logging
import re
import secrets
from typing import Any, Dict
from typing import Any
import uuid
import voluptuous as vol
from supervisor.addons.const import SnapshotAddonMode
from supervisor.addons.const import AddonBackupMode
from ..const import (
ARCH_ALL,
@@ -21,6 +21,9 @@ from ..const import (
ATTR_AUDIO_OUTPUT,
ATTR_AUTH_API,
ATTR_AUTO_UPDATE,
ATTR_BACKUP_EXCLUDE,
ATTR_BACKUP_POST,
ATTR_BACKUP_PRE,
ATTR_BOOT,
ATTR_BUILD_FROM,
ATTR_CONFIGURATION,
@@ -70,9 +73,6 @@ from ..const import (
ATTR_SCHEMA,
ATTR_SERVICES,
ATTR_SLUG,
ATTR_SNAPSHOT_EXCLUDE,
ATTR_SNAPSHOT_POST,
ATTR_SNAPSHOT_PRE,
ATTR_SQUASH,
ATTR_STAGE,
ATTR_STARTUP,
@@ -110,7 +110,7 @@ from ..validate import (
uuid_match,
version_tag,
)
from .const import ATTR_SNAPSHOT
from .const import ATTR_BACKUP, ATTR_CODENOTARY
from .options import RE_SCHEMA_ELEMENT
_LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -148,7 +148,7 @@ RE_MACHINE = re.compile(
)
def _warn_addon_config(config: Dict[str, Any]):
def _warn_addon_config(config: dict[str, Any]):
"""Warn about miss configs."""
name = config.get(ATTR_NAME)
if not name:
@@ -165,8 +165,8 @@ def _warn_addon_config(config: Dict[str, Any]):
name,
)
if config.get(ATTR_SNAPSHOT, SnapshotAddonMode.HOT) == SnapshotAddonMode.COLD and (
config.get(ATTR_SNAPSHOT_POST) or config.get(ATTR_SNAPSHOT_PRE)
if config.get(ATTR_BACKUP, AddonBackupMode.HOT) == AddonBackupMode.COLD and (
config.get(ATTR_BACKUP_POST) or config.get(ATTR_BACKUP_PRE)
):
_LOGGER.warning(
"Add-on which only support COLD backups trying to use post/pre commands. Please report this to the maintainer of %s",
@@ -179,7 +179,7 @@ def _warn_addon_config(config: Dict[str, Any]):
def _migrate_addon_config(protocol=False):
"""Migrate addon config."""
def _migrate(config: Dict[str, Any]):
def _migrate(config: dict[str, Any]):
name = config.get(ATTR_NAME)
if not name:
raise vol.Invalid("Invalid Add-on config!")
@@ -225,6 +225,23 @@ def _migrate_addon_config(protocol=False):
)
config[ATTR_TMPFS] = True
# 2021-06 "snapshot" renamed to "backup"
for entry in (
"snapshot_exclude",
"snapshot_post",
"snapshot_pre",
"snapshot",
):
if entry in config:
new_entry = entry.replace("snapshot", "backup")
config[new_entry] = config.pop(entry)
_LOGGER.warning(
"Add-on config '%s' is deprecated, '%s' should be used instead. Please report this to the maintainer of %s",
entry,
new_entry,
name,
)
return config
return _migrate
@@ -264,7 +281,7 @@ _SCHEMA_ADDON_CONFIG = vol.Schema(
vol.Optional(ATTR_PANEL_ICON, default="mdi:puzzle"): str,
vol.Optional(ATTR_PANEL_TITLE): str,
vol.Optional(ATTR_PANEL_ADMIN, default=True): vol.Boolean(),
vol.Optional(ATTR_HOMEASSISTANT): vol.Maybe(version_tag),
vol.Optional(ATTR_HOMEASSISTANT): version_tag,
vol.Optional(ATTR_HOST_NETWORK, default=False): vol.Boolean(),
vol.Optional(ATTR_HOST_PID, default=False): vol.Boolean(),
vol.Optional(ATTR_HOST_IPC, default=False): vol.Boolean(),
@@ -294,12 +311,13 @@ _SCHEMA_ADDON_CONFIG = vol.Schema(
vol.Optional(ATTR_AUTH_API, default=False): vol.Boolean(),
vol.Optional(ATTR_SERVICES): [vol.Match(RE_SERVICE)],
vol.Optional(ATTR_DISCOVERY): [valid_discovery_service],
vol.Optional(ATTR_SNAPSHOT_EXCLUDE): [str],
vol.Optional(ATTR_SNAPSHOT_PRE): str,
vol.Optional(ATTR_SNAPSHOT_POST): str,
vol.Optional(ATTR_SNAPSHOT, default=SnapshotAddonMode.HOT): vol.Coerce(
SnapshotAddonMode
vol.Optional(ATTR_BACKUP_EXCLUDE): [str],
vol.Optional(ATTR_BACKUP_PRE): str,
vol.Optional(ATTR_BACKUP_POST): str,
vol.Optional(ATTR_BACKUP, default=AddonBackupMode.HOT): vol.Coerce(
AddonBackupMode
),
vol.Optional(ATTR_CODENOTARY): vol.Email(),
vol.Optional(ATTR_OPTIONS, default={}): dict,
vol.Optional(ATTR_SCHEMA, default={}): vol.Any(
vol.Schema(
@@ -407,7 +425,7 @@ SCHEMA_ADDONS_FILE = vol.Schema(
)
SCHEMA_ADDON_SNAPSHOT = vol.Schema(
SCHEMA_ADDON_BACKUP = vol.Schema(
{
vol.Required(ATTR_USER): SCHEMA_ADDON_USER,
vol.Required(ATTR_SYSTEM): SCHEMA_ADDON_SYSTEM,

View File

@@ -9,6 +9,7 @@ from ..coresys import CoreSys, CoreSysAttributes
from .addons import APIAddons
from .audio import APIAudio
from .auth import APIAuth
from .backups import APIBackups
from .cli import APICli
from .discovery import APIDiscovery
from .dns import APICoreDNS
@@ -16,7 +17,6 @@ from .docker import APIDocker
from .hardware import APIHardware
from .homeassistant import APIHomeAssistant
from .host import APIHost
from .info import APIInfo
from .ingress import APIIngress
from .jobs import APIJobs
from .middleware.security import SecurityMiddleware
@@ -26,16 +26,16 @@ from .observer import APIObserver
from .os import APIOS
from .proxy import APIProxy
from .resolution import APIResoulution
from .root import APIRoot
from .security import APISecurity
from .services import APIServices
from .snapshots import APISnapshots
from .store import APIStore
from .supervisor import APISupervisor
_LOGGER: logging.Logger = logging.getLogger(__name__)
MAX_CLIENT_SIZE: int = 1024 ** 2 * 16
MAX_CLIENT_SIZE: int = 1024**2 * 16
class RestAPI(CoreSysAttributes):
@@ -62,6 +62,7 @@ class RestAPI(CoreSysAttributes):
self._register_addons()
self._register_audio()
self._register_auth()
self._register_backups()
self._register_cli()
self._register_discovery()
self._register_dns()
@@ -69,7 +70,7 @@ class RestAPI(CoreSysAttributes):
self._register_hardware()
self._register_homeassistant()
self._register_host()
self._register_info()
self._register_root()
self._register_ingress()
self._register_multicast()
self._register_network()
@@ -80,7 +81,6 @@ class RestAPI(CoreSysAttributes):
self._register_proxy()
self._register_resolution()
self._register_services()
self._register_snapshots()
self._register_supervisor()
self._register_store()
self._register_security()
@@ -145,6 +145,8 @@ class RestAPI(CoreSysAttributes):
web.get("/os/info", api_os.info),
web.post("/os/update", api_os.update),
web.post("/os/config/sync", api_os.config_sync),
web.post("/os/datadisk/move", api_os.migrate_data),
web.get("/os/datadisk/list", api_os.list_data),
]
)
@@ -157,6 +159,7 @@ class RestAPI(CoreSysAttributes):
[
web.get("/security/info", api_security.info),
web.post("/security/options", api_security.options),
web.post("/security/integrity", api_security.integrity_check),
]
)
@@ -226,12 +229,21 @@ class RestAPI(CoreSysAttributes):
]
)
def _register_info(self) -> None:
"""Register info functions."""
api_info = APIInfo()
api_info.coresys = self.coresys
def _register_root(self) -> None:
"""Register root functions."""
api_root = APIRoot()
api_root.coresys = self.coresys
self.webapp.add_routes([web.get("/info", api_info.info)])
self.webapp.add_routes([web.get("/info", api_root.info)])
self.webapp.add_routes([web.post("/refresh_updates", api_root.refresh_updates)])
self.webapp.add_routes(
[web.get("/available_updates", api_root.available_updates)]
)
# Remove: 2023
self.webapp.add_routes(
[web.get("/supervisor/available_updates", api_root.available_updates)]
)
def _register_resolution(self) -> None:
"""Register info functions."""
@@ -311,17 +323,22 @@ class RestAPI(CoreSysAttributes):
web.post("/core/start", api_hass.start),
web.post("/core/check", api_hass.check),
web.post("/core/rebuild", api_hass.rebuild),
# Remove with old Supervisor fallback
]
)
# Reroute from legacy
self.webapp.add_routes(
[
web.get("/homeassistant/info", api_hass.info),
web.get("/homeassistant/logs", api_hass.logs),
web.get("/homeassistant/stats", api_hass.stats),
web.post("/homeassistant/options", api_hass.options),
web.post("/homeassistant/update", api_hass.update),
web.post("/homeassistant/restart", api_hass.restart),
web.post("/homeassistant/stop", api_hass.stop),
web.post("/homeassistant/start", api_hass.start),
web.post("/homeassistant/check", api_hass.check),
web.post("/homeassistant/update", api_hass.update),
web.post("/homeassistant/rebuild", api_hass.rebuild),
web.post("/homeassistant/check", api_hass.check),
]
)
@@ -338,7 +355,12 @@ class RestAPI(CoreSysAttributes):
web.post("/core/api/{path:.+}", api_proxy.api),
web.get("/core/api/{path:.+}", api_proxy.api),
web.get("/core/api/", api_proxy.api),
# Remove with old Supervisor fallback
]
)
# Reroute from legacy
self.webapp.add_routes(
[
web.get("/homeassistant/api/websocket", api_proxy.websocket),
web.get("/homeassistant/websocket", api_proxy.websocket),
web.get("/homeassistant/api/stream", api_proxy.stream),
@@ -356,7 +378,6 @@ class RestAPI(CoreSysAttributes):
self.webapp.add_routes(
[
web.get("/addons", api_addons.list),
web.post("/addons/reload", api_addons.reload),
web.get("/addons/{addon}/info", api_addons.info),
web.post("/addons/{addon}/uninstall", api_addons.uninstall),
web.post("/addons/{addon}/start", api_addons.start),
@@ -369,10 +390,6 @@ class RestAPI(CoreSysAttributes):
web.get("/addons/{addon}/options/config", api_addons.options_config),
web.post("/addons/{addon}/rebuild", api_addons.rebuild),
web.get("/addons/{addon}/logs", api_addons.logs),
web.get("/addons/{addon}/icon", api_addons.icon),
web.get("/addons/{addon}/logo", api_addons.logo),
web.get("/addons/{addon}/changelog", api_addons.changelog),
web.get("/addons/{addon}/documentation", api_addons.documentation),
web.post("/addons/{addon}/stdin", api_addons.stdin),
web.post("/addons/{addon}/security", api_addons.security),
web.get("/addons/{addon}/stats", api_addons.stats),
@@ -393,30 +410,26 @@ class RestAPI(CoreSysAttributes):
]
)
def _register_snapshots(self) -> None:
"""Register snapshots functions."""
api_snapshots = APISnapshots()
api_snapshots.coresys = self.coresys
def _register_backups(self) -> None:
"""Register backups functions."""
api_backups = APIBackups()
api_backups.coresys = self.coresys
self.webapp.add_routes(
[
web.get("/snapshots", api_snapshots.list),
web.post("/snapshots/reload", api_snapshots.reload),
web.post("/snapshots/new/full", api_snapshots.snapshot_full),
web.post("/snapshots/new/partial", api_snapshots.snapshot_partial),
web.post("/snapshots/new/upload", api_snapshots.upload),
web.get("/snapshots/{snapshot}/info", api_snapshots.info),
web.delete("/snapshots/{snapshot}", api_snapshots.remove),
web.get("/backups", api_backups.list),
web.post("/backups/reload", api_backups.reload),
web.post("/backups/new/full", api_backups.backup_full),
web.post("/backups/new/partial", api_backups.backup_partial),
web.post("/backups/new/upload", api_backups.upload),
web.get("/backups/{slug}/info", api_backups.info),
web.delete("/backups/{slug}", api_backups.remove),
web.post("/backups/{slug}/restore/full", api_backups.restore_full),
web.post(
"/snapshots/{snapshot}/restore/full", api_snapshots.restore_full
"/backups/{slug}/restore/partial",
api_backups.restore_partial,
),
web.post(
"/snapshots/{snapshot}/restore/partial",
api_snapshots.restore_partial,
),
web.get("/snapshots/{snapshot}/download", api_snapshots.download),
# Old, remove at end of 2020
web.post("/snapshots/{snapshot}/remove", api_snapshots.remove),
web.get("/backups/{slug}/download", api_backups.download),
]
)
@@ -498,6 +511,15 @@ class RestAPI(CoreSysAttributes):
web.get("/store/addons", api_store.addons_list),
web.get("/store/addons/{addon}", api_store.addons_addon_info),
web.get("/store/addons/{addon}/{version}", api_store.addons_addon_info),
web.get("/store/addons/{addon}/icon", api_store.addons_addon_icon),
web.get("/store/addons/{addon}/logo", api_store.addons_addon_logo),
web.get(
"/store/addons/{addon}/changelog", api_store.addons_addon_changelog
),
web.get(
"/store/addons/{addon}/documentation",
api_store.addons_addon_documentation,
),
web.post(
"/store/addons/{addon}/install", api_store.addons_addon_install
),
@@ -516,14 +538,26 @@ class RestAPI(CoreSysAttributes):
"/store/repositories/{repository}",
api_store.repositories_repository_info,
),
web.post("/store/repositories", api_store.add_repository),
web.delete(
"/store/repositories/{repository}", api_store.remove_repository
),
]
)
# Reroute from legacy
self.webapp.add_routes(
[
web.post("/addons/reload", api_store.reload),
web.post("/addons/{addon}/install", api_store.addons_addon_install),
web.post("/addons/{addon}/update", api_store.addons_addon_update),
web.get("/addons/{addon}/icon", api_store.addons_addon_icon),
web.get("/addons/{addon}/logo", api_store.addons_addon_logo),
web.get("/addons/{addon}/changelog", api_store.addons_addon_changelog),
web.get(
"/addons/{addon}/documentation",
api_store.addons_addon_documentation,
),
]
)

View File

@@ -1,7 +1,7 @@
"""Init file for Supervisor Home Assistant RESTful API."""
import asyncio
import logging
from typing import Any, Awaitable, Dict, List
from typing import Any, Awaitable
from aiohttp import web
import voluptuous as vol
@@ -58,7 +58,6 @@ from ..const import (
ATTR_LOGO,
ATTR_LONG_DESCRIPTION,
ATTR_MACHINE,
ATTR_MAINTAINER,
ATTR_MEMORY_LIMIT,
ATTR_MEMORY_PERCENT,
ATTR_MEMORY_USAGE,
@@ -73,12 +72,10 @@ from ..const import (
ATTR_PROTECTED,
ATTR_PWNED,
ATTR_RATING,
ATTR_REPOSITORIES,
ATTR_REPOSITORY,
ATTR_SCHEMA,
ATTR_SERVICES,
ATTR_SLUG,
ATTR_SOURCE,
ATTR_STAGE,
ATTR_STARTUP,
ATTR_STATE,
@@ -95,22 +92,19 @@ from ..const import (
ATTR_VIDEO,
ATTR_WATCHDOG,
ATTR_WEBUI,
CONTENT_TYPE_BINARY,
CONTENT_TYPE_PNG,
CONTENT_TYPE_TEXT,
REQUEST_FROM,
AddonBoot,
AddonState,
)
from ..coresys import CoreSysAttributes
from ..docker.stats import DockerStats
from ..exceptions import APIError, APIForbidden, PwnedError, PwnedSecret
from ..validate import docker_ports
from .const import ATTR_SIGNED, CONTENT_TYPE_BINARY
from .utils import api_process, api_process_raw, api_validate, json_loads
_LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): vol.Coerce(str)})
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): str})
# pylint: disable=no-value-for-parameter
SCHEMA_OPTIONS = vol.Schema(
@@ -118,8 +112,8 @@ SCHEMA_OPTIONS = vol.Schema(
vol.Optional(ATTR_BOOT): vol.Coerce(AddonBoot),
vol.Optional(ATTR_NETWORK): vol.Maybe(docker_ports),
vol.Optional(ATTR_AUTO_UPDATE): vol.Boolean(),
vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(vol.Coerce(str)),
vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(vol.Coerce(str)),
vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(str),
vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(str),
vol.Optional(ATTR_INGRESS_PANEL): vol.Boolean(),
vol.Optional(ATTR_WATCHDOG): vol.Boolean(),
}
@@ -132,7 +126,7 @@ SCHEMA_SECURITY = vol.Schema({vol.Optional(ATTR_PROTECTED): vol.Boolean()})
class APIAddons(CoreSysAttributes):
"""Handle RESTful API for add-on functions."""
def _extract_addon(self, request: web.Request) -> AnyAddon:
def _extract_addon(self, request: web.Request) -> Addon:
"""Return addon, throw an exception it it doesn't exist."""
addon_slug: str = request.match_info.get("addon")
@@ -146,17 +140,13 @@ class APIAddons(CoreSysAttributes):
addon = self.sys_addons.get(addon_slug)
if not addon:
raise APIError(f"Addon {addon_slug} does not exist")
return addon
def _extract_addon_installed(self, request: web.Request) -> Addon:
addon = self._extract_addon(request)
if not isinstance(addon, Addon) or not addon.is_installed:
raise APIError("Addon is not installed")
return addon
@api_process
async def list(self, request: web.Request) -> Dict[str, Any]:
async def list(self, request: web.Request) -> dict[str, Any]:
"""Return all add-ons or repositories."""
data_addons = [
{
@@ -165,11 +155,9 @@ class APIAddons(CoreSysAttributes):
ATTR_DESCRIPTON: addon.description,
ATTR_ADVANCED: addon.advanced,
ATTR_STAGE: addon.stage,
ATTR_VERSION: addon.version if addon.is_installed else None,
ATTR_VERSION: addon.version,
ATTR_VERSION_LATEST: addon.latest_version,
ATTR_UPDATE_AVAILABLE: addon.need_update
if addon.is_installed
else False,
ATTR_UPDATE_AVAILABLE: addon.need_update,
ATTR_INSTALLED: addon.is_installed,
ATTR_AVAILABLE: addon.available,
ATTR_DETACHED: addon.is_detached,
@@ -180,20 +168,10 @@ class APIAddons(CoreSysAttributes):
ATTR_ICON: addon.with_icon,
ATTR_LOGO: addon.with_logo,
}
for addon in self.sys_addons.all
for addon in self.sys_addons.installed
]
data_repositories = [
{
ATTR_SLUG: repository.slug,
ATTR_NAME: repository.name,
ATTR_SOURCE: repository.source,
ATTR_URL: repository.url,
ATTR_MAINTAINER: repository.maintainer,
}
for repository in self.sys_store.all
]
return {ATTR_ADDONS: data_addons, ATTR_REPOSITORIES: data_repositories}
return {ATTR_ADDONS: data_addons}
@api_process
async def reload(self, request: web.Request) -> None:
@@ -201,7 +179,7 @@ class APIAddons(CoreSysAttributes):
await asyncio.shield(self.sys_store.reload())
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return add-on information."""
addon: AnyAddon = self._extract_addon(request)
@@ -214,11 +192,8 @@ class APIAddons(CoreSysAttributes):
ATTR_LONG_DESCRIPTION: addon.long_description,
ATTR_ADVANCED: addon.advanced,
ATTR_STAGE: addon.stage,
ATTR_AUTO_UPDATE: None,
ATTR_REPOSITORY: addon.repository,
ATTR_VERSION: None,
ATTR_VERSION_LATEST: addon.latest_version,
ATTR_UPDATE_AVAILABLE: False,
ATTR_PROTECTED: addon.protected,
ATTR_RATING: rating_security(addon),
ATTR_BOOT: addon.boot,
@@ -228,7 +203,6 @@ class APIAddons(CoreSysAttributes):
ATTR_MACHINE: addon.supported_machine,
ATTR_HOMEASSISTANT: addon.homeassistant_version,
ATTR_URL: addon.url,
ATTR_STATE: AddonState.UNKNOWN,
ATTR_DETACHED: addon.is_detached,
ATTR_AVAILABLE: addon.available,
ATTR_BUILD: addon.need_build,
@@ -241,13 +215,11 @@ class APIAddons(CoreSysAttributes):
ATTR_PRIVILEGED: addon.privileged,
ATTR_FULL_ACCESS: addon.with_full_access,
ATTR_APPARMOR: addon.apparmor,
ATTR_DEVICES: addon.static_devices,
ATTR_ICON: addon.with_icon,
ATTR_LOGO: addon.with_logo,
ATTR_CHANGELOG: addon.with_changelog,
ATTR_DOCUMENTATION: addon.with_documentation,
ATTR_STDIN: addon.with_stdin,
ATTR_WEBUI: None,
ATTR_HASSIO_API: addon.access_hassio_api,
ATTR_HASSIO_ROLE: addon.hassio_role,
ATTR_AUTH_API: addon.access_auth_api,
@@ -261,55 +233,42 @@ class APIAddons(CoreSysAttributes):
ATTR_DOCKER_API: addon.access_docker_api,
ATTR_VIDEO: addon.with_video,
ATTR_AUDIO: addon.with_audio,
ATTR_AUDIO_INPUT: None,
ATTR_AUDIO_OUTPUT: None,
ATTR_STARTUP: addon.startup,
ATTR_SERVICES: _pretty_services(addon),
ATTR_DISCOVERY: addon.discovery,
ATTR_IP_ADDRESS: None,
ATTR_TRANSLATIONS: addon.translations,
ATTR_INGRESS: addon.with_ingress,
ATTR_INGRESS_ENTRY: None,
ATTR_INGRESS_URL: None,
ATTR_INGRESS_PORT: None,
ATTR_INGRESS_PANEL: None,
ATTR_WATCHDOG: None,
ATTR_SIGNED: addon.signed,
ATTR_STATE: addon.state,
ATTR_WEBUI: addon.webui,
ATTR_INGRESS_ENTRY: addon.ingress_entry,
ATTR_INGRESS_URL: addon.ingress_url,
ATTR_INGRESS_PORT: addon.ingress_port,
ATTR_INGRESS_PANEL: addon.ingress_panel,
ATTR_AUDIO_INPUT: addon.audio_input,
ATTR_AUDIO_OUTPUT: addon.audio_output,
ATTR_AUTO_UPDATE: addon.auto_update,
ATTR_IP_ADDRESS: str(addon.ip_address),
ATTR_VERSION: addon.version,
ATTR_UPDATE_AVAILABLE: addon.need_update,
ATTR_WATCHDOG: addon.watchdog,
ATTR_DEVICES: addon.static_devices
+ [device.path for device in addon.devices],
}
if isinstance(addon, Addon) and addon.is_installed:
data.update(
{
ATTR_STATE: addon.state,
ATTR_WEBUI: addon.webui,
ATTR_INGRESS_ENTRY: addon.ingress_entry,
ATTR_INGRESS_URL: addon.ingress_url,
ATTR_INGRESS_PORT: addon.ingress_port,
ATTR_INGRESS_PANEL: addon.ingress_panel,
ATTR_AUDIO_INPUT: addon.audio_input,
ATTR_AUDIO_OUTPUT: addon.audio_output,
ATTR_AUTO_UPDATE: addon.auto_update,
ATTR_IP_ADDRESS: str(addon.ip_address),
ATTR_VERSION: addon.version,
ATTR_UPDATE_AVAILABLE: addon.need_update,
ATTR_WATCHDOG: addon.watchdog,
ATTR_DEVICES: addon.static_devices
+ [device.path for device in addon.devices],
}
)
return data
@api_process
async def options(self, request: web.Request) -> None:
"""Store user options for add-on."""
addon = self._extract_addon_installed(request)
addon = self._extract_addon(request)
# Update secrets for validation
await self.sys_homeassistant.secrets.reload()
# Extend schema with add-on specific validation
addon_schema = SCHEMA_OPTIONS.extend(
{vol.Optional(ATTR_OPTIONS): vol.Any(None, addon.schema)}
{vol.Optional(ATTR_OPTIONS): vol.Maybe(addon.schema)}
)
# Validate/Process Body
@@ -337,7 +296,7 @@ class APIAddons(CoreSysAttributes):
@api_process
async def options_validate(self, request: web.Request) -> None:
"""Validate user options for add-on."""
addon = self._extract_addon_installed(request)
addon = self._extract_addon(request)
data = {ATTR_MESSAGE: "", ATTR_VALID: True, ATTR_PWNED: False}
options = await request.json(loads=json_loads) or addon.options
@@ -379,8 +338,10 @@ class APIAddons(CoreSysAttributes):
slug: str = request.match_info.get("addon")
if slug != "self":
raise APIForbidden("This can be only read by the Add-on itself!")
addon = self._extract_addon(request)
addon = self._extract_addon_installed(request)
# Lookup/reload secrets
await self.sys_homeassistant.secrets.reload()
try:
return addon.schema.validate(addon.options)
except vol.Invalid:
@@ -389,8 +350,8 @@ class APIAddons(CoreSysAttributes):
@api_process
async def security(self, request: web.Request) -> None:
"""Store security options for add-on."""
addon = self._extract_addon_installed(request)
body: Dict[str, Any] = await api_validate(SCHEMA_SECURITY, request)
addon = self._extract_addon(request)
body: dict[str, Any] = await api_validate(SCHEMA_SECURITY, request)
if ATTR_PROTECTED in body:
_LOGGER.warning("Changing protected flag for %s!", addon.slug)
@@ -399,9 +360,9 @@ class APIAddons(CoreSysAttributes):
addon.save_persist()
@api_process
async def stats(self, request: web.Request) -> Dict[str, Any]:
async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information."""
addon = self._extract_addon_installed(request)
addon = self._extract_addon(request)
stats: DockerStats = await addon.stats()
@@ -419,83 +380,43 @@ class APIAddons(CoreSysAttributes):
@api_process
def uninstall(self, request: web.Request) -> Awaitable[None]:
"""Uninstall add-on."""
addon = self._extract_addon_installed(request)
addon = self._extract_addon(request)
return asyncio.shield(addon.uninstall())
@api_process
def start(self, request: web.Request) -> Awaitable[None]:
"""Start add-on."""
addon = self._extract_addon_installed(request)
addon = self._extract_addon(request)
return asyncio.shield(addon.start())
@api_process
def stop(self, request: web.Request) -> Awaitable[None]:
"""Stop add-on."""
addon = self._extract_addon_installed(request)
addon = self._extract_addon(request)
return asyncio.shield(addon.stop())
@api_process
def restart(self, request: web.Request) -> Awaitable[None]:
"""Restart add-on."""
addon: Addon = self._extract_addon_installed(request)
addon: Addon = self._extract_addon(request)
return asyncio.shield(addon.restart())
@api_process
def rebuild(self, request: web.Request) -> Awaitable[None]:
"""Rebuild local build add-on."""
addon = self._extract_addon_installed(request)
addon = self._extract_addon(request)
return asyncio.shield(addon.rebuild())
@api_process_raw(CONTENT_TYPE_BINARY)
def logs(self, request: web.Request) -> Awaitable[bytes]:
"""Return logs from add-on."""
addon = self._extract_addon_installed(request)
addon = self._extract_addon(request)
return addon.logs()
@api_process_raw(CONTENT_TYPE_PNG)
async def icon(self, request: web.Request) -> bytes:
"""Return icon from add-on."""
addon = self._extract_addon(request)
if not addon.with_icon:
raise APIError(f"No icon found for add-on {addon.slug}!")
with addon.path_icon.open("rb") as png:
return png.read()
@api_process_raw(CONTENT_TYPE_PNG)
async def logo(self, request: web.Request) -> bytes:
"""Return logo from add-on."""
addon = self._extract_addon(request)
if not addon.with_logo:
raise APIError(f"No logo found for add-on {addon.slug}!")
with addon.path_logo.open("rb") as png:
return png.read()
@api_process_raw(CONTENT_TYPE_TEXT)
async def changelog(self, request: web.Request) -> str:
"""Return changelog from add-on."""
addon = self._extract_addon(request)
if not addon.with_changelog:
raise APIError(f"No changelog found for add-on {addon.slug}!")
with addon.path_changelog.open("r") as changelog:
return changelog.read()
@api_process_raw(CONTENT_TYPE_TEXT)
async def documentation(self, request: web.Request) -> str:
"""Return documentation from add-on."""
addon = self._extract_addon(request)
if not addon.with_documentation:
raise APIError(f"No documentation found for add-on {addon.slug}!")
with addon.path_documentation.open("r") as documentation:
return documentation.read()
@api_process
async def stdin(self, request: web.Request) -> None:
"""Write to stdin of add-on."""
addon = self._extract_addon_installed(request)
addon = self._extract_addon(request)
if not addon.with_stdin:
raise APIError(f"STDIN not supported the {addon.slug} add-on")
@@ -503,6 +424,6 @@ class APIAddons(CoreSysAttributes):
await asyncio.shield(addon.write_stdin(data))
def _pretty_services(addon: AnyAddon) -> List[str]:
def _pretty_services(addon: Addon) -> list[str]:
"""Return a simplified services role list."""
return [f"{name}:{access}" for name, access in addon.services_role.items()]

View File

@@ -1,7 +1,7 @@
"""Init file for Supervisor Audio RESTful API."""
import asyncio
import logging
from typing import Any, Awaitable, Dict
from typing import Any, Awaitable
from aiohttp import web
import attr
@@ -29,12 +29,12 @@ from ..const import (
ATTR_VERSION,
ATTR_VERSION_LATEST,
ATTR_VOLUME,
CONTENT_TYPE_BINARY,
)
from ..coresys import CoreSysAttributes
from ..exceptions import APIError
from ..host.sound import StreamType
from ..validate import version_tag
from .const import CONTENT_TYPE_BINARY
from .utils import api_process, api_process_raw, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -56,10 +56,10 @@ SCHEMA_MUTE = vol.Schema(
}
)
SCHEMA_DEFAULT = vol.Schema({vol.Required(ATTR_NAME): vol.Coerce(str)})
SCHEMA_DEFAULT = vol.Schema({vol.Required(ATTR_NAME): str})
SCHEMA_PROFILE = vol.Schema(
{vol.Required(ATTR_CARD): vol.Coerce(str), vol.Required(ATTR_NAME): vol.Coerce(str)}
{vol.Required(ATTR_CARD): str, vol.Required(ATTR_NAME): str}
)
@@ -67,7 +67,7 @@ class APIAudio(CoreSysAttributes):
"""Handle RESTful API for Audio functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return Audio information."""
return {
ATTR_VERSION: self.sys_plugins.audio.version,
@@ -89,7 +89,7 @@ class APIAudio(CoreSysAttributes):
}
@api_process
async def stats(self, request: web.Request) -> Dict[str, Any]:
async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information."""
stats = await self.sys_plugins.audio.stats()

View File

@@ -1,7 +1,6 @@
"""Init file for Supervisor auth/SSO RESTful API."""
import asyncio
import logging
from typing import Dict
from aiohttp import BasicAuth, web
from aiohttp.hdrs import AUTHORIZATION, CONTENT_TYPE, WWW_AUTHENTICATE
@@ -9,27 +8,22 @@ from aiohttp.web_exceptions import HTTPUnauthorized
import voluptuous as vol
from ..addons.addon import Addon
from ..const import (
ATTR_PASSWORD,
ATTR_USERNAME,
CONTENT_TYPE_JSON,
CONTENT_TYPE_URL,
REQUEST_FROM,
)
from ..const import ATTR_PASSWORD, ATTR_USERNAME, REQUEST_FROM
from ..coresys import CoreSysAttributes
from ..exceptions import APIForbidden
from .const import CONTENT_TYPE_JSON, CONTENT_TYPE_URL
from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_PASSWORD_RESET = vol.Schema(
{
vol.Required(ATTR_USERNAME): vol.Coerce(str),
vol.Required(ATTR_PASSWORD): vol.Coerce(str),
vol.Required(ATTR_USERNAME): str,
vol.Required(ATTR_PASSWORD): str,
}
)
REALM_HEADER: Dict[str, str] = {
REALM_HEADER: dict[str, str] = {
WWW_AUTHENTICATE: 'Basic realm="Home Assistant Authentication"'
}
@@ -46,7 +40,7 @@ class APIAuth(CoreSysAttributes):
return self.sys_auth.check_login(addon, auth.login, auth.password)
def _process_dict(
self, request: web.Request, addon: Addon, data: Dict[str, str]
self, request: web.Request, addon: Addon, data: dict[str, str]
) -> bool:
"""Process login with dict data.
@@ -86,7 +80,7 @@ class APIAuth(CoreSysAttributes):
@api_process
async def reset(self, request: web.Request) -> None:
"""Process reset password request."""
body: Dict[str, str] = await api_validate(SCHEMA_PASSWORD_RESET, request)
body: dict[str, str] = await api_validate(SCHEMA_PASSWORD_RESET, request)
await asyncio.shield(
self.sys_auth.change_password(body[ATTR_USERNAME], body[ATTR_PASSWORD])
)

226
supervisor/api/backups.py Normal file
View File

@@ -0,0 +1,226 @@
"""Backups RESTful API."""
import asyncio
import logging
from pathlib import Path
import re
from tempfile import TemporaryDirectory
from aiohttp import web
from aiohttp.hdrs import CONTENT_DISPOSITION
import voluptuous as vol
from ..backups.validate import ALL_FOLDERS, FOLDER_HOMEASSISTANT
from ..const import (
ATTR_ADDONS,
ATTR_BACKUPS,
ATTR_COMPRESSED,
ATTR_CONTENT,
ATTR_DATE,
ATTR_FOLDERS,
ATTR_HOMEASSISTANT,
ATTR_NAME,
ATTR_PASSWORD,
ATTR_PROTECTED,
ATTR_REPOSITORIES,
ATTR_SIZE,
ATTR_SLUG,
ATTR_TYPE,
ATTR_VERSION,
)
from ..coresys import CoreSysAttributes
from ..exceptions import APIError
from .const import CONTENT_TYPE_TAR
from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__)
RE_SLUGIFY_NAME = re.compile(r"[^A-Za-z0-9]+")
# Backwards compatible
# Remove: 2022.08
_ALL_FOLDERS = ALL_FOLDERS + [FOLDER_HOMEASSISTANT]
# pylint: disable=no-value-for-parameter
SCHEMA_RESTORE_PARTIAL = vol.Schema(
{
vol.Optional(ATTR_PASSWORD): vol.Maybe(str),
vol.Optional(ATTR_HOMEASSISTANT): vol.Boolean(),
vol.Optional(ATTR_ADDONS): vol.All([str], vol.Unique()),
vol.Optional(ATTR_FOLDERS): vol.All([vol.In(_ALL_FOLDERS)], vol.Unique()),
}
)
SCHEMA_RESTORE_FULL = vol.Schema({vol.Optional(ATTR_PASSWORD): vol.Maybe(str)})
SCHEMA_BACKUP_FULL = vol.Schema(
{
vol.Optional(ATTR_NAME): str,
vol.Optional(ATTR_PASSWORD): vol.Maybe(str),
vol.Optional(ATTR_COMPRESSED): vol.Maybe(vol.Boolean()),
}
)
SCHEMA_BACKUP_PARTIAL = SCHEMA_BACKUP_FULL.extend(
{
vol.Optional(ATTR_ADDONS): vol.All([str], vol.Unique()),
vol.Optional(ATTR_FOLDERS): vol.All([vol.In(_ALL_FOLDERS)], vol.Unique()),
vol.Optional(ATTR_HOMEASSISTANT): vol.Boolean(),
}
)
class APIBackups(CoreSysAttributes):
"""Handle RESTful API for backups functions."""
def _extract_slug(self, request):
"""Return backup, throw an exception if it doesn't exist."""
backup = self.sys_backups.get(request.match_info.get("slug"))
if not backup:
raise APIError("Backup does not exist")
return backup
@api_process
async def list(self, request):
"""Return backup list."""
data_backups = []
for backup in self.sys_backups.list_backups:
data_backups.append(
{
ATTR_SLUG: backup.slug,
ATTR_NAME: backup.name,
ATTR_DATE: backup.date,
ATTR_TYPE: backup.sys_type,
ATTR_SIZE: backup.size,
ATTR_PROTECTED: backup.protected,
ATTR_COMPRESSED: backup.compressed,
ATTR_CONTENT: {
ATTR_HOMEASSISTANT: backup.homeassistant_version is not None,
ATTR_ADDONS: backup.addon_list,
ATTR_FOLDERS: backup.folders,
},
}
)
if request.path == "/snapshots":
# Kept for backwards compability
return {"snapshots": data_backups}
return {ATTR_BACKUPS: data_backups}
@api_process
async def reload(self, request):
"""Reload backup list."""
await asyncio.shield(self.sys_backups.reload())
return True
@api_process
async def info(self, request):
"""Return backup info."""
backup = self._extract_slug(request)
data_addons = []
for addon_data in backup.addons:
data_addons.append(
{
ATTR_SLUG: addon_data[ATTR_SLUG],
ATTR_NAME: addon_data[ATTR_NAME],
ATTR_VERSION: addon_data[ATTR_VERSION],
ATTR_SIZE: addon_data[ATTR_SIZE],
}
)
return {
ATTR_SLUG: backup.slug,
ATTR_TYPE: backup.sys_type,
ATTR_NAME: backup.name,
ATTR_DATE: backup.date,
ATTR_SIZE: backup.size,
ATTR_COMPRESSED: backup.compressed,
ATTR_PROTECTED: backup.protected,
ATTR_HOMEASSISTANT: backup.homeassistant_version,
ATTR_ADDONS: data_addons,
ATTR_REPOSITORIES: backup.repositories,
ATTR_FOLDERS: backup.folders,
}
@api_process
async def backup_full(self, request):
"""Create full backup."""
body = await api_validate(SCHEMA_BACKUP_FULL, request)
backup = await asyncio.shield(self.sys_backups.do_backup_full(**body))
if backup:
return {ATTR_SLUG: backup.slug}
return False
@api_process
async def backup_partial(self, request):
"""Create a partial backup."""
body = await api_validate(SCHEMA_BACKUP_PARTIAL, request)
backup = await asyncio.shield(self.sys_backups.do_backup_partial(**body))
if backup:
return {ATTR_SLUG: backup.slug}
return False
@api_process
async def restore_full(self, request):
"""Full restore of a backup."""
backup = self._extract_slug(request)
body = await api_validate(SCHEMA_RESTORE_FULL, request)
return await asyncio.shield(self.sys_backups.do_restore_full(backup, **body))
@api_process
async def restore_partial(self, request):
"""Partial restore a backup."""
backup = self._extract_slug(request)
body = await api_validate(SCHEMA_RESTORE_PARTIAL, request)
return await asyncio.shield(self.sys_backups.do_restore_partial(backup, **body))
@api_process
async def remove(self, request):
"""Remove a backup."""
backup = self._extract_slug(request)
return self.sys_backups.remove(backup)
async def download(self, request):
"""Download a backup file."""
backup = self._extract_slug(request)
_LOGGER.info("Downloading backup %s", backup.slug)
response = web.FileResponse(backup.tarfile)
response.content_type = CONTENT_TYPE_TAR
response.headers[
CONTENT_DISPOSITION
] = f"attachment; filename={RE_SLUGIFY_NAME.sub('_', backup.name)}.tar"
return response
@api_process
async def upload(self, request):
"""Upload a backup file."""
with TemporaryDirectory(dir=str(self.sys_config.path_tmp)) as temp_dir:
tar_file = Path(temp_dir, "backup.tar")
reader = await request.multipart()
contents = await reader.next()
try:
with tar_file.open("wb") as backup:
while True:
chunk = await contents.read_chunk()
if not chunk:
break
backup.write(chunk)
except OSError as err:
_LOGGER.error("Can't write new backup file: %s", err)
return False
except asyncio.CancelledError:
return False
backup = await asyncio.shield(self.sys_backups.import_backup(tar_file))
if backup:
return {ATTR_SLUG: backup.slug}
return False

View File

@@ -1,7 +1,7 @@
"""Init file for Supervisor HA cli RESTful API."""
import asyncio
import logging
from typing import Any, Dict
from typing import Any
from aiohttp import web
import voluptuous as vol
@@ -32,7 +32,7 @@ class APICli(CoreSysAttributes):
"""Handle RESTful API for HA Cli functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return HA cli information."""
return {
ATTR_VERSION: self.sys_plugins.cli.version,
@@ -41,7 +41,7 @@ class APICli(CoreSysAttributes):
}
@api_process
async def stats(self, request: web.Request) -> Dict[str, Any]:
async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information."""
stats = await self.sys_plugins.cli.stats()

View File

@@ -1,6 +1,39 @@
"""Const for API."""
ATTR_USE_RTC = "use_rtc"
ATTR_USE_NTP = "use_ntp"
ATTR_DT_UTC = "dt_utc"
CONTENT_TYPE_BINARY = "application/octet-stream"
CONTENT_TYPE_JSON = "application/json"
CONTENT_TYPE_PNG = "image/png"
CONTENT_TYPE_TAR = "application/tar"
CONTENT_TYPE_TEXT = "text/plain"
CONTENT_TYPE_URL = "application/x-www-form-urlencoded"
COOKIE_INGRESS = "ingress_session"
HEADER_TOKEN_OLD = "X-Hassio-Key"
HEADER_TOKEN = "X-Supervisor-Token"
ATTR_APPARMOR_VERSION = "apparmor_version"
ATTR_AGENT_VERSION = "agent_version"
ATTR_AVAILABLE_UPDATES = "available_updates"
ATTR_BOOT_TIMESTAMP = "boot_timestamp"
ATTR_BROADCAST_LLMNR = "broadcast_llmnr"
ATTR_BROADCAST_MDNS = "broadcast_mdns"
ATTR_DATA_DISK = "data_disk"
ATTR_DEVICE = "device"
ATTR_DT_SYNCHRONIZED = "dt_synchronized"
ATTR_DT_UTC = "dt_utc"
ATTR_FALLBACK = "fallback"
ATTR_LLMNR = "llmnr"
ATTR_LLMNR_HOSTNAME = "llmnr_hostname"
ATTR_MDNS = "mdns"
ATTR_PANEL_PATH = "panel_path"
ATTR_SIGNED = "signed"
ATTR_STARTUP_TIME = "startup_time"
ATTR_UPDATE_TYPE = "update_type"
ATTR_USE_NTP = "use_ntp"
ATTR_BY_ID = "by_id"
ATTR_SUBSYSTEM = "subsystem"
ATTR_SYSFS = "sysfs"
ATTR_DEV_PATH = "dev_path"
ATTR_ATTRIBUTES = "attributes"
ATTR_CHILDREN = "children"

View File

@@ -1,7 +1,7 @@
"""Init file for Supervisor DNS RESTful API."""
import asyncio
import logging
from typing import Any, Awaitable, Dict
from typing import Any, Awaitable
from aiohttp import web
import voluptuous as vol
@@ -21,17 +21,22 @@ from ..const import (
ATTR_UPDATE_AVAILABLE,
ATTR_VERSION,
ATTR_VERSION_LATEST,
CONTENT_TYPE_BINARY,
)
from ..coresys import CoreSysAttributes
from ..exceptions import APIError
from ..validate import dns_server_list, version_tag
from .const import ATTR_FALLBACK, ATTR_LLMNR, ATTR_MDNS, CONTENT_TYPE_BINARY
from .utils import api_process, api_process_raw, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__)
# pylint: disable=no-value-for-parameter
SCHEMA_OPTIONS = vol.Schema({vol.Optional(ATTR_SERVERS): dns_server_list})
SCHEMA_OPTIONS = vol.Schema(
{
vol.Optional(ATTR_SERVERS): dns_server_list,
vol.Optional(ATTR_FALLBACK): vol.Boolean(),
}
)
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): version_tag})
@@ -40,7 +45,7 @@ class APICoreDNS(CoreSysAttributes):
"""Handle RESTful API for DNS functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return DNS information."""
return {
ATTR_VERSION: self.sys_plugins.dns.version,
@@ -49,21 +54,32 @@ class APICoreDNS(CoreSysAttributes):
ATTR_HOST: str(self.sys_docker.network.dns),
ATTR_SERVERS: self.sys_plugins.dns.servers,
ATTR_LOCALS: self.sys_plugins.dns.locals,
ATTR_MDNS: self.sys_plugins.dns.mdns,
ATTR_LLMNR: self.sys_plugins.dns.llmnr,
ATTR_FALLBACK: self.sys_plugins.dns.fallback,
}
@api_process
async def options(self, request: web.Request) -> None:
"""Set DNS options."""
body = await api_validate(SCHEMA_OPTIONS, request)
restart_required = False
if ATTR_SERVERS in body:
self.sys_plugins.dns.servers = body[ATTR_SERVERS]
restart_required = True
if ATTR_FALLBACK in body:
self.sys_plugins.dns.fallback = body[ATTR_FALLBACK]
restart_required = True
if restart_required:
self.sys_create_task(self.sys_plugins.dns.restart())
self.sys_plugins.dns.save_data()
@api_process
async def stats(self, request: web.Request) -> Dict[str, Any]:
async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information."""
stats = await self.sys_plugins.dns.stats()

View File

@@ -1,6 +1,6 @@
"""Init file for Supervisor Home Assistant RESTful API."""
import logging
from typing import Any, Dict
from typing import Any
from aiohttp import web
import voluptuous as vol
@@ -21,7 +21,7 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_DOCKER_REGISTRY = vol.Schema(
{
vol.Coerce(str): {
str: {
vol.Required(ATTR_USERNAME): str,
vol.Required(ATTR_PASSWORD): str,
}
@@ -33,7 +33,7 @@ class APIDocker(CoreSysAttributes):
"""Handle RESTful API for Docker configuration."""
@api_process
async def registries(self, request) -> Dict[str, Any]:
async def registries(self, request) -> dict[str, Any]:
"""Return the list of registries."""
data_registries = {}
for hostname, registry in self.sys_docker.config.registries.items():

View File

@@ -1,25 +1,26 @@
"""Init file for Supervisor hardware RESTful API."""
import logging
from typing import Any, Dict
from typing import Any
from aiohttp import web
from ..const import ATTR_AUDIO, ATTR_DEVICES, ATTR_INPUT, ATTR_NAME, ATTR_OUTPUT
from ..coresys import CoreSysAttributes
from ..hardware.const import (
from ..hardware.data import Device
from .const import (
ATTR_ATTRIBUTES,
ATTR_BY_ID,
ATTR_CHILDREN,
ATTR_DEV_PATH,
ATTR_SUBSYSTEM,
ATTR_SYSFS,
)
from ..hardware.data import Device
from .utils import api_process
_LOGGER: logging.Logger = logging.getLogger(__name__)
def device_struct(device: Device) -> Dict[str, Any]:
def device_struct(device: Device) -> dict[str, Any]:
"""Return a dict with information of a interface to be used in th API."""
return {
ATTR_NAME: device.name,
@@ -28,6 +29,7 @@ def device_struct(device: Device) -> Dict[str, Any]:
ATTR_SUBSYSTEM: device.subsystem,
ATTR_BY_ID: device.by_id,
ATTR_ATTRIBUTES: device.attributes,
ATTR_CHILDREN: device.children,
}
@@ -35,7 +37,7 @@ class APIHardware(CoreSysAttributes):
"""Handle RESTful API for hardware functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Show hardware info."""
return {
ATTR_DEVICES: [
@@ -44,7 +46,7 @@ class APIHardware(CoreSysAttributes):
}
@api_process
async def audio(self, request: web.Request) -> Dict[str, Any]:
async def audio(self, request: web.Request) -> dict[str, Any]:
"""Show pulse audio profiles."""
return {
ATTR_AUDIO: {

View File

@@ -1,7 +1,7 @@
"""Init file for Supervisor Home Assistant RESTful API."""
import asyncio
import logging
from typing import Any, Awaitable, Dict
from typing import Any, Awaitable
from aiohttp import web
import voluptuous as vol
@@ -10,6 +10,7 @@ from ..const import (
ATTR_ARCH,
ATTR_AUDIO_INPUT,
ATTR_AUDIO_OUTPUT,
ATTR_BACKUP,
ATTR_BLK_READ,
ATTR_BLK_WRITE,
ATTR_BOOT,
@@ -28,13 +29,12 @@ from ..const import (
ATTR_UPDATE_AVAILABLE,
ATTR_VERSION,
ATTR_VERSION_LATEST,
ATTR_WAIT_BOOT,
ATTR_WATCHDOG,
CONTENT_TYPE_BINARY,
)
from ..coresys import CoreSysAttributes
from ..exceptions import APIError
from ..validate import docker_image, network_port, version_tag
from .const import CONTENT_TYPE_BINARY
from .utils import api_process, api_process_raw, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -43,25 +43,29 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_OPTIONS = vol.Schema(
{
vol.Optional(ATTR_BOOT): vol.Boolean(),
vol.Optional(ATTR_IMAGE): docker_image,
vol.Optional(ATTR_IMAGE): vol.Maybe(docker_image),
vol.Optional(ATTR_PORT): network_port,
vol.Optional(ATTR_SSL): vol.Boolean(),
vol.Optional(ATTR_WATCHDOG): vol.Boolean(),
vol.Optional(ATTR_WAIT_BOOT): vol.All(vol.Coerce(int), vol.Range(min=60)),
vol.Optional(ATTR_REFRESH_TOKEN): vol.Maybe(vol.Coerce(str)),
vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(vol.Coerce(str)),
vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(vol.Coerce(str)),
vol.Optional(ATTR_REFRESH_TOKEN): vol.Maybe(str),
vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(str),
vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(str),
}
)
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): version_tag})
SCHEMA_UPDATE = vol.Schema(
{
vol.Optional(ATTR_VERSION): version_tag,
vol.Optional(ATTR_BACKUP): bool,
}
)
class APIHomeAssistant(CoreSysAttributes):
"""Handle RESTful API for Home Assistant functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return host information."""
return {
ATTR_VERSION: self.sys_homeassistant.version,
@@ -75,11 +79,8 @@ class APIHomeAssistant(CoreSysAttributes):
ATTR_PORT: self.sys_homeassistant.api_port,
ATTR_SSL: self.sys_homeassistant.api_ssl,
ATTR_WATCHDOG: self.sys_homeassistant.watchdog,
ATTR_WAIT_BOOT: self.sys_homeassistant.wait_boot,
ATTR_AUDIO_INPUT: self.sys_homeassistant.audio_input,
ATTR_AUDIO_OUTPUT: self.sys_homeassistant.audio_output,
# Remove end of Q3 2020
"last_version": self.sys_homeassistant.latest_version,
}
@api_process
@@ -102,9 +103,6 @@ class APIHomeAssistant(CoreSysAttributes):
if ATTR_WATCHDOG in body:
self.sys_homeassistant.watchdog = body[ATTR_WATCHDOG]
if ATTR_WAIT_BOOT in body:
self.sys_homeassistant.wait_boot = body[ATTR_WAIT_BOOT]
if ATTR_REFRESH_TOKEN in body:
self.sys_homeassistant.refresh_token = body[ATTR_REFRESH_TOKEN]
@@ -117,7 +115,7 @@ class APIHomeAssistant(CoreSysAttributes):
self.sys_homeassistant.save_data()
@api_process
async def stats(self, request: web.Request) -> Dict[Any, str]:
async def stats(self, request: web.Request) -> dict[Any, str]:
"""Return resource information."""
stats = await self.sys_homeassistant.core.stats()
if not stats:
@@ -137,10 +135,14 @@ class APIHomeAssistant(CoreSysAttributes):
@api_process
async def update(self, request: web.Request) -> None:
"""Update Home Assistant."""
body = await api_validate(SCHEMA_VERSION, request)
version = body.get(ATTR_VERSION, self.sys_homeassistant.latest_version)
body = await api_validate(SCHEMA_UPDATE, request)
await asyncio.shield(self.sys_homeassistant.core.update(version))
await asyncio.shield(
self.sys_homeassistant.core.update(
version=body.get(ATTR_VERSION, self.sys_homeassistant.latest_version),
backup=body.get(ATTR_BACKUP),
)
)
@api_process
def stop(self, request: web.Request) -> Awaitable[None]:

View File

@@ -22,15 +22,26 @@ from ..const import (
ATTR_SERVICES,
ATTR_STATE,
ATTR_TIMEZONE,
CONTENT_TYPE_BINARY,
)
from ..coresys import CoreSysAttributes
from .const import ATTR_DT_SYNCHRONIZED, ATTR_DT_UTC, ATTR_USE_NTP, ATTR_USE_RTC
from .const import (
ATTR_AGENT_VERSION,
ATTR_APPARMOR_VERSION,
ATTR_BOOT_TIMESTAMP,
ATTR_BROADCAST_LLMNR,
ATTR_BROADCAST_MDNS,
ATTR_DT_SYNCHRONIZED,
ATTR_DT_UTC,
ATTR_LLMNR_HOSTNAME,
ATTR_STARTUP_TIME,
ATTR_USE_NTP,
CONTENT_TYPE_BINARY,
)
from .utils import api_process, api_process_raw, api_validate
SERVICE = "service"
SCHEMA_OPTIONS = vol.Schema({vol.Optional(ATTR_HOSTNAME): vol.Coerce(str)})
SCHEMA_OPTIONS = vol.Schema({vol.Optional(ATTR_HOSTNAME): str})
class APIHost(CoreSysAttributes):
@@ -40,6 +51,8 @@ class APIHost(CoreSysAttributes):
async def info(self, request):
"""Return host information."""
return {
ATTR_AGENT_VERSION: self.sys_dbus.agent.version,
ATTR_APPARMOR_VERSION: self.sys_host.apparmor.version,
ATTR_CHASSIS: self.sys_host.info.chassis,
ATTR_CPE: self.sys_host.info.cpe,
ATTR_DEPLOYMENT: self.sys_host.info.deployment,
@@ -49,13 +62,17 @@ class APIHost(CoreSysAttributes):
ATTR_DISK_LIFE_TIME: self.sys_host.info.disk_life_time,
ATTR_FEATURES: self.sys_host.features,
ATTR_HOSTNAME: self.sys_host.info.hostname,
ATTR_LLMNR_HOSTNAME: self.sys_host.info.llmnr_hostname,
ATTR_KERNEL: self.sys_host.info.kernel,
ATTR_OPERATING_SYSTEM: self.sys_host.info.operating_system,
ATTR_TIMEZONE: self.sys_host.info.timezone,
ATTR_DT_UTC: self.sys_host.info.dt_utc,
ATTR_DT_SYNCHRONIZED: self.sys_host.info.dt_synchronized,
ATTR_USE_NTP: self.sys_host.info.use_ntp,
ATTR_USE_RTC: self.sys_host.info.use_rtc,
ATTR_STARTUP_TIME: self.sys_host.info.startup_time,
ATTR_BOOT_TIMESTAMP: self.sys_host.info.boot_timestamp,
ATTR_BROADCAST_LLMNR: self.sys_host.info.broadcast_llmnr,
ATTR_BROADCAST_MDNS: self.sys_host.info.broadcast_mdns,
}
@api_process
@@ -82,11 +99,7 @@ class APIHost(CoreSysAttributes):
@api_process
def reload(self, request):
"""Reload host data."""
return asyncio.shield(
asyncio.wait(
[self.sys_host.reload(), self.sys_resolution.evaluate.evaluate_system()]
)
)
return asyncio.shield(self.sys_host.reload())
@api_process
async def services(self, request):

View File

@@ -1,52 +0,0 @@
"""Init file for Supervisor info RESTful API."""
import logging
from typing import Any, Dict
from aiohttp import web
from ..const import (
ATTR_ARCH,
ATTR_CHANNEL,
ATTR_DOCKER,
ATTR_FEATURES,
ATTR_HASSOS,
ATTR_HOMEASSISTANT,
ATTR_HOSTNAME,
ATTR_LOGGING,
ATTR_MACHINE,
ATTR_OPERATING_SYSTEM,
ATTR_STATE,
ATTR_SUPERVISOR,
ATTR_SUPPORTED,
ATTR_SUPPORTED_ARCH,
ATTR_TIMEZONE,
)
from ..coresys import CoreSysAttributes
from .utils import api_process
_LOGGER: logging.Logger = logging.getLogger(__name__)
class APIInfo(CoreSysAttributes):
"""Handle RESTful API for info functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
"""Show system info."""
return {
ATTR_SUPERVISOR: self.sys_supervisor.version,
ATTR_HOMEASSISTANT: self.sys_homeassistant.version,
ATTR_HASSOS: self.sys_hassos.version,
ATTR_DOCKER: self.sys_docker.info.version,
ATTR_HOSTNAME: self.sys_host.info.hostname,
ATTR_OPERATING_SYSTEM: self.sys_host.info.operating_system,
ATTR_FEATURES: self.sys_host.features,
ATTR_MACHINE: self.sys_machine,
ATTR_ARCH: self.sys_arch.default,
ATTR_STATE: self.sys_core.state,
ATTR_SUPPORTED_ARCH: self.sys_arch.supported,
ATTR_SUPPORTED: self.sys_core.supported,
ATTR_CHANNEL: self.sys_updater.channel,
ATTR_LOGGING: self.sys_config.logging,
ATTR_TIMEZONE: self.sys_timezone,
}

View File

@@ -2,7 +2,7 @@
import asyncio
from ipaddress import ip_address
import logging
from typing import Any, Dict, Union
from typing import Any, Union
import aiohttp
from aiohttp import ClientTimeout, hdrs, web
@@ -22,11 +22,9 @@ from ..const import (
ATTR_PANELS,
ATTR_SESSION,
ATTR_TITLE,
COOKIE_INGRESS,
HEADER_TOKEN,
HEADER_TOKEN_OLD,
)
from ..coresys import CoreSysAttributes
from .const import COOKIE_INGRESS, HEADER_TOKEN, HEADER_TOKEN_OLD
from .utils import api_process, api_validate, require_home_assistant
_LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -54,7 +52,7 @@ class APIIngress(CoreSysAttributes):
return f"http://{addon.ip_address}:{addon.ingress_port}/{path}"
@api_process
async def panels(self, request: web.Request) -> Dict[str, Any]:
async def panels(self, request: web.Request) -> dict[str, Any]:
"""Create a list of panel data."""
addons = {}
for addon in self.sys_ingress.addons:
@@ -69,14 +67,14 @@ class APIIngress(CoreSysAttributes):
@api_process
@require_home_assistant
async def create_session(self, request: web.Request) -> Dict[str, Any]:
async def create_session(self, request: web.Request) -> dict[str, Any]:
"""Create a new session."""
session = self.sys_ingress.create_session()
return {ATTR_SESSION: session}
@api_process
@require_home_assistant
async def validate_session(self, request: web.Request) -> Dict[str, Any]:
async def validate_session(self, request: web.Request) -> dict[str, Any]:
"""Validate session and extending how long it's valid for."""
data = await api_validate(VALIDATE_SESSION_DATA, request)
@@ -220,7 +218,7 @@ class APIIngress(CoreSysAttributes):
def _init_header(
request: web.Request, addon: str
) -> Union[CIMultiDict, Dict[str, str]]:
) -> Union[CIMultiDict, dict[str, str]]:
"""Create initial header."""
headers = {}
@@ -248,7 +246,7 @@ def _init_header(
return headers
def _response_header(response: aiohttp.ClientResponse) -> Dict[str, str]:
def _response_header(response: aiohttp.ClientResponse) -> dict[str, str]:
"""Create response header."""
headers = {}

View File

@@ -1,6 +1,6 @@
"""Init file for Supervisor Jobs RESTful API."""
import logging
from typing import Any, Dict
from typing import Any
from aiohttp import web
import voluptuous as vol
@@ -20,7 +20,7 @@ class APIJobs(CoreSysAttributes):
"""Handle RESTful API for OS functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return JobManager information."""
return {
ATTR_IGNORE_CONDITIONS: self.sys_jobs.ignore_conditions,

View File

@@ -76,7 +76,7 @@ ADDONS_ROLE_ACCESS = {
ROLE_BACKUP: re.compile(
r"^(?:"
r"|/.+/info"
r"|/snapshots.*"
r"|/backups.*"
r")$"
),
ROLE_MANAGER: re.compile(
@@ -99,6 +99,7 @@ ADDONS_ROLE_ACCESS = {
r"|/observer/.+"
r"|/os/.+"
r"|/resolution/.+"
r"|/backups.*"
r"|/snapshots.*"
r"|/store.*"
r"|/supervisor/.+"
@@ -171,7 +172,7 @@ class SecurityMiddleware(CoreSysAttributes):
# Observer
if supervisor_token == self.sys_plugins.observer.supervisor_token:
if not OBSERVER_CHECK.match(request.url):
if not OBSERVER_CHECK.match(request.path):
_LOGGER.warning("%s invalid Observer access", request.path)
raise HTTPForbidden()
_LOGGER.debug("%s access from Observer", request.path)

View File

@@ -1,7 +1,7 @@
"""Init file for Supervisor Multicast RESTful API."""
import asyncio
import logging
from typing import Any, Awaitable, Dict
from typing import Any, Awaitable
from aiohttp import web
import voluptuous as vol
@@ -18,11 +18,11 @@ from ..const import (
ATTR_UPDATE_AVAILABLE,
ATTR_VERSION,
ATTR_VERSION_LATEST,
CONTENT_TYPE_BINARY,
)
from ..coresys import CoreSysAttributes
from ..exceptions import APIError
from ..validate import version_tag
from .const import CONTENT_TYPE_BINARY
from .utils import api_process, api_process_raw, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -34,7 +34,7 @@ class APIMulticast(CoreSysAttributes):
"""Handle RESTful API for Multicast functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return Multicast information."""
return {
ATTR_VERSION: self.sys_plugins.multicast.version,
@@ -43,7 +43,7 @@ class APIMulticast(CoreSysAttributes):
}
@api_process
async def stats(self, request: web.Request) -> Dict[str, Any]:
async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information."""
stats = await self.sys_plugins.multicast.stats()

View File

@@ -1,7 +1,7 @@
"""REST API for network."""
import asyncio
from ipaddress import ip_address, ip_interface
from typing import Any, Awaitable, Dict
from typing import Any, Awaitable
from aiohttp import web
import attr
@@ -82,7 +82,7 @@ SCHEMA_UPDATE = vol.Schema(
)
def ipconfig_struct(config: IpConfig) -> Dict[str, Any]:
def ipconfig_struct(config: IpConfig) -> dict[str, Any]:
"""Return a dict with information about ip configuration."""
return {
ATTR_METHOD: config.method,
@@ -92,7 +92,7 @@ def ipconfig_struct(config: IpConfig) -> Dict[str, Any]:
}
def wifi_struct(config: WifiConfig) -> Dict[str, Any]:
def wifi_struct(config: WifiConfig) -> dict[str, Any]:
"""Return a dict with information about wifi configuration."""
return {
ATTR_MODE: config.mode,
@@ -102,7 +102,7 @@ def wifi_struct(config: WifiConfig) -> Dict[str, Any]:
}
def vlan_struct(config: VlanConfig) -> Dict[str, Any]:
def vlan_struct(config: VlanConfig) -> dict[str, Any]:
"""Return a dict with information about VLAN configuration."""
return {
ATTR_ID: config.id,
@@ -110,7 +110,7 @@ def vlan_struct(config: VlanConfig) -> Dict[str, Any]:
}
def interface_struct(interface: Interface) -> Dict[str, Any]:
def interface_struct(interface: Interface) -> dict[str, Any]:
"""Return a dict with information of a interface to be used in th API."""
return {
ATTR_INTERFACE: interface.name,
@@ -125,7 +125,7 @@ def interface_struct(interface: Interface) -> Dict[str, Any]:
}
def accesspoint_struct(accesspoint: AccessPoint) -> Dict[str, Any]:
def accesspoint_struct(accesspoint: AccessPoint) -> dict[str, Any]:
"""Return a dict for AccessPoint."""
return {
ATTR_MODE: accesspoint.mode,
@@ -141,9 +141,7 @@ class APINetwork(CoreSysAttributes):
def _get_interface(self, name: str) -> Interface:
"""Get Interface by name or default."""
name = name.lower()
if name == "default":
if name.lower() == "default":
for interface in self.sys_host.network.interfaces:
if not interface.primary:
continue
@@ -158,7 +156,7 @@ class APINetwork(CoreSysAttributes):
raise APIError(f"Interface {name} does not exist") from None
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return network information."""
return {
ATTR_INTERFACES: [
@@ -176,7 +174,7 @@ class APINetwork(CoreSysAttributes):
}
@api_process
async def interface_info(self, request: web.Request) -> Dict[str, Any]:
async def interface_info(self, request: web.Request) -> dict[str, Any]:
"""Return network information for a interface."""
interface = self._get_interface(request.match_info.get(ATTR_INTERFACE))
@@ -223,7 +221,7 @@ class APINetwork(CoreSysAttributes):
return asyncio.shield(self.sys_host.network.update())
@api_process
async def scan_accesspoints(self, request: web.Request) -> Dict[str, Any]:
async def scan_accesspoints(self, request: web.Request) -> dict[str, Any]:
"""Scan and return a list of available networks."""
interface = self._get_interface(request.match_info.get(ATTR_INTERFACE))

View File

@@ -1,7 +1,7 @@
"""Init file for Supervisor Observer RESTful API."""
import asyncio
import logging
from typing import Any, Dict
from typing import Any
from aiohttp import web
import voluptuous as vol
@@ -33,7 +33,7 @@ class APIObserver(CoreSysAttributes):
"""Handle RESTful API for Observer functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return HA Observer information."""
return {
ATTR_HOST: str(self.sys_docker.network.observer),
@@ -43,7 +43,7 @@ class APIObserver(CoreSysAttributes):
}
@api_process
async def stats(self, request: web.Request) -> Dict[str, Any]:
async def stats(self, request: web.Request) -> dict[str, Any]:
"""Return resource information."""
stats = await self.sys_plugins.observer.stats()

View File

@@ -1,7 +1,8 @@
"""Init file for Supervisor HassOS RESTful API."""
import asyncio
import logging
from typing import Any, Awaitable, Dict
from pathlib import Path
from typing import Any, Awaitable
from aiohttp import web
import voluptuous as vol
@@ -9,42 +10,60 @@ import voluptuous as vol
from ..const import (
ATTR_BOARD,
ATTR_BOOT,
ATTR_DEVICES,
ATTR_UPDATE_AVAILABLE,
ATTR_VERSION,
ATTR_VERSION_LATEST,
)
from ..coresys import CoreSysAttributes
from ..validate import version_tag
from .const import ATTR_DATA_DISK, ATTR_DEVICE
from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): version_tag})
SCHEMA_DISK = vol.Schema({vol.Required(ATTR_DEVICE): vol.All(str, vol.Coerce(Path))})
class APIOS(CoreSysAttributes):
"""Handle RESTful API for OS functions."""
@api_process
async def info(self, request: web.Request) -> Dict[str, Any]:
async def info(self, request: web.Request) -> dict[str, Any]:
"""Return OS information."""
return {
ATTR_VERSION: self.sys_hassos.version,
ATTR_VERSION_LATEST: self.sys_hassos.latest_version,
ATTR_UPDATE_AVAILABLE: self.sys_hassos.need_update,
ATTR_BOARD: self.sys_hassos.board,
ATTR_VERSION: self.sys_os.version,
ATTR_VERSION_LATEST: self.sys_os.latest_version,
ATTR_UPDATE_AVAILABLE: self.sys_os.need_update,
ATTR_BOARD: self.sys_os.board,
ATTR_BOOT: self.sys_dbus.rauc.boot_slot,
ATTR_DATA_DISK: self.sys_os.datadisk.disk_used,
}
@api_process
async def update(self, request: web.Request) -> None:
"""Update OS."""
body = await api_validate(SCHEMA_VERSION, request)
version = body.get(ATTR_VERSION, self.sys_hassos.latest_version)
version = body.get(ATTR_VERSION, self.sys_os.latest_version)
await asyncio.shield(self.sys_hassos.update(version))
await asyncio.shield(self.sys_os.update(version))
@api_process
def config_sync(self, request: web.Request) -> Awaitable[None]:
"""Trigger config reload on OS."""
return asyncio.shield(self.sys_hassos.config_sync())
return asyncio.shield(self.sys_os.config_sync())
@api_process
async def migrate_data(self, request: web.Request) -> None:
"""Trigger data disk migration on Host."""
body = await api_validate(SCHEMA_DISK, request)
await asyncio.shield(self.sys_os.datadisk.migrate_disk(body[ATTR_DEVICE]))
@api_process
async def list_data(self, request: web.Request) -> dict[str, Any]:
"""Return possible data targets."""
return {
ATTR_DEVICES: self.sys_os.datadisk.available_disks,
}

View File

@@ -1,9 +1,16 @@
try {
new Function("import('/api/hassio/app/frontend_latest/entrypoint.0d3c68f7.js')")();
} catch (err) {
function loadES5() {
var el = document.createElement('script');
el.src = '/api/hassio/app/frontend_es5/entrypoint.9e377d5a.js';
el.src = '/api/hassio/app/frontend_es5/entrypoint.f8f83860.js';
document.body.appendChild(el);
}
if (/.*Version\/(?:11|12)(?:\.\d+)*.*Safari\//.test(navigator.userAgent)) {
loadES5();
} else {
try {
new Function("import('/api/hassio/app/frontend_latest/entrypoint.b6cf778b.js')")();
} catch (err) {
loadES5();
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -0,0 +1 @@
!function(){"use strict";var t,n,e={14971:function(t,n,e){var r,i,o=e(93217),u=e(69330),a=(e(58556),e(62173)),c=function(t,n,e){if("input"===t){if("type"===n&&"checkbox"===e||"checked"===n||"disabled"===n)return;return""}},f={renderMarkdown:function(t,n){var e,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r||(r=Object.assign({},(0,a.getDefaultWhiteList)(),{input:["type","disabled","checked"],"ha-icon":["icon"],"ha-svg-icon":["path"],"ha-alert":["alert-type","title"]})),o.allowSvg?(i||(i=Object.assign({},r,{svg:["xmlns","height","width"],path:["transform","stroke","d"],img:["src"]})),e=i):e=r,(0,a.filterXSS)((0,u.TU)(t,n),{whiteList:e,onTagAttr:c})}};(0,o.Jj)(f)}},r={};function i(t){var n=r[t];if(void 0!==n)return n.exports;var o=r[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.m=e,i.x=function(){var t=i.O(void 0,[191,752],(function(){return i(14971)}));return t=i.O(t)},t=[],i.O=function(n,e,r,o){if(!e){var u=1/0;for(s=0;s<t.length;s++){e=t[s][0],r=t[s][1],o=t[s][2];for(var a=!0,c=0;c<e.length;c++)(!1&o||u>=o)&&Object.keys(i.O).every((function(t){return i.O[t](e[c])}))?e.splice(c--,1):(a=!1,o<u&&(u=o));if(a){t.splice(s--,1);var f=r();void 0!==f&&(n=f)}}return n}o=o||0;for(var s=t.length;s>0&&t[s-1][2]>o;s--)t[s]=t[s-1];t[s]=[e,r,o]},i.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(n,{a:n}),n},i.d=function(t,n){for(var e in n)i.o(n,e)&&!i.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},i.f={},i.e=function(t){return Promise.all(Object.keys(i.f).reduce((function(n,e){return i.f[e](t,n),n}),[]))},i.u=function(t){return{191:"2dbdaab4",752:"829db8ac"}[t]+".js"},i.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},i.p="/api/hassio/app/frontend_es5/",function(){var t={971:1};i.f.i=function(n,e){t[n]||importScripts(i.p+i.u(n))};var n=self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[],e=n.push.bind(n);n.push=function(n){var r=n[0],o=n[1],u=n[2];for(var a in o)i.o(o,a)&&(i.m[a]=o[a]);for(u&&u(i);r.length;)t[r.pop()]=1;e(n)}}(),n=i.x,i.x=function(){return Promise.all([i.e(191),i.e(752)]).then(n)};i.x()}();

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -0,0 +1,14 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -0,0 +1 @@
!function(){"use strict";var r,t,n={5425:function(r,t,n){var e=n(93217);n(58556);function o(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==n)return;var e,o,u=[],i=!0,a=!1;try{for(n=n.call(r);!(i=(e=n.next()).done)&&(u.push(e.value),!t||u.length!==t);i=!0);}catch(f){a=!0,o=f}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}(r,t)||function(r,t){if(!r)return;if("string"==typeof r)return u(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(r,t)}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=r[n];return e}var i={filterData:function(r,t,n){return n=n.toUpperCase(),r.filter((function(r){return Object.entries(t).some((function(t){var e=o(t,2),u=e[0],i=e[1];return!(!i.filterable||!String(i.filterKey?r[i.valueColumn||u][i.filterKey]:r[i.valueColumn||u]).toUpperCase().includes(n))}))}))},sortData:function(r,t,n,e){return r.sort((function(r,o){var u=1;"desc"===n&&(u=-1);var i=t.filterKey?r[t.valueColumn||e][t.filterKey]:r[t.valueColumn||e],a=t.filterKey?o[t.valueColumn||e][t.filterKey]:o[t.valueColumn||e];return"string"==typeof i&&(i=i.toUpperCase()),"string"==typeof a&&(a=a.toUpperCase()),void 0===i&&void 0!==a?1:void 0===a&&void 0!==i?-1:i<a?-1*u:i>a?1*u:0}))}};(0,e.Jj)(i)}},e={};function o(r){var t=e[r];if(void 0!==t)return t.exports;var u=e[r]={exports:{}};return n[r](u,u.exports,o),u.exports}o.m=n,o.x=function(){var r=o.O(void 0,[191],(function(){return o(5425)}));return r=o.O(r)},r=[],o.O=function(t,n,e,u){if(!n){var i=1/0;for(c=0;c<r.length;c++){n=r[c][0],e=r[c][1],u=r[c][2];for(var a=!0,f=0;f<n.length;f++)(!1&u||i>=u)&&Object.keys(o.O).every((function(r){return o.O[r](n[f])}))?n.splice(f--,1):(a=!1,u<i&&(i=u));if(a){r.splice(c--,1);var l=e();void 0!==l&&(t=l)}}return t}u=u||0;for(var c=r.length;c>0&&r[c-1][2]>u;c--)r[c]=r[c-1];r[c]=[n,e,u]},o.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(t,{a:t}),t},o.d=function(r,t){for(var n in t)o.o(t,n)&&!o.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},o.f={},o.e=function(r){return Promise.all(Object.keys(o.f).reduce((function(t,n){return o.f[n](r,t),t}),[]))},o.u=function(r){return"2dbdaab4.js"},o.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},o.p="/api/hassio/app/frontend_es5/",function(){var r={477:1,425:1};o.f.i=function(t,n){r[t]||importScripts(o.p+o.u(t))};var t=self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[],n=t.push.bind(t);t.push=function(t){var e=t[0],u=t[1],i=t[2];for(var a in u)o.o(u,a)&&(o.m[a]=u[a]);for(i&&i(o);e.length;)r[e.pop()]=1;n(t)}}(),t=o.x,o.x=function(){return o.e(191).then(t)};o.x()}();

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
/* @preserve
* Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com
* (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/

Binary file not shown.

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More