Change ROOT_URL for Meteor Webapp

It would be very helpful if there was a way to change the ROOT_URL in the CryoSPARC webapp. This would allow CryoSPARC to be easily served with Open OnDemand in an HPC setting. Right now all the Open OnDemand solutions rely on a NoVNC connection (AFAIK). This means users interact with CryoSPARC inside a web-browser inside of a virtual desktop inside of their local web-browser. It’s not a great user experience. However, if it were possible to change the ROOT_URL of the CryoSPARC webapp, it could be served directly to users’ local browser tab seamlessly through Open OnDemand.

It seems to me like the only thing preventing this from working is the fact that there are multitude of hardcoded paths in the webapp. There are several hundred instances of paths which begin with a “/” in the top-level minified javascript:

[user@computer web.browser]$ grep -oh -e '\"\/[^\"]*\"'  50592286c5f5542d035fd46578678e310bdddf72.js |wc -l
598

Is it possible to change this? It would be really stellar if users could define a ROOT_URL environment variable in the config.sh for cryosparcm. I will note that ROOT_URL is already set in superviorsd.conf

[program:webapp]
command=%(ENV_CRYOSPARC_ROOT_DIR)s/cryosparc_webapp/nodejs/bin/node ./bundle/main.js
directory=%(ENV_CRYOSPARC_ROOT_DIR)s/cryosparc_webapp
autostart=false
autorestart=true
redirect_stderr=true
stdout_logfile=%(ENV_CRYOSPARC_ROOT_DIR)s/run/webapp.log
environment=MONGO_URL="mongodb://%(ENV_CRYOSPARC_MASTER_HOSTNAME)s:%(ENV_CRYOSPARC_MONGO_PORT)s/meteor",MONGO_OPLOG_URL="mongodb://%(ENV_CRYOSPARC_MASTER_HOSTNAME)s:%(ENV_CRYOSPARC_MONGO_PORT)s/local",PORT="%(ENV_CRYOSPARC_HTTP_PORT)s",HTTP_FORWARDED_COUNT="1",ROOT_URL="http://%(ENV_CRYOSPARC_MASTER_HOSTNAME)s:%(ENV_CRYOSPARC_HTTP_PORT)s",NODE_OPTIONS="--max-old-space-size=8192"

However, when I changed it, the sub-URI did not propagate to all the paths in the webapp.

Hi @kmdalton,

Thanks for the detailed post, it is very much appreciated. We will look into adding a configurable parameter within config.sh that modifies the ROOT_URL environment variable passed to the Meteor application.

- Suhail

Hi @sdawood,

Many thanks for getting back to me! If it helps convince your team, I would certainly be willing to open source an Open OnDemand app for CryoSPARC. I just need the ROOT_URL support, and I can put something together. I think this would really help a lot of academic users and sysadmins.

Cheers,
Kevin

Hi @sdawood,

Any word from the devs on this? I think installing CryoSPARC without dedicated hardware has stumped a lot of academic sysadmins. This is a possible solution which would certainly work for us at Harvard. My read was that it shouldn’t take much work on your end. Hope I’m right about that!

Thanks,
Kevin