ADL_LRS icon indicating copy to clipboard operation
ADL_LRS copied to clipboard

Running in a subpath is not supported

Open ralokt opened this issue 4 years ago • 1 comments

I'm trying to host the LRS in a subpath, ie, it is to be accessed via <domain>/lrs.

This appears not to be supported - for semi-technical/political/bureaucracy reasons, running on a subdomain is not an option for me.

Issues I ran into so far:

  • STATIC_URL and MEDIA_URL are not configurable via settings.ini. This isn't a huge issue, it's trivial to set DJANGO_SETTINGS_MODULE manually and then define custom settings that import and overwrite the default settings.
  • /me shows wrong endpoint. This is what prompted me to create this issue, since it's not circumventable with creative configuration. This template code [1] assumes that it can generate the endpoint like so:
http{% if request.is_secure %}s{% endif %}://{{ request.META.HTTP_HOST }}/xAPI/

A possible fix for this particular issue would be to use URL reversal here (and give this pattern [2] a name to make that possible).

This list is not exhaustive since I have only begun my deployment in a subpath, and am therefore only able to report my findings so far.

It would be great if in general the LRS didn't make this assumption about how it is deployed, however.

[1] https://github.com/adlnet/ADL_LRS/blob/master/adl_lrs/templates/me.html#L30 [2] https://github.com/adlnet/ADL_LRS/blob/master/lrs/urls.py#L8

ralokt avatar Aug 25 '20 16:08 ralokt

Hey there! I don't think the original team accounted for that situation, although it's a pretty common pattern in our age of containerized proxies.

Agree that the more flexible this can be, the better. I'll skim through this week and check a few ideas (including yours) to see if we can support this.

Thanks! -Trey

vbhayden avatar Aug 25 '20 16:08 vbhayden