nextgenhealthcare / connect-docker

Official Dockerfiles for Connect https://hub.docker.com/r/nextgenhealthcare/connect
Mozilla Public License 2.0
78 stars 51 forks source link

Setting _MP_DATABASE__READONLY_URL fails with malformed JDBC connection string #39

Open johnrash opened 1 year ago

johnrash commented 1 year ago

Setting the environment variable _MP_DATABASE__READONLY_URL results in a malformed JDBC connection string in mirth.properties as forward slashes are escaped when being parsed by entrypoint.sh

_MP_DATABASE__READONLY_URL=jdbc:postgresql://db.hostname.example.com:5432/mirthdb becomes database-readonly.url = jdbc:postgresql:\\/\\/db.hostname.example.com:5432\\/mirthdb

Removing the toothpicks from ${VALUE} in a custom image fixed the issue for me sed -i "s/^${ESCAPED_KEY}\s*=\s*.*\$/${ACTUAL_KEY} = ${VALUE//\//\\/}/" /opt/connect/conf/mirth.properties to sed -i "s/^${ESCAPED_KEY}\s*=\s*.*\$/${ACTUAL_KEY} = ${VALUE}/" /opt/connect/conf/mirth.properties