Add flag to serve files from a directory#138
Conversation
There was a problem hiding this comment.
Thanks for your contribution, this definitely has potential to be quite useful.
The initial plan for distributing the program was that there is just a single binary made available that the user just had to run, which was why it was important to bundle the UI statically with it. At times of update, the user can just download the new version and replace the binary.
Having a launcher that automatically retrieves the latest version of the binary and the UI, and dynamically serving them is certainly a possibility. Although from a security perspective I personally do not like the idea of allowing the binary to automatically fetch a new version of the program and run it without needing the user's confirmation, which would probably be the main benefit of having such a launcher. That is at least on the binary executable side, I would be less opposed to this on the UI side, although I still want to avoid having the backend coupled with the frontend specifically, which is why we don't have a build.rs script to automatically build and include it, for example.
At this point my plan is still to compile in the UI for official builds, give the user a notification if there's a new version available, and direct them to download the new file, although it's possible that will change.
That said, having this option available certainly is a great benefit still, and so I would love to merge your contribution eventually :)
|
How does this look? I've added conditional compilation (the |
Bash-09
left a comment
There was a problem hiding this comment.
Just some very minor comments, otherwise it's looking good :)
Bash-09
left a comment
There was a problem hiding this comment.
Functionality seems to work well. I'm happy to merge with just those minor changes mentioned earlier.
I've added the launch option
--web-dirwhich takes a path as an argument. Using it, the client-backend will serve files for the Web UI from there, rather than using the files bundled into the executable at build time.This, as well as providing better support for custom UIs chosen by users, lays the groundwork for having some external program manage the client-backend and webui versions separately, downloading the binary packages of each from GitHub releases, without having to recompile the client-backend each time the webui is updated. This is probably the best way to ship the client to non-technical users, as they would simply install the launcher and it would take care of all the components needed. (I'm already working on this in a private repo btw - dev team, we can talk more about this later if you want)
As always, feel free to talk to me here or on the Discord regarding this PR.