You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "ywww (GitHub)" <gi...@apache.org> on 2018/11/16 07:49:07 UTC
[GitHub] [incubator-dubbo] ywww opened issue #2795: 如何关闭 dubbo telnet调试功能
由于安全问题, 需要关闭 dubbo telnet调试功能
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] dslchd commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "dslchd (GitHub)" <gi...@apache.org>.
请问这个功能 telnet="disabled" 必须是2.6.6?才支持吗?
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] kexianjun commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
支持关闭telnet,我本地有实现过,在下面调用handler.telnet(channel, (String) message)的时候加个配置判断一下,不知道这样是否可行? @carryxyh
```
public void received(Channel channel, Object message) throws RemotingException {
channel.setAttribute(KEY_READ_TIMESTAMP, System.currentTimeMillis());
ExchangeChannel exchangeChannel = HeaderExchangeChannel.getOrAddChannel(channel);
try {
if (message instanceof Request) {
// handle request.
Request request = (Request) message;
if (request.isEvent()) {
handlerEvent(channel, request);
} else {
if (request.isTwoWay()) {
Response response = handleRequest(exchangeChannel, request);
channel.send(response);
} else {
handler.received(exchangeChannel, request.getData());
}
}
} else if (message instanceof Response) {
handleResponse(channel, (Response) message);
} else if (message instanceof String) {
if (isClientSide(channel)) {
Exception e = new Exception("Dubbo client can not supported string message: " + message + " in channel: " + channel + ", url: " + channel.getUrl());
logger.error(e.getMessage(), e);
} else {
String echo = handler.telnet(channel, (String) message);
if (echo != null && echo.length() > 0) {
channel.send(echo);
}
}
} else {
handler.received(exchangeChannel, message);
}
} finally {
HeaderExchangeChannel.removeChannelIfDisconnected(channel);
}
}
```
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] carryxyh commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "carryxyh (GitHub)" <gi...@apache.org>.
@kcysk
应该会在2.6.6版本
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] AnyOSR commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "AnyOSR (GitHub)" <gi...@apache.org>.
我看的2.6.x版本好像没有关闭telnet的代码,可以稍微改下源码然后重新编译一下
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] kcysk commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "kcysk (GitHub)" <gi...@apache.org>.
👌,谢谢
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] kcysk commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "kcysk (GitHub)" <gi...@apache.org>.
这个功能将会在哪个版本放出来?
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] carryxyh commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "carryxyh (GitHub)" <gi...@apache.org>.
@kexianjun @beiwei30
Maybe we should close the duplicate pr https://github.com/apache/incubator-dubbo/pull/2809 and fix the doc.
Then we can close this issue.
How do u think?
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] dslchd commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "dslchd (GitHub)" <gi...@apache.org>.
请问这个功能 telnet="disabled" 必须是2.6.6?才支持吗?
我现在使用的是2.5.10我看源码中QosProtocolWrapper 中有标识支持禁用。但我还不知道在哪里可以配置。
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] kexianjun commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
Sure it's better to config ```<dubbo:protocol name="dubbo" port="20890" telnet="disabled"/>``` to disable telnet than this pr #2809 of mine.
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] carryxyh commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "carryxyh (GitHub)" <gi...@apache.org>.
@kexianjun
个人认为可以。可以成为一个临时方案。未来dubbo的telnet功能应该会集成到QOS里,到时候关闭QOS即可。但是目前我在issue列表里看到好多次关闭telnet的问题,我们可以暂时用配置修复它。愿意提交一个PR来解决这个问题么
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] kexianjun commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
当前版本似乎没有看到关闭telnet的代码
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] kexianjun commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
@carryxyh @beiwei30 I've closed this pr #2809. And do we need config like ```<dubbo:protocol name="dubbo" port="20890" telnet="disabled"/>``` ?
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] kexianjun commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
@carryxyh @beiwei30 I've close this pr #2809. And do we need config like ```<dubbo:protocol name="dubbo" port="20890" telnet="disabled"/>``` ?
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] beiwei30 commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
I believe #2925 from @kexianjun should satisfy this particular requirement, to disable telnet, simply configure
```xml
<dubbo:protocol name="dubbo" port="20890" telnet="help"/>
```
In this way, only `help` is available for executing, and other commands are disabled.
I don't agree with the idea of introducing another flag to control this func. A better way to disable telent should be:
```xml
<dubbo:protocol name="dubbo" port="20890" telnet="disabled"/>
```
Then we can use this magic word `disabled` in org.apache.dubbo.remoting.telnet.support.TelnetHandlerAdapter to return immediately.
What do you think, Guys?
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] kexianjun commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
> @kexianjun
> 个人认为可以。可以成为一个临时方案。未来dubbo的telnet功能应该会集成到QOS里,到时候关闭QOS即可。但是目前我在issue列表里看到好多次关闭telnet的问题,我们可以暂时用配置修复它。愿意提交一个PR来解决这个问题么
pls review this pr #2809
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] tswstarplanet commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
> 由于安全问题, 需要关闭 dubbo telnet调试功能
你是指的telnet之后invoke吗?
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] carryxyh commented on issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "carryxyh (GitHub)" <gi...@apache.org>.
目前大体情况是,dubbo协议不允许关闭telnet。
rest等协议不支持telnet。
https://github.com/apache/incubator-dubbo/issues/2033#issuecomment-405797434
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] beiwei30 closed issue #2795: 如何关闭 dubbo telnet调试功能
Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
[ issue closed by beiwei30 ]
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org