humhub / app

20 stars 8 forks source link

Improve URL Detection Input #60

Closed luke- closed 1 year ago

luke- commented 1 year ago

Would be great if in the opener dialog also accepts URLs like:

PrimozRatej commented 1 year ago

Is it reasonable to assume that sometestproject12345.humhub.com/dashboard is also a valid format? It would be more convenient for the user if they didn't have to type the https:// every time.

luke- commented 1 year ago

That would be good, but we must handle that it could also run under http://. (Maybe some autodetection?)

Also, HumHub could be installed in a subdirectory. e.g. https://example.com/humhub

PrimozRatej commented 1 year ago

I was thinking that if the user does not provide the protocol, we assume that it's https. If the user does provide a protocol, we override this assumption. Regarding installations in subdirectories, I don't see a problem as long as the manifest.json exists at the specified URL.

luke- commented 1 year ago

Ok that sounds good.

Problem could be, when a user provide https://example.com/humhub/humhub/dashboard. We should try to find the root URL in following order:

  1. https://example.com/humhub/humhub/manifest.json
  2. https://example.com/humhub/manifest.json
  3. https://example.com/manifest.json
PrimozRatej commented 1 year ago

Acceptable URLs:

We iterate through a url.pathSegments till we found and manifest.json

luke- commented 1 year ago

@PrimozRatej Great, thats a nice solution