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

Add new IC page for MIOB's (category=manager,type=miob) #305

Open
stv0g opened this issue Mar 25, 2022 · 6 comments
Open

Add new IC page for MIOB's (category=manager,type=miob) #305

stv0g opened this issue Mar 25, 2022 · 6 comments

Comments

@stv0g
Copy link
Contributor

stv0g commented Mar 25, 2022

As discussed in our earlier meetings, we would like to use the VILLASweb IC page for the touch panel displays of our Multi-IO Boxes (miob's).

I have implemented a new manager component for the MIOBs in VILLAScontroller (https://git.rwth-aachen.de/acs/public/villas/controller/-/merge_requests/30).

There is now also a MIOB already reporting its status to the Demo instance: https://villas.k8s.eonerc.rwth-aachen.de/infrastructure/547646

We can now customize the IC page for the additional status fields.

/cc @n-eiling

@stv0g
Copy link
Contributor Author

stv0g commented Mar 30, 2022

In GitLab by @iripiri on Mar 30, 2022, 09:19

  • Use fullscreen mode as in dashboard to blend out menu etc.
  • use icons/visualizations (instead of text)
  • open/collapse info (bootstrap accordion)
  • dev tools chrome (firefox?): choose display size

@stv0g
Copy link
Contributor Author

stv0g commented Mar 30, 2022

In GitLab by @n-eiling on Mar 30, 2022, 09:35

This is how we start chromium: (Window Size 800x400)

/usr/bin/chromium-browser --window-size=800,480 --kiosk --window-position=0,0 http://127.0.0.1

@stv0g
Copy link
Contributor Author

stv0g commented Apr 6, 2022

In GitLab by @n-eiling on Apr 6, 2022, 11:05

Another requirement for using VILLASweb on the MIOBs is that we have a way to login without user interaction - ideally just by visiting an URL as in my last comment. Maybe we can add a token that can be passed via GET request. (Should this be a separate issue?)

Related InFIS issue: https://git-ce.rwth-aachen.de/acs/private/research/infis/ap3/integration/-/issues/36

@stv0g
Copy link
Contributor Author

stv0g commented Apr 6, 2022

In GitLab by @skolen on Apr 6, 2022, 11:41

You will need to request a token using the VILLASweb API endpoint.

.../authenticate/internal/ with a POST request including username and password in the body of the request. Tokens have a limited time validity so hard-coding a token in a subsequent request will not work permanently. We will have to create a user in VILLASweb for the MIOBs for this purpose.

To access the IC data of the MIOB you can pass the user token as a parameter in the query like this somehow:

.../ic/<id of component>?token=<my-awesome-token>

We could add another parameter here to automatically allow for toggling a full-screen mode of the IC page in the frontend once this feature is implemented.

Will need to find a way to store the user token in the browser storage so that the VILLASweb GUI knows about the successful authentication.

@stv0g
Copy link
Contributor Author

stv0g commented Apr 6, 2022

In GitLab by @n-eiling on Apr 6, 2022, 12:00

Hm, I think it's really difficult / a lot of work to implement something where we maintain and update session tokens. I guess it would be possible to curl a HTTP POST request to get the token and use that in a GET request with chromium. However, the tokens should probably not be valid indefinitely and updating them might require quite some logic on the MIOB side.

To be honest, I would have just gone the route of punching holes in the whole security concept and allow certain tokens indefinite access without any previous login. Or open only the specific overview page to unauthorized access. Or somehow whitelist the MIOBs. They will probably communicate via VPN anyway, so security is not strictly necessary.

@stv0g
Copy link
Contributor Author

stv0g commented Apr 6, 2022

Fetching a token via CURL is really easy:

TOKEN=$(curl -XPOST -d '{"Username": "test", "Password": "testtest"}' https://villas.k8s.eonerc.rwth-aachen.de/api/v2/authenticate/internal | jq -r .token)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant