brian7704 / OpenTAKServer

Yet another open source TAK Server for ATAK, iTAK, and WinTAK
GNU General Public License v3.0
64 stars 8 forks source link

Support for environment variables #28

Open nerdalertdk opened 5 months ago

nerdalertdk commented 5 months ago

To continue #23

If you are gonna anything big with the config system, please consider support for ENV it even support a default value.

https://www.geeksforgeeks.org/python-os-getenv-method/

nerdalertdk commented 5 months ago

This would keeping our config file easy to maintain, only have the options we changed

# If HOSTNAME doesn't exist, presume local development and return localhost
print(os.environ.get('HOSTNAME', 'localhost')

https://medium.com/dopplerhq/using-environment-variables-in-python-for-app-configuration-and-secrets-50f01ea1fd3d