getredash/redash

Environment variable configuration should take precedence over database settings

Open

#5,626 建立於 2021年10月18日

在 GitHub 查看
 (0 留言) (3 反應) (0 負責人)Python (24,845 star) (4,236 fork)batch import
Backendhelp wanted

描述

Right now, if settings are introduced that are configurable by environment variables, they will be ignored in favour of configured database settings.

This is because the organization model prefers to get its settings from the database (short circuit): https://github.com/getredash/redash/blob/143d22db04a9058966b8c7d678b06f228b937326/redash/models/organizations.py#L69

and there is no mechanism to synchronize database settings with detected environment variables, even if they are initially loaded via https://github.com/getredash/redash/blob/master/redash/settings/organization.py .

I would like to suggest that environment variables, when present, should be preferred over prior DB stored settings, as they should always be assumed to have been most recently provided as the desired configuration versus anything that may have been previously configured and persisted.

This matches the typical behaviour of many other software, where command-line arguments or envars always take precedence over local files.

貢獻者指南