Compare commits

...

103 commits
1.0.0 ... main

Author SHA1 Message Date
53f02b054b Aggiorna README.md 2025-01-22 22:33:04 +08:00
05589ace02 Cari file su "/" 2025-01-22 22:30:50 +08:00
334571dfda Aggiorna README.md 2025-01-22 22:25:01 +08:00
82112b21af Aggiorna README.md 2025-01-22 22:23:56 +08:00
04b37541f6 Aggiorna README.md 2025-01-22 22:23:13 +08:00
77371e0157 Aggiorna README.md 2025-01-22 22:19:55 +08:00
ebf3df4952 Aggiorna README.md 2025-01-22 22:14:55 +08:00
c3b850ec4a Aggiorna README.md 2025-01-22 22:14:36 +08:00
cc2e332953 Aggiorna README.md 2025-01-22 22:10:22 +08:00
dependabot[bot]
4ce4bad3fa
Bump actions/checkout from 4.2.1 to 4.2.2 (#386) 2024-10-28 15:20:44 +01:00
dependabot[bot]
c714207423
Bump actions/checkout from 4.2.0 to 4.2.1 (#385)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-14 09:17:44 +02:00
Matheson Steplock
f52ff8259e
Drop Debian Bullseye (#382) 2024-10-09 09:29:37 +02:00
Darren Griffin
1292ab7372
Add OHF logo to README (#380) 2024-09-30 18:37:51 +02:00
dependabot[bot]
f9375b5593
Bump actions/checkout from 4.1.7 to 4.2.0 (#379)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-30 09:06:24 +02:00
Stefan Agner
05592309e6
Add note about NetworkManager managed interface (#375) 2024-08-12 21:55:31 +02:00
Viacheslav Bocharov
a140122c6c
Fix check online in DEBIAN/postinst from ping to curl (#370)
* Fix check online in DEBIAN/postinst from ping to curl

In some virtual machines ping sockets may be disabled, but curl works good.

Signed-off-by: Viacheslav Bocharov <adeep@lexina.in>

* Update URL_CHECK_ONLINE to https://checkonline.home-assistant.io/online.txt

---------

Signed-off-by: Viacheslav Bocharov <adeep@lexina.in>
2024-06-21 14:15:46 +02:00
dependabot[bot]
6669bf6aca
Bump actions/checkout from 4.1.6 to 4.1.7 (#371)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [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/v4.1.6...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/checkout
  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>
2024-06-17 09:07:17 +02:00
Matheson Steplock
c7848eec49
Reorganize dependencies (#368) 2024-05-23 10:43:43 +02:00
dependabot[bot]
ec41ff48be
Bump actions/checkout from 4.1.5 to 4.1.6 (#367) 2024-05-20 09:05:34 +02:00
dependabot[bot]
8b1d7a3656
Bump actions/checkout from 4.1.4 to 4.1.5 (#365)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 09:10:59 +02:00
dependabot[bot]
9afc7a625e
Bump actions/checkout from 4.1.3 to 4.1.4 (#362)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.4.
- [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/v4.1.3...v4.1.4)

---
updated-dependencies:
- dependency-name: actions/checkout
  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>
2024-04-29 09:04:01 +02:00
dependabot[bot]
f1ee897da5
Bump actions/checkout from 4.1.2 to 4.1.3 (#361)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 08:56:12 +02:00
dependabot[bot]
c787aa7bc0
Bump actions/checkout from 4.1.1 to 4.1.2 (#359) 2024-03-18 08:01:54 +01:00
dependabot[bot]
d531539877
Bump softprops/action-gh-release from 1 to 2 (#358)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 10:58:45 +01:00
Matheson Steplock
b345d3ee65
Bump Version 2024-02-12 16:55:07 -05:00
sdotter
c255defe1e
Added raspberrypi5-64 support... (#345) 2024-02-12 16:52:53 -05:00
Matheson Steplock
c99ffd00fc
Bump Version to 1.6.0 2024-02-01 16:54:55 -05:00
Matheson Steplock
77d549776c
Cleanup container and stop services before installing (#343) 2024-01-17 12:15:34 +01:00
Matheson Steplock
13ffd23c36
Add support for containerd.sock in supervisor (#344) 2024-01-17 12:14:27 +01:00
dependabot[bot]
5b8fd2b0f4
Bump actions/upload-artifact from 3 to 4 (#341)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-19 21:28:50 -05:00
dependabot[bot]
8f0a7f3808
Bump actions/stale from 8.0.0 to 9.0.0 (#340) 2023-12-11 07:23:30 +01:00
Matheson Steplock
3dde6e9e90
Workaround to allow installation on Debian 11 (#337) 2023-11-07 23:56:37 +01:00
Stefan Agner
d7290e4a19
Pull latest stable Supervisor if image is missing (#336)
Similar to Home Assistant OS if the Supervisor is missing, make sure to
pull the latest stable image.

See also https://github.com/home-assistant/operating-system/pull/2765
2023-11-02 20:01:56 -04:00
Marcel de Vries
8dbfda2221
Only attach TTY for hassio_cli wrapper when not completing command (#334) 2023-10-23 15:39:36 +02:00
Marcel de Vries
21a9d0b3f3
Attach TTY for hassio_cli wrapper to make spinner work (#332) 2023-10-23 12:24:25 +02:00
dependabot[bot]
4bc6a478a5
Bump actions/checkout from 4.1.0 to 4.1.1 (#333)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 08:58:22 +02:00
Matheson Steplock
724cbf2dfb
Support Network Storage (#325) 2023-10-16 09:29:49 +02:00
Matheson Steplock
ba6a9d341c
Update resolved.conf (#328) 2023-10-16 09:29:15 +02:00
Matheson Steplock
5256c521f0
Add tasks.json to make testing easier (#330) 2023-10-08 16:22:10 -04:00
Matheson Steplock
2e5c669723
Fix redirects on errors (#327) 2023-10-05 08:22:39 +02:00
dependabot[bot]
aaed7d4370
Bump actions/checkout from 4.0.0 to 4.1.0 (#324)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-25 11:01:40 +02:00
Andrea
8b004cc97a
Update README.md (#319) 2023-09-12 10:42:20 +02:00
dependabot[bot]
0b5838b847
Bump actions/checkout from 3 to 4 (#320)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-09-12 10:41:48 +02:00
Matheson Steplock
06671c39bd
Bump version 2023-06-19 01:08:46 -04:00
Matheson Steplock
15f4ab16c2
Add Support For Debian Bookworm (#297) 2023-06-14 15:04:04 -04:00
Matheson Steplock
9c6a021760
Bump Version 2023-06-03 14:52:53 -04:00
Sergio Conde Gómez
923437fa7f
Set bind propagation for supervisor data (#293) 2023-06-02 20:18:01 -04:00
dependabot[bot]
be8508f7ef
Bump actions/stale from 7.0.0 to 8.0.0 (#283)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 09:30:12 +02:00
Daniel Lo Nigro
048a4dd86b
Modernize apt commands (#280) 2023-03-05 22:12:56 +01:00
Matheson Steplock
9eb7b0348b
Bump Version 2023-03-02 15:25:59 -05:00
p0wer
d8af25272d
Issue #247 Ensure systemd-journal-gatewayd socket is correct (#277)
* Create systemd socket override for systemd-journal-gatewayd

As stated in https://github.com/home-assistant/supervised-installer/issues/247 the default action for systemd-journal-gatewayd is to listen on HTTP port while Supervisor needs Unix socket file that's bind mounted in Docker container. This override changes socket location.

* Check and fix systemd socket file

As stated in #247 with the default setup the path /run/systemd-journal-gatewayd.sock may be a directory, not a file, we have to fix that

* Remove unnecessary unit file

Socket location change has been moved to systemd override which is the suggested way of changing original packaged unit behavior

* Rename hassio-supervisor.conf to 10-hassio-supervisor.conf
2023-02-27 17:25:12 -05:00
p0wer
d135a92f6d
Fix for missing apparmor profile directory (#278)
Fixes https://github.com/home-assistant/supervised-installer/issues/270
2023-02-15 18:18:04 -05:00
dependabot[bot]
77ba930b84
Bump actions/stale from 6.0.1 to 7.0.0 (#269)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-27 08:17:52 +01:00
Paul Sütterlin
d5e5550703
Add lsb-release dependency (#264)
Not all Debian Installations come with lsb-release, therefore installation may fail in select cases. Adding the dependency to the list resolves possible complications.
2022-12-18 21:29:09 -05:00
Matheson Steplock
730bf01008
Solve Compression Error - Build Debian Package in Docker (#263)
* Build Debian Package in Docker

* Fix docker run

* Fix Formatting

* Fix YAML Errors

* Test Formatting Fix

* Pin to bullseye-slim

* Build Debian Package in Docker

* Bump Version Number
2022-12-11 15:33:29 -05:00
Matheson Steplock
becd4e691a
Simplify Example Path 2022-12-10 15:51:10 -05:00
Matheson Steplock
586b0a8554
Bump Version to 1.4.0 2022-12-10 15:46:38 -05:00
Matheson Steplock
928b3abc34
Block Unsupported OS (#262)
* Check Support

* fix wording

* Add Bypass OS Check
2022-12-10 15:45:58 -05:00
Andy Grunwald
10b1819f05
docs: Add documentation about how to reconfigure "$DATA_SHARE" (#251)
This was mainly used by https://github.com/home-assistant/supervised-installer/issues/187
2022-12-08 22:16:19 -05:00
Tony2k
51a506a494
Add Odroid C4 (#257) 2022-11-25 12:40:59 +01:00
Tony2k
3f64b3ff34
Add Odroid C4 (#258) 2022-11-25 12:40:44 +01:00
Tony2k
2de4f4b6d0
Add Odroid C4 machine (#250)
https://hub.docker.com/r/homeassistant/odroid-c4-homeassistant
2022-11-16 15:51:36 -05:00
Lucas Mindêllo de Andrade
a3d1502f51
feat(PREINSTALL): check if CPU arch is supported (#243) 2022-10-26 21:37:34 -04:00
dependabot[bot]
3e8f78ff38
Bump actions/stale from 6.0.0 to 6.0.1 (#245)
Bumps [actions/stale](https://github.com/actions/stale) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v6.0.0...v6.0.1)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-10 10:08:48 +02:00
dependabot[bot]
76187a3e60
Bump actions/stale from 5.2.0 to 6.0.0 (#242)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-26 12:07:15 +02:00
Matheson Steplock
c0cfcb3806
Bump version 2022-09-25 17:39:14 -04:00
Tomas Klouda
0779e8d745
Fix switch to cgroup v1 for Debian 11 on Raspberry Pi (#240)
There was wrong path used, as `/boot/cmdline.txt` is only used on Rapbian or RaspiOS which are not supported .
2022-09-25 17:25:07 -04:00
Matheson Steplock
46ec13fd49
Bump version 2022-09-22 21:15:45 -04:00
dependabot[bot]
da2d4945de
Bump actions/stale from 5.1.1 to 5.2.0 (#236)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-19 09:22:28 +02:00
Nikolay Shcheglov
120705a944
Add apparmor to required deps (#192) 2022-09-15 21:59:30 -04:00
Matheson Steplock
a4c446282f
Switch to stale workflow (#233) 2022-09-15 10:53:37 +02:00
Matheson Steplock
8b0cfe7a53
Expose systemd-journal-gatewayd (#235)
* Expose systemd-journal-gatewayd

* Enable and start systemd-journal-gatewayd.socket

* add systemd-journal-remote to requirements

* add systemd-journal-remote to requirements
2022-09-15 09:00:29 +02:00
Matheson Steplock
87c4f98a86
add log-opts (#234) 2022-09-15 08:59:38 +02:00
Nick Nothom
00d765fcd9
Fix typos (#232) 2022-08-29 22:28:17 +02:00
Pascal Vizeli
45a38d1fc4
Add IPv6 support for upcoming supervisor (#229) 2022-08-11 16:09:34 -04:00
Foxler2010
7ffcc23818
fixed typo (#228)
assisisisisisistant
2022-08-07 01:22:44 -04:00
Matheson Steplock
2f62e65aab
Bump version number 2022-07-25 16:14:51 -04:00
Matheson Steplock
1efaf1ce08
Update NetworkManager Config (#224)
* Update networkmanager config to match OS

* drop Supervisor default

* remove divert of NetworkManager file

* switch to checkonline

* remove http from ping

* divert default config
2022-07-25 16:12:43 -04:00
dependabot[bot]
168d844b33
Bump actions/upload-artifact from 2 to 3 (#219)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-05 09:35:34 +02:00
dependabot[bot]
f330417eaa
Bump actions/checkout from 2 to 3 (#220)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-05 09:31:09 +02:00
Sven Serlier
10cd745f4e
Add dependabot (#218) 2022-07-05 09:29:02 +02:00
Matheson Steplock
9f0efc9d20
bump version number 2022-06-23 16:51:56 -04:00
Christoph Spörk
d79ea23c2b
multiple default routes mess up installation (#210)
In case multiple default routes on different network interfaces are defined, installation is messed up

exiting awk script after first hit should resolve this issue
2022-06-22 20:57:51 -04:00
Matheson Steplock
6adb847f90
bump version to 1.2.0, as /run/supervisor has been added 2022-05-16 21:08:15 -04:00
Matheson Steplock
582f74113d
bump version to 1.1.2 2022-05-16 20:55:14 -04:00
Matheson Steplock
b45f5cd627
Add check for /boot/cmdline.txt (#206)
* add check /boot/cmdline.txt

* fix spacing
2022-05-16 17:09:15 -04:00
Matheson Steplock
d9256b3d81
streamline hassio-supervisor (#212)
* streamline hassio-supervisor

* mount /run/supervisor to /run/supervisor

* revert mount change

* remove SUPERVISOR_CPU_RT
2022-05-16 16:38:14 -04:00
Pascal Vizeli
da3b7ae7ce
Update hassio-supervisor.service (#204) 2022-03-26 16:57:11 -04:00
Matheson Steplock
52e073a3ea
bump version 1.1.1 2022-03-23 15:27:28 -04:00
Matheson Steplock
9463f705cf
Improved formatting (#196)
* Fixed formatting with help of shellcheck

* add curly braces
2022-03-23 09:47:16 +01:00
Matheson Steplock
13d3088604
Start systemd-resolved (#202)
* Enable and start systemd-resolved

* reorder start
2022-03-23 09:46:05 +01:00
Matheson Steplock
ceb01be00b
Switch to cgroupv1 (#201)
* Switch to cgroupv1

* change wording

* warn user

* fix if statement
2022-03-23 09:45:22 +01:00
Matheson Steplock
4310fa6579
Bump version to 1.1.0 2022-02-07 15:42:16 -05:00
Matheson Steplock
22cfa7ae5a
Switch to ghcr.io (#188) 2022-02-07 09:37:06 +01:00
Matheson Steplock
070fad61fe fix typo 2022-02-06 15:00:19 -05:00
Matheson Steplock
886b7efb30
Add "Install Complete" Message (#190)
* Add install complete message

* Get interface ip
2022-02-06 14:20:37 -05:00
Matheson Steplock
3200e99888
Reset debconf selections (#189)
* reset machine type

* rename function

* Add removal message

* add detail to message
2022-02-05 21:09:18 -05:00
Matheson Steplock
089222313e
Build package on PR (#167)
* Build Test Deb Package

* set retention-days to 15

* Update .github/workflows/build-deb-pr.yml

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update .github/workflows/build-deb-pr.yml

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* set lowest permissions

* set branch to main

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-11-07 20:19:04 +01:00
Pascal Vizeli
cf37577f61
Simplify AppArmor handler with new OS-Agent (#165)
* Simplify AppArmor handler with new OS-Agent

* improve grammar

* bump version number

Co-authored-by: Matheson Steplock <ikifar2012@users.noreply.github.com>
2021-11-02 13:43:02 -04:00
Matheson Steplock
d15efe7eeb
Issue template (#166)
* base template

* ADR

* steps

* fix placeholder

* formatting

* reformat

* reorder

* description

* config
2021-11-02 12:08:09 -04:00
Pascal Vizeli
f844eb1cf8
Remove avahi-daemon (#163) 2021-10-29 12:33:02 +02:00
Phill (pssc)
ab687fddef
Fix issues with diversion removal on install/upgrade (#159) 2021-10-27 17:23:17 -04:00
Kanga-Who
a13eda0e54
Added wget to the required dependencies (#157)
* Added wget to the required dependencies 

wget required to download the `deb` package

* Switch to multiline

Co-authored-by: Matheson Steplock <ikifar2012@users.noreply.github.com>
2021-10-26 22:44:15 -04:00
24 changed files with 680 additions and 138 deletions

95
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View file

@ -0,0 +1,95 @@
name: Bug Report
description: Do you think you have found a bug? If so then file a bug report
title: "Bug Report: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
If you haven't already, please visit the Home Assistant [Discord](https://www.home-assistant.io/join-chat/) and/or [Community Forums](https://community.home-assistant.io/) to get help before filing a bug report.
Thank You for taking the time to fill out this bug report!
- type: input
id: os-version
attributes:
label: OS Version
description: Please Insert the output of `lsb_release -d`
placeholder: Debian GNU/Linux 12 (bookworm)
validations:
required: true
- type: input
id: uname
attributes:
label: System Information
description: Please Insert the output of `uname -a`
placeholder: 'Linux ha 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux'
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Please explain in detail, the issue you encountered and the steps to recreate it.
placeholder: |
I encountered an issue when trying to upgrade my existing installation to the Debian package.
Steps to recreate:
1. Run the now deprecated installation script
2. Attempt to upgrade to version 1.0.0 of the Debian package with dpkg -i as root
3. The install will fail with the error: `dpkg-divert: error: rename involves overwriting`
validations:
required: true
- type: dropdown
id: machine-type
attributes:
label: Machine Type
description: Which machine type are you running?
options:
- generic-x86-64
- khadas-vim3
- odroid-c2
- odroid-c4
- odroid-n2
- odroid-xu
- qemuarm
- qemuarm-64
- qemux86
- qemux86-64
- raspberrypi
- raspberrypi2
- raspberrypi3
- raspberrypi3-64
- raspberrypi4
- raspberrypi4-64
- raspberrypi5-64
- tinker
validations:
required: true
- type: textarea
id: installer-output
attributes:
label: Installer output
description: Please copy and paste any relevant output from the installer. This will be automatically formatted into code, so no need for backticks.
render: text
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output from `journalctl -f`. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: checkboxes
id: adr
attributes:
label: ADR
description: Before submitting this issue, you have read the [ADR](https://github.com/home-assistant/architecture/blob/master/adr/0014-home-assistant-supervised.md).
options:
- label: I have read through the [ADR](https://github.com/home-assistant/architecture/blob/master/adr/0014-home-assistant-supervised.md) and have confirmed that my system is compliant with the requirements
required: true
- label: I understand that if my system is found to not be compliant, my issue will be closed immediately without further investigation
required: true
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://www.home-assistant.io/code_of_conduct/).
options:
- label: I have read and agree to the [Home Assistant Code of Conduct](https://www.home-assistant.io/code_of_conduct/)
required: true

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Home Assistant Discord
url: https://www.home-assistant.io/join-chat/
about: Need help? Ask us in the `#homeassistant_supervised` Discord channel.
- name: Home Assistant Community Forums
url: https://community.home-assistant.io/
about: The community forums are another great place to get help and find installation guides maintained by the community.

8
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
time: "06:00"
open-pull-requests-limit: 10

17
.github/stale.yml vendored
View file

@ -1,17 +0,0 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

23
.github/workflows/build-deb-pr.yml vendored Normal file
View file

@ -0,0 +1,23 @@
name: Build Test Deb Package
on:
pull_request:
branches:
- main
jobs:
build-test-deb-package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Build Debian Package in Docker
run: |
docker run --rm -v $(pwd):/tmp debian:bookworm-slim bash -c \
"cd /tmp \
&& chmod 555 homeassistant-supervised/DEBIAN/p* \
&& dpkg-deb --build --root-owner-group homeassistant-supervised"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: homeassistant-supervised.deb
path: homeassistant-supervised.deb

View file

@ -11,11 +11,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- run: chmod 755 homeassistant-supervised/DEBIAN/p* - name: Build Debian Package in Docker
- run: dpkg-deb --build --root-owner-group homeassistant-supervised run: |
docker run --rm -v $(pwd):/tmp debian:bookworm-slim bash -c \
"cd /tmp \
&& chmod 555 homeassistant-supervised/DEBIAN/p* \
&& dpkg-deb --build --root-owner-group homeassistant-supervised"
- name: Release - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
with: with:
files: homeassistant-supervised.deb files: homeassistant-supervised.deb

39
.github/workflows/stale.yml vendored Normal file
View file

@ -0,0 +1,39 @@
name: Stale
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "0 * * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 60
days-before-close: 7
stale-issue-label: "stale"
exempt-issue-labels: "no-stale,Help%20wanted,help-wanted,pinned,rfc,security"
stale-issue-message: >
There hasn't been any activity on this issue recently. Due to the
high number of incoming GitHub notifications, we have to clean some
of the old issues, as many of them have already been resolved with
the latest updates.
Please make sure to update to the latest version and check if that
solves the issue. Let us know if that works for you by
adding a comment 👍
This issue has now been marked as stale and will be closed if no
further activity occurs. Thank you for your contributions.
stale-pr-label: "stale"
exempt-pr-labels: "no-stale,pinned,rfc,security"
stale-pr-message: >
There hasn't been any activity on this pull request recently. This
pull request has been automatically marked as stale because of that
and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

17
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build Debian Package",
"type": "shell",
"command": "chmod 555 homeassistant-supervised/DEBIAN/p* && dpkg-deb --build --root-owner-group homeassistant-supervised",
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
}
]
}

62
Hassio installer.txt Normal file
View file

@ -0,0 +1,62 @@
INSTALLAZIONE HOME ASSISTEANT SUPERVISED
seguire il github https://github.com/home-assistant/supervised-installer
andare come utente root
su -
poi
apt install \
apparmor \
bluez \
cifs-utils \
curl \
dbus \
jq \
libglib2.0-bin \
lsb-release \
network-manager \
nfs-common \
systemd-journal-remote \
systemd-resolved \
udisks2 \
wget -y
e probabilmente vi verrà chiesto di riavviare per far funzionare NetworkManager al posto del normale programma di manager di debian
controllare che funzioni come scritto in https://wiki.debian.org/NetworkManager
nel file /etc/NetworkManager/NetworkManager.conf ci dovrà essere
[ifupdown]
managed=false
altrimenti settare come definito nel sito
il precedente file di configurazione si trova
/etc/network/interfaces
verificare se Docker-ce è installato con
docker -v
altrimenti installarlo con
curl -fsSL get.docker.com | sh
installare OS-Agent usando l'ultima versione da https://github.com/home-assistant/os-agent/releases/latest
wget https://github.com/home-assistant/os-agent/releases/download/1.6.0/os-agent_1.6.0_linux_aarch64.deb
sudo dpkg -i os-agent_1.6.0_linux_aarch64.deb
wget -O homeassistant-supervised.deb https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
BYPASS_OS_CHECK=true apt install ./homeassistant-supervised.deb
NOTE
verificare i servizi in systemd di Home assistant
haos-agent.service Home Assistant OS Agent
hassio-apparmor.service Hass.io AppArmor
hassio-supervisor.service Hass.io supervisor
es
systemctl status hassio-supervisor.service

102
README.md
View file

@ -1,6 +1,8 @@
# This installation method is for advanced users only # This installation method is for advanced users only
## Make sure you understand [the requirements](https://github.com/home-assistant/architecture/blob/master/adr/0014-home-assistant-supervised.md) ### Make sure you understand [the requirements](https://github.com/home-assistant/architecture/blob/master/adr/0014-home-assistant-supervised.md)
qui il file semplificato [Hassio installer.txt](Hassio%20installer.txt)
# Install Home Assistant Supervised # Install Home Assistant Supervised
@ -14,40 +16,85 @@ This method is considered advanced and should only be used if one is an expert i
Run the following commands as root (`su -` or `sudo su -` on machines with sudo installed): Run the following commands as root (`su -` or `sudo su -` on machines with sudo installed):
Step 1: Install the following dependacy's with this command: Step 1: Install the following dependencies with this command:
```bash ```bash
apt-get install \ apt install \
jq \ apparmor \
bluez \
cifs-utils \
curl \ curl \
avahi-daemon \ dbus \
udisks2 \ jq \
libglib2.0-bin \ libglib2.0-bin \
lsb-release \
network-manager \ network-manager \
dbus -y nfs-common \
systemd-journal-remote \
systemd-resolved \
udisks2 \
wget -y
``` ```
Step 2: Install Docker-CE with the following command: If you haven't been using NetworkManager before, you might see instructions on how to let NetworkManager manage the current network interface.
### NetworkManager
probabilmente vi verrà chiesto di riavviare per far funzionare NetworkManager al posto del normale programma di manager di debian
controllare che funzioni come scritto in https://wiki.debian.org/NetworkManager
nel file ```/etc/NetworkManager/NetworkManager.conf``` ci dovrà essere
```
[ifupdown]
managed=false
```
altrimenti settare come definito nel sito
il precedente file di configurazione si trova
```
/etc/network/interfaces
```
### Step 2: Docker-CE:
verificare se è installato Docker-CE
```bash
docker -v
```
altrimenti va installato
```bash ```bash
curl -fsSL get.docker.com | sh curl -fsSL get.docker.com | sh
``` ```
Step 3: Install the OS-Agent: ### Step 3: Install the OS-Agent:
Instructions for installing the OS-Agent can be found [here](https://github.com/home-assistant/os-agent/tree/main#using-home-assistant-supervised-on-debian) Instructions for installing the OS-Agent can be found [here](https://github.com/home-assistant/os-agent/tree/main#using-home-assistant-supervised-on-debian)
Step 4: Install the Home Assisistant Supervised Debian Package: Step 4: Install the Home Assistant Supervised Debian Package:
```bash ```bash
wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb wget -O homeassistant-supervised.deb https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
dpkg -i homeassistant-supervised.deb apt install ./homeassistant-supervised.deb
``` ```
Orange Pi5 Plus is not supported so you must use
```bash
BYPASS_OS_CHECK=true apt install ./homeassistant-supervised.deb
```
## Supported Machine types ## Supported Machine types
- generic-x86-64 - generic-x86-64
- odroid-c2 - odroid-c2
- odroid-c4
- odroid-n2 - odroid-n2
- odroid-xu - odroid-xu
- qemuarm - qemuarm
@ -60,9 +107,38 @@ dpkg -i homeassistant-supervised.deb
- raspberrypi4 - raspberrypi4
- raspberrypi3-64 - raspberrypi3-64
- raspberrypi4-64 - raspberrypi4-64
- raspberrypi5-64
- tinker - tinker
- khadas-vim3 - khadas-vim3
## Configuration
The default path for our `$DATA_SHARE` is `/usr/share/hassio`.
This path is used to store all home assistant related things.
You can reconfigure this path during installation with
```bash
DATA_SHARE=/my/own/homeassistant dpkg --force-confdef --force-confold -i homeassistant-supervised.deb
```
## Troubleshooting ## Troubleshooting
If somethings going wrong, use `journalctl -f` to get your system logs. If you are not familiar with Linux and how you can fix issues, we recommend to use our Home Assistant OS. If something's going wrong, use `journalctl -f` to get your system logs. If you are not familiar with Linux and how you can fix issues, we recommend to use our Home Assistant OS.
[![Home Assistant - A project from the Open Home Foundation](https://www.openhomefoundation.org/badges/home-assistant.png)](https://www.openhomefoundation.org/)
## NOTE
verificare i servizi in systemd di Home assistant
```haos-agent.service``` Home Assistant OS Agent
```hassio-apparmor.service``` Hass.io AppArmor
```hassio-supervisor.service``` Hass.io supervisor
es
```
systemctl status hassio-supervisor.service
```

View file

@ -1,9 +1,10 @@
Package: homeassistant-supervised Package: homeassistant-supervised
Section: base Section: base
Version: 1.0.0 Version: 2.0.0
Priority: optional Priority: optional
Architecture: all Architecture: all
Depends: curl, bash, docker-ce, dbus, network-manager, apparmor, jq, systemd, os-agent Pre-Depends: curl, bash, docker-ce, dbus, network-manager, apparmor, jq, systemd, os-agent, systemd-journal-remote, systemd-resolved
Depends: bluez, cifs-utils, nfs-common
Maintainer: Matheson Steplock <https://mathesonsteplock.ca/> Maintainer: Matheson Steplock <https://mathesonsteplock.ca/>
Homepage: https://www.home-assistant.io/ Homepage: https://www.home-assistant.io/
Description: Home Assistant Supervised Description: Home Assistant Supervised

View file

@ -8,81 +8,121 @@ ARCH=$(uname -m)
BINARY_DOCKER=/usr/bin/docker BINARY_DOCKER=/usr/bin/docker
DOCKER_REPO=homeassistant DOCKER_REPO="ghcr.io/home-assistant"
SERVICE_DOCKER="docker.service" SERVICE_DOCKER="docker.service"
SERVICE_NM="NetworkManager.service" SERVICE_NM="NetworkManager.service"
# Read infos from web # Read infos from web
URL_VERSION_HOST="version.home-assistant.io" URL_CHECK_ONLINE="https://checkonline.home-assistant.io/online.txt"
URL_VERSION="https://version.home-assistant.io/stable.json" URL_VERSION="https://version.home-assistant.io/stable.json"
HASSIO_VERSION=$(curl -s $URL_VERSION | jq -e -r '.supervisor') HASSIO_VERSION=$(curl -s ${URL_VERSION} | jq -e -r '.supervisor')
URL_APPARMOR_PROFILE="https://version.home-assistant.io/apparmor.txt" URL_APPARMOR_PROFILE="https://version.home-assistant.io/apparmor.txt"
# reload systemd
info "Reload systemd"
systemctl daemon-reload
# Restart NetworkManager # Restart NetworkManager
info "Restarting NetworkManager" info "Restarting NetworkManager"
systemctl restart "${SERVICE_NM}" systemctl restart "${SERVICE_NM}"
# Set permissions of /etc/systemd/resolved.conf
# check if file has correct permissions
if [ "$(stat -c %a /etc/systemd/resolved.conf)" != "644" ]; then
info "Setting permissions of /etc/systemd/resolved.conf"
chmod 644 /etc/systemd/resolved.conf
fi
# Enable and restart systemd-resolved
info "Enable systemd-resolved"
systemctl enable systemd-resolved.service> /dev/null 2>&1;
info "Restarting systemd-resolved"
systemctl restart systemd-resolved.service
# Check and fix systemd-journal-gatewayd socket location
if [ ! -S "/run/systemd-journal-gatewayd.sock" ]; then
info "Set up systemd-journal-gatewayd socket file"
if [ "$(systemctl is-active systemd-journal-gatewayd.socket)" = 'active' ]; then
systemctl stop systemd-journal-gatewayd.socket
fi
rm -rf "/run/systemd-journal-gatewayd.sock";
fi
# Enable and start systemd-journal-gatewayd
if [ "$(systemctl is-active systemd-journal-gatewayd.socket)" = 'inactive' ]; then
info "Enable systemd-journal-gatewayd"
systemctl enable systemd-journal-gatewayd.socket> /dev/null 2>&1;
systemctl start systemd-journal-gatewayd.socket
fi
# Start nfs-utils.service for nfs mounts
if [ "$(systemctl is-active nfs-utils.service)" = 'inactive' ]; then
info "Start nfs-utils.service"
systemctl start nfs-utils.service
fi
# Restart Docker service # Restart Docker service
info "Restarting docker service" info "Restarting docker service"
systemctl restart "$SERVICE_DOCKER" systemctl restart "${SERVICE_DOCKER}"
# Check network connection # Check network connection
while ! ping -c 1 -W 1 ${URL_VERSION_HOST}; do while ! curl -q ${URL_CHECK_ONLINE} >/dev/null 2>&1 ; do
info "Waiting for ${URL_VERSION_HOST} - network interface might be down..." info "Waiting for ${URL_CHECK_ONLINE} - network interface might be down..."
sleep 2 sleep 2
done done
case $ARCH in # Get primary network interface
PRIMARY_INTERFACE=$(ip route | awk '/^default/ { print $5; exit }')
IP_ADDRESS=$(ip -4 addr show dev "${PRIMARY_INTERFACE}" | awk '/inet / { sub("/.*", "", $2); print $2 }')
case ${ARCH} in
"i386" | "i686") "i386" | "i686")
MACHINE=${MACHINE:=qemux86} MACHINE=${MACHINE:=qemux86}
HASSIO_DOCKER="$DOCKER_REPO/i386-hassio-supervisor" HASSIO_DOCKER="${DOCKER_REPO}/i386-hassio-supervisor"
;; ;;
"x86_64") "x86_64")
MACHINE=${MACHINE:=qemux86-64} MACHINE=${MACHINE:=qemux86-64}
HASSIO_DOCKER="$DOCKER_REPO/amd64-hassio-supervisor" HASSIO_DOCKER="${DOCKER_REPO}/amd64-hassio-supervisor"
;; ;;
"arm" |"armv6l") "arm" |"armv6l")
if [ -z $MACHINE ]; then if [ -z "${MACHINE}" ]; then
db_input critical ha/machine-type | true db_input critical ha/machine-type || true
db_go || true db_go || true
db_get ha/machine-type || true db_get ha/machine-type || true
MACHINE="$RET" MACHINE="${RET}"
db_stop db_stop
fi fi
HASSIO_DOCKER="$DOCKER_REPO/armhf-hassio-supervisor" HASSIO_DOCKER="${DOCKER_REPO}/armhf-hassio-supervisor"
;; ;;
"armv7l") "armv7l")
if [ -z $MACHINE ]; then if [ -z "${MACHINE}" ]; then
db_input critical ha/machine-type | true db_input critical ha/machine-type || true
db_go || true db_go || true
db_get ha/machine-type || true db_get ha/machine-type || true
MACHINE="$RET" MACHINE="${RET}"
db_stop db_stop
fi fi
HASSIO_DOCKER="$DOCKER_REPO/armv7-hassio-supervisor" HASSIO_DOCKER="${DOCKER_REPO}/armv7-hassio-supervisor"
;; ;;
"aarch64") "aarch64")
if [ -z $MACHINE ]; then if [ -z "${MACHINE}" ]; then
db_input critical ha/machine-type | true db_input critical ha/machine-type || true
db_go || true db_go || true
db_get ha/machine-type || true db_get ha/machine-type || true
MACHINE="$RET" MACHINE="${RET}"
db_stop db_stop
fi fi
HASSIO_DOCKER="$DOCKER_REPO/aarch64-hassio-supervisor" HASSIO_DOCKER="${DOCKER_REPO}/aarch64-hassio-supervisor"
;; ;;
*) *)
error "$ARCH unknown!" error "${ARCH} unknown!"
;; ;;
esac esac
PREFIX=${PREFIX:-/usr} PREFIX=${PREFIX:-/usr}
SYSCONFDIR=${SYSCONFDIR:-/etc} SYSCONFDIR=${SYSCONFDIR:-/etc}
DATA_SHARE=${DATA_SHARE:-$PREFIX/share/hassio} DATA_SHARE=${DATA_SHARE:-$PREFIX/share/hassio}
CONFIG=$SYSCONFDIR/hassio.json CONFIG="${SYSCONFDIR}/hassio.json"
cat > "$CONFIG" <<- EOF cat > "${CONFIG}" <<- EOF
{ {
"supervisor": "${HASSIO_DOCKER}", "supervisor": "${HASSIO_DOCKER}",
"machine": "${MACHINE}", "machine": "${MACHINE}",
@ -90,10 +130,6 @@ cat > "$CONFIG" <<- EOF
} }
EOF EOF
# Pull Supervisor image
info "Install supervisor Docker container"
docker pull "$HASSIO_DOCKER:$HASSIO_VERSION" > /dev/null
docker tag "$HASSIO_DOCKER:$HASSIO_VERSION" "$HASSIO_DOCKER:latest" > /dev/null
# Install Supervisor # Install Supervisor
info "Install supervisor startup scripts" info "Install supervisor startup scripts"
@ -108,6 +144,7 @@ systemctl enable hassio-supervisor.service > /dev/null 2>&1;
# Install AppArmor # Install AppArmor
info "Install AppArmor scripts" info "Install AppArmor scripts"
mkdir -p "${DATA_SHARE}/apparmor"
curl -sL ${URL_APPARMOR_PROFILE} > "${DATA_SHARE}/apparmor/hassio-supervisor" curl -sL ${URL_APPARMOR_PROFILE} > "${DATA_SHARE}/apparmor/hassio-supervisor"
sed -i "s,%%HASSIO_CONFIG%%,${CONFIG},g" "${PREFIX}/sbin/hassio-apparmor" sed -i "s,%%HASSIO_CONFIG%%,${CONFIG},g" "${PREFIX}/sbin/hassio-apparmor"
sed -i -e "s,%%SERVICE_DOCKER%%,${SERVICE_DOCKER},g" \ sed -i -e "s,%%SERVICE_DOCKER%%,${SERVICE_DOCKER},g" \
@ -122,8 +159,34 @@ systemctl start hassio-apparmor.service
info "Start Home Assistant Supervised" info "Start Home Assistant Supervised"
systemctl start hassio-supervisor.service systemctl start hassio-supervisor.service
# Install HA CLI # Install HA CLI
info "Installing the 'ha' cli" info "Installing the 'ha' cli"
chmod a+x "${PREFIX}/bin/ha" chmod a+x "${PREFIX}/bin/ha"
# Switch to cgroup v1
if [ -f /etc/default/grub ]
then
if ! grep -q "systemd.unified_cgroup_hierarchy=false" /etc/default/grub; then
info "Switching to cgroup v1"
cp /etc/default/grub /etc/default/grub.bak
sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT="/&systemd.unified_cgroup_hierarchy=false /' /etc/default/grub
update-grub
touch /var/run/reboot-required
fi
elif [ -f /boot/firmware/cmdline.txt ]
then
if ! grep -q "systemd.unified_cgroup_hierarchy=false" /boot/firmware/cmdline.txt; then
info "Switching to cgroup v1"
sed -i.bak 's/$/ systemd.unified_cgroup_hierarchy=false/' /boot/firmware/cmdline.txt
touch /var/run/reboot-required
fi
else
warn "Could not find /etc/default/grub or /boot/firmware/cmdline.txt failed to switch to cgroup v1"
fi
info "Within a few minutes you will be able to reach Home Assistant at:"
info "http://homeassistant.local:8123 or using the IP address of your"
info "machine: http://${IP_ADDRESS}:8123"
if [ -f /var/run/reboot-required ]
then
warn "A reboot is required to apply changes to grub."
fi

18
homeassistant-supervised/DEBIAN/postrm Normal file → Executable file
View file

@ -4,7 +4,9 @@ function info { echo -e "\e[32m[info] $*\e[39m"; }
function warn { echo -e "\e[33m[warn] $*\e[39m"; } function warn { echo -e "\e[33m[warn] $*\e[39m"; }
function error { echo -e "\e[31m[error] $*\e[39m"; exit 1; } function error { echo -e "\e[31m[error] $*\e[39m"; exit 1; }
# Undo diversions # Undo diversions
function undo_divert () {
dpkg-divert --package homeassistant-supervised --remove --rename \ dpkg-divert --package homeassistant-supervised --remove --rename \
--divert /etc/NetworkManager/NetworkManager.conf.real /etc/NetworkManager/NetworkManager.conf --divert /etc/NetworkManager/NetworkManager.conf.real /etc/NetworkManager/NetworkManager.conf
@ -16,3 +18,19 @@ dpkg-divert --package homeassistant-supervised --remove --rename \
dpkg-divert --package homeassistant-supervised --remove --rename \ dpkg-divert --package homeassistant-supervised --remove --rename \
--divert /etc/network/interfaces.real /etc/network/interfaces --divert /etc/network/interfaces.real /etc/network/interfaces
}
function reset_debconf_selections () {
info "Resetting debconf selections"
echo PURGE | debconf-communicate homeassistant-supervised >/dev/null
}
case "$1" in
remove|abort-install|disappear)
info Undo divert on "$@"
undo_divert
reset_debconf_selections
info "Removal complete, due to the complexity of this installation method,"
info "you will need to manually remove the containers created by the supervisor"
;;
esac

View file

@ -10,6 +10,35 @@ warn "Home Assistant as a VM or run Home Assistant Core"
warn "via a Docker container." warn "via a Docker container."
warn "" warn ""
# Check if we are running on a supported OS
BYPASS_OS_CHECK=${BYPASS_OS_CHECK:-false}
supported_os=("Debian GNU/Linux 12 (bookworm)")
CURRENT_OS=$(lsb_release -d | awk -F"\t" '{print $2}')
os_supported=false
for os in "${supported_os[@]}"; do
if [[ $os == "$CURRENT_OS" ]]; then
os_supported=true
break
fi
done
if [[ $os_supported == false ]]; then
if [[ $BYPASS_OS_CHECK != "true" ]]; then
error "${CURRENT_OS} is not supported!"
fi
warn "Bypassing OS check..."
warn "${CURRENT_OS} is not supported!"
warn "Please DO NOT report issues regarding this OS!"
fi
# Check if we are running on a supported architecture
ARCH=$(uname -m)
if [[ ! "i386|i686|x86_64|arm|armv6l|armv7l|aarch64" == *"$ARCH"* ]]; then
error "${ARCH} is not supported!"
fi
# Check if Modem Manager is enabled # Check if Modem Manager is enabled
if systemctl is-enabled ModemManager.service &> /dev/null; then if systemctl is-enabled ModemManager.service &> /dev/null; then
warn "ModemManager service is enabled. This might cause issue when using serial devices." warn "ModemManager service is enabled. This might cause issue when using serial devices."
@ -22,6 +51,24 @@ if [[ "$(sysctl --values kernel.dmesg_restrict)" != "0" ]]; then
echo "kernel.dmesg_restrict=0" >> /etc/sysctl.conf echo "kernel.dmesg_restrict=0" >> /etc/sysctl.conf
fi fi
# If the hassio_supervisor service is running or exists, stop it
if [[ "$(systemctl is-active hassio-supervisor.service)" == "active" ]]; then
info "Stopping hassio_supervisor service"
systemctl stop hassio-supervisor.service
fi
# If the hassio_apparmor service is running or exists, stop it
if [[ "$(systemctl is-active hassio-apparmor.service)" == "active" ]]; then
info "Stopping hassio_apparmor service"
systemctl stop hassio-apparmor.service
fi
# Check for existing hassio_supervisor container and destroy it
if [[ "$(docker ps -aq -f name=hassio_supervisor)" ]]; then
# ensure the hassio_supervisor service is stopped
info "Removing existing hassio_supervisor container"
docker container rm --force hassio_supervisor > /dev/null
fi
dpkg-divert --package homeassistant-supervised --add --rename \ dpkg-divert --package homeassistant-supervised --add --rename \
--divert /etc/NetworkManager/NetworkManager.conf.real /etc/NetworkManager/NetworkManager.conf --divert /etc/NetworkManager/NetworkManager.conf.real /etc/NetworkManager/NetworkManager.conf
@ -34,3 +81,6 @@ dpkg-divert --package homeassistant-supervised --add --rename \
dpkg-divert --package homeassistant-supervised --add --rename \ dpkg-divert --package homeassistant-supervised --add --rename \
--divert /etc/network/interfaces.real /etc/network/interfaces --divert /etc/network/interfaces.real /etc/network/interfaces
dpkg-divert --package homeassistant-supervised --add --rename \
--divert /etc/systemd/resolved.conf.real /etc/systemd/resolved.conf

View file

@ -1,4 +1,4 @@
Template: ha/machine-type Template: ha/machine-type
Type: Select Type: Select
Choices: generic-x86-64, odroid-c2, odroid-n2, odroid-xu, qemuarm, qemuarm-64, qemux86, qemux86-64, raspberrypi, raspberrypi2, raspberrypi3, raspberrypi4, raspberrypi3-64, raspberrypi4-64, tinker, khadas-vim3 Choices: generic-x86-64, odroid-c2, odroid-c4, odroid-n2, odroid-xu, qemuarm, qemuarm-64, qemux86, qemux86-64, raspberrypi, raspberrypi2, raspberrypi3, raspberrypi4, raspberrypi3-64, raspberrypi4-64, raspberrypi5-64, tinker, khadas-vim3
Description: Select machine type Description: Select machine type

View file

@ -5,7 +5,18 @@ autoconnect-retries-default=0
rc-manager=file rc-manager=file
[keyfile] [keyfile]
unmanaged-devices=type:bridge;type:tun;type:veth unmanaged-devices=type:bridge;type:tun;driver:veth
[logging] [logging]
backend=journal backend=journal
[connection]
connection.mdns=2
connection.llmnr=2
[connectivity]
uri=http://checkonline.home-assistant.io/online.txt
interval=600
[device]
wifi.scan-rand-mac-address=no

View file

@ -1,13 +0,0 @@
[connection]
id=Supervisor default
uuid=f35ac84e-420b-4003-a6d9-9700e8a32e54
type=802-3-ethernet
llmnr=2
mdns=2
[ipv4]
method=auto
[ipv6]
addr-gen-mode=stable-privacy
method=auto

View file

@ -1,4 +1,9 @@
{ {
"log-driver": "journald", "log-driver": "journald",
"storage-driver": "overlay2" "storage-driver": "overlay2",
"ip6tables": true,
"experimental": true,
"log-opts": {
"tag": "{{.Name}}"
}
} }

View file

@ -0,0 +1,25 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details
[Resolve]
#DNS=
#FallbackDNS=1.1.1.1 8.8.8.8 1.0.0.1 8.8.4.4 2606:4700:4700::1111 2001:4860:4860::8888 2606:4700:4700::1001 2001:4860:4860::8844
#Domains=
DNSSEC=no
DNSOverTLS=no
#MulticastDNS=yes
#LLMNR=yes
#Cache=yes
DNSStubListener=no
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no

View file

@ -1,7 +1,12 @@
[Unit] [Unit]
Description=Hass.io supervisor Description=Hass.io supervisor
Requires=%%SERVICE_DOCKER%% Requires=docker.service dbus.service
After=%%SERVICE_DOCKER%% dbus.socket Wants=network-online.target hassio-apparmor.service time-sync.target systemd-journal-gatewayd.socket systemd-resolved.service
After=docker.service dbus.service network-online.target hassio-apparmor.service time-sync.target systemd-journal-gatewayd.socket systemd-resolved.service
StartLimitIntervalSec=60
StartLimitBurst=5
ConditionPathExists=/run/dbus/system_bus_socket
ConditionPathExists=/run/docker.sock
[Service] [Service]
Type=simple Type=simple

View file

@ -0,0 +1,3 @@
[Socket]
ListenStream=
ListenStream=/run/systemd-journal-gatewayd.sock

View file

@ -1,4 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2048,SC2086 # shellcheck disable=SC2048,SC2086
docker exec hassio_cli ha $* if [ "$1" != "__complete" ]; then
use_tty="-t"
else
use_tty=""
fi
docker exec ${use_tty} hassio_cli ha $*

View file

@ -8,20 +8,12 @@ CONFIG_FILE=%%HASSIO_CONFIG%%
DATA="$(jq --raw-output '.data // "/usr/share/hassio"' ${CONFIG_FILE})" DATA="$(jq --raw-output '.data // "/usr/share/hassio"' ${CONFIG_FILE})"
PROFILES_DIR="${DATA}/apparmor" PROFILES_DIR="${DATA}/apparmor"
CACHE_DIR="${PROFILES_DIR}/cache" CACHE_DIR="${PROFILES_DIR}/cache"
REMOVE_DIR="${PROFILES_DIR}/remove"
# Exists AppArmor
if ! command -v apparmor_parser > /dev/null 2>&1; then
echo "[Warning]: No apparmor_parser on host system!"
exit 0
fi
# Check folder structure # Check folder structure
mkdir -p "${PROFILES_DIR}" mkdir -p "${PROFILES_DIR}"
mkdir -p "${CACHE_DIR}" mkdir -p "${CACHE_DIR}"
mkdir -p "${REMOVE_DIR}"
# Load/Update exists/new profiles # Load existing profiles
for profile in "${PROFILES_DIR}"/*; do for profile in "${PROFILES_DIR}"/*; do
if [ ! -f "${profile}" ]; then if [ ! -f "${profile}" ]; then
continue continue
@ -32,18 +24,3 @@ for profile in "${PROFILES_DIR}"/*; do
echo "[Error]: Can't load profile ${profile}" echo "[Error]: Can't load profile ${profile}"
fi fi
done done
# Cleanup old profiles
for profile in "${REMOVE_DIR}"/*; do
if [ ! -f "${profile}" ]; then
continue
fi
# Unload Profile
if apparmor_parser -R -W -L "${CACHE_DIR}" "${profile}"; then
if rm -f "${profile}"; then
continue
fi
fi
echo "[Error]: Can't remove profile ${profile}"
done

View file

@ -1,37 +1,113 @@
#!/usr/bin/env bash #!/bin/sh
# shellcheck disable=SC1091
# ==============================================================================
# Supervisor Docker container
# ==============================================================================
set -e set -e
# Load configs # Load configs
CONFIG_FILE=%%HASSIO_CONFIG%% CONFIG_FILE=%%HASSIO_CONFIG%%
SUPERVISOR="$(jq --raw-output '.supervisor' ${CONFIG_FILE})"
MACHINE="$(jq --raw-output '.machine' ${CONFIG_FILE})"
DATA="$(jq --raw-output '.data // "/usr/share/hassio"' ${CONFIG_FILE})"
# Init supervisor # Init supervisor
HASSIO_DATA=${DATA} SUPERVISOR_DATA="$(jq --raw-output '.data // "/usr/share/hassio"' ${CONFIG_FILE})"
HASSIO_IMAGE_ID=$(docker inspect --format='{{.Id}}' "${SUPERVISOR}") SUPERVISOR_STARTUP_MARKER="/run/supervisor/startup-marker"
HASSIO_CONTAINER_ID=$(docker inspect --format='{{.Image}}' hassio_supervisor || echo "") SUPERVISOR_STARTSCRIPT_VERSION="${SUPERVISOR_DATA}/supervisor-version"
SUPERVISOR_MACHINE="$(jq --raw-output '.machine' ${CONFIG_FILE})"
SUPERVISOR_IMAGE="$(jq --raw-output '.supervisor' ${CONFIG_FILE})"
runSupervisor() { SUPERVISOR_IMAGE_ID=$(docker images --no-trunc --filter "reference=${SUPERVISOR_IMAGE}:latest" --format "{{.ID}}" || echo "")
docker rm --force hassio_supervisor || true SUPERVISOR_CONTAINER_ID=$(docker inspect --format='{{.Image}}' hassio_supervisor || echo "")
# Check if previous run left the startup-marker in place. If so, we assume the
# Container image or container is somehow corrupted.
# Delete the container, delete the image, pull a fresh one
if [ -f "${SUPERVISOR_STARTUP_MARKER}" ]; then
echo "[WARNING] Supervisor container did not remove the startup marker file. Assuming container image or container corruption."
docker container rm --force hassio_supervisor || true
SUPERVISOR_CONTAINER_ID=""
# Make sure we delete all supervisor images
SUPERVISOR_IMAGE_IDS=$(docker images --no-trunc --filter "reference=${SUPERVISOR_IMAGE}" --format "{{.ID}}" | uniq || echo "")
docker image rm --force "${SUPERVISOR_IMAGE_IDS}" || true
SUPERVISOR_IMAGE_ID=""
fi
# If Supervisor image is missing, pull it
mkdir -p "$(dirname ${SUPERVISOR_STARTUP_MARKER})"
touch ${SUPERVISOR_STARTUP_MARKER}
if [ -z "${SUPERVISOR_IMAGE_ID}" ]; then
# Get the latest from update information
# Using updater information instead of config. If the config version is
# broken, this creates a way back (e.g., bad release).
SUPERVISOR_VERSION=$(jq -r '.supervisor // "stable"' "${SUPERVISOR_DATA}/updater.json" || echo "stable")
# Get version from stable channel in case we have no local version
# information.
if [ "${SUPERVISOR_VERSION}" = "stable" ]; then
SUPERVISOR_VERSION="$(curl -s --location https://version.home-assistant.io/stable.json | jq -e -r '.supervisor')"
fi
echo "[WARNING] Supervisor image missing, downloading a fresh one: ${SUPERVISOR_VERSION}"
# Pull in the Supervisor
if docker pull "${SUPERVISOR_IMAGE}:${SUPERVISOR_VERSION}"; then
# Tag as latest
docker tag "${SUPERVISOR_IMAGE}:${SUPERVISOR_VERSION}" "${SUPERVISOR_IMAGE}:latest"
else
# Pull failed, updater info might be corrupted or the release might have
# been removed from the container registry, delete the updater info
# to start from scratch on next try.
echo "[ERROR] Supervisor downloading failed."
rm -f "${SUPERVISOR_DATA}/updater.json"
exit 1
fi
SUPERVISOR_IMAGE_ID=$(docker inspect --format='{{.Id}}' "${SUPERVISOR_IMAGE}" || echo "")
fi
if [ -n "${SUPERVISOR_CONTAINER_ID}" ]; then
# Image changed, remove previous container
if [ "${SUPERVISOR_IMAGE_ID}" != "${SUPERVISOR_CONTAINER_ID}" ]; then
echo "[INFO] Supervisor image has been updated, destroying previous container..."
docker container rm --force hassio_supervisor || true
SUPERVISOR_CONTAINER_ID=""
fi
# Start script changed, remove previous container
# shellcheck disable=SC3013
if [ ! -f "${SUPERVISOR_STARTSCRIPT_VERSION}" ] || [ "${SUPERVISOR_STARTSCRIPT_VERSION}" -nt "$0" ] || [ "${SUPERVISOR_STARTSCRIPT_VERSION}" -ot "$0" ]; then
echo "[INFO] Supervisor start script has changed, destroying previous container..."
docker container rm --force hassio_supervisor || true
SUPERVISOR_CONTAINER_ID=""
fi
fi
# If Supervisor container is missing, create it
if [ -z "${SUPERVISOR_CONTAINER_ID}" ]; then
echo "[INFO] Creating a new Supervisor container..."
# shellcheck disable=SC2086 # shellcheck disable=SC2086
docker run --name hassio_supervisor \ docker container create \
--privileged \ --name hassio_supervisor \
--security-opt apparmor=hassio-supervisor \ --privileged --security-opt apparmor="hassio-supervisor" \
--security-opt seccomp=unconfined \
-v /run/docker.sock:/run/docker.sock:rw \ -v /run/docker.sock:/run/docker.sock:rw \
-v /run/containerd/containerd.sock:/run/containerd/containerd.sock:rw \
-v /run/systemd-journal-gatewayd.sock:/run/systemd-journal-gatewayd.sock:rw \
-v /run/dbus:/run/dbus:ro \ -v /run/dbus:/run/dbus:ro \
-v /run/supervisor:/run/os:rw \
-v /run/udev:/run/udev:ro \ -v /run/udev:/run/udev:ro \
-v /etc/machine-id:/etc/machine-id:ro \ -v /etc/machine-id:/etc/machine-id:ro \
-v "${HASSIO_DATA}":/data:rw \ -v ${SUPERVISOR_DATA}:/data:rw,slave \
-e SUPERVISOR_SHARE="${HASSIO_DATA}" \ -e SUPERVISOR_SHARE=${SUPERVISOR_DATA} \
-e SUPERVISOR_NAME=hassio_supervisor \ -e SUPERVISOR_NAME=hassio_supervisor \
-e SUPERVISOR_MACHINE="${MACHINE}" \ -e SUPERVISOR_MACHINE=${SUPERVISOR_MACHINE} \
"${SUPERVISOR}" "${SUPERVISOR_IMAGE}:latest"
}
# Store the timestamp of this script. If the script changed, let's
# recreate the container automatically.
touch --reference="$0" "${SUPERVISOR_STARTSCRIPT_VERSION}"
fi
# Run supervisor # Run supervisor
mkdir -p "${HASSIO_DATA}" mkdir -p ${SUPERVISOR_DATA}
([ "${HASSIO_IMAGE_ID}" = "${HASSIO_CONTAINER_ID}" ] && docker start --attach hassio_supervisor) || runSupervisor echo "[INFO] Starting the Supervisor..."
docker container start hassio_supervisor
exec docker container wait hassio_supervisor