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

How to start a connect container with pre-configured channels? #9

Closed
bluepuma77 opened this issue Aug 19, 2020 · 6 comments
Closed
Labels

Comments

@bluepuma77
Copy link

nextgenhealthcare/connect works great so far, I have started the container with some open TCP-Ports, changed the password and deployed some channels to receive HL7v2 messages over MLLP.

docker run \
  --name hl7-connect \
  --link hl7-postgres:postgres\
  --restart=unless-stopped \
  -p 8080:8080 \
  -p 8443:8443 \
  -p 7000-7100:7000-7100 \
  --env DATABASE=postgres \
  --env DATABASE_URL=jdbc:postgresql://hl7-postgres:5432/db \
  --env DATABASE_MAX_CONNECTIONS=20 \
  --env DATABASE_USERNAME=db \
  --env DATABASE_PASSWORD=db \
  --env VMOPTIONS=-Xmx512m \
  -d nextgenhealthcare/connect

Now with everything stable, I would like to automate the full configuration and start of connect and the channels. What's the best practice to do this programatically when starting a new container?

  1. Change user/pass used to connect with the GUI
  2. Import channels from XML file
  3. Deploy and start the channels
@bluepuma77
Copy link
Author

It would be great to be able to set the NextGen Connect admin user/pass with Docker variables like the ones for database access

--env CONNECT_USERNAME=username
--env CONNECT_PASSWORD=secret

Can I just write user/pass into the database or is there a command line tool I can use?

@bluepuma77
Copy link
Author

After further research I found in the User Guide the instructions on page 460 to set the password to the default "admin".

UPDATE PERSON_PASSWORD SET PASSWORD = 'YzKZIAnbQ5m+3llggrZvNtf5fg69yX7pAplfYg0Dngn /fESH93OktQ==' WHERE PERSON_ID = ?;

Is there no method to set a new password from CLI?

sorinvc pushed a commit to t-system/connect-docker that referenced this issue Sep 10, 2020
…om feature/update-tests-to-use-different-pg-username-password to master

* commit '09842ddcb72b6416f0504cd4c38b92ba2382de42':
  Update tests to use different database username and password to ensure they test that the entrypoint script is fixed.
@cturczynskyj
Copy link
Collaborator

If the CLI is proving inadequate, you could try switching over to the rest API (https://:8443/api/). The rest API is guaranteed to support all functionality since that is what the Administrator UI uses to configure Connect servers.

@aristotelos
Copy link

@cturczynskyj I have the same wish as @bluepuma77:

  • Be able to volume-mount a set of channel XML files that get imported and deployed automatically during container startup if they do not yet exist (and overwritten if they already exist) (to avoid having to script this via scripting that waits for the container to be up, and then issuing web requests to the REST API)
  • Be able to set the admin username and password using environment variables injected in the container (for security reasons)

I am aware that the most stable way of getting this functionality is changing the mcserver executable so that it allows this parametrization on startup. What do you think, would that be an option?

@tonygermano
Copy link

@aristotelos I think it would be worth making the second request in the main repo, as it is not specific to docker and could be useful with other install methods.

I mentioned the problems with the first request on this issue #5

Since then, there has been some discussion in Slack, and probably the best way to achieve what you want is with a custom plugin that will activate after the mirth server has completed configuring the new database and started up. It can then acquire the channel definitions and import them automatically.

This is also not docker specific, but it works well with the docker container because the plugin loading mechanism allows you to have them installed on first run rather than installing them after the server is running and rebooting.

@aristotelos
Copy link

@tonygermano Thank you, created nextgenhealthcare/connect#6037.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants