GithubHelp home page GithubHelp logo

fileman's Introduction

fileman

一个简单的文件中转服务器 !!!

场景:

存储临时文件, 在终端通过curl、wget就可对文件的上传下载,另外fileman对接oss存储, 屏蔽了oss sdk的使用.

support storage:

  • local storage
  • aliyun oss storage
  • s3 (minio)

todo:

  • other oss

API

upload

post

/upload          (select default storage)
/upload/local    (select local host storage)
/upload/oss      (select aliyun oss)

download

get

/file/{filename}              (...)
/downlaod/oss/{filename}      (...)
/downlaod/local/{filename}    (...)

Run

config

fileman.yaml

# 监听地址
listen_address: ":8080"

# 文件存放目录
upload_dir: "/tmp"

basic_auth:
  enable: false
  username: "test-user"
  password: "hello"

# 阿里云OSS
oss:
  enable: true
  public: true
  endpoint: ""
  access_key: ""
  access_secret: ""
  bucket_name: ""

s3:
  enable: true
  use_ssl: false
  endpoint: ""
  access_key: ""
  access_secret: ""
  bucket_name: ""

dev run

make run

Usage

build && install

make build
make install

默认安装到

/usr/local/bin/

手动启动

fileman -c /tmp/fileman.yaml

如果不指定配置文件, 配置文件的搜索顺序为

  • {current path}
  • /etc/
  • /etc/file_transfer

Example

no basic auth

upload

$> curl -F [email protected] http://localhost:8080/upload/local

filename: 643616221782092862
download: http://localhost:8080/download/local/643616221782092862

download

$> curl -o {filename} http://localhost:8080/download/local/{filename}

basic auth

upload/downlaod (curl/wget)

$> curl --user user:password -F [email protected] http://localhost:8080/upload/local

$> curl --user user:password http://localhost:8080/download/local/{filename}
or
$> wget --http-user=user --http-password=password http://localhost:8080/download/local/{filename}

fileman's People

Contributors

rfyiamcool avatar

Stargazers

 avatar Larry Xu avatar Eliah Rusin avatar bytehello avatar Max Zhang avatar marlon avatar Lubomir Anastasov avatar

Watchers

 avatar  avatar

Forkers

freemanpolys

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.