esl / MongoosePush

MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS.
Apache License 2.0
108 stars 24 forks source link

Fix config resolution #216

Closed pawlooss1 closed 6 months ago

pawlooss1 commented 6 months ago

This PR changes resolution of configuration environmental variables. Previously the resolver would iterate over all configuration keys and call Confex.fetch_env!(app, key) to resolve all values. The issue with it was that if some keys were already set by TOML resolver they would still be seen as {:system, type, var_name, default} which led to overriding TOML config with defaults. Also, it changes default values of PUSH_*_ENABLED to false to avoid implicit creation of an incorrect pool. At last it fixes a clash where after defining some service pools in TOML file, entries from prod.exs would be appended to them due to the behaviour of Config.Reader.merge/2. If someone defines pools in TOML file then no other pools should be created.