homeassistant: Enable app properly on first install

- When app is installed for the first time, the drop-in configuration file
/etc/apache2/includes/home-assistant-freedombox.conf is not created properly.
This is because app.enable() is not being called and not all components are
enabled (including the drop-in configuration component). Fix this by calling
app.enable() in setup().

- Ensure that apache2 is restarted after the homeassistant app is update to
version 2 from version 1.

Tests:

- On a fresh VM, without the patch, installing HA does not result in working HA
UI. With patch, on a fresh VM. It works.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2026-10-10 07:46:20 -04:00
1 parent 5e72f3944a
commit e0685bbc44
1 file changed
+5 -1
+5 -1
View File
@@ -97,7 +97,8 @@ class HomeAssistnatApp(app_module.App):
self.add(firewall_local_protection)
webserver = WebserverRoot('webserverroot-homeassistant',
'home-assistant-freedombox')
'home-assistant-freedombox',
last_updated_version=2)
self.add(webserver)
image_name = 'registry.freedombox.org/' \
@@ -138,3 +139,6 @@ class HomeAssistnatApp(app_module.App):
super().setup(old_version)
privileged.setup(old_version)
if not old_version:
self.enable()