SomfyProtect2MQTT icon indicating copy to clipboard operation
SomfyProtect2MQTT copied to clipboard

docker config.yaml Permission

Open kahatie opened this issue 1 year ago • 2 comments

--- FR --- Bonjour et tout d'abord un grand merci pour ce projet

Sous docker j'ai rencontre un problème de droit avec le fichier de config.yaml

vue que j'ai galérai 2h je vous pose la la solution :

Après avoir installer le container il faut créé / édit config.yaml pour ce connecter au container en root : docker exec -it --workdir / --user root <docker id/name> sh puis une fois logger on peut copier le fichier de config d'exemple: copy /app/config/config.yaml /config/config.yaml

puis edité le

enfin fixer les droits en lecture seule pour appuser: chown appuser /config/config.yaml chmod 400 /config/config.yaml

--- EN ---

After installing the container you must create / edit config.yaml to connect to the container as root: docker exec -it --workdir / --user root <docker id/name> sh then once logged we can copy the example config file: copy /app/config/config.yaml /config/config.yaml

then edited it

finally set read-only rights to appuser : chown appuser /config/config.yaml chmod 400 /config/config.yaml

kahatie avatar Feb 22 '24 00:02 kahatie

Hello,

Can this permission can be fixed directly in the docker-compose ?

Minims avatar Feb 24 '24 20:02 Minims

HI in the docker-compose i think no maybe we can do it in the dockerfile? if you can add it to the entrypoint, a script which checks if config.yaml exists otherwise copy the example file and applies the permissions. then do continus do normal entrypoint... i m not no sure you can do it with appuser may it need be root for do it

kahatie avatar Feb 25 '24 09:02 kahatie