diff --git a/base/options.go b/base/options.go index bfa94179..67c53791 100644 --- a/base/options.go +++ b/base/options.go @@ -39,6 +39,9 @@ type Options struct { // Allow the bot to read it's own messages (default: false) ReadSelf bool AWSOpts *AWSOptions + + // Optional, used for debugging to identify the bot. + DebugTag string } func NewOptions() *Options { @@ -58,6 +61,7 @@ func (o *Options) Parse(fs *flag.FlagSet, argv []string) error { fs.StringVar(&mysqlTLSCA, "mysql-tls-ca", os.Getenv("BOT_MYSQL_TLS_CA"), "Bot MySQL TLS CA") fs.StringVar(&o.StathatEZKey, "stathat-ezkey", os.Getenv("BOT_STATHAT_EZKEY"), "Bot stathat ezkey") fs.BoolVar(&o.ReadSelf, "read-self", false, "Allow the bot to read it's own messages") + fs.StringVar(&o.DebugTag, "debug-tag", os.Getenv("BOT_DEBUG_TAG"), "Bot debug tag") awsOpts := &AWSOptions{} fs.StringVar(&awsOpts.AWSRegion, "aws-region", os.Getenv("BOT_AWS_REGION"), "AWS region for cloudwatch logs, optional") @@ -109,5 +113,6 @@ func (o *Options) Command(args ...string) *exec.Cmd { return kbchat.RunOptions{ KeybaseLocation: o.KeybaseLocation, HomeDir: o.Home, + DebugTag: o.DebugTag, }.Command(args...) } diff --git a/canarybot/main.go b/canarybot/main.go index d0f0c685..3ea18010 100644 --- a/canarybot/main.go +++ b/canarybot/main.go @@ -37,6 +37,7 @@ func NewBotServer(opts Options) *BotServer { KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, NumPipes: 5, + DebugTag: opts.DebugTag, }), opts: opts, } diff --git a/elastiwatch/main.go b/elastiwatch/main.go index f6580668..7806fc53 100644 --- a/elastiwatch/main.go +++ b/elastiwatch/main.go @@ -45,6 +45,7 @@ func NewBotServer(opts Options) *BotServer { Server: base.NewServer("elastiwatch", opts.Announcement, opts.AWSOpts, opts.MultiDSN, opts.ReadSelf, kbchat.RunOptions{ KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, + DebugTag: opts.DebugTag, }), opts: opts, } diff --git a/gcalbot/main.go b/gcalbot/main.go index 2e9d29a8..49633a09 100644 --- a/gcalbot/main.go +++ b/gcalbot/main.go @@ -49,6 +49,7 @@ func NewBotServer(opts Options) *BotServer { Server: base.NewServer("gcalbot", opts.Announcement, opts.AWSOpts, opts.MultiDSN, opts.ReadSelf, kbchat.RunOptions{ KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, + DebugTag: opts.DebugTag, }), opts: opts, } diff --git a/githubbot/main.go b/githubbot/main.go index fd3bddb6..8e139550 100644 --- a/githubbot/main.go +++ b/githubbot/main.go @@ -51,6 +51,7 @@ func NewBotServer(opts Options) *BotServer { Server: base.NewServer("githubbot", opts.Announcement, opts.AWSOpts, opts.MultiDSN, opts.ReadSelf, kbchat.RunOptions{ KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, + DebugTag: opts.DebugTag, }), opts: opts, } diff --git a/gitlabbot/main.go b/gitlabbot/main.go index e58c2ba7..bc833de6 100644 --- a/gitlabbot/main.go +++ b/gitlabbot/main.go @@ -44,6 +44,7 @@ func NewBotServer(opts Options) *BotServer { Server: base.NewServer("gitlabbot", opts.Announcement, opts.AWSOpts, opts.MultiDSN, opts.ReadSelf, kbchat.RunOptions{ KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, + DebugTag: opts.DebugTag, }), opts: opts, } diff --git a/go.mod b/go.mod index a8d9fe33..035e55e4 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/gorilla/mux v1.7.3 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/keybase/go-codec v0.0.0-20180928230036-164397562123 - github.com/keybase/go-keybase-chat-bot v0.0.0-20251212163122-450fd0812017 + github.com/keybase/go-keybase-chat-bot v0.0.0-20260127182354-7367dd3315a3 github.com/opensearch-project/opensearch-go/v4 v4.5.0 github.com/stathat/go v1.0.0 github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index 75ad2357..3945c087 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,8 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/keybase/go-codec v0.0.0-20180928230036-164397562123 h1:yg56lYPqh9suJepqxOMd/liFgU/x+maRPiB30JNYykM= github.com/keybase/go-codec v0.0.0-20180928230036-164397562123/go.mod h1:r/eVVWCngg6TsFV/3HuS9sWhDkAzGG8mXhiuYA+Z/20= -github.com/keybase/go-keybase-chat-bot v0.0.0-20251212163122-450fd0812017 h1:lB6jgDag58Ie9yfLSGDQiUZt60zPyRpK6aWCtovQeSo= -github.com/keybase/go-keybase-chat-bot v0.0.0-20251212163122-450fd0812017/go.mod h1:wl5lBoVNkepL8Hzs7jyqg3GS6U+by4yQeNr7oT0Evt0= +github.com/keybase/go-keybase-chat-bot v0.0.0-20260127182354-7367dd3315a3 h1:0uwBoNFUfi+vqQplGh2md1bak0WYelaoqkjn6hBSwJM= +github.com/keybase/go-keybase-chat-bot v0.0.0-20260127182354-7367dd3315a3/go.mod h1:wl5lBoVNkepL8Hzs7jyqg3GS6U+by4yQeNr7oT0Evt0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= diff --git a/macrobot/main.go b/macrobot/main.go index fe379ac3..21670ad2 100644 --- a/macrobot/main.go +++ b/macrobot/main.go @@ -28,6 +28,7 @@ func NewBotServer(opts base.Options) *BotServer { Server: base.NewServer("macrobot", opts.Announcement, opts.AWSOpts, opts.MultiDSN, opts.ReadSelf, kbchat.RunOptions{ KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, + DebugTag: opts.DebugTag, }), opts: opts, } diff --git a/meetbot/main.go b/meetbot/main.go index 7ddfedf4..d412f200 100644 --- a/meetbot/main.go +++ b/meetbot/main.go @@ -43,6 +43,7 @@ func NewBotServer(opts Options) *BotServer { Server: base.NewServer("meetbot", opts.Announcement, opts.AWSOpts, opts.MultiDSN, opts.ReadSelf, kbchat.RunOptions{ KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, + DebugTag: opts.DebugTag, }), opts: opts, } diff --git a/pollbot/main.go b/pollbot/main.go index e42a49d9..39141ba3 100644 --- a/pollbot/main.go +++ b/pollbot/main.go @@ -40,6 +40,7 @@ func NewBotServer(opts Options) *BotServer { Server: base.NewServer("pollbot", opts.Announcement, opts.AWSOpts, opts.MultiDSN, opts.ReadSelf, kbchat.RunOptions{ KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, + DebugTag: opts.DebugTag, }), opts: opts, } diff --git a/triviabot/main.go b/triviabot/main.go index a4363103..db8afb12 100644 --- a/triviabot/main.go +++ b/triviabot/main.go @@ -27,6 +27,7 @@ func NewBotServer(opts base.Options) *BotServer { Server: base.NewServer("triviabot", opts.Announcement, opts.AWSOpts, opts.MultiDSN, opts.ReadSelf, kbchat.RunOptions{ KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, + DebugTag: opts.DebugTag, }), opts: opts, } diff --git a/webhookbot/main.go b/webhookbot/main.go index 8af9d106..6fedd602 100644 --- a/webhookbot/main.go +++ b/webhookbot/main.go @@ -39,6 +39,7 @@ func NewBotServer(opts Options) *BotServer { KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, NumPipes: 5, + DebugTag: opts.DebugTag, }), opts: opts, } diff --git a/zoombot/main.go b/zoombot/main.go index 25c60217..207a9785 100644 --- a/zoombot/main.go +++ b/zoombot/main.go @@ -46,6 +46,7 @@ func NewBotServer(opts Options) *BotServer { Server: base.NewServer("zoombot", opts.Announcement, opts.AWSOpts, opts.MultiDSN, opts.ReadSelf, kbchat.RunOptions{ KeybaseLocation: opts.KeybaseLocation, HomeDir: opts.Home, + DebugTag: opts.DebugTag, }), opts: opts, }