Skip to content

Entrypoint doesn't write DRAWIO_MSGRAPH_TENANT_ID to msgraph_tenant_id #204

Description

@rcross-lc

The entrypoint script writes out DRAWIO_MSGRAPH_TENANT_ID to PreConfig.js, but not msgraph_tenant_id.

if [[ -z "${DRAWIO_MSGRAPH_CLIENT_ID}" ]]; then
echo "urlParams['od'] = '0'; //OneDrive" >> $CATALINA_HOME/webapps/draw/js/PreConfig.js
else
#Google drive application id and client id for the editor
echo "window.DRAWIO_MSGRAPH_CLIENT_ID = '${DRAWIO_MSGRAPH_CLIENT_ID}'; " >> $CATALINA_HOME/webapps/draw/js/PreConfig.js
echo -n "${DRAWIO_MSGRAPH_CLIENT_ID}" > $CATALINA_HOME/webapps/draw/WEB-INF/msgraph_client_id
echo -n "${DRAWIO_MSGRAPH_CLIENT_SECRET}" > $CATALINA_HOME/webapps/draw/WEB-INF/msgraph_client_secret
if [[ "${DRAWIO_MSGRAPH_TENANT_ID}" ]]; then
echo "window.DRAWIO_MSGRAPH_TENANT_ID = '${DRAWIO_MSGRAPH_TENANT_ID}'; " >> $CATALINA_HOME/webapps/draw/js/PreConfig.js
fi
fi

The server app is expecting to read the tenant id from this file here:

https://github.com/jgraph/drawio/blob/890ea0b7880f4962bfc2b25b35103286aad0d1cb/src/main/java/com/mxgraph/online/MSGraphAuth.java#L13

I can work around this by writing the tenant id out to a file and bind mounting it:

- type: bind
  source: ./msgraph_tenant_id
  target: /usr/local/tomcat/webapps/draw/WEB-INF/msgraph_tenant_id
  read_only: true

Also bonus meme: comments in this section reference google drive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions