scp using vert.x shell ssh server

360 views
Skip to first unread message

Theo Weiss

unread,
Nov 23, 2015, 3:06:19 PM11/23/15
to vert.x
Hi Julien,

the shell features of vert.x are really cool!
I’m wondering if it is possible to code a vert.x service for uploading / downloading files with scp (secure copy) using the current vert.x shell api?

Thanks in advance,
Theo

signature.asc

Julien Viet

unread,
Nov 23, 2015, 3:16:58 PM11/23/15
to ve...@googlegroups.com, Theo Weiss
On 23 Nov 2015 at 21:06:18, Theo Weiss (th...@m1theo.org) wrote:
Hi Julien, 

the shell features of vert.x are really cool! 

thanks!


I’m wondering if it is possible to code a vert.x service for uploading / downloading files with scp (secure copy) using the current vert.x shell api? 


do you mean an SSH client ?


Thanks in advance, 
Theo 

-- 
You received this message because you are subscribed to the Google Groups "vert.x" group. 
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com. 
Visit this group at http://groups.google.com/group/vertx. 
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/7ECDF176-1320-4DCD-AD7B-9BDC25B25A91%40m1theo.org. 
For more options, visit https://groups.google.com/d/optout. 

Julien Viet

unread,
Nov 23, 2015, 3:18:16 PM11/23/15
to ve...@googlegroups.com, Theo Weiss
SSH client -> SCP client

-- 
Julien Viet
www.julienviet.com

Theo Weiss

unread,
Nov 23, 2015, 3:46:26 PM11/23/15
to ve...@googlegroups.com
scp myfile -> vert.x ssh-server

> Am 23.11.2015 um 21:18 schrieb Julien Viet <jul...@julienviet.com>:
>
> SSH client -> SCP client
>
> --
> Julien Viet
> www.julienviet.com
>
>
> On 23 Nov 2015 at 21:16:50, Julien Viet (jul...@julienviet.com) wrote:
>
>> On 23 Nov 2015 at 21:06:18, Theo Weiss (th...@m1theo.org) wrote:
>>> Hi Julien,
>>>
>>> the shell features of vert.x are really cool!
>> thanks!
>>
>>>
>>> I’m wondering if it is possible to code a vert.x service for uploading / downloading files with scp (secure copy) using the current vert.x shell api?
>>>
>>
>> do you mean an SSH client ?
I thought of something like this: scp localfile user@vertx-server-ip:/a/b/destfile.
Or have I misunderstood the things?
>>
>>
>>> Thanks in advance,
>>> Theo
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "vert.x" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/vertx.
>>> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/7ECDF176-1320-4DCD-AD7B-9BDC25B25A91%40m1theo.org.
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "vert.x" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
> Visit this group at http://groups.google.com/group/vertx.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/etPan.56537484.1ba026fa.2c7%40juliens-mbp-2.
signature.asc

Julien Viet

unread,
Nov 23, 2015, 4:28:02 PM11/23/15
to ve...@googlegroups.com, Theo Weiss
and the file would be copied to the Vert.x FileSystem ?

I am not sure that it fits in the scope of the Shell project.

-- 
Julien Viet
www.julienviet.com

For more options, visit https://groups.google.com/d/optout.

Julien Viet

unread,
Nov 23, 2015, 5:26:52 PM11/23/15
to Theo Weiss, ve...@googlegroups.com
I see, makes sense.

But I don’t think it is the scope of the Shell project though.

Perhaps in a project that would provide SCP / SFTP / FTP handler style.

On 23 Nov 2015 at 22:50:00, Theo Weiss (th...@m1theo.org) wrote:


> Am 23.11.2015 um 22:27 schrieb Julien Viet <jul...@julienviet.com>:
>
> and the file would be copied to the Vert.x FileSystem ?
No. It could be handled by a custom „bodyhandler“, similar to a http body/upload-handler, for example to add it in a further step to a mongoFS.


Theo Weiss

unread,
Nov 24, 2015, 5:09:07 PM11/24/15
to ve...@googlegroups.com
May be there is another solution for my use case:
- I have a vert.x based service for managing files in mongoFS and managing the meta data concerning these files. Until now there is a HTTP/REST interface for doing this.
- Now I want to provide a terminal application for my users, which can be used for:
— managing things in / from the users space (e.g. uploading files, et.al.)
— login to the vert.x service for managing the meta data, ...
Implementing the vert.x based service is strait forward, thank you for that! I think I’ve also understood how to implement the login service on the server side.

But I’m wondering if there is a vert.x (shell) api for implementing a terminal application?
I’ve seen your PR https://github.com/vert-x3/vertx-shell/pull/10 and it seems to me, as if the PR adds terminal app support, but I’m totally unsure about that. Can you give some explanation of the new features?

signature.asc

Julien Viet

unread,
Nov 24, 2015, 5:43:09 PM11/24/15
to ve...@googlegroups.com, Theo Weiss
The term server provides a bare term server either via SSH, Telnet or the (not merged yet but soon) HTTP/SockJS , not a shell : so yes in a nutshell a terminal application.

In such application your application deals with a TTY, it manages the stdin / stdout and the eventual signals.

The Vert.x Shell itself is built on top of this feature.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/vertx.

Thomas Weiss

unread,
Jan 7, 2016, 12:29:36 PM1/7/16
to ve...@googlegroups.com
Hi Julien,

sorry for bothering you again. I think I've used the wrong terminology
discribing my use case. I wanted to ask you, if there is an api within
vertx-shell for writing a *console* application like you did it with the
standalone mode of CRaSH in org.crsh.standalone.CRaSH.java?

I looked around in the vertx-shell, termd, CRaSH and jline2 code to get
a bit of understanding how these console/terminal things work but I'm
totally lost. May be you can give me a hint were to start.

Thanks in advance,
Theo
--

Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Arno Steitz, Yvonne Veyhelmann
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Aufsichtsrat/Supervisory Board:
Katrin James, Winfried Holz
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196

Julien Viet

unread,
Jan 7, 2016, 1:20:44 PM1/7/16
to ve...@googlegroups.com
Hi,

can you describe exactly what you want to do ?

it is not clear if you want to make Vert.x Shell run with the current user terminal or if you want want to write a custom console application using Vert.x Shell that would be in the current user terminal ?
> --
> You received this message because you are subscribed to the Google Groups "vert.x" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
> Visit this group at https://groups.google.com/group/vertx.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/568EA077.9060709%40science-computing.de.

Thomas Weiss

unread,
Jan 11, 2016, 11:53:10 AM1/11/16
to ve...@googlegroups.com
Hi,

I want to write an application - let's call it myapp - which works like
that:
- I open a linux xterm
- I start myapp
- myapp gives me a prompt
- I can type help and get a list of all possible commands and returns
again to the prompt of myapp
- I can execute my custom command e.g. "listresources"
...

I want to implement the commands with vertx-shells CommandBuilder or as
io.vertx.ext.shell.command.AnnotatedCommand and register them with the
CommandRegistry and so on. I want to have all the vertx goodies
available and probably share code with my other vertx applications.


Regards,
Theo


Am 07.01.16 um 19:20 schrieb Julien Viet:


> Hi,
>
> can you describe exactly what you want to do ?
>
> it is not clear if you want to make Vert.x Shell run with the current user terminal or if you want want to write a custom console application using Vert.x Shell that would be in the current user terminal ?
>
>
>
>> On Jan 7, 2016, at 6:29 PM, Thomas Weiss <T.W...@science-computing.de> wrote:
>>
>> Hi Julien,
>>
>> sorry for bothering you again. I think I've used the wrong terminology discribing my use case. I wanted to ask you, if there is an api within vertx-shell for writing a *console* application like you did it with the standalone mode of CRaSH in org.crsh.standalone.CRaSH.java?
>>
>> I looked around in the vertx-shell, termd, CRaSH and jline2 code to get a bit of understanding how these console/terminal things work but I'm totally lost. May be you can give me a hint were to start.
>>

Julien Viet

unread,
Jan 11, 2016, 12:42:11 PM1/11/16
to ve...@googlegroups.com
I think that the most straighforward way to do that is to use a library, for example JLine or Aesh and create a bridge with this library : implement io.vertx.ext.shell.term.TermServer and io.vertx.ext.shell.term.Term then create an io.vertx.ext.shell.ShellServer and register this term server before running the shell server.

The TermServer receives an Handler<Term> so it can call this handler any time with a Term, here is some pseudo code with JLine:

ShellServer server = ShellServer.create(vertx);
TermServer termServer = new JLineTermServer();
server.registerTermServer(termServer);
// Other setup like command resolver, etc…
server.listen();

in JLineTermServer when listen is called, then call the handler with the JLineTerm implementation:

private Handler<Term> termHandler;

public TermServer termHandler(Handler<Term> handler) {
termHandler = handler;
return this;
}

public TermServer listen(Handler<AsyncResult<TermServer>> listenHandler) {
Term term = new JLineTerm(…);
termHandler.handle(term);
return this;
}

this is the high level description of how it would be done, then the rest is to implement the actual bridging code between JLineTerm and JLine library to make it work.
> --
> You received this message because you are subscribed to the Google Groups "vert.x" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
> Visit this group at https://groups.google.com/group/vertx.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/5693DDEC.6070305%40science-computing.de.

Theo Weiss

unread,
Jan 11, 2016, 3:04:03 PM1/11/16
to ve...@googlegroups.com
Thanks Julien,

I will give it a try.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/B4178624-9134-4931-A4D2-7001EAE7211A%40julienviet.com.
signature.asc
Reply all
Reply to author
Forward
0 new messages