mxschmitt / action-tmate

Debug your GitHub Actions via SSH by using tmate to get access to the runner system itself.
https://mxschmitt.github.io/action-tmate/
MIT License
2.95k stars 289 forks source link

Enable copying files from tmate session #175

Closed franpog859 closed 1 year ago

franpog859 commented 1 year ago

As a developer, I want to be able to easily download files from the tmate session. When debugging, I want to gather logs, connection dumps, and other data that could not be easily copied via ctrl+c or analyzed in the session. I tried via scp but it does not work. I'm not sure if https://transfer.sh/ is secure enough for any confidential data. Do you have any suggestions on how to achieve that without too much trouble?

scp 123qwe@lon1.tmate.io:/test.pcapng ./test.pcapng`
Connection to lon1.tmate.io closed by remote host.
scp: Connection closed
dscho commented 1 year ago

Unfortunately, the tmate infrastructure on which we rely does not offer any easy way to transfer files.

Personally, for short files, I resorted to using a trick: base64-encoding on one side, copying into the clipboard, and on the other side base64-decoding it again. That's how I transport diffs from a tmate session to the local branch, for example.

franpog859 commented 1 year ago

Sadly, saving some big connection dump PCAP files won't be an easy operation this way. I guess I can somehow work around it with this encoding-decoding method as you mentioned

If you don't plan to add any file-sharing support, feel free to close this issue with some wont-fix label

dscho commented 1 year ago

If you don't plan to add any file-sharing support

It's not so much action-tmate's decision than it is tmates. And seeing as that would add a lot of bandwidth to tmate.io that would have be paid by someone, I don't fault them to be hesitant.

A better alternative to copy files like PCAP ones might be to use croc (please sponsor) or syncthing (there are hints how to use it without web GUI here, for example).

franpog859 commented 1 year ago

Thanks for these suggestions! I already created a similar issue for tmate - https://github.com/tmate-io/tmate/issues/294 - I guess it won't be resolved anytime soon though as that would add a lot of bandwidth to tmate.io that would have be paid by someone

I think I'll close this issue then. If anything changes, please, reopen it. I'll also reopen it if there is something going on on the tmate side

dscho commented 1 year ago

Thank you!