Releases: orhun/rustypaste
v0.16.0
Added
- Support
max_upload_dir_size
by @Narayanbhat166
Now you can configure the server to limit the total size of the uploaded files as follows:
[server]
max_upload_dir_size = "100G"
This would help with e.g. public instances in terms of avoiding a storage attack where a single user uploads a bunch of big/small files.
In addition to [server].auth_tokens
and [server].delete_tokens
in the configuration file, it has been made possible to set multiple tokens for authentication and deletion via their respective environment variables.
AUTH_TOKENS_FILE
: Points to a file containing a list of tokens for authentication, one per line.DELETE_TOKENS_FILE
: Points to a file containing a list of tokens for deletion, one per line.
For example:
export AUTH_TOKENS_FILE=./auth_file
and auth_file
contains:
bread
brioche
baguette
naan
Changed
- Allow shortening URLs with a filename by @Vaelatern in #373
This enable naming shortened URLs beyond using a random string or the text "url". For example:
$ curl -s -F "url=https://shorten.this" -H "filename: abc" "<server_address>"
The shortened URL will be saved as abc
in the server.
- Update all dependencies
Removed
I'm looking for a service to publicly host a rustypaste instance.
If you have any suggestions or want to sponsor this, please let me know in this issue!
New Contributors
- @Narayanbhat166 made their first contribution
- @Vaelatern made their first contribution in #374
- @nydragon made their first contribution in #339
v0.15.1
Added
- Include file creation date in the file list (
creation_date_utc
)
$ curl "http://<server_address>/list" | jq .
[
{
"file_name": "immense-goose.txt",
"file_size": 416,
"creation_date_utc": "2024-06-12 19:21:56",
"expires_at_utc": null
}
]
- Enable Docker ARM64 builds
- Add @tessus as a maintainer
Removed
- Remove public instance link and blog post from README.md
Fixed
- Fix uploading reports to codecov
New Contributors
Full Changelog: v0.15.0...v0.15.1
v0.15.0
Added
Now you can use the filename
header to override the name of the uploaded file.
For example:
curl -F "[email protected]" -H "filename:override.txt" http://localhost:8000
Even if random_url
is set, the filename will be override.txt
rustypaste-cli
also has a new argument for overriding the file name:
rpaste -n filename-on-server.txt awesome.txt
rustypaste
now returns more appropriate status codes in the following 2 cases (instead of a generic 500 code):
- If the mime type is on the blacklist:
UnsupportedMediaType
(415) - If the file already exists:
Conflict
(409)
Changed
- Do path joins more safely by @RealOrangeOne in #247
- Gracefully exit when there is no config file found by @orhun
- Switch to cargo-llvm-cov for code coverage by @orhun in #260
- Replace unmaintained action by @tessus in #266
- Set up mergify by @orhun
- Apply clippy suggestions by @orhun
- Update funding options by @orhun
- Update the copyright years by @orhun
- Bump dependencies
Fixed
- Improve logging for deleted file by @tessus in #235
- Fix deployment by @tessus in #236
- Return the correct file on multiple files with same name by @tessus in #234
- Update the hash of the example file by @tessus in #254
- Error on upload with the same filename by @tessus in #258
New Contributors
- @RealOrangeOne made their first contribution in #247
v0.14.4
v0.14.3
v0.14.2
v0.14.1
v0.14.0
Added
- Add delete endpoint (#136)
Now you can delete files from the server with sending a DELETE
request. To enable this, set the delete_tokens
array in the configuration file or use the DELETE_TOKEN
environment variable.
[server]
delete_tokens = [ "may_the_force_be_with_you" ]
And then you can send a DELETE
request as follows:
$ curl -H "Authorization: may_the_force_be_with_you" -X DELETE "<server_address>/file.txt"
file deleted
You can also use rpaste
(the command line tool) to delete files:
$ rpaste -d awesome.UA86.txt
Changed
- Update crates and rustls deps (#135)
- Bump Shuttle to
0.25.0
v0.13.0
Added
- Support handling spaces in filenames (#107)
Now you can replace the whitespaces with either underscore or encoded space (%20
) character in the filenames.
For example:
[server]
handle_spaces = "replace"
$ curl -F "file=@test file.txt" <server_address>
<server_address>/test_file.txt
Or you can use encoded spaces:
[server]
handle_spaces = "encode"
$ curl -F "file=@test file.txt" <server_address>
<server_address>/test%20file.txt
Please note that random_url
should not be configured to use the original file names.
Changed
- Improve random_url config handling (#122)
[paste].random_url.enabled
is deprecated. You can now disable random URLs by commenting out [paste].random_url
.
# enabled
random_url = { type = "petname", words = 2, separator = "-" }
# disabled
# random_url = { type = "petname", words = 2, separator = "-" }
- Replace unmaintained actions (#116)
- Bump Shuttle to
0.24.0
- Bump dependencies
Fixed
- Don't log invalid token in release builds (#112)
Before, invalid tokens were logged as follows:
[2023-08-13T19:24:30Z WARN rustypaste::auth] authorization failure for a.b.c.d (header: invalid_token)
Now, we print the token only in debug mode. In release mode, the log entry will look like this:
[2023-08-13T19:24:30Z WARN rustypaste::auth] authorization failure for a.b.c.d