helpdesk-validator icon indicating copy to clipboard operation
helpdesk-validator copied to clipboard

Frontend config.js inside the container

Open ZakarFin opened this issue 3 months ago • 5 comments

I'm trying to setup the docker container that has been uploaded to GitHub packages as is, but it seems only works if run on localhost. The ui.zip in both 2024.0.0 and 2024.0.1 has this config.js file included validator\js\config.js that points to http://localhost:8090. I can't find any configuration option to override this and it basically means that when the user clicks the "Start test" button on Test selection page OR accesses the Test reports page the browser tries to call the localhost instead of the service that the page is shown from. Also I can't find the repository that hosts this ui.zip (it's only included in the release version package as binary zip-file?)

validator/js/config.js has this:

var serverURL = "http://localhost:8090/validator/v2/";
var serverRealURL = "http://localhost:8090/validator/v2/";
var serverDirectURL = "http://localhost:8090/validator/v2/";
var serverCaptchaURL = "http://localhost:8090/validator/captcha/verify";
var swaggerURL = "http://localhost:8090/validator/swagger-ui.html"

A simple solution would be to only include the path, not the server/domain part so the frontend would call the service that it's hosted on:

var serverURL = "/validator/v2/";
var serverRealURL = "/validator/v2/";
var serverDirectURL = "/validator/v2/";
var serverCaptchaURL = "/validator/captcha/verify";
var swaggerURL = "/validator/swagger-ui.html"

What is your take on the container that is hosted on https://github.com/INSPIRE-MIF/helpdesk-validator/pkgs/container/helpdesk-validator%2Finspire-validator? Should it not be used as is, but users should create their own dockerfile/with their own UI.zip instead? Or am I missing something that would let me specify the domain the service is running in?

image

ZakarFin avatar Mar 20 '24 09:03 ZakarFin