-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
feat: add support for base url #1873
feat: add support for base url #1873
Conversation
Signed-off-by: Stefan Dej <meteyou@gmail.com>
how does one actually use this? |
To my understanding, you need to set an environment variable, |
Meh. I ended up using Caddy and just proxying Printer.site.com To http://ip:80 using reverse proxy Works fine and I don't have to do silly things with compiling a custom version. If this is done right it should be a property read from a config, not some undocumented build process |
Actually, seems like I'm wrong - this is a built-in environment variable to vite, and should be specified by passing the |
@Wulfsta yes you are right. You have to set --base to build the mainsail. Vite is the build tool. |
@EricZimmerman pls read the issue for this PR: #1600 Pls don't mixup things! |
@meteyou can you clarify the relation between this setting and Once you release a new tagged version (and I have time) I will update the configuration in NixOS to add the base option, since it mostly seems to be working. |
VUE_APP_PATH is only for development when you use vite serve. If you need help, pls use our discord or the discussions forum. |
I would prefer documentation of this feature to needing to ask on a different platform. |
@Wulfsta it is not a real "feature". its more like a vue/vite background setting and just fix it, that it works. thats why it is not documented. if it would be a "generic user feature", then it would need docs. but we are too less people and have too less time to write all the docs. sry... |
Ah, then I should not rely on that environment variable for a downstream build! I produced a build such that it is possible to reverse proxy as requested in the linked issue, but it relies on setting that during build time. |
https://cli.vuejs.org/config/#baseurl There you go, the official Vue documentation. We just added support for that, therefore it's not really a mainsail feature we just added this because of the feature requests we got. |
yes, it's really only there to make a build with subdirectories. my plan would be to release 2 builds at some point. one with "/" as base_url and one with "/mainsail". but this also requires some changes in moonraker for updates etc. |
That seems way easier than just allowing base URL to be supplied in a configuration file like other properties. 😄 Why not 1000 builds so people have options vs / and /mainsail? |
@EricZimmerman pls tell me a solution to config something in a config file, which cannot be read without this setting? do you know the chicken, egg problem? |
I do know it. It's not personal. Just frustrating when many other apps do this out of the box. I have my solution and it works well. Caddy made this way easier than nginx |
@EricZimmerman other apps other dependencies. its just not possible with vue/vite + the websocket communication we use with klipper. but maybe i'm just to dumb to implement this. so if you think you are much smarter than me, feel free to fork mainsail and solve this issue and merge it. your FR is still open so if some other contributer is smarter than me, can also hit this issue. otherwise, pls stop posting something like that above and steel my time more and more! |
Description
This PR allows to use a base url, when building Mainsail. This PR cannot fix a dynamic subdirectory URL. So you have to build your own Mainsail build for each subdirectory.
Maybe it is possible to release a second build in the release for
/mainsail
as subdirectory, but we have to double-check this, to have no issues with the Moonraker update manager.Related Tickets & Documents
fixes #1600
fixes a part of #1163
Mobile & Desktop Screenshots/Recordings
none
[optional] Are there any post-deployment tasks we need to perform?
none