-
Notifications
You must be signed in to change notification settings - Fork 174
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
ARA-server communication with mysql over ssl #157
Comments
Hey @smarcu92 and thanks for the issue. You're right, we should add a Would you like to try a patch that implements this change ? See: https://review.opendev.org/#/c/746735/ git clone https://github.com/ansible-community/ara
pushd ara
git fetch https://review.opendev.org/recordsansible/ara refs/changes/35/746735/4 && git checkout FETCH_HEAD
popd
pip install ./ara[server] Edit: updated patchset, there was an issue with the original patch. |
Hey @dmsimard, Thanks! |
Hey @dmsimard, Sorry for the wait.
I get the following error:
Let me know what I should try next. |
Hey @smarcu92 and thanks for testing it out. It looks like the variable is being parsed as a string instead of a dictionary. Something like: default:
# [...]
DATABASE_CONN_MAX_AGE: 60
DATABASE_ENGINE: django.db.backends.mysql
DATABASE_HOST: localhost
DATABASE_NAME: ara
DATABASE_OPTIONS:
ssl:
ca: /path/to/cert/BaltimoreCyberTrustRoot.crt.pem
DATABASE_PASSWORD: password
DATABASE_PORT: 3306
DATABASE_USER: ara
# [...] |
Hey @dmsimard, Using the settings.yaml worked.
Is there a way we could pass it as an env variable? |
Hey @smarcu92, I've looked at the dynaconf documentation and they mention that the following should work:
I couldn't get that to work locally with a similar string issue though. I did get the following to work, however:
It'd be a good idea to add that to our docs as an example. |
Hey @dmsimard, Thanks for the solution! It works perfectly! Any idea when this will be released? |
It'll be released in 1.5 but will merge in master soon so you can deploy from master until it's released. When docs are updated, they'll include: I don't know when 1.5 will be released yet but I'd like to tag a beta after fixing these issues: https://github.com/ansible-community/ara/milestone/1. Need to iterate a bit on the new CLI too. |
This is required for some use cases such as configuring SSL certificates with remote database backends. Related: #157 Change-Id: I3ae6deee753c9644a1a3e5b8eddbbcd86f9cd10b
What component is this about ?
ara-server
What is your ARA installation like ?
ara: 1.4.2 Running in a docker container hosted in Azure
ansible: 2.9.6
django.db.backends.mysql
Database: MariaDB in Azure
What is happening ?
I have ara-server setup to communicate with MariaDB. The settings used by ara to communicate with the db are declared using env variables.
Everything works fine, until I enable SSL on MariaDB, at which point ARA crashes. Telling me that I need to configure SSL.
Looking over the ARA documentation, I don't see a clear way of doing the SSL setup for ARA.
Looking over the Azure documentation on how to configure SSL connectivity between applications and MariaDB
https://docs.microsoft.com/en-us/azure/mariadb/howto-configure-ssl
I need to:
The problem is that there's no environment variable or field in the settings.yaml to load the certificate.
Also the Options filed needed for setting-up the SSL connection is missing from the settings.py in Ara.
/usr/local/lib/python3.7/site-packages/ara/server/settings.py
Original
To get this working I modified the file to include the Options field and everything works as expected.
I'm not ok with this solution... am I missing something? Can this be done using existing settings or variables? If not it would be great if the Options field would be included in the settings.yaml and retrievable via env variables.
Thanks!
The text was updated successfully, but these errors were encountered: