Quantcast
Channel: 看得透又看得远者prevail. ppt.cc/flUmLx ppt.cc/fqtgqx ppt.cc/fZsXUx ppt.cc/fhWnZx ppt.cc/fnrkVx ppt.cc/f2CBVx
Viewing all articles
Browse latest Browse all 20548

利用 FileManager(现名Filebrowser) 搭建个人网盘

$
0
0

为什么需要自己搭建网盘

  • 目前网盘大部分不是限速就是限制容量,体验太差;
  • 分享不受限制,高级功能不受会员限制;
  • 具有局域网最大速度访问优势,在线浏览图片、影音速度都可以慢速需求。

FileManager 是什么?

  • 基于 Go 语言提供 Web 交互的文件管理程序,操作方便,轻量级搭建极其简单,多平台支持,可以运行在路由器中;
  • 多用户管理,可以共享系统给他人使用;
  • 文件上传、下载(支持打包下载)、预览、文档在线编辑功能、目录和文件管理创建。

我的使用场景

  • 临时分享文件使用。如果搭建在服务器上,服务器空间昂贵,但是上传和下载速度比普通宽带快,分享临时文件方便快捷;
  • 搭建在路由上,然后路由器通过 frp 内网穿透,远程访问家中路由器上文件,相对 NAS 更加省电,浏览图片和音乐家里的上传带宽也够用;
  • 相对于 Smb、ftp、webdav 连接过程更简单,用于在公用电脑上下载自己常用的软件,不需要安装任何客户端软件。直接建立一个公共只读账户,放一些自己常用的工具软件,方便传输。

如何搭建?

sh https://github.com/filebrowser/filebrowser/raw/master/build.sh





配置 FileManager

简单配置
  • port:服务所用端口
  • database:数据库存放地址
  • scope:需要管理的文件夹路径
  • allowCommands:允许使用指令
  • allowEdit:允许进行文件编辑操作
  • allowNew:允许进行新建文件和文件夹操作
  • 更多配置请参考官方文档 配置文档: https://github.com/filebrowser/filebrowser

1


2


3


4


5


6


7


8


9


10


vim /etc/file/config.json


# 文件内容


{


"port": 1250,


"database": "/etc/database.db",


"scope": "/home/zhangyongcun/doc/",


"allowCommands": true,


"allowEdit": true,


"allowNew": true


}

运行服务


1


filemanager -c /etc/file/config.json

加入 supervisor

1


2


3


4


5


6


7


8


9


10


11


vim /etc/supervisor/conf.d/file.conf


# 文件内容


[program:file]


user=root


command=filemanager -c /etc/file/config.json


process_name=%(program_name)s


autostart=true


redirect_stderr=true


stdout_logfile=/var/log/file.log


stdout_logfile_maxbytes=1MB


stdout_logfile_backups=0

使用 nginx 转发端口

1


2


3


4


5


6


7


8


9


vim /etc/nginx/sites-enabled/file


# 文件内容


server {


listen 80;


server_name file.xxxx.com;


location / {


proxy_pass http://localhost:1250;


}


}

访问:file.xxxx.com 或者 xxxx.com:1250 即可,默认账户:admin 默认密码:admin 登陆之后可以进行密码重置.

项目地址:https://github.com/filebrowser/filebrowser

Viewing all articles
Browse latest Browse all 20548

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>