Skip to content

Commit 59cb704

Browse files
committedOct 25, 2023
Fixed Receiving Malformed URI error on startup (docker-drawio-125)
1 parent 2d6f60d commit 59cb704

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎main/docker-entrypoint.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ if [[ "${DRAWIO_SELF_CONTAINED}" ]]; then
2929
elif [[ "${EXPORT_URL}" ]]; then
3030
echo "window.EXPORT_URL = '/service/0';" >> $CATALINA_HOME/webapps/draw/js/PreConfig.js
3131
fi
32-
#DRAWIO_SERVER_URL is the new URL of the deployment, e.g. https://www.example.com/drawio
32+
#DRAWIO_SERVER_URL is the new URL of the deployment, e.g. https://www.example.com/drawio/
3333
#DRAWIO_BASE_URL is still used by viewer, lightbox and embed. For backwards compatibility, DRAWIO_SERVER_URL is set to DRAWIO_BASE_URL if not specified.
3434
if [[ "${DRAWIO_SERVER_URL}" ]]; then
3535
echo "window.DRAWIO_SERVER_URL = '${DRAWIO_SERVER_URL}';" >> $CATALINA_HOME/webapps/draw/js/PreConfig.js
36-
echo "window.DRAWIO_BASE_URL = '${DRAWIO_BASE_URL:-${DRAWIO_SERVER_URL}}';" >> $CATALINA_HOME/webapps/draw/js/PreConfig.js
36+
echo "window.DRAWIO_BASE_URL = '${DRAWIO_BASE_URL:-${DRAWIO_SERVER_URL:0:$((${#DRAWIO_SERVER_URL}-1))}}';" >> $CATALINA_HOME/webapps/draw/js/PreConfig.js
3737
else
3838
echo "window.DRAWIO_BASE_URL = '${DRAWIO_BASE_URL:-http://localhost:8080}';" >> $CATALINA_HOME/webapps/draw/js/PreConfig.js
39-
echo "window.DRAWIO_SERVER_URL = window.DRAWIO_BASE_URL;" >> $CATALINA_HOME/webapps/draw/js/PreConfig.js
39+
echo "window.DRAWIO_SERVER_URL = window.DRAWIO_BASE_URL + '/';" >> $CATALINA_HOME/webapps/draw/js/PreConfig.js
4040
fi
4141
#DRAWIO_VIEWER_URL is path to the viewer js, e.g. https://www.example.com/js/viewer.min.js
4242
echo "window.DRAWIO_VIEWER_URL = '${DRAWIO_VIEWER_URL}';" >> $CATALINA_HOME/webapps/draw/js/PreConfig.js

‎self-contained/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ The best option for Windows users is to copy the contents of `Windowsdrive:/Wind
1010

1111
You can customize the application by setting the following environment variables.
1212

13-
* `DRAWIO_SERVER_URL`: Your deployment base URL. For example, `https://drawio.example.com` or `https://www.example.com/drawio` if it is deployed into a folder.
14-
* `DRAWIO_BASE_URL`: Your deployment base URL but used with the viewer, lightbox and embed. Usually the same as `DRAWIO_SERVER_URL`.
13+
* `DRAWIO_SERVER_URL`: Your deployment base URL. For example, `https://drawio.example.com/` or `https://www.example.com/drawio/` if it is deployed into a folder. **Note**: Must end with `/`
14+
* `DRAWIO_BASE_URL`: Your deployment base URL but used with the viewer, lightbox and embed. Usually the same as `DRAWIO_SERVER_URL` but does **not** end with `/`.
1515
* `DRAWIO_CSP_HEADER`: (Optional) Your website Content-Security-Policy if you want to customize it.
1616
* `DRAWIO_VIEWER_URL`: (Optional) If you want to host a draw.io viewer also, set the viewer URL. For example, `https://drawio.example.com/js/viewer.min.js`
1717
* `DRAWIO_LIGHTBOX_URL`: (Optional) If you want to host a draw.io viewer also, set the lightbox URL. For example, `https://drawio.example.com`

1 commit comments

Comments
 (1)

davidjgraph commented on Oct 25, 2023

@davidjgraph

Reviewed. #125.

Please sign in to comment.