RFC: Add-on configs
Context
Every Add-on have a differen aproach to solve the issue if people need to be able to edit files. All the approach have the same issue, that the data are not part of the snapshot/restore/cleanup. It make also that is part feel as foreign body.
Decision
We add a new config helper they can be requested by Add-on. /config will be show internal inside Add-on and for the user they will have a new /config/**add-on** folder structure for edit files. /data stay internal while /config can be access from outside. The old /config will be expose as /core and need mapped with core flag if you want have all add-on config, the flag is data.
For the first 2 month, we make an fallback to avoid breaking or missing folders for a soft migration.
Is /config shared between Home Assistant and add-ons?
I think we should avoid renaming the current /config to /core. While it makes more sense, it does impact all documentation and can be breaking for automations or things people do with hardcoded paths (e.g. running shell command, using ssh keypair and whatever else they think of).
As a counter-proposal, the /addons folder has been misunderstood in general quite a bit. I often have had question about that folder (e.g, "What is it for?", "I've installed this add-on and nothing shows up there"). So, maybe use /addons/**add-on** as the public data configuration folder instead and move the local (custom) add-ons folder to /custom_addons (which matches the expectations with the custom integrations method).
Let's avoid making breaking changes. We can add an /addons_config ?
The repurposing of /addon should not be a breaking one.
while be very important to be abel to edit/manipulate the addons config file, like core file.
for debuging/troubleshooting, fixing problem, configuring some custom part that are not for the moment managed by the addon ui config part...
For exemple nginx proxy manager does not provide for the moment a way to reset lost password... if the database are sqlite (the default) you need to access with sqlite3 cli to modify the database to reset the password...
on haos for the moment there no simple solution available to do that...
on haos the solution for the moment is to use ssh & terminal addons to dive into the nginx proxy manager container with docker exec... add sqlite package, and modify the file with sqlite cmd...
map config attribut permit to map "addons" (that map to /mnt/data/supervisor/addons/local), but is not an access to the addons configuration directory (/mnt/data/supervisor/addons/data) where this type of file are (like the database.sqlite of nginx proxy manager addons).
Propositions :
-
i thinks a news value like
addons_config(need to be different thanaddonsto avoid bracking thing) to map/addons_configto '/mnt/data/supervisor/addons/data' in addons container that set to true. -
or new subdirectory in
/configlikeaddonscan be more simple. and can be hardlink (from /mnt/data/supervisor/addons/data to /mnt/data/supervisor/homeassitant/addons) for the moment. in that way while be abel to access to addons config file with the existing addons (file editor/samba/vstudio/ssh&webterm...).
This has been implemented by #4650 🎉