Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading Registry UI on https #1442

Closed
johnkbarrow opened this issue Apr 19, 2021 · 7 comments
Closed

Error loading Registry UI on https #1442

johnkbarrow opened this issue Apr 19, 2021 · 7 comments
Assignees
Labels
Bug Something isn't working

Comments

@johnkbarrow
Copy link

As per #1120 I've used environment variables REGISTRY_UI_CONFIG_UIURL and REGISTRY_UI_CONFIG_APIURL to allow the Registry UI to work with https.
Unfortunately, when calling https://myschemareg/api I'm getting an error as that page is in turn trying to call http://myschemareg/openapi?format=JSON.
I can't find a similar environment variable to override that URL - is there one?

@EricWittmann EricWittmann self-assigned this Apr 20, 2021
@EricWittmann EricWittmann added the Bug Something isn't working label Apr 20, 2021
@EricWittmann
Copy link
Member

For version 1.3.2.Final, which I'm assuming is what you're using, there unfortunately is not a config setting for that. Here is the code that is giving you trouble:

private String generateSpecUrl(HttpServletRequest request) {
try {
String url = request.getRequestURL().toString();
url = new URI(url).resolve("/openapi?format=JSON").toString();
return url;
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}

That has been changed fairly significantly in the latest release (2.0.0.Final released last Friday). Now we include documentation on all/most of the APIs we support, and we root them all at /apis which is a bit of a change from 1.3 where the APIs were rooted at /api. In any case, looking at the code for 2.0 I don't think this will be a problem any longer.

https://github.com/Apicurio/apicurio-registry/blob/master/app/src/main/java/io/apicurio/registry/ui/servlets/SpecUrlFilter.java

@johnkbarrow
Copy link
Author

Hi @EricWittmann - yes, I'm using 1.3.2.Final. It's not a big issue for me as I'm using the REST API rather than the UI.

@EricWittmann
Copy link
Member

OK thanks. Would it be possible for you to test 2.0.0.Final with your setup? I'd be very interested if there are any similar issues with SSL remaining there. In this case, hitting /apis and then seeing if the API docs for each API worked, that would be super helpful. If it's not easy for you to test don't worry about it. :)

@johnkbarrow
Copy link
Author

I'm using the docker in-memory image - is there a 2.0.0.Final release of that yet?

@johnkbarrow
Copy link
Author

@EricWittmann - I see why I got 1.3.2.Final - I used "apicurio/apicurio-registry-mem:latest"

Looks like 2.0.0.Final is tagged with "apicurio/apicurio-registry-mem:latest-release"

@johnkbarrow
Copy link
Author

johnkbarrow commented Apr 29, 2021

Hi @EricWittmann - I finally got chance to do some testing with 2.0.0.Final with my setup:

The Registry UI wouldn't load properly without setting the environment variable

"name": "REGISTRY_UI_CONFIG_APIURL",
"value": "https://servername.com/apis/registry"

The /apis endpoint loads fine, apart from the link for the IBM Schema Registry /apis/ibmcompat/v1 that returns a 404

@EricWittmann
Copy link
Member

Great news! Thanks for checking. The IBM compat 404 error is unfortunate but expected (missing openapi spec for that API).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants