All Projects → hetianyi → Godfs

hetianyi / Godfs

Licence: apache-2.0
A simple fast, easy use distributed file system written in go.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Godfs

Anydlbot
An Open Source GPLv3 All-In-One Telegram Bot
Stars: ✭ 236 (-7.81%)
Mutual labels:  download, upload
ZDrive
Seamless download/upload contents via Google Drive 📂
Stars: ✭ 25 (-90.23%)
Mutual labels:  download, upload
miniprogram-network
Redefine the Network API of Wechat MiniProgram (小程序网络库)
Stars: ✭ 93 (-63.67%)
Mutual labels:  download, upload
Telegram Upload
Upload and download files from Telegram up to 2GiB using your account
Stars: ✭ 223 (-12.89%)
Mutual labels:  download, upload
kubefilebrowser
kubernetes container filebrowser and webshell
Stars: ✭ 23 (-91.02%)
Mutual labels:  download, upload
Sjnetwork
SJNetwork is a high level network request tool based on AFNetworking and inspired on YTKNetwork.
Stars: ✭ 231 (-9.77%)
Mutual labels:  download, upload
Backdoor
A backdoor that runs on Linux and Windows
Stars: ✭ 36 (-85.94%)
Mutual labels:  download, upload
Httptransfertasks
Cross Platform HTTP Transfers for downloading and uploading (supports background operations)
Stars: ✭ 87 (-66.02%)
Mutual labels:  download, upload
simple http server
simple http server for upload and download
Stars: ✭ 101 (-60.55%)
Mutual labels:  download, upload
speed-cloudflare-cli
📈 Measure the speed and consistency of your internet connection using speed.cloudflare.com
Stars: ✭ 99 (-61.33%)
Mutual labels:  download, upload
Ounotes
An Application built for students to access Notes , Question Papers , Syllabus and Resources for all Subjects of O.U (Osmania University) 📘👨‍🎓
Stars: ✭ 173 (-32.42%)
Mutual labels:  download, upload
PyroGramBot
pluggable Telegram Bot based on Pyrogram
Stars: ✭ 168 (-34.37%)
Mutual labels:  download, upload
Fgdownloader
用于断点下载、任务队列、上传进度、下载进度
Stars: ✭ 143 (-44.14%)
Mutual labels:  download, upload
Bilibiliupload
Stream download and upload, not only for bilibili.
Stars: ✭ 232 (-9.37%)
Mutual labels:  download, upload
Okhttps
如艺术一般优雅,像 1、2、3 一样简单,前后端通用,轻量却强大的 HTTP 客户端(同时支持 WebSocket 与 Stomp 协议)
Stars: ✭ 92 (-64.06%)
Mutual labels:  download, upload
rsync
gokrazy rsync
Stars: ✭ 308 (+20.31%)
Mutual labels:  download, upload
Dropbox Stream
Upload & Download streams for Dropbox
Stars: ✭ 35 (-86.33%)
Mutual labels:  download, upload
Nodestream
Storage-agnostic streaming library for binary data transfers
Stars: ✭ 70 (-72.66%)
Mutual labels:  download, upload
httputils
Http工具包:OkHttp轻量封装 、功能全面、设计力求优雅与纯粹,Java领域前后端处Http问题的新选择。
Stars: ✭ 21 (-91.8%)
Mutual labels:  download, upload
angular-material-datatransfer
A HTML5 datatransfer UI for handling upload and download of multiple simultaneous files.
Stars: ✭ 13 (-94.92%)
Mutual labels:  download, upload

godfs

Build Status go report card

   ____  ____  ____  _________
  / ___\/ __ \/ __ \/ ___/ __/ GoDFS::v2.0.0-dev
 / /_/\  /_/ / /_/ / /__/\ \   A distribute filesystem.
 \____/\____/____./_/______/   github.com/hetianyi/godfs

README | 中文文档

godfs 是一个用go实现的轻量,快速,简单易用的分布式文件存储服务器。

godfs 开箱即用,并对docker支持友好。

你可以在docker hub上下载最新镜像: https://hub.docker.com/r/hehety/godfs/

版本兼容表

特性

  • 快速, 轻量, 开箱即用, 友好的go API
  • 易于扩展,运行稳定
  • 低开销
  • 提供HTTP方式的下载和上传API
  • 支持文件断点下载
  • 跨站点资源保护
  • 支持不同平台下的编译运行: Linux, Windows
  • 更好地支持docker容器
  • 更好的文件迁移解决方案
  • 支持读写和只读文件节点
  • 文件组内自动同步
  • 支持访问令牌

安装

请先安装golang1.11+

以CentOS7为例.

从最新的源码构建:

git clone https://github.com/hetianyi/godfs.git
cd godfs
./make.sh
# Windows下直接点击 make.cmd 开始构建。

构建成功后, 会在bin 目录下生成一个可执行文件:

./bin/godfs

将构建成功的二进制文件安装到目录 /usr/bin:

./install.sh

启动tracker服务:

godfs tracker [options]

启动storage服务:

godfs storage [options]

启动agent服务:

godfs agent [options]

agent为新增节点角色,是storage server的代理,能够代理后端storage服务文件的上传下载,提供给前端服务一个统一的入口点,尤其在http协议下能够屏蔽组内文件同步的延时问题和下载容错问题。

上传文件:

# 已有tracker
godfs client upload /you/upload/file [--trackers <pass>@<host>:<port>[,<pass>@<host>:<port>]]
# 没有tracker服务器,也可以直接上传到指定的storage服务器
godfs client upload /you/upload/file [--storages <pass>@<host>:<port>[,<pass>@<host>:<port>]]

architecture

如果你想上传文件到指定的group,可以在命令行加参数-g <groupID>

你还可以用一个更酷的命令来上传一个文件夹下所有的文件:

godfs client upload * --trackers <trackers>

architecture

也可以使用 curl 来上传文件:

curl -F "[email protected]/your/file" "http://your.host:http_port/upload"

上传成功之后,服务器会返回一个json字符串:

{
    "accessMode":"public",
    "form":[
        {
            "index":1,
            "type":"file",
            "name":"f",
            "value":"fme_eval.msi",
            "size":1309757440,
            "group":"G01",
            "instanceId":"9de71d97",
            "md5":"71e55b30e36b1b8c3343270f86bb6234",
            "fileId":"CfzJHbO1MS84thD13PWEsLIURCw_ZZ7bIqPgpWFJxZ3Ad1cZFzTSL9AMP1CnCChK3Au9dqQ0ciAmdQ5Oaxgj0g"
        }
    ]
}

其中, form 是post表单中的所有字段的name-value信息,文件已被替换为上传之后的路径地址 如果你想上传文件到指定的group,可以在路径上加参数?group=<groupID>

# 下载文件
godfs client download CfzJHbO1MS84thD13PWEsLIURCw_ZZ7bIqPgpWFJxZ3Ad1cZFzTSL9AMP1CnCChK3Au9dqQ0ciAmdQ5Oaxgj0g --name 123.zip

Token的使用

token能够控制一个私有文件在一定时间内的可访问性。

token需要在后端根据secret自行生成,godfs只需要计算并匹配token,token携带的格式如下:

http://...?tk=&ts=

token计算:

md5(timestamp+filemd5+secret) ==> token

构建docker镜像:

cd godfs/docker
docker build -t godfs:latest .

推荐使用docker来运行godfs,最新的godfs的docker镜像可以在 docker hub 获取:

docker pull hehety/godfs

启动tracker服务器:

docker run -d --net host --name tracker hehety/godfs:2.0.0-dev \
godfs tracker \
--bind-address 0.0.0.0 \
--secret 123123 \
--data-dir /godfs/data

启动storage服务器:

docker run -d --net host --name s1  hehety/godfs:2.0.0-dev \
godfs storage \
--bind-address 0.0.0.0 \
--secret 123123 \
--data-dir /godfs/data \
--log-dir /godfs/logs \
--trackers [email protected]:11706 \
--preferred-network eth0

你可以使用docker的命令-e来覆盖配置文件中的相应配置。

客户端命令:

Usage: godfs [global options] command [command options] [arguments...]

Commands:

     tracker  start as tracker server
     storage  start as storage server
     client   godfs client cli
     help, h  Shows a list of commands or help for one command

Options:

   --version, -v  show version
   --help, -h     show help
说明:

godfs 2.0版本移除了sqlite数据库(在1.x中测试发现,sqlite数据库文件在大并发和大数据量的情况下可能会出现损坏和无法写入情况),使用boltdb来存储配置数据,使用gox包的set来存储文件id,简化的数据存储策略能够大幅提升随机写入性能。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].