Describe the bug
When using the option --host argument with a base URL, for example the one shown in the label-studio argument help --host "http://ls.domain.com/subdomain/", href's with absolute paths (those starting with"/") break and make label-studio unusable. URL's should all be changed to relative paths when using base href html tag (either remove leading "/" or add start with "./").
This issue keeps cropping up in new releases and has been discussed before in issues https://github.com/heartexlabs/label-studio/issues/358 and https://github.com/heartexlabs/label-studio/issues/507
Locations
href="/user/signup"href="/user/login"img src='/static/images/opossum_hanging.svg"{% load static %} and <link rel="stylesheet" href="{% static 'css/login.css' %}"/> resulting in href="/static/css/login....css"href="./static/css/login....css" or maybe prepend the "host" argument to the "static" variable?To Reproduce
Steps to reproduce the behavior (it would be great if this could be added as a test case):
docker run -it -p 8080:8080 heartexlabs/label-studio:latest label-studio --host "http://ls.domain.com/subdomain/"<a href="/user/signup">Sign up</a> resolves to http://ls.domain.com/user/signup, but it should resolve to http://ls.domain.com/subdomain/user/signup. This would be corrected with <a href="./user/signup">Sign up</a> when <base href="http://ls.domain.com/subdomain/"> is in the <head> html tag.127.0.0.1 ls.domain.com to /etc/hosts (have not tested this) @nicholasrq check this please in the frontend part.
@laynr Could you check pip install label-studio==1.0.1rc1 please? I hope it's fixed there.
@nicholasrq / @makseq
For example this line of code:
https://github.com/heartexlabs/label-studio/blob/e50c16f096a7383147d2289f324cf28990336066/label_studio/users/templates/users/user_signup.html#L9
resolved to<link rel="stylesheet" href="/static/css/login.<some number>.css"/>when viewing the source of the rendered webpage. If it resolved to<link rel="stylesheet" href="./static/css/login.<some number>.css"/>I believe it would work.Similarly this line of code:
https://github.com/heartexlabs/label-studio/blob/e50c16f096a7383147d2289f324cf28990336066/label_studio/users/templates/users/user_signup.html#L26
resolved to<img src="/static/images/opossum_hanging.<some number>..svgwhen viewing the source of the rendered webpage. If it resolved toimg src="./static/images/opossum_hanging.<some number>..svgI believe it would work.
{ settings.HOSTNAME }}/ like the following worked!!https://github.com/heartexlabs/label-studio/blob/e50c16f096a7383147d2289f324cf28990336066/label_studio/users/templates/users/user_signup.html#L29
https://github.com/heartexlabs/label-studio/blob/e50c16f096a7383147d2289f324cf28990336066/label_studio/users/templates/users/user_signup.html#L30
href, src, and base href appear correct. Maybe the java script files need to be changed (I don't know)?@laynr We are releasing 1.0.2 version today, these problems must be fixed there. Or you can try master branch right now.
Most helpful comment
@laynr We are releasing 1.0.2 version today, these problems must be fixed there. Or you can try master branch right now.