-
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
download files from luci ( use LuCI as file share ) #846
Comments
You should not give them access to /etc and root directories, as then they can also see your settings and other private stuff. By default LuCI allows read access to stuff under /www directory Note that you can utilise symlinks, as explained here:
|
I know this security risk (download from /etc and ...) . But in my app i monitor some sensor information and save them in /tmp folder.(in memory). and then i want access user download this exported info after authenticating with his username and password.Is this not possible ? (Thanks in advance for your response) |
Unfortunately your answer doesn't work for me |
Works for me, but naturally only from LAN. If you want it to work from wan, you need to adjust firewall etc. Below is example of outputting tail of kernel log to file /www/test/test.txt and then how it is visible in the browser:
EDIT:
|
LuCI doesn't actual make a copy of /etc. It only launches a sysupgrade script that collects files from /etc (also also from other places if necessary) and creates an archive of those to /tmp (I think) and then sends that to the browser. Source code for the LuCI side functionality is here, in case you want to write something similar for your needs: https://github.com/openwrt/luci/blob/master/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua#L302 The sysupgrade script is coming from base-files: https://github.com/openwrt/openwrt/blob/master/package/base-files/files/sbin/sysupgrade The easy approach for you is to use the /www like I showed, and just make sure that you have script that copies the files there as needed. If you want more complex access to other parts of the file system, feel free to start coding along the lines I showed here. |
Thank you for your good answers . I will test your suggested solutions and I will announce the results. |
I created a directory in my /etc folder . and then i linked it to /www/test (ln -s /etc/test1 /www/test) |
I've uploaded some files in my OpenWrt root , /etc , /tmp directories.
I want user to be able to download uploaded files from from the above directories .
How can i give a download URL to user , to download that files ?
The text was updated successfully, but these errors were encountered: