mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-03 14:13:26 +00:00
Unable to delete and no token on curl #111
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 @barart on GitHub.
Im self-hosting transfer.sh using a doker container, i can upload files from browser and using curl and i can get the file, browser show the download link also curl, also i can see the files on my server but i cant delete those files from curl or browser let me explain:
If i upload a file from browser i can get my deletion token, if i go to http://ip:port/yF126n/file/deletiontoken i just see a empty page but if i go to my server i can see the files there, the log just show this:
[transfer.sh]2022/05/04 01:48:42 myip:56463 - - [2022-05-04T01:48:42Z] "GET /yF126n/storm.PNG/deletetoken HTTP/1.1" 405 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0"
if i try to delete the file using curl the file do not delete and i get no response from curl, the log show this:
[transfer.sh]2022/05/04 01:53:43 myip:51674 - - [2022-05-04T01:53:43Z] "DELETE /yF126n/storm.PNG/deletetoken HTTP/1.1" 0 "" "curl/7.74.0"
If i upload a file from curl the file upload fine but curl dont return my delete token just the download link:
user@server:~ $ curl --upload-file ./test http://ip:port
http://ip:port/KVHtU3/testuser@server:~ $
Do i missed a configuration or something? im using the latest release
@paolafrancesca commented on GitHub:
file are created with only owner permission
yes, only the files are delete, not the directory
@barart commented on GitHub:
Ok, i have a last question, is there a database or something where the delete token and file history are stored? I mean, if a user forgot his delete token can i just delete the files manually or i need to delete ? can i also delete the folders?
@paolafrancesca commented on GitHub:
hello @barart
you are making a
GETrequest instead of aDELETEone when opening the url in the browser. having an empty405(method not allowed) response is correctthis is strange, the request is a
DELETEone, the file should be deleted. having an empty response is correct, but the file should be deleted as well.I wonder if running on docker can be the problem: what is your
--basedirvalue? is it on a volume shared with docker? does it have the proper permissions? can you share anls -lahof{basedir}/yF126n?the donwload link is returned as header, you must tell curl to output the response headers:
curl -v --upload-file hello.txt https://transfer.shsee
x-url-delete: https://transfer.sh/IJmsUv/hello.txt/T3gVRiodma1w@barart commented on GitHub:
Hello @aspacca
Thanks for your reply,
My --basedir value is
--basedir=/transfersand yes is in a volume shared and i think it has the proper permissions, im running it as-nonrootso user (according to your manual) is5000my docker Volume has this values:This are my ls outputs:
For some reason if i do a ls on yF126n with my current user i got this:
I need to sudo the command, in order to ls the directory:
I see that the directory is empty (so i think the files are gone?) but directory stills there, that's why I thought the files had not been deleted, i just make another test and i can confirm that files are gone but directory still there