Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving hard-coded webapi configs somewhere else #108

Open
juropo opened this issue Jun 11, 2024 · 1 comment · Fixed by #137
Open

Moving hard-coded webapi configs somewhere else #108

juropo opened this issue Jun 11, 2024 · 1 comment · Fixed by #137

Comments

@juropo
Copy link

juropo commented Jun 11, 2024

Currently, the webapi in DESDEO2 (and also the old webapi) has important networking settings hard coded, like the web address where the database is located.

The information needed to connect to the database is the biggest offender here, because the database usernames and passwords should never be uploaded to github.

I would like these things to be read from environment variables. That way it would be very easy to provide the necessary information when hosting webapi on a system like kubernetes. It is also possible to provide them as a part of a command line argument or bat/shell script when running webapi somewhere else. The code could still use some default values, like localhost etc. when then environment variables haven't been defined.

A config file of some kind would be another alternative, but not as good in my opinion, because those config files would need to be stored somewhere as well, so the problem of storing database usernames and passwords on the open internet would remain.

@juropo juropo linked a pull request Aug 15, 2024 that will close this issue
@juropo
Copy link
Author

juropo commented Aug 27, 2024

The webapi configs are now all in one place in desdeo/api/config.py, and I think all the other code is using those values as well. The default values in the config file can also be overridden with env variables, so I think this issue is mostly solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant