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 support to run MTDA web frontend behind reverse proxy #302

Merged

Conversation

fmoessbauer
Copy link
Member

This change ensures that all resources are references relative to the
current URI. By that, the whole MTDA web frontend can be served below a
subpath. This is required to support use-cases where multiple MTDA
devices are served by a single nginx reverse proxy in a single web page.
This approach can be used to serve a whole testing network via a single
IP entrypoint and without giving the users IP access to the testing
network itself.

To make the socket.io communication work, we further set the path
component of the current URI when connecting to the ws server.

Previously, the material icons could not be found because the subpath
/assets was added twice.

Signed-off-by: Felix Moessbauer <[email protected]>
This change imports the js dependencies from relative paths instead of
absolute ones. By that, running behind a reverse proxy with a URI
rewrite becomes possible.

Signed-off-by: Felix Moessbauer <[email protected]>
This change ensures that all resources are references relative to the
current URI. By that, the whole MTDA web frontend can be served below a
subpath. This is required to support use-cases where multiple MTDA
devices are served by a single nginx reverse proxy in a single web page.
This approach can be used to serve a whole testing network via a single
IP entrypoint and without giving the users IP access to the testing
network itself.

To make the socket.io communication work, we further set the path
component of the current URI when connecting to the ws server.

Signed-off-by: Felix Moessbauer <[email protected]>
Copy link
Collaborator

@chombourger chombourger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work @fmoessbauer - thank you so much for your contribution

@bovi
Copy link
Member

bovi commented Jul 28, 2023

@fmoessbauer I think the nginx config needs to be licensed. see here: https://github.com/siemens/mtda/blob/master/.reuse/dep5

@fmoessbauer
Copy link
Member Author

@fmoessbauer I think the nginx config needs to be licensed. see here: https://github.com/siemens/mtda/blob/master/.reuse/dep5

Ok, will update the commit.

This adds an example nginx configuration file to access multiple mtda
devices via a reverse proxy. By that, users can access a set of mtda
devices via a single web-frontend and without having IP access to each
individual MTDA device.

Signed-off-by: Felix Moessbauer <[email protected]>
@fmoessbauer fmoessbauer force-pushed the fm/make-reverse-proxy-compatible branch from b219263 to f4a079f Compare July 28, 2023 11:40
@chombourger chombourger added check and removed check labels Jul 28, 2023
@chombourger chombourger merged commit 1e383d5 into siemens:master Jul 28, 2023
7 checks passed
@fmoessbauer fmoessbauer deleted the fm/make-reverse-proxy-compatible branch July 28, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants