elfmz / far2l

Linux port of FAR v2
GNU General Public License v2.0
1.76k stars 172 forks source link

sftp/scp support [gvfs,sshfs backends: separate projects; internal backend: see #247] #86

Closed unxed closed 7 years ago

unxed commented 8 years ago

native sftp/scp support (without using sshfs or something like it) would be nice https://github.com/michaellukashov/Far-NetBox/

unxed commented 7 years ago

gvfs-mount also create no mount points for smb server itself caja (file manager from MATE desktop) lists server content somehow using smb url, not mount point path see https://github.com/mate-desktop/caja for implementation

unxed commented 7 years ago

btw, current version crashes on shift-f4, is it expected behavour on this stage of development?

invy commented 7 years ago

F7 to create mount point. User and password fields do not work anyway.

unxed commented 7 years ago

tried F7. anonymous smb share mounted as expected. btw, "add to disk menu" option does not work.

invy commented 7 years ago

Of course it doesn't, because it's not implemented and I don't actually know whether it's possible.

unxed commented 7 years ago

current elfmz's build use a shell script to generate disk menu. maybe it can import some paths defined by plug-ins from some text file? the question is: should such disk menu items persist on far2l (or system?) restart, or not.

invy commented 7 years ago

I've actually imagined, that is should be possible via present far API. But I've only seen registration during startup and I don't know whether i can receive notifications when disk menu item is selected.

unxed commented 7 years ago

and I don't know whether i can receive notifications when disk menu item is selected.

I can hardly name any plugin implementing this behavour.

btw, currently shell script is called every time disk menu is shown. I wonder if it's output can be modified via far api.

invy commented 7 years ago

It's hack, and I'm no fun of it. Adding this to API can also break compatibility...

elfmz commented 7 years ago

Obvious extension for that shell script would be reading some text file (for example ~/.far2l/roots) with well-defined format and adding any additional entries found there.

unxed commented 7 years ago

implementing something that works just now does not close the door for better implementation in future :) I am already using far2l on everyday basis and enjoy any fixed bug, any new feature implemented.

invy commented 7 years ago

Nothing is so eternal as temporary things :)

Better solution: far provides function to add plugin controlled entries to disk menu. I.e. map: plugin id -> vector of entries. When on such entry is selected, plugin gets notification. When plugin is removed, all entries associated with plugin are removed.

elfmz commented 7 years ago

Text file in profile is easily configurable manually, that's why sooner or later I will commit such a feature. Another question if it fair or not to use such user-editable thing from plugin as API. About notification: as I understand it then should produce dynamically changed submenu? IMHO not better than just usually going to plugin's panel. Better (and logical) would be possibility to modify that menu not only from startup but at any moment.

invy commented 7 years ago

File has problems, because it's not synchronised with plugin. If plugin isn't loaded, you read disk menu entries from file try to open it, it will fail. Plugin won't be able also to handle mount for this entries.

About interface: no. I didn't mean sub menu. I've meant more simply grouping.

File is good for favourites, but once again, if we have API interface for modifying the disk menu, it could be managed by plugin.

elfmz commented 7 years ago

Currently there is same problem: you may type ftp://foo in far's command line while ftp plugin not active - it will not work, and nobody cares about that :) Also far may be smart enough to check pathes, see that its path to plugin and dont show it if not active.

invy commented 7 years ago

Plugin registers "ftp" prefix during initialization (there is corresponding structure member for it). Plugin can also have access to cmd line input and do actions. If plugin is not registered of course "ftp" is not registred and far can't do anything about commands starting with "ftp" and it's perfectly fine.

If fa would put entries in disk menu on it's own without having the plugin, it's a problem. So I think only plugin should be responsible for its entries and when it's not loaded, there won't be any entries and no problems. Anyway central file introduces redundance and redundance causes inconsistence and so should be avoided if there is no explicit need in it.

invy commented 7 years ago

Plugin also really needs callback, when entry it has responsible for, is selected in disk menu, because it needs to mount eventually (I.e after restart)

invy commented 7 years ago

JFYI: Implementation will take a little longer because of unforeseen problems with GMainLoop and signals. Somehow gmainloop creates another thread and receives signals there. I've found the way to call main thread (for opening authentication dialog), but this solution (with the GDispatcher and GMainContext) i don't really like. I'll look into this issue next week, so don't worry, I'm not forgetting about this plugin :)

(Disclaimer: I've never developed for glib, gio and gtk+ so I'll need to read documentation about this things when I have time)

unxed commented 7 years ago

Implementation will take a little longer

any news on this?

invy commented 7 years ago

Yes. The news are: I was lazy :)

I need to conquer my laziness and write user interaction (maybe on weekend), to allow login, password and domain name input.

unxed commented 7 years ago

Can I do something to give you some pleasent mood & motivation to do it? Maybe a postcard or something like it? :)

invy commented 7 years ago

For some reason far is locking up, when I try to open InputBox. I'm running out of ideas. At the beginning I was thinking, it's due to calls from another threads (where gio callback got called). I've changed the plugin, so that all calls to Far API would happen on the single thread... this didn't help. Far is stuck in message processing loop not accepting any input.

I hope I can find something...

unxed commented 7 years ago

https://github.com/cycleg/far-gvfs

may be closed now?

unxed commented 7 years ago

1) Problem is actually solved with far-gvfs 2) There is #247.

Closing.

asimonov commented 6 years ago

@unxed , on MacOS+far2l I am currently using sshfs to mount Ubuntu 16.04 system under normal user who can 'sudo' in ssh.

I can browse Ubuntu files in the mount and edit user files. But if I edit files requiring sudo i get window asking 'operation requires privileges elevation', 'enter sudo password:'. I do this and then nothing happens. The question keeps popping up.

What is the good way to handle occasional edit that requires sudo?

unxed commented 6 years ago

@asimonov guess you should open the separate issue for this.

singalen commented 5 years ago

Can I voice my concern for this issue? As mentioned here, on Mac gvfs solution is dissatisfactory because:

I believe, this issue is still the appropriate place for discussion?

asimonov commented 5 years ago

yes, have been using sshfs for few months now and the description is spot on!

would be really great to have proper sftp client packaged with far2l

On 29 Oct 2018, at 17:39, Victor Sergienko notifications@github.com wrote:

Can I voice my concern for this issue? As mentioned here https://github.com/elfmz/far2l/issues/247#issuecomment-319925591, on Mac gvfs solution is dissatisfactory because:

fuse doesn't come with the OS; it requires installing a kernel module, which very few Mac users will do; connecting to multiple new hosts with sshfs each day is inconvenient. asimonov's issue is a consequence of the imperfect integration too. I believe, this issue is still the appropriate place for discussion?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/elfmz/far2l/issues/86#issuecomment-434005222, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOr9vqPNcLr5y2Ej_2j_In3cEevDS_qks5upz1BgaJpZM4KAAXN.

singalen commented 5 years ago

Having thought of it, we could do the same thing as NetBox did with WinScp: frankenstein some existing scp/sftp parts from OpenSSH/Pytty/FileZilla into the old Far's FTP client.

unxed commented 5 years ago

connecting to multiple new hosts with sshfs each day is inconvenient.

Fix released :) https://github.com/unxed/far2l-fuse

if I edit files requiring sudo i get window asking 'operation requires privileges elevation', 'enter sudo password:'. I do this and then nothing happens

@asimonov's issue is a consequence of the imperfect integration too.

NetBox was unable to do the trick also. Btw, it looks like it's still possible to partially solve this using sshfs -o sftp_server="sudo /usr/lib/openssh/sftp-server" (I'm planning to add support for custom mount options to far2l-fuse later) or using dedicated keypairs: https://unix.stackexchange.com/questions/111026/how-to-use-sftp-on-a-system-that-requires-sudo-for-root-access-ssh-key-based-a/111040#111040

fuse doesn't come with the OS it requires installing a kernel module, which very few Mac users will do

Got no mac, just wondering. Is it actually so hard to get sshfs/fuse running there? o_O 10 seconds of googling "sshfs macosx" gives tons of manuals that look relatively easy to follow.

Anyway, supplying a script for easy sshfs/fuse installation depending on running OS is much less work than developing sftp implementation from scratch and keeping it up to date with actual SSH protocol, ciphers, hashes, etc.


Btw, let's continue discussing SFTP-releated stuff here: https://github.com/elfmz/far2l/issues/247 Why do we use closed-as-duplicate issue instead of open one? English is welcome in every issue here AFAIK.

singalen commented 5 years ago

Wow, thank you very much!

Got no mac, just wondering. Is it actually so hard to get sshfs/fuse running there? o_O

Hm, that sounds somewhat condescending.

It's not TOO HARD, it's quite INCONVENIENT and UNCONVENTIONAL. Unlike Linux, it's not normal to install new kernel modules on Mac. Installation itself doesn't run so smoothly as on Linux. On Mac, fuse and sshfs are two different software packages, and last time I tried they required some dances to get them to work together.

Most of the tutorials get outdated with a new OS release, as the names of the kernel modules change.

On a more attentive look, they are not too easy, as they address 2 different ways to install FUSE on Mac. It's a sign that none of these is perfect, both have their quirks.

Another quirk is that the first Google hit, https://github.com/osxfuse/osxfuse/wiki/SSHFS, refers to SSHFS package dated in 2014. It's 3 OS releases old. I can bet it won't work and will require searching for/building another package. I can bet it takes some effort to find a compatible pair of FUSE and SSHFS packages.

I honestly tried to run sshfs once, and ran into several unexpected issues. I'm not ready to try it again right now, but I eventually will. I will do my best to gather a list of problems that occured :)

This all totals to "too much effort to get just another file manager running", while it, frankly speaking, could just work out of box.

unxed commented 5 years ago

Summary:

asimonov commented 5 years ago

@unxed thanks a lot! trying gvfs and fuse plugins now

Just checked my records and I use FUSE + SSHFS. Then browse/edit files on mounted file systems in far2l.

This is what my records show: installed sshfs 2.5.0 from https://github.com/osxfuse/sshfs/releases installed osx fuse 3.7.1 https://osxfuse.github.io/