Mount /config inside addon?
Hey
Since I have many automations and configurations in yaml files, it would be great to edit them directly from claw. quick google search tells me:
Update config.yaml of addon
map:
- config:rw
and /config will be mounted as /config inside addon. BUT as I see /config already used by openclaw, right? and there is no way to mount by different name What you can suggest? Thanks
Hi @slayer !
Well this is true. It is possible to map but it is not possible to map with different name. This will cause the addon and OpenClaw directories to start storing in the config folder. Currently AddOn runs under addon_confilgs/somename_openclaw_assistant and the somename_openclaw_assistant is virtually mapped as /config in the image. So this may cause collisions once we replace the mapped path. When we switch that it hides some risks:
- file collisions,
- polluting HA config with add-on internals,
- breaking paths/scripts that assume current layout.
Or simply said, OpenClaw will stop working in it's virtual folder and produce all it's files, including memory, secrets, keys etc. inside the HA core /config folder. This could break already existing OpenClaw Addon installs and people may need to manually transfer their claw files or reconfigure from scratch if they enabled the configuration. It will act as a fresh install.
While it is possible to add it, I'm worried about people accidently breaking their bots by enabling this.
sure, I didn't consider the option to map HAs /config to inner /config and keep HA and OC files together.
Is it possible to use another directory (not /config) for OC config files? for example /openclaw_config and keep /config for HA files?
It is possible to put it in 1 level deeper folder, but this will cause any currently working install to fail. So we have to implement special transfer logic before the addon is initialized, in order to move all the files. Again it would be risky. At my end I did workaround of this by using the Samba Share addon. It's kinda hacky but I can control r/w rights, expose only the folders I want and map it only to the network interfaces I want. And I don't need to mount /config directly.
Hm, interesting
Do you mean to mount SMB volume inside OC addon?
@slayer
Well not really, because this requires rights which the addon level lacks, it needs SYS_ADMIN in order to mount SMB network paths. Instead of that I created smb.env file in secrets folder and stored the Samba Share credentials. Then I told OpenClaw to install smbclient and create a new skill capable of browsing the network path. Also skill checks smbclient availability (because will disappear after docker image rebuilds) and it will auto install it if it is missing.
Then using that skill openclaw can browse /config and the other exposed folders without having to map. I know it's workaround but I rarely need it access there, so it does the job.
wow, sounds like smelly approach, but can be good workaround thanks, will try
Yea, it is. But I already had Samba Share installed because I reach HA files directly on Windows, so I thought it would be easier and less painful to use it like that.
As I can see in HA docs, ha config folder has its own name to map to.
List of Home Assistant directory types to bind mount into your container. Possible values: homeassistant_config, addon_config, ssl, addons, backup, share, media, all_addon_configs, and data. Defaults to read-only, which you can change by adding the property read_only: false.
It should be possible without workarounds
I had OC, while running on Opus 4.6, creating a deploy routine. It included a python script executed in HA to deploy e.g. the packages for new "projects" from OC into HA. Since I was lacking knowledge and experience, I lost track of it and OC forgot (with lighter model). It may have been better to create a documented skill for that or even better implementing something like that in the corresponding OC integration. However, I am nowhere competent to do it.