It is possible to build web GUIs using the https://rclone.org/rc/ - check out https://rclone.org/commands/rclone_rcd/ also - you make your GUI then rclone will serve it for you and you can access the API.
I made a proof of concept react app to do this. I’m not a frontend developer so it has been hard work for me!
Hello @ncw! Thank you for merging PR 2844, adding vfsgen for static items!
Here is a question: how should we deal with static assets?
For example, we may have a file called “styles.css”, and normally, that might be served via
/static/styles.css. However, this would make it impossible for a user to browse a folder named
Here are some options:
Choose a sentinel value for static assets. For example, “/rclone-static-112358” or “/random-number-11235”. Downsides: now we have a hardcoded value which a user is never able to browse.
Inline everything. That is, rather than our code saying
<link href="/rclone-static/styles.css">, simply inline it. The two disadvantages is that this does not work for images (for example, an icon depicting a folder), and this would increase the HTML payload size upon every request. (Technically, one could inline .svg files.)
Choose not to use any HTML features which rely on static assets, such as images. This could be very limiting.
Host assets externally (eg,
<link href="http://example.com/styles.css">). I think this is the worst idea, since how rclone’s http feature would have an external dependency, which has both stability and security implications.
Run another local HTTP server, on a different port, whose sole job would be to serve static assets. Eg,
<link href="http://localhost:9090/styles.css">. This would give the most flexibility, though probably has the most complexity.
If it were me, I would probably choose option 1, or possibly option 2, or option 5. But maybe you have an idea for a solution I haven’t thought of, or a tradeoff that you’d find acceptable.
A good question indeed! I was thinking that we could use a special directory like
@rclonestatic@ and keep them all in there.
Another way of sorting this out would be to use a parameter string so append
?rclone=static to each URL and get the URL handler to separate them. This would have the advantage that there would be no namespace collision.
I’m not keen on options 2-4 and 5 would indeed make life more complicated. The URL parameter idea is probably the best one as it is “out of band” and all the URLs should be generated by us.
I like the URL parameter idea (
?rclone=static) - didn’t even think of doing something like that. Will take that direction. Thanks!
Okay, I have a work in progress branch that I would love your feedback on, if you have time. I’ve added the ability to:
- Serve static files with the
?rclone=static URL param
- Implemented a slightly richer GUI:
- The ability to navigate “up” a directory
- Show file sizes and modification times
This is important because, when we want to add even more features (yay!) to the GUI, we won’t be limited to the fields which are currently in the
serve.DirEntry data structure.
Here is a preview:
And here is my branch thus far: https://github.com/ncw/rclone/pull/2874
Does this seem like it’s going in a direction that make sense?
Great I added some comments on the pull request.
This seems rather interesting - how’s the progress?
I’ve been trying to use rc and rcd to create an interface to monitor jobs running on a NAS box.
What I haven’t found yet is a way to obtain -P(rogress) like information. Any ideas how to do it?
something like job/progress ???
You can use core/stats which should have most things in!
I really missed it. Thanks. I was looking for something related to job/xxxx.
How does it work when more than one job is running (if I understand correctly you could run more than on job, right?).
You’ll get combined stats for all the jobs I think. I’ve not tried it actually!
May I suggest adding a job Id to each of the file being transfered? And setting the job passed on the command line as jobid=0 or 1 (in case the command is no rcd)?
This would make the creation of a API based GUI much simpler and consistent.
Also, is there a way to get info like: total size of the job (in bytes), number of files to be transfered, etc. To display progress information much like -P does?
Many thanks once again.
Bellow is a snapshot of the simple screen. I do not intend to make a complete GUI to configure rclone or setup/start jobs, but good enough to allow monitoring multiple jobs running on different hosts, with some graphic progress information and allow changing some parameters on the fly (other than bandwidth) for performance tuning (if it works). All files are statick HTML/CSS/JS and can be serverd by rclone, so no backend required.
If anyone is interested, I can upload to github.
I wouldn’t mind using something like this from a browser behind caddy on my remote vps. It would be nice to have something to monitor jobs that way. And drill to the log (potentially increase verbosity of it on the fly with RC).
That looks very interesting - I would like to see it please
Will finish some changes (to make it simpler to configure) and will upload to github.
Hello! I have not made too much progress on this, for two reasons:
- I’m getting married, and wedding planning has been taking all of my time!
My apologies for the delay here! No ETA on my end, but thought I’d drop in and let you know what is happening with me!
See you soon for news about your web-based GUI.