diff --git a/CHANGELOG.md b/CHANGELOG.md index b7adfdb..7734d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,11 @@ Template: - Default version of Nextcloud is now 29. +## Fixes + +- Home Assistant config gets correctly generated with secrets + even if LDAP integration is not enabled. + # v0.2.10 ## New Features diff --git a/README.md b/README.md index 24b7872..8aa05d7 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,8 @@ Self Host Blocks takes care of common self-hosting needs: Great care is taken to make the proposed stack robust. This translates into a test suite comprised of automated NixOS VM tests -including playwright tests. +which includes playwright tests to verify some important workflow +like logging in. ### Services diff --git a/docs/contributing.md b/docs/contributing.md index d08fc19..33544da 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -46,7 +46,7 @@ then will run the test script. If the test includes playwright tests, you can see the playwright trace with: ```bash -$ nix run .#playwright -- show-trace path/to/trace.zip +$ nix run .#playwright -- show-trace $(nix eval .#checks.x86_64-linux.vm_grocy_basic --raw)/trace/0.zip ``` ## Upload test results to CI {#contributing-upload} diff --git a/modules/services/home-assistant.nix b/modules/services/home-assistant.nix index 457ba3b..99ad2ba 100644 --- a/modules/services/home-assistant.nix +++ b/modules/services/home-assistant.nix @@ -347,11 +347,11 @@ in mkdir -p ''$(dirname ${file}) && cp ${onboarding} ${file} fi '') - + (lib.optionalString cfg.ldap.enable (shblib.replaceSecrets { + + (shblib.replaceSecrets { userConfig = cfg.config; resultPath = "${config.services.home-assistant.configDir}/secrets.yaml"; generator = shblib.replaceSecretsGeneratorAdapter (lib.generators.toYAML {}); - })); + }); systemd.tmpfiles.rules = [ "f ${config.services.home-assistant.configDir}/automations.yaml 0755 hass hass" diff --git a/test/services/home-assistant.nix b/test/services/home-assistant.nix index ab31e3b..feb1dd6 100644 --- a/test/services/home-assistant.nix +++ b/test/services/home-assistant.nix @@ -65,7 +65,11 @@ let "expect(page.get_by_text('All set')).to_be_visible()" "page.get_by_role('button', name=re.compile('Finish')).click()" - "expect(page.get_by_text('Overview')).to_be_visible()" + "page.get_by_label(re.compile('Username')).fill('admin')" + "page.get_by_label(re.compile('Password')).fill('adminpassword')" + "page.get_by_role('button', name=re.compile('Log in')).click()" + + "expect(page).to_have_title(re.compile('Overview'))" ]; } ]; };