orhun / rustypaste

A minimal file upload/pastebin service.
https://blog.orhun.dev/blazingly-fast-file-sharing
MIT License
771 stars 48 forks source link

paste with random names collide #312

Closed CvH closed 3 months ago

CvH commented 3 months ago

We have several pastes that were generated with the same random name (running rustypaste 0.14.2 at ubuntu).

config

[paste]
random_url = { type = "petname", words = 2, separator = "-" }

The command that creates that pastes for us is

#!/bin/sh
cat "$@" | curl https://server.com -F 'file=@-' -H "Authorization: Bearer ${token}"

example

root@server:/rustypaste/upload# ls -lah lasting-giraffe.log*
-rw-r--r-- 1 rustypaste rustypaste 214K Feb  3 02:29 lasting-giraffe.log.1727967488761
-rw-r--r-- 1 rustypaste rustypaste 425K Mar 10 14:07 lasting-giraffe.log.1731119760881
root@server:/rustypaste/upload# ls -lah eager-sponge.log.*
-rw-r--r-- 1 rustypaste rustypaste 705K Jan 14 23:34 eager-sponge.log.1726315416603
-rw-r--r-- 1 rustypaste rustypaste 3.5K Jun 22 15:36 eager-sponge.log.1740110740452

Now while creating the paste it returns https://server.com/eager-sponge.log that points to the old log (that is not identical) and the new paste is not accessible at all.

I searched the issues but didn't found something similar sounding, is this a know problem and maybe solved with 0.15.0 ?

tessus commented 3 months ago

All these issues should be fixed with 0.15.0. please see the release notes at https://github.com/orhun/rustypaste/releases/tag/v0.15.0

CvH commented 3 months ago

tx, already updated I have a look if this is fixed 👍