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

Feature/template credentials #6

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

alee-x
Copy link

@alee-x alee-x commented Aug 9, 2022

The current Dockerfiles for MDM and the Postgres database hardcode the database username and password(s) at build time. This means that if a user wants to make any changes to a deployment they have to rebuild both images, something that can be very time-consuming if using buildx (i.e. building on an Apple Silicon machine).

This is also a security risk -- I realise that the intention is that the person building and deploying MDM should enter their credentials in mauro-data-mapper/config/runtime.yml but, as I discovered with our deployment, there's nothing to make them do that. Hardcoding values in files also mean that the Postgres DB is easily accessed if the container file system is ever compromised.

This PR modifies build.yml to replace hardcoded credentials with templated environment variables instead. This means that the credentials are set by defining the corresponding env vars either in a .env file or in the docker-compose file.

It also allows the user to set the host address of the Postgres database -- meaning that users have the option to link the MDM deployment to an existing Postgres DB and are no longer tied into using the packaged one.

The PR also templates the maurodatamapper configuration and the simplejavamail variables, again allowing the user to change settings and redeploy the Compose without having to rebuild the entire container image.

The defaults for the templated environment variables have been added .env and .env.cd

I've verified that this is working and a-ok on my systems but please let me know if there's anything I've missed.
Thanks!
Alex

alee-x added 6 commits July 29, 2022 14:07
…authentication credentials enabling them to be set at runtime rather than prior to build.
…build file, including Grails and MDM-specific configurations
@CLAassistant
Copy link

CLAassistant commented Aug 9, 2022

CLA assistant check
All committers have signed the CLA.

@olliefreeman
Copy link
Contributor

I’m currently on holiday but we already coded in the ability to pass the username and password into the pg build at runtime due to another request, I will comment on this properly when I’m back next week

@olliefreeman olliefreeman self-requested a review August 9, 2022 12:47
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 this pull request may close these issues.

3 participants