dirkhh / adsb-feeder-image

Easy to use turn-key SD card image for a number of popular single board computers to run a complete ADS-B feeder
https://adsb.im/home
GNU General Public License v3.0
130 stars 14 forks source link

Redesign the handling of .env vs config.json #131

Closed dirkhh closed 8 months ago

dirkhh commented 8 months ago

Instead of trying to do all this implicitly with magic code and magic flag files, add four very simple single use functions to read and write either .env or config.json. Use those to set up config.json from a .env file if necessary.

With this in place, simplify and fix the backup and restore code.

Creating new backups, we no longer store the .env file since it is derived from the config.json. Restoring an old backup, we load the .env file and create a config.json file from it, the same way we would do it at app start.