fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] Creating a tunnel with Fabric


From: Christian Vest Hansen
Subject: Re: [Fab-user] Creating a tunnel with Fabric
Date: Mon, 2 Nov 2009 10:39:42 +0100

The use of a context manager do indeed strike me as elegant, and a
quick googling suggests that paramiko is capable of port forwarding.

Unfortunately, I can't comment on whether the fabric context managers
in their current incarnation are powerful enough to do this. Jeff
should know, but he is currently in the process of recovering from an
operation, I hear.

On Mon, Nov 2, 2009 at 5:32 AM, Taras Mankovski <address@hidden> wrote:
> Hey Guys,
>
> What do you think about creating a function in Fabric that would allow
> easy setup of a tunnel through ssh?
>
> This would be very helpful for me because it would make it very easy
> to for example connect to a remote MySQL server using my command line
> MySQL client.
>
> We could use a "with" context statement, something like:
>
> with tunnel(local=3307, remote=3306):
>     local('mysql --port=3007 --host=localhost' mydb < db/dbdump.sql')
>
> This would eliminate the need to upload mysql dump file to the server
> just to be able to run import.
>
> Another application could be for administering Cherokee web servers.
>
> Cherokee web admin by default is only accessible from the server that
> it's running on. So you want to access the admin you have to tunnel
> into the server and access the admin interface using a local port.
> This could also be simplified with this functionality.
>
> with tunnel(local=9090, remote=9090):
>    sudo('cherokee-admin')
>    prompt('Stop cherokee admin?')
>
> That last line would keep the tunnel open until it's closed by providing 
> input.
>
> I think it's quiet elegant, what do you guys think?
>
> Thank you,
> Taras
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]