2023-02-14 19:22:51 +01:00
|
|
|
# up
|
|
|
|
|
Simple standalone file upload server with api and cli
|
2023-02-17 13:22:29 +01:00
|
|
|
|
|
|
|
|
## TODO
|
|
|
|
|
|
|
|
|
|
- implement goroutine to expire after 1d, 10m etc
|
2023-03-01 16:28:53 +01:00
|
|
|
implemented. add go routine to server, use Db.Iter()
|
2023-02-17 13:22:29 +01:00
|
|
|
- use bolt db to retrieve list of items to expire
|
|
|
|
|
- also serve a html upload page
|
|
|
|
|
- add auth options (access key, users, roles, oauth2)
|
|
|
|
|
- add metrics
|
|
|
|
|
- add upctl command to remove a file
|
2023-02-24 12:16:03 +01:00
|
|
|
- use global map of api endpoints like /file/get/ etc
|
2023-02-28 19:05:09 +01:00
|
|
|
- create cobra client commands (upload, list, delete, edit)
|
|
|
|
|
|
2023-03-07 20:06:13 +01:00
|
|
|
## BUGS
|
|
|
|
|
|
|
|
|
|
### upctl HTTP 413 weird behavior
|
|
|
|
|
|
|
|
|
|
- with -d reports correctly the 413, w/o it, it reports the timeout before.
|
2023-02-28 19:05:09 +01:00
|
|
|
|
|
|
|
|
## curl commands
|
|
|
|
|
|
|
|
|
|
### upload
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
curl -X POST localhost:8080/api/putfile -F "upload[]=@xxx" -F "upload[]=@yyy" -H "Content-Type: multipart/form-data"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### download
|
|
|
|
|
```
|
|
|
|
|
curl -O http://localhost:8080/api/v1/file/388f41f4-3f0d-41e1-a022-9132c0e9e16f/2023-02-28-18-33-xxx
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### delete
|
|
|
|
|
```
|
|
|
|
|
curl -X DELETE http://localhost:8080/api/v1/file/388f41f4-3f0d-41e1-a022-9132c0e9e16f/
|
|
|
|
|
curl -X DELETE http://localhost:8080/api/v1/file/?id=388f41f4-3f0d-41e1-a022-9132c0e9e16f/
|
|
|
|
|
curl -X DELETE -H "Accept: application/json" -d '{"id":"$id"}' http://localhost:8080/api/v1/file/
|
|
|
|
|
```
|