mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-06 07:22:17 +00:00
Possible to generate our own random token? #368
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chiwalfrm on GitHub.
I have one PC that needs to share a file that changes daily with another PC remotely (not on same network).
I looked at the example provided on the website:
(Uploading is easy using curl)
$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt
https://transfer.sh/66nb8/hello.txt
(Download the file)
$ curl https://transfer.sh/66nb8/hello.txt -o hello.txt
After the upload, the curl command returns a URL with a random token ("66nb8" in the above example). The problem is the other PC doesn't know the random token, and also I want to put the download command in cron. Is it possible for us to specify our own random token that we could use over and over? The file is encrypted so security concern with plaintext URL is not a problem.
curl --upload-file ./hello.txt https://transfer.sh/3b2rd9n3kbew8jhs/hello.txt
...where 3b2rd9n3kbew8jhs is the random token chosen by the user.
Thank you.
@sheerun commented on GitHub:
I see it's currently hardcored to random: https://github.com/dutchcoders/transfer.sh/blob/master/transfersh-server/handlers.go#L350
@nl5887 commented on GitHub:
Because we're using random tokens, we can keep everything simple without using authentication. If we'll allow custom tokens, we need to add authentication, authorisation and all such. And we built this just for simple sharing.
@Jellby commented on GitHub:
I would like some kind of predictable URL too, though I'd prefer a full path with at least a couple of directory levels. Security and privacy are not primary concerns in this case: I don't mind if others can read the file and, if I choose a nontrivial name, I can be reasonably sure the file will not be overwritten (and it's not a big deal if it is). It could be something like mailinator.