Announcement

Collapse
No announcement yet.

Launching Mirth from external launcher

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Launching Mirth from external launcher

    I'm wondering if there is an api call that can actually launch Mirth Connect (and log in) if the server IP and credentials are passed in.

    I was thinking I might could build something in a .net application that could store all of the Mirth instances (IPs) and the credentials for each so that with a push of a button, it could launch and log into all of them.

    I have 9 instances that I log into each morning and that would be a nice feature.

    Any ideas if this is possible?

  • #2
    Can someone shed some light on whether there are any mirth connect administrator launcher command line switches? Is there an argument that I can pass to the launcher, say in a batch or bash script while firing up the java command?
    say... ./launcer.exe -opensite 1 ???

    Comment


    • #3
      Code:
      ./launcher --help
      INFO  2020-02-13 13:52:59,577 [main] com.mirth.connect.client.launcher.MirthClientLauncher: Arguments: [--help]
      usage: launch
       -a,--address <arg>            The address to connect to Mirth Connect
                                     with.
       -d,--allow-incorrect-digest   Allows JARs that fail digest verification.
                                     This should only be used for
                                     development/testing purposes.
       -h,--help                     Prints this help message.
       -j,--java-console             If specified, the Administrator will be
                                     launched with a Java console dialog.
       -k,--allow-self-signed        Allows JARs signed with self-signed
                                     certificates to be verified. This should
                                     only be used for development/testing
                                     purposes.
       -m,--max-heap-size <arg>      The client-side max heap size to use when
                                     launching the Administrator.
       -o,--stay-open                If specified, the launcher will stay open
                                     after launching the Administrator.
       -v,--use-same-jvm             If specified, the Administrator will be
                                     launched using the same JVM as the
                                     launcher. Useful when you don't have access
                                     to a launcher script.
      Not sure why this isn't listed in the help above, but you can pass the path to a .jnlp file as an argument and it will import as a new connection and immediately start connecting.

      Comment


      • #4
        THAT WORKS GREAT!!!
        It's good to know that you can shell script the launcher like that!
        The only improvement is if we could pass it the user/pass from the command line.

        Comment


        • #5
          This is great but there doesn't seem to be a way to pass any credentials. I'd like to be able to launch it and log in automatically.

          Comment


          • #6
            The client itself can accept a username and password as arguments.

            If you launch your jnlp with webstart (the old way, pre-launcher) you can add your credentials to the jnlp file. I couldn't get it to work with the launcher, and it's not very secure since the credentials will be stored in plain text. Also javaws is no longer supported by oracle, but you might have luck with https://openwebstart.com/. I haven't tried it yet.

            If you edit the jnlp file, near the bottom you'll see an "application-desc" section that contains some arguments. The first is the hostname and the second is the version number. I have no idea why this needs to be passed as an argument, and I don't know what happens if you pass the wrong version. You can add a 3rd argument for the username and a 4th for the password. Then just run the following and you'll be automatically logged in.
            Code:
            javaws webstart.jnlp
            Alternatively, I also got it to start by invoking java directly. You will need to make sure that you have all of the correct jar files mentioned in the jnlp file already, because this will skip downloading them from the server and verifying the signatures. I ran this from the 3.5.1 folder under the launcher's cache folder (you may have different versions cached.)
            Code:
            java -cp $(find -name *.jar|paste -sd:) com.mirth.connect.client.ui.Mirth https://mirthserver:8443 3.5.1 myusername mypassword
            This was from a Linux bash shell. You'll need to modify for Windows. It might work without modification on Mac, but I don't have one to test on. Basically, you just need to add all those jar files to the classpath somehow. It may be easier to move them all into a single folder.

            Comment


            • #7
              Thanks. Figured out the credentials in the jnlp file. That is slick, except I have to that already have a 3rd and 4th parameter for something else. If I put the credentials after those (5th and 6th), login fails.

              I was hoping there was a way to launch it and have the files download (like the first time you log into an instance) and also log in automatically. Not sure if there is a way to do that.

              Comment


              • #8
                You should be able to put username and password in 3 and 4, and bump the ssl flag and protocols back to 5 and 6.

                Comment

                Working...
                X