23

GitHub - zhaojun1998/zfile: 在线云盘

 4 years ago
source link: https://github.com/zhaojun1998/zfile
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Z-File

https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square Codacy Badge https://img.shields.io/badge/springboot-2.0.6-orange.svg?style=flat-square GitHub tag (latest SemVer)

此项目是一个在线文件目录的程序, 支持各种对象存储和本地存储, 使用定位是个人放常用工具下载, 或做公共的文件库. 不会向多账户方向开发.

前端基于 h5ai 的原有功能使用 Vue 重新开发了一遍. 后端采用 SpringBoot, 数据库采用内嵌数据库.

预览地址: https://zfile.jun6.net

系统特色

  • 内存缓存 (免安装)
  • 内存数据库 (免安装)
  • 个性化配置
  • 自定义目录的 header 说明文件
  • 自定义 JS, CSS
  • 文件夹密码
  • 支持在线浏览文本文件, 视频, 图片, 音乐. (支持 FLV 和 HLS)
  • 文件/目录二维码
  • 缓存动态开启, 缓存自动刷新
  • 全局搜索
  • 支持 阿里云 OSS, FTP, 华为云 OBS, 本地存储, MINIO, OneDrive 国际/家庭/个人版, OneDrive 世纪互联版, 七牛云 KODO, 腾讯云 COS, 又拍云 USS.

快速开始

安装依赖环境:

# CentOS系统
yum install -y java-1.8.0-openjdk unzip

# Debian/Ubuntu系统
apt update
apt install -y openjdk-8-jre-headless unzip

下载项目:

wget -P ~ https://c.jun6.net/ZFILE/zfile-0.9.war
cd ~
mkdir zfile && unzip zfile-0.9.war -d zfile && rm -rf zfile-0.9.war
chmod +x ~/zfile/bin/*.sh

程序的目录结构为:

├── zfile
    ├── META-INF
    ├── WEB-INF
    └── bin
        ├── start.sh    # 启动脚本
        └── stop.sh     # 停止脚本
        ├── restart.sh  # 重启脚本

启动项目:

 ~/zfile/bin/start.sh

停止项目:

 ~/zfile/bin/stop.sh

重启项目:

 ~/zfile/bin/restart.sh

修改配置文件:

vim ~/zfile/WEB-INF/classes/application.yml

默认启动端口为 8080, 如需请配置文件请编辑上述文件, 修改后重启程序生效.

访问地址:

用户前台: http://127.0.0.1:8080/#/main

初始安装: http://127.0.0.1:8080/#/install

管理后台: http://127.0.0.1:8080/#/admin

OneDrive 使用教程.

访问地址进行授权, 获取 accessToken 和 refreshToken:

国际/家庭/个人版:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=09939809-c617-43c8-a220-a93c1513c5d4&response_type=code&redirect_uri=https://zfile.jun6.net/onedirve/callback&scope=offline_access%20User.Read%20Files.ReadWrite.All

世纪互联版:

https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize?client_id=4a72d927-1907-488d-9eb2-1b465c53c1c5&response_type=code&redirect_uri=https://zfile.jun6.net/onedirve/china-callback&scope=offline_access%20User.Read%20Files.ReadWrite.All

然后分别填写至访问令牌和刷新令牌即可:

http://cdn.jun6.net/2020-01-24_18-57-06.png

运行环境

  • JDK: 1.8
  • 缓存: caffeine
  • 数据库: h2/mysql

预览

前台首页 后台设置 存储策略 缓存管理

常见问题

数据库

缓存默认支持 h2mysql, 前者为嵌入式数据库, 无需安装, 但后者相对性能更好.

默认路径

默认 H2 数据库文件地址: ~/.zfile/db/, ~ 表示用户目录, windows 为 C:/Users/用户名/, linux 为 /home/用户名/, root 用户为 /root/

头尾文件和加密文件

  • 目录头部显示文件名为 header.md
  • 目录需要密码访问, 添加文件 password.txt (无法拦截此文件被下载, 但可以改名文件)

TODO

  • 文本预览更换更好用的编辑器
  • 后台支持上传、编辑、删除等操作
  • API 支持
  • 更方便的部署方式

支持作者

如果本项目对你有帮助,请作者喝杯咖啡吧。

687474703a2f2f63646e2e6a756e362e6e65742f616c697061792e706e67

687474703a2f2f63646e2e6a756e362e6e65742f7765636861742e706e67


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK