Skip to content
Draft
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
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ RUN groupadd engine \
WORKDIR /opt/engine
COPY --chown=engine:engine --from=builder \
--exclude=cli-lib \
--exclude=client-lib \
--exclude=mirth-cli-launcher.jar \
--exclude=mccommand \
--exclude=manager-lib \
Expand Down Expand Up @@ -117,6 +118,7 @@ RUN addgroup -S engine \
WORKDIR /opt/engine
COPY --chown=engine:engine --from=builder \
--exclude=cli-lib \
--exclude=client-lib \
--exclude=mirth-cli-launcher.jar \
--exclude=mccommand \
--exclude=manager-lib \
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ tasks.register('build') {

tasks.register('dist') {
group = 'build'
description = 'Builds everything and creates the distribution extension zips in server/dist.'
dependsOn ':server:createExtensionZips'
description = 'Builds everything and creates the distribution extension and Swing Administrator zips in server/dist.'
dependsOn ':server:createExtensionZips', ':server:swingadminZip'
}

tasks.register('test') {
Expand Down
10 changes: 10 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,16 @@ def extensionZipTasks = zippedExtensions.collect { name ->
}
}

// The Swing Administrator is not part of Docker images or installers; admins
// unzip this into the OIE home to add it.
tasks.register('swingadminZip', Zip) {
description = 'Zips client-lib for admins to unzip into the OIE home to enable the Swing Administrator.'
archiveFileName = "swingadmin-${version}.zip"
destinationDirectory = file('dist')
from('setup') { include 'client-lib/**' }
dependsOn createSetup
}

tasks.register('createExtensionZips') {
group = 'build'
description = 'Creates the per-extension distribution zips in server/dist/extensions.'
Expand Down
47 changes: 38 additions & 9 deletions server/public_html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,27 @@ <h1>Service Available</h1>
<p>
The backend service is running.
</p>
<p>
Please point your preferred Administrator Launcher to:<br>
<span id="jnlp-text" class="jnlp-path-container"></span>
</p>
<p>
Don't have an Administrator Launcher yet? Learn about
<a href="https://docs.openintegrationengine.org/launchers/" target="_blank" rel="noopener noreferrer">available launcher options</a>.
<div id="launcher-info">
<p>
Please point your preferred Administrator Launcher to:<br>
<span id="jnlp-text" class="jnlp-path-container"></span>
</p>
<p>
Don't have an Administrator Launcher yet? Learn about
<a href="https://docs.openintegrationengine.org/launchers/" target="_blank" rel="noopener noreferrer">available launcher options</a>.
</p>
</div>
<p id="webadmin-link" hidden>
<a href="/oie-webadmin/" class="api-link">Open the Web Administrator</a>
</p>
<div id="install-info" hidden>
<p>
No administrator is installed on this server. To manage it, install the
<a href="https://openintegrationengine.org/web-administrator/" target="_blank" rel="noopener noreferrer">Web Administrator</a>
or the
<a href="https://docs.openintegrationengine.org/launchers/" target="_blank" rel="noopener noreferrer">Swing Administrator</a>.
</p>
</div>
<p>
You can also explore the Client API at the link below.
</p>
Expand All @@ -126,8 +139,24 @@ <h1>Service Available</h1>

<script>
document.addEventListener('DOMContentLoaded', function() {
const jnlpElement = document.getElementById('jnlp-text');
jnlpElement.textContent = `${window.location.origin}/webstart.jnlp`;
const jnlpUrl = `${window.location.origin}/webstart.jnlp`;
document.getElementById('jnlp-text').textContent = jnlpUrl;

// Both administrators are optional: show the ones installed, or how to install one
function isInstalled(url, ifUnknown) {
return fetch(url, { method: 'HEAD' })
.then(function(response) { return response.ok; })
.catch(function() { return ifUnknown; });
}
Promise.all([
isInstalled(jnlpUrl, true), // unknown: keep the launcher text shown by default
isInstalled(`${window.location.origin}/oie-webadmin/`, false)
]).then(function(installed) {
const swing = installed[0], web = installed[1];
document.getElementById('launcher-info').hidden = !swing;
document.getElementById('webadmin-link').hidden = !web;
document.getElementById('install-info').hidden = swing || web;
});
});
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro

if ((request.getRequestURI().equals(contextPathProp + "/webstart.jnlp") || request.getRequestURI().equals(contextPathProp + "/webstart")) && isWebstartRequestValid(request)) {
jnlpDocument = getAdministratorJnlp(request);
if (jnlpDocument == null) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
return;
}
response.setHeader("Content-Disposition", "attachment; filename = \"webstart.jnlp\"");
} else {
response.setContentType("");
Expand Down Expand Up @@ -119,6 +123,11 @@ private boolean isWebstartRequestValid(HttpServletRequest request) {
}

protected Document getAdministratorJnlp(HttpServletRequest request) throws Exception {
// The Swing Administrator is optional; client-lib is only present when installed
if (!new File(getClientLibPath(), "mirth-client.jar").isFile()) {
return null;
}

InputStream clientJnlpIs = null;
Document document;
try {
Expand Down
1 change: 1 addition & 0 deletions tools/install4j/oie-installer-config.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<entry location="conf" />
<entry location="oieserver" />
<entry location="oieserver.ps1" />
<entry location="client-lib" />
</exclude>
</dirEntry>
<dirEntry mountPoint="24" file="${compiler:installer:mediaRoot}/server/setup" overwriteMode="never" uninstallMode="never" overrideOverwriteMode="true" overrideUninstallMode="true">
Expand Down
Loading