Open petrm opened 2 years ago
I ran into the same issue. It's a potential security issue but also an inconvenience because the yaml files can't be edited by anyone but root. I am using the docker container with a bind mount and would like to make this bind mount available via NFS, so I can edit the files from any computer in my network with a nicer editor.
Seems that I've managed to implement a quick fix to make it work:
environment:
- 'HOME=/config'
- 'PLATFORMIO_GLOBALLIB_DIR=/config/.piolibs'
The drawback is that platformio will install required dependencies on compile time.
The problem
The official ESPHome docker image does not allow setting user/group to run the application with. While it is possible to pass to docker username and group, some of the functionality is then broken. The web interface functions, it is possible to edit and save files, but impossible to compile. The compilation fails, because platformio is using for cache /root, which is owned by root and therefore not writable by the user passed to docker. An simple fix would be to use a different folder than /root for the temporary files, for example by setting $HOME to this folder in the docker image or as an ugly workaround chmod /root to RW for all.
Which version of ESPHome has the issue?
2021.11.0
What type of installation are you using?
Docker
Which version of Home Assistant has the issue?
No response
What platform are you using?
ESP32
Board
N/A
Component causing the issue
Docker image
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response