Skip to content

Releases: orhun/rustypaste

v0.16.0

11 Dec 12:08
8954ce4
Compare
Choose a tag to compare

Added

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.

  • Add support for multiple auth tokens via env vars by @nydragon in #339

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

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

v0.15.1

29 Jul 20:08
22162c0
Compare
Choose a tag to compare

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

27 Mar 20:09
44c07a3
Compare
Choose a tag to compare

Added

  • Allow to override filename when using random_url by @tessus in #233

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
  • Use more specific HTTP status codes by @tessus in #262

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

v0.14.4

20 Dec 19:53
c8dd415
Compare
Choose a tag to compare

Removed

  • Remove excessive warning messages when auth tokens are not found (#210) (Thanks @tessus!)

v0.14.3

12 Dec 18:32
d6e1968
Compare
Choose a tag to compare

Changed

  • Return 404 for not exposed endpoints instead of 403
  • Disallow blank delete_tokens and auth_tokens
  • Bump dependencies

Thanks to @DDtKey for contributing to this release and creating protect-endpoints. 💖

v0.14.2

05 Dec 12:28
d4b02ec
Compare
Choose a tag to compare

Added

  • Add installation instructions for FreeBSD (#177)
  • Add auth token handling to HTML form example (#183)
  • Add release instructions

Changed

  • Bump Shuttle to 0.34.1
  • Bump dependencies

v0.14.1

02 Nov 23:09
79662d6
Compare
Choose a tag to compare

Changed

  • Switch to tracing for logging (#163)
  • Bump Shuttle to 0.31.0
  • Bump dependencies

v0.14.0

05 Sep 17:47
f46d2f5
Compare
Choose a tag to compare

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

26 Aug 20:43
a44ae94
Compare
Choose a tag to compare

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

v0.12.1

11 Aug 12:27
77f0e42
Compare
Choose a tag to compare

Fixed

  • Do not list expired files (#109)