Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/simon987/ws_bucket

Simple websocket-based file upload service with token-based auth
https://github.com/simon987/ws_bucket

fasthttp websocket

Last synced: 16 days ago
JSON representation

Simple websocket-based file upload service with token-based auth

Awesome Lists containing this project

README

        

[![Build Status](https://ci.simon987.net/buildStatus/icon?job=ws_bucket)](https://ci.simon987.net/job/ws_bucket/) [![CodeFactor](https://www.codefactor.io/repository/github/simon987/ws_bucket/badge)](https://www.codefactor.io/repository/github/simon987/ws_bucket)

### Docker example

```bash
docker run --rm -v $PWD/data:/data -p 3020:3020 -e WS_BUCKET_SECRET=secret simon987/ws_bucket
```

### Environment variables

| Name | Default |
|:---|:---|
| `WS_BUCKET_ADDR` | `0.0.0.0:3020` |
| `WS_BUCKET_WORKDIR` | `./data` |
| `WS_BUCKET_LOGLEVEL` | `trace` |
| `WS_BUCKET_CONNSTR` | `host=localhost user=ws_bucket dbname=ws_bucket password=ws_bucket sslmode=disable` |
| `WS_BUCKET_DIALECT` | `postgres` |
| `WS_BUCKET_SECRET` | `default_secret`* |

\* You should change this value!

### Running tests
```bash
export WS_BUCKET_ADDR=0.0.0.0:3021
export WS_BUCKET_WORKDIR=.

cd test/
go test
```

### Auth
Administration endpoints require HMAC_SHA256 authentication.
Request header:
```
{
"Timestamp":
"X-Signature":
}
```

Upload endpoint requires a valid upload token:
```
{
"X-Upload-Token":
}
```