Repository navigation
feat: mount the Home Assistant /ssl directory read-only - #873
Merged
Merged
Conversation
The addon maps share, homeassistant_config and addon_config, but not the
standard Home Assistant `/ssl` directory. Certificates managed by addons such
as Let's Encrypt live there, so an MQTT TLS configuration pointing at them
fails at startup:
error: z2m: MQTT failed to connect, exiting...
(ENOENT: no such file or directory, open '/ssl/privkey.pem')
Copying the files into a mapped directory works but has to be redone on every
renewal, which defeats automated renewal; a symlink from the mapped config
directory is not followed.
Map `ssl` read-only, alongside the existing mappings. Read-only is sufficient:
the addon only needs to read the certificate and key, and the renewal is
performed by whichever addon manages them. Because the directory is mounted
rather than copied, renewals are picked up without further action.
Applied to both the stable and edge addons. The proxy addon is unchanged: it
does not connect to MQTT.
Closes zigbee2mqtt#835
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The reported issue covers two consumers of the Home Assistant `/ssl` directory: the MQTT `cert`/`key` options and the frontend `ssl_cert`/`ssl_key` options. The mount already serves both; say so, rather than documenting only the MQTT case. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #835.
The addon maps
share,homeassistant_configandaddon_config, but not the standard Home Assistant/ssldirectory. Certificates managed by addons such as Let's Encrypt live there, so an MQTT TLS configuration that points at them fails at startup:Copying the certificate and key into a mapped directory works, but has to be repeated on every renewal — which defeats the point of automated renewal. A symlink from the mapped config directory into
/sslis not followed.Change
Map
sslalongside the existing mappings, read-only:{ "type": "ssl", "read_only": true }Read-only is sufficient — the addon only needs to read the certificate and key, and renewal is performed by whichever addon manages them. Because the directory is mounted rather than copied, renewals are picked up with no further action.
Users can then reference the certificates directly:
Scope
zigbee2mqttandzigbee2mqtt-edge.zigbee2mqtt-proxyis unchanged — it does not connect to MQTT./addon_configmount which was recorded under## [Unreleased]in the changelog; happy to bump if you would prefer.DOCS.md.13 lines added, none removed. All three addon configs still parse as valid JSON and every mapped type is a valid Home Assistant addon folder.
🤖 Generated with Claude Code