Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Oct 2014, 08:01
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
gnetconnect
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: Mon 15 Jul 2013, 15:52    Post subject:  gnetconnect
Subject description: Remote connections for all apps using curlftpfs and sshfs
 

Hi everybody...long time no see...

I wrote this little app on Arch, but I thought you Puppy users might appreciate it. Uses gtkdialog and rox-filer. It's a frontend for curlftpfs and sshfs. Curlftpfs allows you to mount an ftp connection as a fuse filesystem and access it with *any* application, which is much more useful in some ways than gvfs, which only works for apps compiled against it. Sshfs does the same via ssh. I'm not going to provide binaries for the either program, especially since there's so many different puppies now. But assuming a user can locate or compile appropriate binaries this could be useful.

I love rox-filer and simple editors like leafpad, but what I miss sometimes about apps like thunar, nautilus, and gedit is the ability to work on remote files. This will allow you to mount your remote connections and access them as any other filesystem using any program you wish. Both tend to hand if used for a truly remote connection, but are great for use over a lan.

The gui frontend is a roxapp and can be run from anywhere. Extract the tarball where you want it and it will have inside it a Network directory. open that up and click on the "New Connection" icon to create a new connection. When finished there will be another roxapp icon in the same directory that you can click on to access the connection. Right click on the icon when you're done and unmount it from the popup menu. Fairly simple. Intentionally. To remove a bookmark just delete the corresponding roxapp folder. You can also rename a connection to anything you wish. There will be a minimal .gnetconnectrc configuration file created in your home directory.

Requires:
nohup
xterm or a link/wrapper called xterm
sshfs http://fuse.sourceforge.net/sshfs.html
curlftpfs http://curlftpfs.sourceforge.net/
rox-filer
gtkdialog

This is beta quality right now. Feedback welcome. I may develop it further.
gnetconnect-0.1-1.jpg
Description  Screenshot showing the application window, my Network folder, and one of the remote connections open.
jpg

 Download 
Filename  gnetconnect-0.1-1.jpg 
Filesize  227.08 KB 
Downloaded  262 Time(s) 
gnetconnect-0.1.tar.gz
Description 
gz

 Download 
Filename  gnetconnect-0.1.tar.gz 
Filesize  18.04 KB 
Downloaded  266 Time(s) 

_________________
Bring on the locusts ...
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 
sc0ttman


Joined: 16 Sep 2009
Posts: 2385
Location: UK

PostPosted: Mon 15 Jul 2013, 16:53    Post subject:  

Works a treat! Connected to the akita repo no problems.. Yet to test extensively but seems great, and fuse+sshfs is smaller than I thought... Very Happy

EDIT: I was even able to load an SFS file from my online repo, and it worked!

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: Mon 15 Jul 2013, 22:21    Post subject:  

Glad to hear it! I used to use nfs for a lot of things like this (running FreeBSD I had my ports and src trees exported on the LAN) but there's cases where that's not ideal or not available. Such as administering a remote server, when you only have ftp access.
_________________
Bring on the locusts ...
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 
sc0ttman


Joined: 16 Sep 2009
Posts: 2385
Location: UK

PostPosted: Wed 17 Jul 2013, 02:37    Post subject:  

How would I add an option to mount as read only? Is this possible? I would LOVE to add this feature - to protect myself from further stupidity (I deleted files in my repo by accident trying to re-code your work!)
_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: Wed 17 Jul 2013, 06:33    Post subject:  

It's entirely possible to do. If you look at the actual command that is run:
Code:
sshfs <some-user>@<some-server>: <some-mountpoint>

You can append various options at the end of the command, one of which is "ro", just like the vanilla "mount -o ro" command. So:
Code:
sshfs <some-user>@<some-server>: <some-mountpoint> -o ro

That mounts your share read only. Inside the AppDir for the connection are two scripts (for ssh, ftp only has one). AppRun is what runs when you click the icon, while connect.sh launches the connection and is the one to edit.

As for adding an option, I could add an entry in the right click menu that would mount it read only. Give me a couple days though. Not much time to spare until friday or so.

I was planning on a slight revamp anyway, as right now there is no way to edit connection parameters without firing up a text editor. I could easily create an edit dialog that looked just like the creation dialog. And add in the read-only option at the same time.

_________________
Bring on the locusts ...
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 
sc0ttman


Joined: 16 Sep 2009
Posts: 2385
Location: UK

PostPosted: Wed 17 Jul 2013, 14:19    Post subject:  

Thanks, I've updated my local copy, so now when I click on a created connection I get an Xdialog --yesno, asking me to mount as read only or not.. And I added a new 'connect as read only' right click option as well (-cro).. Thanks!

I've attached my new copy, as described above, just for the hell of it, I'm not intending this to be incorporated in any way!
gnetconnect-0.1-readonly.tar.gz
Description 
gz

 Download 
Filename  gnetconnect-0.1-readonly.tar.gz 
Filesize  18.85 KB 
Downloaded  213 Time(s) 

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: Wed 17 Jul 2013, 14:52    Post subject:  

Took a look at it and it's fine, with one or two caveats. I'd rather implement any dialogs in gtkdialog, so it has one less dependency and stays more portable. The other is I would like to reserve the possibility of passing more than one -o option, so the use of "$1" may not be appropriate. Here's somewhat what I'm thinking...
Code:
OPTS="-o ro" TERMINAL -e $APP_DIR/connect.sh

That passes the environment variable OPTS to the connect script, where we can do...
Code:
NOHUP SSHFS USER@SERVER:SUBDIR $MOUNT_DIR $OPTS

Without having to use...
Code:
[ "$1" = "READONLY" ] && OPTS="-o ro" || OPTS=""

or anything else to parse the options.

My ideas on scripting are that every extra line introduces a place to slow your program down, so if you can implement the same functionality in less code it's all for the best. Not so important with a tiny little program like this, but good practice nonetheless.

The direction I was thinking of going is a bit different than the current state. Right now when you create a new connection it runs a series of sed commands on all the files inside the new directory, including the scripts themselves. I want to redo it so the connection parameters are stored as variables inside a config file in the AppDir (which is trivially easy with gtkdialog - you can use the raw gtkdialog output for the config file). The config file gets sourced by the scripts, which can remain vanilla. So the only file that would need the sed magic is AppInfo.xml, just to set the tooltip.

Doing that would make it really easy to create a dialog to edit connection parameters, probably in the right click menu. If I did that, then I could add a checkbox to make it default to ro, eliminating the need for a second dialog when you left click on the icon. You could still mount rw using the right click menu. That's close to a fundamental rewrite, so I'd bump the version to 0.2 rather than 0.1.1. But I'm thinking it's how I should have done it to begin.

If I'm going to go to the trouble, any other features you'd like to see implemented? I'd rather incorporate things early so as to avoid coding myself into a corner somewhere.

_________________
Bring on the locusts ...
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: Wed 17 Jul 2013, 14:55    Post subject:  

I should have looked closer before hitting Submit...had to edit the code snippets twice...
_________________
Bring on the locusts ...
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 
sc0ttman


Joined: 16 Sep 2009
Posts: 2385
Location: UK

PostPosted: Wed 17 Jul 2013, 14:57    Post subject:  

Nathan F wrote:
If I'm going to go to the trouble, any other features you'd like to see implemented? I'd rather incorporate things early so as to avoid coding myself into a corner somewhere.

No requests, my needs are simple... That all sounds good, look forward to it, but mine will do me *for now* Wink

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0892s ][ Queries: 13 (0.0226s) ][ GZIP on ]