keybase / go-keybase-chat-bot Goto Github PK
View Code? Open in Web Editor NEWOfficial Go Keybase chat bot SDK
License: BSD 3-Clause "New" or "Revised" License
Official Go Keybase chat bot SDK
License: BSD 3-Clause "New" or "Revised" License
Some functions such as ListMembersOfTeam
will error if the keybase cli has any warnings, as the function tries to unmarshal both stdout and stderr. Here is an example payload that failed unmarshaling:
2020-02-12T16:04:47.296724-05:00 ▶ [WARN keybase versionfix.go:236] 001 KBFS needs to restart; running version 5.2.0, but 5.3.0-20200212090128+1e4b858d80 installed.
{"result": "..."}
Hi,
I have installed Keybase today on windows7, but after installation, only a black window is appearing. Nothing else is showing.
Please guide what to do?
Regards
The CA cert expired, which is embedded in keybase/client
. This was recently fixed in keybase/client@fbebbc9
For more details:
keybase/client#26088
This lib would be fixed by doing a new build with a newer keybase client.
In my GCP Cloud Run logs I have a string of the following
2020-02-20 17:00:00.639 PST2020/02/21 01:00:00 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:00:29.641 PST2020/02/21 01:00:29 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:01:17.639 PST2020/02/21 01:01:17 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:02:27.939 PST2020/02/21 01:02:27 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:02:54.638 PST2020/02/21 01:02:54 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:03:18.541 PST2020/02/21 01:03:18 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:03:43.739 PST2020/02/21 01:03:43 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:04:03.739 PST2020/02/21 01:04:03 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:04:42.038 PST2020/02/21 01:04:42 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:05:09.139 PST2020/02/21 01:05:09 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:05:33.239 PST2020/02/21 01:05:33 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:06:11.238 PST2020/02/21 01:06:11 Listen: failed to auth: unable to run Keybase command
2020-02-20 17:07:00.939 PST2020/02/21 01:07:00 Listen: failed to auth: unable to run Keybase command
Which finally ends in a
2020-02-20 17:18:31.241 PSTMemory limit of 1024M exceeded with 1024M used. Consider increasing the memory limit, see https://cloud.google.com/run/docs/configuring/memory-limits
All of them are Listen: failed to auth: unable to run Keybase command
, which comes from
go-keybase-chat-bot/kbchat/kbchat.go
Lines 63 to 65 in 1ce2a64
The reason why getUsername() is failing is unclear (and probably unrelated), but it doesn't seem that memory usage should increase as it keeps retrying.
Breaking this out from #55
Google Cloud's serverless container environment is called Cloud Run.
I'm trying to run a bot here in a container, but it kept crashing on calls to kbc.GetUsername()
. Eventually this was tracked down to be a problem with the Command("status")
call.
The issue is that Cloud Run captures STDOUT and STDERR without duplicating the file descriptors, so those original STDOUT/STDERR FDs are no longer doing what we expect. getUsername()
expects to shell out to keybase status
and read its STDOUT, but since the FDs are being hogged by Cloud Run's logging, the output doesn't come back and it ends up timing out as noted in #55.
In that issue I recommended 2 potential fixes: using a different FD that we know Cloud Run isn't hogging, or using another API altogether that doesn't involve shelling out to the keybase CLI.
@malware-unicorn PoC'd the first option successfully.
Noting that this is needed in order to support this feature request keybase/bot-sshca#85
flag.StringVar(&kbLoc, "keybase", "keybase", "the location of the Keybase app")
where do I find the aforementioned location of the keybase app ?
Many of the names and functions that the go bot uses are very specific. Examples:
GetTextMessages
(all other message types are ignored)SendAttachmentByTeam
Rather than have specific functions for cases like these, I think it'd make more sense to have more general options that map 1-to-1 to the functions exposed to us by the underlying Keybase API. The TypeScript bot is a good example of this; the functionality for the above functions is implemented via read
and attach
, respectively.
That being said, I think there are some methods like SendMessageByTlfName
that save the creation of a lot of new channel objects. Since the bot types will require a major version upgrade, I'm opening this issue to start a discussion on what function signatures it'd make sense to change in a v2.
Currently, we document all our functions in the markdown of the README. I think it'd be nice and more idiomatic if we transferred most of this documentation over to GoDoc comments and linked to the godoc.org page for the bot.
That being said, I think it's still important to describe some basic functionalities and examples in the README, I just think the comprehensive documentation would make more sense in a medium better suited for it.
Our bot is starting to integrate wallet and team features. If we were to do a major upgrade, I think it'd make sense to rename the package from kbchat
to something more general, like kbbot
.
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.