-
Notifications
You must be signed in to change notification settings - Fork 450
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
[Feature] Set BASE_URL in MQTTX-Web on startup #1575
Comments
Thank you for your input. Currently, we only provide bundled static files through the Docker image, and these files require configurations to be provided before the bundling process. If we want to support modifications of these configurations through Docker parameters, it might require us to include the source code in the image and compile it upon container startup. This could result in an increased image size and longer startup time. Considering that some users might need this feature, we are planning to expose some configuration options to the users and document this accordingly. Users could then build their own images by modifying these configuration files. |
Hi @ysfscream, could you please share your thoughts on this? Thanks! |
Hi, all. Thanks for using the MQTTX, and I understand the motivation behind the request to dynamically modify the Given the challenges associated with directly modifying the I'm not familiar with the specifics of Home Assistant (HA), but if the HA environment allows, this script-based automation approach for building and deploying could be a viable solution. This way, we can accommodate the need to adjust the |
Thanks for the replies. So, I think to save rebuilding each time I'll need to make a build with Hmm. Might be simpler just to bundle with nginx and get it to redirect urls. OK thanks. |
Motivation
It's not a huge issue but thought I'd try getting MQTTX working inside home assistant (HA), and realize it could be very easy with this small tweak to MQTTX, and other users might find the same useful. (Or maybe I'm missing some easy way to do it)
Trying to set up MQTTX Web as an "addon" in HA, which displays the page in a frame. In HA's framework, perhaps for security or just for architectural reasons, mqttx is required to have a different BASE_URL each time its docker container is started.
Is there a way to set BASE_URL on start up? or otherwise could this option be added?
I see there's an option to set a BASE_URL when compiling with yarn, but it would be much easier to base something off something like the existing mttqx-web docker container rather than recreating the whole build environment.
Detailed design
A solution would require some way to set BASE_URL on startup, either from an environment variable, .env.local file, or http-server --base=... or the like.
Similarly, it would be great if VUE_APP_PAGE_TITLE and VUE_APP_PAGE_DESCRIPTION could be dynamically set on startup.
Also is there a way to set up a default server to connect to?
Alternatives
Maybe I could just work out a minimal yarn setup and re-build before running, or alter the URLs dynamically with a dedicated instance of nginx, but these seem like comparatively heavy weight solutions which add a lot of complexity.
Cheers.
The text was updated successfully, but these errors were encountered: