picosh / pico

hacker labs - open source and managed web services leveraging SSH
https://pico.sh
MIT License
757 stars 26 forks source link

rsync and sftp problems #49

Closed mulle-nat closed 8 months ago

mulle-nat commented 8 months ago

When I tried to download an older post with scp it told me to use sftp or rsync.

sftp works partially. I can download posts and images via, imgs.sh though I get funny warnings:

sftp> mget *
Server sent suspect path "/" during readdir of "/"
Fetching /21b1f3a6-9571-4800-aecf-e164a149639a.jpg to 21b1f3a6-9571-4800-aecf-e164a149639a.jpg
21b1f3a6-9571-4800-aecf-e164a149639a.jpg                                               100%  633     1.6KB/s   00:00    
read remote "/21b1f3a6-9571-4800-aecf-e164a149639a.jpg" : Failure
Fetching /446b5292-1b71-4d4c-a561-c95ac602776b.jpg to 446b5292-1b71-4d4c-a561-c95ac602776b.jpg
446b5292-1b71-4d4c-a561-c95ac602776b.jpg                                               100% 2872    12.9KB/s   00:00    

The images seem intact though.

But I can't delete with sftp. It says removing, but it doesn't.

rsync just hangs when collecting files.

rsync -avz -e ssh prose.sh:/ /home/src/srcW/prose.sh/
receiving file list ... ^C
rsync error: unexplained error (code 255) at rsync.c(713) [Receiver=3.2.7]
neurosnap commented 8 months ago

Hi! Thanks so much for reaching out, much appreciated.

Under the hood we created interfaces for some operations via stfp / rsync but not everything is implemented at the moment. We definitely want our services to work with common use cases -- like downloading your content.

I'll investigate these issues ASAP and reply back when we have more information.

Is there anything you wanted to do but couldn't get to work at all?

For example, we have a custom flow for deleting items from pico services: https://prose.sh/help#post-delete

antoniomika commented 8 months ago

Re-opening for the rsync issues. The sftp issues should be all set now

mulle-nat commented 8 months ago

Is there anything you wanted to do but couldn't get to work at all?

I could delete the post via the interactive ssh interface, so its not a show stopper. Thanks for looking into it.

antoniomika commented 8 months ago

@mulle-nat we've deployed the fixes for sftp. Now traversing the file tree and doing simple operations (ls, get files, etc) will work as expected. We also solved the issue with imgs downloading weirdly and have deployed those changes. Let me know if you have any issues still!.

I'll start working on the rsync fixes now.

antoniomika commented 8 months ago

And now rsync should have a more proper implementation as well.

We don't support compression -z or user/group preservation (-o, -g; we don't retain that type of information and it could be unsafe for us to include that info as well). You will receive a proper error when using these flags now.

mulle-nat commented 8 months ago

Works for me now. :+1:

It's a bit finicky about the path though rsync -vP -e ssh prose.sh:/ /tmp/prose works fine but rsync -vP -e ssh prose.sh: /tmp/prose gives "ABORTING due to unsafe pathname from sender: /", though that is exactly the path that is actually required :wink: