Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/simon987/ws_bucket
- Owner: simon987
- License: gpl-3.0
- Created: 2019-03-04T23:13:06.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-10T00:25:05.000Z (over 5 years ago)
- Last Synced: 2024-10-30T01:44:03.506Z (2 months ago)
- Topics: fasthttp, websocket
- Language: Go
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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":
}
```