bastilimbach / docker-MagicMirror

Docker image for the Magic Mirror 2 project by Michael Teeuw.
https://hub.docker.com/r/bastilimbach/docker-magicmirror/
MIT License
185 stars 54 forks source link

Config with template variables #42

Closed Legion2 closed 4 years ago

Legion2 commented 4 years ago

Add the possibility to use environment variables in the config.js which are evaluated once when starting the docker container. This feature only applies to config.js.template and generate config.js when the container is started. Existing configurations should not be affected by this new feature (opt-in).

The environment variables are replaced with the linux envsubst tool, which uses Shell variable syntax ($name and ${name}) and the variables are given via the environment. envsubst only replaces the variables and does nothing extra such as bash substitution expressions or default values.

MichMich/MagicMirror#1947

bastilimbach commented 4 years ago

This is neat! Thank you for your contribution 🎉