datasharingframework / dsf

A distributed process engine based on the BPMN 2.0 and FHIR R4 standards
https://dsf.dev
Apache License 2.0
13 stars 7 forks source link

Make FHIR proxy server context path customizable #85

Closed holger-stenzhorn closed 1 year ago

holger-stenzhorn commented 1 year ago

The context path of the FHIR proxy server is currently hardcoded to /fhir. To render this customizable, only a few changes need to be performed:

The above has been implemented and successfully tested in our local environment already.

⚠️ There just seems to be a tiny bug though in dsf-fhir/dsf-fhir-server/src/main/java/dev/dsf/fhir/adapter/HtmlFhirAdapter.java in private String getUrlHeading(Resource resource) which leads to a a double display of /fhir in the shown title, e.g. https://diz.uks.eu/dsf/fhir/fhir/metadata and - if I am not mistaken - there should be a html tab left to the json and xml tabs. (see screenshot)

temp

hhund commented 1 year ago

@holger-stenzhorn I have implemented your suggestion slightly modified in #95. The DEV_DSF_SERVER_CONTEXT_PATH variable does not need to be specified for the DSF FHIR app server if the apache httpd ProxyPass and ProxyPassReverse directives stay hard coded to the DSF FHIR app server context path default .../fhir...

holger-stenzhorn commented 1 year ago

The given solution works nicely but there is a tiny "edge case": If you enter e.g. https://diz.uks.eu/dsf/test/fhir then this gets redirected to https://diz.uks.eu/fhir. A quick and easy fix for this issue would be to change host-ssl.conf accordingly:

+Redirect ${SERVER_CONTEXT_PATH} ${SERVER_CONTEXT_PATH}/
-<Location "${SERVER_CONTEXT_PATH}">
+<Location "${SERVER_CONTEXT_PATH}/">
        RequestHeader set X-ClientCert %{SSL_CLIENT_CERT}s

-       ProxyPass http://${APP_SERVER_IP}:8080/fhir timeout=${PROXY_PASS_TIMEOUT_HTTP} connectiontimeout=${PROXY_PASS_CONNECTION_TIMEOUT_HTTP}
-       ProxyPassReverse http://${APP_SERVER_IP}:8080/fhir
+       ProxyPass http://${APP_SERVER_IP}:8080/fhir/ timeout=${PROXY_PASS_TIMEOUT_HTTP} connectiontimeout=${PROXY_PASS_CONNECTION_TIMEOUT_HTTP}
+       ProxyPassReverse http://${APP_SERVER_IP}:8080/fhir/