8 char id + item_explanation change

This commit is contained in:
Paul Zinselmeyer 2023-04-20 14:28:53 +02:00
parent 574e906439
commit 1ff78e414f
2 changed files with 7 additions and 4 deletions

View file

@ -4,7 +4,7 @@ All following requests can only read the uploaded data.
To use the build-in link-shortener functionality you have to POST the URL with Content-Type: text/x-uri or Content-Type: text/uri-list.
To change the default expiration date, you can use the `?ttl=` parameter. It supports durations like `60s`, `60m`, `24h`, `30d`, `12M`, `1y` or iso dates like `1970-01-01T00:00:00` in UTC timezone.
To change the default expiration date of one month, you can use the `?ttl=` parameter. It supports durations like `60s`, `60m`, `24h`, `30d`, `12M`, `1y` or iso dates like `1970-01-01T00:00:00` in UTC timezone.
## Upload a link
`$ curl -H "Content-Type: text/x-uri" --data "https://example.com" <bin_url>`
@ -19,8 +19,11 @@ To change the default expiration date, you can use the `?ttl=` parameter. It sup
`$ tar -cz my-files* | curl -X POST -H "Content-Type: application/gzip" -T - <bin_url>`
## Enryption
`$ tar -cz my-files | gpg -c | curl -X POST -H "Content-Type: application/octet-stream" -T - <bin_url>`
`$ curl <bin_url> | gpg -d - | tar -xzf`
```
$ tar -cz my-files | gpg -co tmp.tar.gz
$ curl -X POST -H "Content-Type: application/octet-stream" -T tmp.tar.gz <bin_url>
$ curl <bin_url> | gpg -d - | tar -xzf
```
## Accessing the data
After uploading data you can access it by accessing <bin_url> with an optional file extension that suits the data that you uploaded.

View file

@ -185,7 +185,7 @@ pub async fn handle_callback(
let id = rand::thread_rng()
.sample_iter(Alphanumeric)
.take(16)
.take(8)
.map(char::from)
.collect::<String>();