8000 Request: config option to change static ui path prefix · Issue #1679 · hyperledger/firefly · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Request: config option to change static ui path prefix #1679

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

Open
mcreekmore opened this issue Apr 24, 2025 · 5 comments
Open

Request: config option to change static ui path prefix #1679

mcreekmore opened this issue Apr 24, 2025 · 5 comments
Labels
enhancement New feature or request

Comments

@mcreekmore
Copy link
mcreekmore commented Apr 24, 2025

What would you like to be added?

Add an option such as ui.prefix to the firefly-core config options here:
https://hyperledger.github.io/firefly/latest/reference/config/#ui

Why is this needed?

The Firefly UI (easily accessibly via http://firefly:5000/ui) is not accessible once its put behind a reverse proxy with a path prefix.

For example if it was necessary to access the ui behind https://example.com/firefly/ui, the browser would make requests to static resources without the /firefly path prefix resulting in 404s at https://example.com/ui/static/js/main.js.

A configuration option that allowed you to either provide the entire FQDN+prefix or just the path prefix where the service sits would solve this problem. I was hoping that api.publicURL config option would serve this purpose but it does not.

It may not be possible for all users to place the firefly ui/service directly at the root prefix.

@mcreekmore mcreekmore added the enhancement New feature or request label Apr 24, 2025
@EnriqueL8
Copy link
Contributor

I believe you can set PUBLIC_URL environment variable for this https://github.com/hyperledger/firefly-ui/blob/2011cffe7a8b5cb5a3485712950294780e672633/public/index.html#L8

@mcreekmore
Copy link
Author
mcreekmore commented Apr 28, 2025

I believe you can set PUBLIC_URL environment variable for this https://github.com/hyperledger/firefly-ui/blob/2011cffe7a8b5cb5a3485712950294780e672633/public/index.html#L8

@EnriqueL8 I've tried this originally and it doesn't seem to work as expected. Static resources are still fetching from the root prefix

@EnriqueL8
Copy link
Contributor

Correct @mcreekmore I think this is at build time only of the UI resources

@mcreekmore
Copy link
Author

Correct @mcreekmore I think this is at build time only of the UI resources

@EnriqueL8 Forgive me I'm a bit confused now. The PUBLIC_URL variable is meant to resolve this issue, and yet its not possible to set the variable properly without rebuilding the container?

How is it possible to set the prefix for static UI resources while using the officially signed container?

@EnriqueL8
Copy link
Contributor
EnriqueL8 commented Apr 30, 2025

Turns out the PUBLIC_URL variable is only usable when building the UI resources so yes would need to rebuild the resources.

So we would need to do the following:

  • Make this path configurable in the FireFly API Server to host the UI resources
    uiPath := config.GetString(coreconfig.UIPath)
    if uiPath != "" && config.GetBool(coreconfig.UIEnabled) {
    r.PathPrefix(`/ui`).Handler(newStaticHandler(uiPath, "index.html", `/ui`))
    }
  • At runtime allow the static resources to requests at the correct path

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

No branches or pull requests

2 participants
0