gnetconnect

Filemanagers, partitioning tools, etc.
Post Reply
Message
Author
User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

gnetconnect

#1 Post by Nathan F »

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.
Attachments
gnetconnect-0.1.tar.gz
(18.04 KiB) Downloaded 476 times
Bring on the locusts ...

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#2 Post by sc0ttman »

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... :D

EDIT: I was even able to load an SFS file from my online repo, and it worked!
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#3 Post by Nathan F »

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 ...

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#4 Post by sc0ttman »

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!)
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#5 Post by Nathan F »

It's entirely possible to do. If you look at the actual command that is run:

Code: Select all

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: Select all

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 ...

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#6 Post by sc0ttman »

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!
Attachments
gnetconnect-0.1-readonly.tar.gz
(18.85 KiB) Downloaded 405 times
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#7 Post by Nathan F »

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: Select all

OPTS="-o ro" TERMINAL -e $APP_DIR/connect.sh
That passes the environment variable OPTS to the connect script, where we can do...

Code: Select all

NOHUP SSHFS USER@SERVER:SUBDIR $MOUNT_DIR $OPTS
Without having to use...

Code: Select all

[ "$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 ...

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#8 Post by Nathan F »

I should have looked closer before hitting Submit...had to edit the code snippets twice...
Bring on the locusts ...

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#9 Post by sc0ttman »

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* ;)
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

Post Reply