Skip to content

Feature/template credentials #6

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,25 @@ MDM_PORT=8082

# Change this to change the tag assigned to the built docker mdm image
MDM_TAG=2022.2

# Database settings
MDM_DB_HOST=postgres
MDM_DB_PORT=5432
DB_PASSWORD=postgresisawesome

# Database settings for mauro user
MDM_DB_USER_NAME=maurodatamapperuser
MDM_DB_USER_PASSWORD=pleaseChangeMe2022!

# Email configuration
MDM_EMAIL_USERNAME=''
MDM_EMAIL_PASSWORD=''
MDM_EMAIL_HOST=''
MDM_EMAIL_PORT=''

# Grails configuration
MDM_GRAILS_CORS_ALLOWEDORIGINS=''

# MDM configuration
MDM_AUTHORITY_NAME='Mauro Data Mapper'
MDM_AUTHORITY_URL='http://localhost'
23 changes: 22 additions & 1 deletion .env.cd
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,25 @@ MDM_PORT=9000
MDM_TAG=continuous-development

# Change this to force a pull and rebuild of the codebase
CACHE_BURST=1
CACHE_BURST=1

# Database settings
MDM_DB_HOST=postgres
MDM_DB_PORT=5432
DB_PASSWORD=postgresisawesome

MDM_DB_USER_NAME=maurodatamapperuser
MDM_DB_USER_PASSWORD=pleaseChangeMe2022!

# Email configuration
MDM_EMAIL_USERNAME=''
MDM_EMAIL_PASSWORD=''
MDM_EMAIL_HOST=''
MDM_EMAIL_PORT=''

# Grails configuration
MDM_GRAILS_CORS_ALLOWEDORIGINS=''

# MDM configuration
MDM_AUTHORITY_NAME='Mauro Data Mapper'
MDM_AUTHORITY_URL='http://localhost'
21 changes: 18 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ services:
build: ./postgres
shm_size: 512mb
environment:
POSTGRES_PASSWORD: postgresisawesome
POSTGRES_PASSWORD: ${DB_PASSWORD}
DATABASE_HOST: ${MDM_DB_HOST}
DATABASE_PORT: ${MDM_DB_PORT}
MDM_DB_USER_NAME: ${MDM_DB_USER_NAME}
MDM_DB_USER_PASSWORD: ${MDM_DB_USER_PASSWORD}
volumes:
- postgres12:/var/lib/postgresql/data
restart: on-failure
Expand All @@ -20,8 +24,19 @@ services:
MDM_UI_THEME_NAME: "default"
CACHE_BURST: "${CACHE_BURST}"
environment:
PGPASSWORD: postgresisawesome
runtime.config.path: /usr/local/tomcat/conf/runtime.yml
PGPASSWORD: ${DB_PASSWORD}
DATABASE_HOST: ${MDM_DB_HOST}
DATABASE_PORT: ${MDM_DB_PORT}
DATABASE_USERNAME: ${MDM_DB_USER_NAME}
DATABSE_PASSWORD: ${MDM_DB_USER_PASSWORD}
MDM_EMAIL_USERNAME: ${MDM_EMAIL_USERNAME}
MDM_EMAIL_PASSWORD: ${MDM_EMAIL_PASSWORD}
MDM_EMAIL_HOST: ${MDM_EMAIL_HOST}
MDM_EMAIL_PORT: ${MDM_EMAIL_PORT}
MDM_GRAILS_CORS_ALLOWEDORIGINS: ${MDM_GRAILS_CORS_ALLOWEDORIGINS}
MDM_AUTHORITY_NAME: ${MDM_AUTHORITY_NAME}
MDM_AUTHORITY_URL: ${MDM_AUTHORITY_URL}
ports:
- "${MDM_PORT}:8080"
depends_on:
Expand All @@ -38,4 +53,4 @@ volumes:
postgres12:
driver: local
lucene_index:
driver: local
driver: local
25 changes: 13 additions & 12 deletions mauro-data-mapper/config/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
# Database connection details
---
database:
host: postgres
port: 5432
host: ${DATABASE_HOST}
port: ${DATABASE_PORT}
name: maurodatamapper
dataSource:
username: maurodatamapperuser
password: jF80LQyP4BbH
username: ${DATABASE_USERNAME}
password: ${DATABASE_PASSWORD}
---
# MDM configuration properties
---
maurodatamapper:
authority:
name: 'Mauro Data Mapper'
url: http://localhost
name: ${MDM_AUTHORITY_NAME}
url: ${MDM_AUTHORITY_URL}
---
# Standard Email configuration
---
simplejavamail:
smtp:
username: ''
password: ''
host: ''
port: ''
username: ${MDM_EMAIL_USERNAME}
password: ${MDM_EMAIL_PASSWORD}
host: ${MDM_EMAIL_HOST}
port: ${MDM_EMAIL_PORT}
transportstrategy: SMTP_TLS
---
# mdm-plugin-email-proxy Configuration
Expand All @@ -39,7 +39,8 @@ grails:
cors:
enabled: true
# The following are the defaults
# allowedOrigins: [] # Cannot use allowedOrigins with *, they have to be clearly stated origins
# Cannot use allowedOrigins with *, they have to be clearly stated origins
allowedOrigins: ['${MDM_GRAILS_CORS_ALLOWEDORIGINS}']
allowedOriginPatterns: [ '*' ]
allowedMethods: [ 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'HEAD' ]
allowedHeaders: [ 'origin', 'content-type', 'accept', 'authorization', 'pragma', 'cache-control' ]
Expand All @@ -52,4 +53,4 @@ hibernate:
search:
backend:
directory:
root: '/lucene'
root: '/lucene'
7 changes: 1 addition & 6 deletions postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
FROM postgres:12.0-alpine
COPY fixtures /docker-entrypoint-initdb.d

ENV POSTGRES_PASSWORD=postgresisawesome \
DATABASE_HOST=postgres \
DATABASE_PORT=5432 \
DATABASE_NAME=maurodatamapper \
DATABASE_USERNAME=maurodatamapperuser \
DATABASE_PASSWORD=jF80LQyP4BbH
ENV DATABASE_NAME=maurodatamapper

COPY ./bin /usr/local/bin
RUN chmod +x /usr/local/bin/*
4 changes: 2 additions & 2 deletions postgres/fixtures/1_init-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
set -e

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER $DATABASE_USERNAME with SUPERUSER PASSWORD '$DATABASE_PASSWORD';
CREATE DATABASE ${DATABASE_NAME} OWNER $DATABASE_USERNAME;
CREATE USER $MDM_DB_USER_NAME with SUPERUSER PASSWORD '$MDM_DB_USER_PASSWORD';
CREATE DATABASE ${DATABASE_NAME} OWNER $MDM_DB_USER_NAME;
EOSQL