@@ -6,10 +6,62 @@ filedrop
66[ ![ Issues] ( https://img.shields.io/github/issues-raw/foxcpp/filedrop.svg?style=flat-square )] ( https://github.com/foxcpp/filedrop/issues )
77[ ![ License] ( https://img.shields.io/github/license/foxcpp/filedrop.svg?style=flat-square )] ( https://github.com/foxcpp/filedrop/blob/master/LICENSE )
88
9- Too lightweight file storage server with HTTP API.
9+ Lightweight file storage server with HTTP API.
1010
11- ** Currently filedrop is implemented only as a library. Sections below also
12- document ideas for standalone server. See issue #3 .**
11+ ### Features
12+ - Painless configuration! You don't even have to ` rewrite ` requests on your reverse proxy!
13+ - Limits support! Link usage count, file size and storage time.
14+ - Embeddable! Can run as part of your application.
15+
16+ You can use filedrop either as a standalone server or as a part of your application.
17+ In former case you want to check ` filedropd ` subpackage, in later case just
18+ import ` filedrop ` package and pass config stucture to ` filedrop.New ` , returned
19+ object implements ` http.Handler ` so you can use it how you like.
20+
21+ ### Installation
22+
23+ This repository uses Go 1.11 modules. Things may work with old ` GOPATH `
24+ approach but we don't support it so don't report cryptic compilation errors
25+ caused by wrong dependency version.
26+
27+ ` master ` branch contains code from latest (pre-)release. ` dev ` branch
28+ contains bleeding-edge code. You probably want to use one of [ tagged
29+ releases] ( https://github.com/foxcpp/filedrop/releases ) .
30+
31+ #### SQL drivers
32+
33+ filedrop uses SQL database as a meta-information storage so you need a
34+ SQL driver for it to use.
35+
36+ When building standalone server you may want to enable one of the
37+ supported SQL DBMS using build tags:
38+ * ` postgres ` for PostgreSQL
39+ * ` sqlite3 ` for SQLite3
40+ * ` mysql ` for MySQL
41+
42+ ** Note:** No SQL server support is planned. However if you would like
43+ to see it - PRs are welcome.
44+
45+ When using filedrop as a library you are given more freedom. Just make
46+ sure that you import driver you use.
47+
48+ #### Library
49+
50+ Just use ` github.com/foxcpp/filedrop ` as any other library. Documentation
51+ is here: [ godoc.org] ( https://godoc.org/github.com/foxcpp/filedrop ) .
52+
53+ #### Standalone server
54+
55+ See ` fildropd ` subdirectory. To start server you need a configuration
56+ file. See example [ here] ( filedrop.example.yml ) . It should be pretty
57+ straightforward. Then just pass path to configuration file in
58+ command-line arguments.
59+
60+ ```
61+ filedropd /etc/filedropd.yml
62+ ```
63+
64+ systemd unit file is included for your convenience.
1365
1466### HTTP API
1567
@@ -49,27 +101,7 @@ and allow it to be downloaded not more than 10 times.
49101
50102### Authorization
51103
52- filedrop supports very basic access control. Basically, it can execute SQL
53- query with contents of ` Authorization ` header and file name. If query returns 1 - access
54- will be allowed, if query returns 0 or fails - client will get 403.
55-
56- Also if you are using filedrop as a library, you can instead just pass custom
57- authorization callback.
58-
59- See [ configuration example] ( filedrop.example.yml ) for details.
60-
61- ### Installation
62-
63- ` go get ` or clone this repo and build binary from ` filedropd ` package. Pass
64- path to configuration in first argument. You are perfect.
65-
66- ### Configuration
67-
68- [ Documented example] ( filedrop.example.yml ) is included in repo, check it out.
69-
70- ### Embedding
104+ When using filedrop as a library you can setup custom callbacks
105+ for access control.
71106
72- If your backend server is written in Golang or you are not a big fan of
73- microservices architecture - you can run filedrop server as part of your
74- program. See [ documentation] ( godocs.org/github.com/foxcpp/filedrop ) for
75- details.
107+ See ` filedrop.AuthConfig ` documentation.
0 commit comments