-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add File Manager / File Browser based on form.FileUpload #6553
Conversation
I am not sure if I like OpenWrt/LuCI moving more toward functionality that is more typical to a full-scale desktop distro. I fear that it will add complexity and new error possibilities. We already had a file browser "luci-app-rosy-file-server" a few years ago (more like a download site ), but the author disappeared rather soon and the app was left unmaintained. (And it initially had some security flaws.) That app was dropped a few years later. The basic functionality might be ok, but when you start talking about moving files, compress archives and "browse archive contents", we are soon in a feature swamp, taking into account the various FS types and archive formats possibly in use. I like the current situation, where LuCI is used for user-friendly high-level config, but if you need to manipulate individual files etc. tasks, you need to familiarize yourself with the SSH console and cmdline in general. |
I agree with your concerns. Still many packages doesn't have a Luci app or is not merged yet like luci-app-sshtunnel, luci-app-tor ;) The Rosy File server may be just one bad example because it become unsupported. If the File Browser will be part of Luci itself that would be much better but this is an additional load to the team. |
Just be realistic: there is not much "LuCI team". Jow is the main guru, feckert has updated a lot, systemcrash recently something, polynomialdivision something, I have taken care of some apps and some general maintenance, but there is no large "LuCI team". There are then several active app maintainers like dibdot, who take care of their own apps. But for the "general LuCI functionality", Jow is (and has been) pretty much alone, especially regarding the more demanding tasks. Thatswhy I am sceptical about introducing apps with complex functionality reaching to file permission changes, file moves, archive browsing, compression etc. Taking into account the diversity of the OpenWrt device/FS universe, the scope quickly grows pretty complex. If a file browser is authored by you, the expectation is that you will take care of it for a few years. Hit-and-run introductions of new apps where the original author quickly loses interest, have gone pretty badly in history. |
Tiny File Manager meet most of your requirements, and only depends on php. |
Several other web file managers: @stokito |
Ok, so even in the current state the simple file browsing will make life easier. I'll remove the separate module and make it just built-in into mod-system. But if anyone interested you can go ahead yourself or call me and we can work together. @muink thank you, the PHP is too big for most routers. But I fill take inspiration from file managers listed here. For sure I can at least grab translations :) |
luci-app-tinyfilemanager looks great, but it's too difficult to install and if I did install it, I might have run out of space But that would have been it, file manager, file editor and a proper terminal would grow openwrt's usability by leaps and bound. |
f2ed6f0
to
2a88abc
Compare
How do I help test this? I'm not sure I have the expertise to make code changes but I can try it out - this is in Snapshots branch? This is something I've been looking for from OpenWRT for a long time, the ability to have a file browser (with upload/download) with minimal if any dependencies (my devices are small) so I can more easily use it as a network file backup or host media for sharing with DLNA. I would love if I could set a default directory that the browser opens to each time, but what you have seems good enough (even if I look forward to the UI improvements). Edit for more details: Apparently, installing Samba takes up ~8mb on 23.05, so this leaves me with about 0.7mb left out of my 16mb device! Meanwhile, installing a different web file manager requires PHP and usually SQL, and it needs separate password/user setup too, if you can even find one that is easily installed in such an unusual and constrained environment. I would expect a built-in manager to take merely a few hundred K on the other hand. |
Sorry, if you wish to test it then you have to install a snapshot version and copy the files that I changed. If you just want to see how it looks you can open |
I look forward to try that on my openwrt running router running stable branch. I think for the openwrt's most regular challenges, the following abilities are most important. Upload a file to a place Hopefully, this lowers the bar for the users which cannot cross the putty/winscp barriers |
In the Browser mode the file tree dialog won't be closed when clicking on a file. The mode is used by a File Browser. Signed-off-by: Sergey Ponomarev <[email protected]>
2a88abc
to
adbde3f
Compare
I managed to get rid off the setTimeout() to click on the Select button to open the file browser.
I think it would be better to introduce such method. Also
Anyway, please merge the PR. Even the basic file browser can solve many problems for users not familiar (yet) with SSH and SCP/SFTP |
OK - since other senior members are AWOL on this change-set, and it looks OK, I'll merge this soon. Can this get picked for 22 and 23? |
I am also not happy at all with having this by default, it will grant full write access to any file on the system for the ui user. And no, please don't pick such a big feature addition + ui rework + permission relaxation into the stable branches, at least not as integral part of luci-mod-system. Maybe it is better to introduce it as application. |
Does app segregation mean it can be handled by acl permissions? |
It means it will not be installed by default and/or it is possible to have builds without it. |
4d24c93
to
fdacde3
Compare
My two cents is that I'd be fine with this as an application. I don't, personally, need this on a bridge or a router with tiny space, but if I'm building something with external storage or media it would be a must. I'm not sure I'm following the permissions discussion, though. It's clearly important, but for an end user like myself, under what modes of operation is it read-only? Do I have to enable it to be editable or is it possible to lock it down and it's default writable? |
Check luci-app-acl. It allows to create a read only user |
I am excited to try this out ! How much space does it take As I wrote in this thread File manager, along with a text editor and console, in luci will remove a major roadblock for new openwrt user to access the complex functions not available in the web interface. |
Sorry for pushing, but can we merge it? |
Not as part of luci-mod-system. |
Allow downloading from a file browser. The Download button is located near to Delete. It's shown only for files: folders or /dev/ devices can't be downloaded. The downloading is made via fs.read_direct() which internally calls cgi-download. Signed-off-by: Sergey Ponomarev <[email protected]>
fdacde3
to
f086bb2
Compare
Ok, now this is a separate app. Made a force push. |
Thanks for taking care of separating it. The only minor thing I see is that the ACL group name should be changed from "luci-mod-system-filebrowser" to "luci-app-filebrowser". Otherwise LGTM. |
Add a File Browser based on the FileUpload CBI element. It allows browsing files and directories on a router, delete and upload. This covers only basic needs. Signed-off-by: Sergey Ponomarev <[email protected]>
f086bb2
to
6afea76
Compare
fixed, force pushed |
Thanks, merged! |
Thank you! Later I'll back to this and will try to change a design and add editing. |
@stokito do you want to create a cherry-pick PR for release? |
base files were changed (ui.js, form.js), so we can't cherry pick potentially breaking changes |
Please create a Weblate translation component https://hosted.weblate.org/projects/openwrt/ |
I did that. |
Nice work! Here is the commit rdmitry0911@3659619 I used a simplest possible approach to reuse the FileUploader while you implemented it as a separate view. This makes your solution slightly bigger. My initial idea was to add the File Manager as a part of Luci core and maybe this will happen later. |
Thank you! It is mostly chatgpt' efforts :) I'll try to make a PR for a new plugin. What name you would propose to distinguish it from yours? filemanager? |
If you make a PR - don't do it from your main/master branch. |
What is the best way to make a PR? |
@rdmitry0911 branch named based the feature name. |
FYI: A new luci-app-filemanager is going to be added in the #7300 |
Luci needs for a file manager.
The FileUpload CBI element allows to browse files and directories on a router, delete and upload. This already covers a basic needs. The only really missing features are:
So we can extend the FileUpload and add a "browser mode" when you don't select a file but just walking on directories. The PR is PoC of the idea: it adds a new menu item System / File Browser that opens a page with the FileUpload in a browser mode:
Here the directory listing was opened automatically and no Cancel or Select buttons.
It's ugly but just something that shows the idea (or even can be used today if you really need).
So my questions are:
Some other existing solutions:
CC @giaulo @muink @xiaozhuai @helmiau @ozon @stangri: You guys may be interested in the topic.