vert-x3 / vertx-shell Goto Github PK
View Code? Open in Web Editor NEWThe shell for Vert.x
License: Apache License 2.0
The shell for Vert.x
License: Apache License 2.0
the 'Command Pack' example, in each language section, is always givin in java.
package examples.pack;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.ext.shell.command.Command;
import io.vertx.ext.shell.command.CommandBuilder;
import io.vertx.ext.shell.command.CommandResolver;
import io.vertx.ext.shell.spi.CommandResolverFactory;
import java.util.ArrayList;
import java.util.List;
public class CommandPackExample implements CommandResolverFactory {
@Override
public void resolver(Vertx vertx, Handler<AsyncResult<CommandResolver>> resolveHandler) {
List<Command> commands = new ArrayList<>();
// Add commands
commands.add(Command.create(vertx, JavaCommandExample.class));
// Add another command
commands.add(CommandBuilder.command("another-command").processHandler(process -> {
// Handle process
}).build(vertx));
// Resolve with the commands
resolveHandler.handle(Future.succeededFuture(() -> commands));
}
}
At some point it would be nice to get a bump on the netty version. I'm assuming you are dependant on termd's netty version though based on reviewing your pom. Is this something that could be possible.
We have been trying to work with Netflix ribbon and specifically RxNetty which are moving to newer versions of netty that conflict at runtime.
more like a feature request: command 'verticle-deploy' doesn't come with the possibility to add deployment options. If a second argument (json-string?) is given, a verticle with deployment options could be deployed from the shell (which would be nice, since verticles without any config/options are pretty rare)
Hi,
In case of SSH there is an AuthProvider used for authentication, but the authenticated user is not accessible in the commands, however it would be very useful (required in my case).
In my opinion this would require many changes in the different interfaces.
Are there any plans in this direction?
Thank you and best regards,
Csaba
SSH login with interactive authentication, leads sometimes to:
Password authentication
Password:
dispatch_protocol_error: type 51 seq 9
java.lang.NullPointerException
at io.vertx.ext.shell.term.impl.HttpTermServer.lambda$listen$123(HttpTermServer.java:136)
at io.vertx.ext.shell.term.impl.HttpTermServer$$Lambda$54/899380598.handle(Unknown Source)
at io.vertx.core.http.impl.HttpServerImpl.lambda$null$21(HttpServerImpl.java:258)
Workaround : use listen(ar -> {})
Currently I don't see a way to customize the prompt of the ShellServer.
I've set vertx-shell to connect with SSH, and everything works very well.
The only problem is, how to do non-interactive things vis ssh
command?
I've tried:
ssh user@${ip} -p ${port} ls
But I failed.
There was a shell for vertx 2 that was based on CRaSH. this looks like a custom term library, why not on CRaSH?
(this is curiosity question since I'm about to write a REPL interface to an app)
is there a way to remove or disable the builtin commands like 'ls'?
id like to create a restricted cli that exposes application specific commands
Does vertx-shell support vi command?
when I ssh to the vertx-shell, Can I use the h+i+j+k to move the cursor?
when i use
addOption(new Option()
.setArgName("help")
.setShortName("h")
.setLongName("help"));
and type a command like
% shadowone -h
i get
io.vertx.core.cli.MissingValueException: The option 'help' requires a value
at io.vertx.core.cli.impl.DefaultParser.checkRequiredValues(DefaultParser.java:201)
at io.vertx.core.cli.impl.DefaultParser.parse(DefaultParser.java:125)
at io.vertx.core.cli.impl.DefaultParser.parse(DefaultParser.java:82)
at io.vertx.core.cli.impl.DefaultCLI.parse(DefaultCLI.java:47)
at io.vertx.core.cli.CLI$parse$3.call(Unknown Source)
at net.iowntheinter.cintershell.impl.cmds.example.TestOneShot$__clinit__closure1.doCall(TestOneShot.groovy:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1249)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1212)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:810)
at net.iowntheinter.cintershell.impl.commandOneShot.invokeMethod(commandOneShot.groovy)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:430)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:369)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
at net.iowntheinter.cintershell.impl.commandOneShot$_closure1.doCall(commandOneShot.groovy:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
at groovy.lang.Closure.call(Closure.java:426)
at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:53)
at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:105)
at com.sun.proxy.$Proxy13.handle(Unknown Source)
at io.vertx.ext.shell.command.impl.ProcessImpl.lambda$run$132(ProcessImpl.java:470)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$18(ContextImpl.java:335)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at java.lang.Thread.run(Thread.java:745)
i believe it should work as described here:
http://vertx.io/docs/vertx-shell/java/#_command_arguments
vertx-shell
's dependency sshd-core
has a critical vulnerability for version 1.2.0 reported here CVE-2022-45047. Is there a plan to upgrade sshd-core to 2.9.1 or later to fix this vulnerability?
4.5.x
Allow to use the HTTP client to perform cURL like operations - SSL/TLS config should be supported
for testing purposes or invoke commands locally
Futurise the async methods of the shell.
I'm trying to test out the vert.x shell, but am having trouble getting it started. When I run the command
vertx run -conf '{"telnetOptions":{"port":5000}}' maven:io.vertx:vertx-shell:3.6.2
I get the following stack trace
Failed in deploying verticle
java.lang.NoClassDefFoundError: io/vertx/ext/shell/spi/CommandResolverFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at io.vertx.core.impl.IsolatingClassLoader.loadClass(IsolatingClassLoader.java:62)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at io.vertx.ext.shell.impl.ShellServiceImpl.start(ShellServiceImpl.java:92)
at io.vertx.ext.shell.ShellVerticle.start(ShellVerticle.java:47)
at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$8(DeploymentManager.java:494)
at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:320)
at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: io.vertx.ext.shell.spi.CommandResolverFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 30 more
I'm running
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
And Vert.x version 3.6.2
in the CLI on Windows 10 Pro.
Is there something I'm missing?
the recent patch deploys one verticle per command, perhaps we can group them to have less verticle deployed (not for performance reason but rather for not cluttering the verticle space) and have a map Context->Verticle .
The Shiro authentication is deprecated and is is recommend to use the property file auth provider (https://vertx.io/docs/vertx-auth-properties/java/). The implementation and documentation of the Vertx shell should reflect this.
Use the property file auth provider to define users for the SSH shll
There seems to be an open pull request already: #45
The bus-tail
command actually consumes an event bus message before it arrives at its destination which prevents the consumer from receiving it. I'm assuming that this is not by design. I am observing this in 3.6.0.
It should be possible to start an SSHServer
or a TelnetServer
using an Handler<Tty>
directly.
Need a Shell#close method for proper shutdown of the interactive shell session.
The HTTP term does not work after login.
Try the deploy service http
example:
You will see:
java.lang.UnsupportedOperationException: Mount the router as a sub-router instead. This method will not properly handle errors.
at io.vertx.ext.web.handler.sockjs.impl.SockJSImpl.handle(SockJSImpl.java:87)
at io.vertx.ext.web.handler.sockjs.impl.SockJSImpl.handle(SockJSImpl.java:64)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1284)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:173)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:140)
at io.vertx.ext.web.handler.impl.AuthenticationHandlerInternal.postAuthentication(AuthenticationHandlerInternal.java:43)
at io.vertx.ext.web.handler.impl.AuthenticationHandlerImpl.lambda$handle$0(AuthenticationHandlerImpl.java:90)
at io.vertx.ext.web.handler.impl.BasicAuthHandlerImpl.lambda$null$0(BasicAuthHandlerImpl.java:76)
Configurable.
should reuse eventbus for exchanging objects or at least the eventbus codecs to encode / decode objects to/from buffer/string
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.