cute-file-explorer

资源下载

http://iscute.cn/chfs
http://iscute.cn/tar/chfs/1.10/chfs-linux-amd64-1.10.zip
http://iscute.cn/tar/chfs/1.10/chfs-mac-amd64-1.10.zip
http://iscute.cn/tar/chfs/2.0/chfs-linux-amd64-2.0.zip
http://as4k.top:7000/chfs/shared/linux-pkg/chfs-linux-amd64-2.0.zip

linux

#filename: xchfs.sh
nohup /usr/local/bin/chfs --path="/xdata/xdld" --port=6666 --rule="::r|admin:xingyongsheng-top:rw|as4k:123456::as4k:rw" &> /tmp/chfs.log &

macOS

#filename: xchfs.sh
nohup /Users/as4kmbp/as4kdp/chfs/chfs --path="/Users/as4kmbp/as4kdp/hugo/xdocs/content/images" --port=8000 --rule="::r|admin:xingyongsheng.top:rw" &> /Users/as4kmbp/as4kdp/chfs/chfs.log &

anybody can access any thing by default
./chfs --help


kill `ps aux | grep "/Users/as4k/As4k/xgreen-app/chfs" | grep -v grep  | awk '{print $2}'`
nohup /Users/as4k/As4k/xgreen-app/chfs --path="/Users/as4k/As4k/xgreen-app/chfs-data" --port=8000 &> /Users/as4k/As4k/xgreen-app/chfs.20200819.log &

chfs-on-aws


mkdir -p /xdata/chfs20/;
nohup /usr/bin/chfs --path="/xdata/chfs20/" --port=80 --rule="::r|admin:xingyongsheng:rw" &> /root/chfs.log &

webdav

mac访问

http://fs.as4k.com:7778/webdav

win10

http://fs.as4k.com:7778/webdav 不能直接访问(似乎需要修改注册表)

http://192.168.1.8/webdav 可以直接访问(似乎需要修改注册表)

ubuntu18.04

可以直接访问 dav://fs.as4k.com:7778/webdav

API使用


http://192.168.1.8/asset/api.html#true2-8
http://iscute.cn/chfs
http://192.168.1.8/#/xshare/dp265


查看目录列表
root@DESKTOP-PM5KOT8:~# curl 192.168.1.8/chfs/files?filepath=dp265
{"virtualRoot":0,"currentMask":"RWD","files":[{"name":"ROOT.tar.gz", "dir":false, "size":205258256, "modified":"2020-01-02 15:07:05", "icon":"asset/icons/unknown.svg", "mask":"RWD","guestMask":"RWD","hasSubDir":false},{"name":"sdfdsf.txt", "dir":false, "size":0, "modified":"2020-01-05 16:08:28", "icon":"asset/icons/txt.svg", "mask":"RWD","guestMask":"RWD","hasSubDir":false},{"name":"tools.jar", "dir":false, "size":8610238, "modified":"2020-01-02 16:10:22", "icon":"asset/icons/unknown.svg", "mask":"RWD","guestMask":"RWD","hasSubDir":false}]}root@DESKTOP-PM5KOT8:~# 

重命名 curl -X POST http://192.168.1.8/chfs/rename -F old="/dp265/TEST/xx.txt" -F new="new.txt"

用户登录
[root@ip-172-31-42-40 ~]# curl -v -X POST http://aws.as4k.top/chfs/session -F user="admin" -F pwd="xingyongsheng"
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 18.162.214.190...
* TCP_NODELAY set
* Connected to aws.as4k.top (18.162.214.190) port 80 (#0)
> POST /chfs/session HTTP/1.1
> Host: aws.as4k.top
> User-Agent: curl/7.61.1
> Accept: */*
> Content-Length: 249
> Content-Type: multipart/form-data; boundary=------------------------794047b448e26579
> 
< HTTP/1.1 201 Created
< Set-Cookie: JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2MiOiJhZG1pbiIsImV4cCI6MTU3ODIxNzAxOX0.1TiA3AHQey7kZNefFBhWOjJwuO4F9xNVY6y3Nk4WksI; Path=/; Expires=Tue, 05 Jan 2021 09:06:59 GMT; HttpOnly
< Set-Cookie: user=admin; Path=/; Expires=Tue, 05 Jan 2021 09:06:59 GMT
< Date: Sun, 05 Jan 2020 09:06:59 GMT
< Content-Length: 0
< 
* Connection #0 to host aws.as4k.top left intact


上传文件
curl -X POST http://192.168.1.8/chfs/upload -F file=@local-file.txt -F folder=/remote-dir
curl -X POST http://192.168.1.8/chfs/upload -F file=@tmp.txt -F folder=/dp265/TEST

需要登录上传文件
curl -X POST http://aws.as4k.top/chfs/upload -H 'Cookie: JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2MiOiJhZG1pbiIsImV4cCI6MTU3ODIxOTg0NH0.kHt6kFcQExJBvfkSHgI_BDc-gdLYt4bzc_hkKCoXTXc' -F file=@tmp.txt.tar.gz -F folder=/
注意这里的根路径是chfs服务存放资源的更路径,不是Linux系统的根路径

curl 'http://aws.as4k.top/chfs/upload' -H 'Connection: keep-alive' -H 'Origin: http://aws.as4k.top' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36' -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryioicNwTA0y3J8kji' -H 'Accept: */*' -H 'Referer: http://aws.as4k.top/' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: zh-CN,zh;q=0.9' -H 'Cookie: JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2MiOiJhZG1pbiIsImV4cCI6MTU3ODIxOTg0NH0.kHt6kFcQExJBvfkSHgI_BDc-gdLYt4bzc_hkKCoXTXc; user=admin' --data-binary $'------WebKitFormBoundaryioicNwTA0y3J8kji\r\nContent-Disposition: form-data; name="file"; filename="redis-4.0.14.tar.gz"\r\nContent-Type: application/x-gzip\r\n\r\n\r\n------WebKitFormBoundaryioicNwTA0y3J8kji\r\nContent-Disposition: form-data; name="folder"\r\n\r\n\r\n------WebKitFormBoundaryioicNwTA0y3J8kji--\r\n' --compressed --insecure