fossasia / eventyay-tickets

https://tickets-dev.eventyay.com
Apache License 2.0
1.51k stars 37 forks source link

Add TLS/mTLS settings for postgreSQL and Redis #47

Closed Shivangi-ch closed 4 months ago

Shivangi-ch commented 4 months ago

This PR fixes: #28

Current behavior:- With the current settings we can use PostgreSQL as database and Redis as cache, we only have to specify it in the configurations. However, the current settings.py does not specify any TLS/mTLS options for DB and cache.

New Behavior:- So to support TLS connections with the database and cache I have added new options only for postgresql database and redis caches. I have added new keys such as sslmode, sslrootcert etc. These values should be set in the configurations before running the server if we need to run in TLS/mTLS mode.

Shivangi-ch commented 4 months ago

Hey @hongquan, I have taken care of the recommendations mentioned by you in PR #46 Also I have moved the TLS config building logic to a separate file tls_settings.py and imported it in the main settings.py

Could you please review the PR

Shivangi-ch commented 4 months ago

Please rename _tlssettings.py to _settingshelpers.py. Later on, we can move some other code to it.

@hongquan I have renamed the file as suggested.

Please format your code with Ruff. Only format your new file. Don't touch other files (this must be done in a dedicated PR somedays in the future).

and formatted the new file using ruff.

mariobehling commented 2 months ago

Due to challenges with the previous branch merges, it would be easiest if you could make this PR again against the current development branch. Appreciate your effort!