Skip to content

Commit ea728a8

Browse files
Merge pull request #2 from chrisfosterelli/README
Add README and License
2 parents 9598a31 + d984710 commit ea728a8

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Two Story Robot
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# simple-file-upload
2+
3+
Docker container that provides an API endpoint for simple, secure file uploads.
4+
5+
This docker container exposes a single, write-only endpoint at `/upload` that
6+
accepts a single file along with a `token` GET parameter for authentication. The
7+
authentication for the endpoint, along with the location of the uploaded file,
8+
is configured using environment variables on the container.
9+
10+
You can upload a file with curl like so:
11+
12+
```bash
13+
> curl -XPOST -F '[email protected]' dockerhost:3000/upload?key=TESTUSER
14+
```
15+
16+
Multiple keys are supported, and every key is a 1:1 mapping to a location on
17+
disk. Any additional uploads for a key will override the previous upload for
18+
that key.
19+
20+
The design goals for this container are a secure upload tool that:
21+
1. Can only be used to upload files, not download or read them
22+
2. Can only be used with a matching authentication key
23+
3. Can only upload to a single location per authentication key
24+
4. Can only override the previous upload, not store additional uploads
25+
26+
# How to Use
27+
28+
Basic usage is as follows:
29+
30+
```
31+
docker run \
32+
-e "KEY_TESTUSER=/uploads/testuser-file.txt" \
33+
-v /my_local_dir/:/uploads/ \
34+
-p 3000:3000 \
35+
twostoryrobot/simple-file-upload
36+
```
37+
38+
This will start the upload server, listening on port 3000. Files that are
39+
uploaded with the key `TESTUSER` will be placed at `/uploads/testuser-file.txt`.
40+
You can use a volume to get easy access to this file on your host machine, or in
41+
another container.

0 commit comments

Comments
 (0)