-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run example http://pad-local.com/#/learn failed. #252
Comments
Currently, we are working on upgrading the Puppet Padlocal to the latest version v1.x, you can learn the progress from this PR: After it has been upgraded, we recommended using the Wechaty community officially getting started repo at https://github.com/wechaty/getting-started and it should be able to work out-of-the-box, which is very convenient to the newcomers. For now, as a workaround, I'm using a Wechaty Token Gateway with Puppet Padlocal so that we can use the new Wechaty v1.x with the old Puppet Padlocal, and it works great with our community bot Friday BOT. You can learn how the Friday BOT creates its Wechaty Token Gateway from this script. And after running this script, you can use the new Wechaty Puppet Service Token (which is compatible with Wechaty v1.x) and use it with the latest Wechaty v1.x code. Please read those codes and I hope you can make it work soon. If you run into any hard-to-solve issue, unfortunately, please feel free to create a reproducible repo and I can take a look at it for you. Good luck! |
I follow the getting started document to run:
got error:
|
You need to use the Friday BOT creates its Wechaty Token Gateway because the current PadLocal is not compatible with the latest Wechaty v1.x. SolutionWechaty Token GatewayTry to start the Wechaty Token Gateway like this: WECHATY_IMAGE=wechaty/wechaty:0.78
docker pull "$WECHATY_IMAGE"
docker run \
-ti \
--name friday_wechaty_puppet_service_token_gateway \
--rm \
--privileged \
--network=host \
-e WECHATY_LOG=verbose \
-e WECHATY_PUPPET=wechaty-puppet-padlocal \
-e WECHATY_PUPPET_PADLOCAL_TOKEN=puppet_padlocal_58658ea9872846xxxxxxxxxxxxxxxxxxxx \
-e WECHATY_TOKEN=insecure_ebd42481-0c59-4563-a03b-c072ab782c2d \
"$WECHATY_IMAGE" Start Wechaty with the new Gated TokenAfter you have started the above script, you will get a valid Wechaty Puppet Service Token named export WECHATY_PUPPET_SERVICE_TOKEN=insecure_ebd42481-0c59-4563-a03b-c072ab782c2d
export WECHATY_PUPPET=wechaty-puppet-service
export WECHATY_LOG=verbose
npm start |
ok, it works! thanks! |
Terrific, you are welcome! |
Docker run successfully, then I scanned the QRCode URL, docker has been able to output some information of wechat. but run
docker console log:
|
It seems that your gateway and the discover service works. Could you check this issue: And see if your issue is related to thel TLS? It might because I use the wrong SNI insecure. |
Follow your tips, closed TLS, it works!
successful log:
|
Congratulations! That's because the TLS support has only been supported since v1.0 (and it has been enabled by default) |
Excuse me, @huan could you provide more explanation on "-e WECHATY_TOKEN=insecure_ebd42481-0c59-4563-a03b-c072ab782c2d " in gateway script?Since if we already provide that token then how could we GET the granted token? and is that token just an example or unchanged? I ran that script and the bot just started running but didn't give me any token.Thanks very much in advance for the help. |
@Hamlet626 what do you mean "if we already provide that token"? It would be great if you can create a new issue and descript your question in detail. |
@huan Oh so just because I saw in the script line 13 we already wrote that token there right? I just don't understand is such script helping us get the token, or otherwise how should we get that "insecure_edb..." token, so that we use that token to run our own program right? Thanks for replying, not sure my understanding was right. And sure,I will start a new issue just after few more tries. |
You are welcome. There might be confusing to users that when we are saying "TOKEN", there are two types of them:
The WPP TOKEN and the WPS TOKEN are totally different, and if you use one for another, it will not work. Wechaty Puppet Provider (WPP)
And here's the most important one: Wechaty Puppet Service (WPS, wechaty-puppet-service) token Wechaty Puppet Service (WPS)The WPS TOKEN is the most compatible token for Polyglot (Python, Go, .NET, etc) Wechaty:
I hope the above information can help you to have a better understanding of the WPS TOKEN v.s. the WPP TOKEN, please feel free to file an new issue if you have more questions. |
Yeah, it resolves my confusion indeed. Thanks a lot for the explanation and your patient. Just going to try it out soon! |
Great to know that your confusion had been resolved! Looking forward to seeing your future process, and have a nice day! |
When I run example http://pad-local.com/#/learn step-by-step, got error at last step "npm run demo"
Env:
Error:
The text was updated successfully, but these errors were encountered: