468 Commits

Author SHA1 Message Date
Pascal Vizeli
40aa5c9caf
Write core state to /run/supervisor & monitor (#2027)
* Write core state to /run/supervisor & monitor

* Add watchdog

* Add log if they getting started

* fix stale comment

* Fix script

* avoid output

* fix tests

* fix lint

* Update rootfs/etc/services.d/watchdog/run

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

Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-09-08 10:09:41 +02:00
Pascal Vizeli
2321890dde
Full support of bytes arrays on gvariant (#2024)
* Full support of bytes arrays on gvariant

* Fix overlay ssid

* cleanup ssid

* fix test
2020-09-07 16:34:20 +02:00
Joakim Sørensen
25ea80e169
Fixes issues with managing wireless interfaces (#2015)
* Fixes issues with managing wireless interfaces

* Add test

* Add back fixture
2020-09-04 20:58:37 +02:00
Joakim Sørensen
f32d17d924
Format API error messages (#1997) 2020-08-30 17:53:10 +02:00
Pascal Vizeli
a9a2c35f06
Sentry send env infos (#1992) 2020-08-29 11:44:08 +02:00
Joakim Sørensen
98785b00e2
Use jinja for payload generation (#1985) 2020-08-28 11:46:22 +02:00
Joakim Sørensen
8d3694884d
Split payload so we can set auto without IP configuration (#1982)
* Guard for no interfaces

* Host reload on update

* Extract payload

* Check eth and wifi interfaces with a valid ip4 config

* Add tests

* Fix tests

* Move to enum
2020-08-28 10:40:50 +02:00
Pascal Vizeli
a2821a98ad
Fix gvar for dbus if binary is not a string (#1984) 2020-08-27 17:04:14 +02:00
Pascal Vizeli
6db4c60f47
Fix byte parser (#1981) 2020-08-27 14:31:34 +02:00
Pascal Vizeli
127073c01b
Small cleanup & adjustments for 236 (#1978) 2020-08-27 10:33:35 +02:00
Pascal Vizeli
1a3b369dd7
Update black 20.8b1 (#1976) 2020-08-26 23:01:29 +02:00
Pascal Vizeli
efcfc1f841
Watchdog for Add-ons (#1970)
* Watchdog for Add-ons

* Run task

* Extend appliaction watchdog

* fix spell

* Add running tasks

* Add tests

* Fix states

* Update supervisor/misc/tasks.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update tests/test_validate.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Adjust timeout

* change timeout

* Modify tasker

* slots the task object

* fix typing

* Add tests

* fix lint

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-08-26 22:20:35 +02:00
Joakim Sørensen
7a5a01bdcc
Add network to host suppported features (#1973) 2020-08-26 14:11:21 +02:00
Joakim Sørensen
9bcb15dbc0
MVP: Add Network Manager context (#1937)
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-08-24 16:58:02 +02:00
Pascal Vizeli
016fd24859
Fix hardware serial list check (#1943) 2020-08-18 15:03:30 +02:00
Pascal Vizeli
d315e81ab2
Extend hardware/udev support & usb mapping (#1940)
* Extend hardware/udev support & usb mapping

* Cleanup list

* new style

* Fix tests

* Fix

* use frozen

* add test for usb

* Fix block disks

* Update API.md

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

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2020-08-18 14:25:07 +02:00
Pascal Vizeli
94f112512f
Machine ID for user/sentry & cleanups (#1928)
* Machine ID for user/sentry & cleanups

* Add tests / fix users
2020-08-15 18:26:20 +02:00
Joakim Sørensen
b6509dca1f
Split extra info and add more metrics (#1927)
* Split extra

* Restructure and add info

* adjust test

* Move docker version

* Add name and repository for addons

* Test supervisor version

* Use context instead of extra

* adjust test
2020-08-15 16:26:01 +02:00
Joakim Sørensen
b51f9586c4
Fix attribute in sentry data_filter (#1920) 2020-08-14 19:29:10 +02:00
Joakim Sørensen
f5f5f829ac
Add test for denylist (#1914)
* Add test for denylist

* Mock API in conftest
2020-08-14 18:09:03 +02:00
Joakim Sørensen
84755836c9
Filter AddonConfigurationError from sentry (#1912) 2020-08-14 14:06:46 +02:00
Joakim Sørensen
c9585033cb
Sanitize event (#1908)
* Sanitise event

* No need to remove supervisor token

* cleanup

* Typo

* Review comments

* Move and test

* Move and use hdr
2020-08-14 13:40:14 +02:00
Joakim Sørensen
3b0d0e9928
Add disk total, used, free to host/info API (#1909) 2020-08-14 09:24:38 +02:00
Pascal Vizeli
a9bdab4b49
Fix validation issue addon options (#1898)
* Fix validation issue addon options

* Add some basic tests

* Update supervisor/addons/validate.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-08-12 14:49:46 +02:00
Pascal Vizeli
ad988f2a24
Add diagnostics support (#1870)
* Add diagnostics support

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* add aditional data

* Fix handling

* Better states

* Fix opt

* Update supervisor/bootstrap.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Only events on supported systems

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-08-05 14:54:03 +02:00
Martin Hjelmare
4f1ed690cd
Add free disk space log on docker install error (#1868)
* Add free disk space info

* Log available space on docker image install error

* Add unit to log message

* Add 404 check and better log message

* Set default path to supervisor data path

* Clean up attribute access

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

* Move free space helper to hardware

* Add hardware test

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-08-03 15:00:07 +02:00
Pascal Vizeli
adb39ca93f
Support to exclude machine (#1835)
* Support to exclude machine

* add tests
2020-07-15 14:53:44 +02:00
Pascal Vizeli
5fdc340e58
Streamline version (#1834)
* More streamline version handling

* Strict it up

* update tests
2020-07-15 13:05:11 +02:00
Pascal Vizeli
bb64dca6e6
Fix symlink snapshot (#1833)
* Fix symbolic link issue with snapshot

* Add tests

* fix symlink

* add encrypted test

* Modify x
2020-07-14 15:39:03 +02:00
Pascal Vizeli
bdfcf1a2df
Migrate to python 3.8 (#1824)
* Migrate to python 3.8

* Fix tests on Py38

* cleanup tests

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-07-13 22:26:41 +02:00
Franck Nijhof
9eab92513a
Add QA/CI to Supervisor (#1814) 2020-07-05 20:20:29 +02:00
Maximilian Bösing
a3cf445c93
Bugfix: No such file or directory: '/data/homeassistant/home-assistant_v2.db-shm' (#1795)
* Do not use `tar_file.add` to recursively add backup folder

As the folders might contain files which are being removed temporarily (e.g. shared memory file of sqlite database), relying on `tar_file.add` becomes problematic as it crashes the whole backup process if a file does not exist anymore.
This becomes annoying, if the file which causes the error should be excluded by the filter.

To workaround this issue, we manually iterating over the files/directories and apply filters before passing the file or directory to the `tar_file.add` method. As per [documentation](https://docs.python.org/3/library/pathlib.html#pure-paths), pure path does not access the file system.

Fixes #779

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Remove unused import

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Applied code review suggestions

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Applied codestyle

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Remove `pathlib` util and move `is_excluded_by_filter` into `tar` utils

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Rename method

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Rename `origin_dir` to `origin_path` and apply `Path` typehint

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Codestyle

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Add comment why we add the directory even if we are iterating over all its items

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Use `atomic_contents_add` from tar utils to archive addon data

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Remove unused function `exclude_filter`

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Remove unsecure default list value

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Some more codestyle

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Lowercase method name `Path.joinpath`

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Fix codestyle and use proper variable

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Add test for `_is_excluded_by_filter`

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Update addon.py

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-06-26 11:36:49 +02:00
Franck Nijhof
f0d46e8671
Improve flake8 configuration and pydocstyle fixes (#1742) 2020-05-22 13:38:57 +02:00
Franck Nijhof
1d83c0c77a
Update isort configuration and sorts imports in codebase (#1739)
* Add known first party to isort configuration

* Run isort on supervisor and tests folder
2020-05-21 13:30:54 +02:00
Pascal Vizeli
796f9a203e
Rename zwave_mqtt to ozw (#1729) 2020-05-19 16:54:50 +02:00
Martin Hjelmare
53fa8e48c0
Delint tests (#1720)
* Delint tarfile test

* Delint tests
2020-05-11 20:41:09 +02:00
Pascal Vizeli
c605af6ccc
Add discovery support for new ozw integration (#1701) 2020-05-07 08:32:10 +02:00
Pascal Vizeli
9a2f025646
Add support for homematic (#1690) 2020-05-01 15:23:56 +02:00
Franck Nijhof
3010bd4eb6
Remove Home Panel Discovery (#1594)
* Remove Home Panel Discovery

* Remove related tests
2020-03-23 10:32:56 +01:00
Pascal Vizeli
4ac7f7dcf0
Rename Hass.io -> Supervisor (#1522)
* Rename Hass.io -> Supervisor

* part 2

* fix lint

* fix auth name
2020-02-21 17:55:41 +01:00
Pascal Vizeli
8dbfea75b1
Extend video & add tests (#1518) 2020-02-20 00:29:48 +01:00
Pascal Vizeli
fcdd66dc6e
Fix Hardware list (#1490) 2020-02-07 18:30:39 +01:00
Pascal Vizeli
a320e42ed5
Fix services validation & add tests (#1456) 2020-01-27 21:38:26 +01:00
Bram Kragten
24ded99286 Typo (#1444)
* Typo

* Typo test
2020-01-20 17:11:41 +01:00
Pascal Vizeli
f55c10914e
UI Schema / Addon options (#1441)
* UI schema for add-on options

* Fix lint

* Add tests

* Address comments
2020-01-20 15:13:17 +01:00
Pascal Vizeli
e4ac17fea6
Support Odroid N2 (#1416) 2020-01-06 14:08:30 +01:00
Pascal Vizeli
fc5d97562f
Dns update (#1393)
* Improvements to DNS validator to include IPv6 (#1312)

* improvements to DNS validator to include IPv6

* fixed the DNS validators

* updated per suggestions

* Update const.py

* Update dns.py

* Update validate.py

* Update validate.py

* Update dns.py

* Update test_validate.py

* Update validate.py

* Cleanup

* Don't set default DNS server as default

* Remove update local resolver

* Fix lint
2019-12-05 21:52:55 +01:00
Pascal Vizeli
615e68b29b
Add discovery support for Almond (#1339)
* Add discovery support for Almond

* Fix docstring
2019-10-22 13:39:46 +02:00
Pascal Vizeli
11811701d0
Add snapshot_exclude option (#1337)
* Add snapshot tar filter

* Add filter to add-on

* Fix bug

* Fix
2019-10-21 14:48:24 +02:00
Pascal Vizeli
05c8022db3
Check path on extractall (#1336)
* Check path on extractall

* code cleanup

* Add logger

* Fix issue

* Add tests
2019-10-21 12:23:00 +02:00