Temporary file storage
$ asdf install
$ go run .$ go test ./...Docker image is built and pushed automatically on push to main. See .github/workflows/build.yaml.
Required environment variables:
| Variable | Description |
|---|---|
db_url |
PostgreSQL connection string |
bucket_name |
GCS bucket name |
base_url |
Download URL prefix (default: https://dropbox-files.deploys.app/) |
PORT |
Listen port (default: 8080) |
Endpoint: https://dropbox.deploys.app/
POST /
dropbox.upload
| Name | Type | Data Type | Description |
|---|---|---|---|
| Authorization | required | string | Authorization token |
| Param-Ttl | optional | number | 1-7, default 1 |
| Param-Project | required | string | Project name |
| Param-Filename | optional | string | Filename in Content-Disposition |
| Name | Type | Data Type | Description |
|---|---|---|---|
| ttl | optional | number | 1-7, default 1 |
| project | required | string | Project name |
| projectId | optional | string | Project ID (alternative to project name) |
| filename | optional | string | Filename in Content-Disposition |
Query parameters take precedence over headers when both are provided.
File data binary
{
"ok": true,
"result": {
"downloadUrl": "https://dropbox-files.deploys.app/1<filename>",
"expiresAt": "2020-01-01T01:01:01Z"
}
}{
"ok": false,
"error": {
"message": "api: unauthorized"
}
}# using query parameters
$ http POST https://dropbox.deploys.app/?ttl=1&project=my-project \
Authorization:"Bearer <token>" \
< file
# using headers
$ http POST https://dropbox.deploys.app/ \
Authorization:"Bearer <token>" \
param-ttl:1 \
param-project:my-project \
< file