From 3c12fb6254df3fcf5dced7e7add312083bc486d9 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 6 Aug 2018 05:02:47 -0400 Subject: [PATCH 1/8] fix #283 (remove unnecessary log.Fatal) The server should never crash during rehash, even if the config is invalid. --- irc/client.go | 19 +++++++++---------- irc/config.go | 6 +++--- irc/logger/logger.go | 11 +++-------- irc/nickserv.go | 7 ++++++- irc/server.go | 36 ++++++++++++++++++++++++------------ 5 files changed, 45 insertions(+), 34 deletions(-) diff --git a/irc/client.go b/irc/client.go index ad3717f2..d5b6a3f3 100644 --- a/irc/client.go +++ b/irc/client.go @@ -7,7 +7,6 @@ package irc import ( "fmt" - "log" "net" "runtime/debug" "strconv" @@ -82,8 +81,8 @@ type Client struct { vhost string } -// NewClient returns a client with all the appropriate info setup. -func NewClient(server *Server, conn net.Conn, isTLS bool) *Client { +// NewClient sets up a new client and starts its goroutine. +func NewClient(server *Server, conn net.Conn, isTLS bool) { now := time.Now() config := server.Config() fullLineLenLimit := config.Limits.LineLen.Tags + config.Limits.LineLen.Rest @@ -114,15 +113,17 @@ func NewClient(server *Server, conn net.Conn, isTLS bool) *Client { } if config.Server.CheckIdent && !utils.AddrIsUnix(conn.RemoteAddr()) { _, serverPortString, err := net.SplitHostPort(conn.LocalAddr().String()) + if err != nil { + server.logger.Error("internal", "bad server address", err.Error()) + return + } serverPort, _ := strconv.Atoi(serverPortString) - if err != nil { - log.Fatal(err) - } clientHost, clientPortString, err := net.SplitHostPort(conn.RemoteAddr().String()) - clientPort, _ := strconv.Atoi(clientPortString) if err != nil { - log.Fatal(err) + server.logger.Error("internal", "bad client address", err.Error()) + return } + clientPort, _ := strconv.Atoi(clientPortString) client.Notice(client.t("*** Looking up your username")) resp, err := ident.Query(clientHost, serverPort, clientPort, IdentTimeoutSeconds) @@ -141,8 +142,6 @@ func NewClient(server *Server, conn net.Conn, isTLS bool) *Client { } } go client.run() - - return client } func (client *Client) resetFakelag() { diff --git a/irc/config.go b/irc/config.go index e3680ad1..b27891b6 100644 --- a/irc/config.go +++ b/irc/config.go @@ -410,17 +410,17 @@ func (conf *Config) Operators(oc map[string]*OperClass) (map[string]*Oper, error } // TLSListeners returns a list of TLS listeners and their configs. -func (conf *Config) TLSListeners() map[string]*tls.Config { +func (conf *Config) TLSListeners() (map[string]*tls.Config, error) { tlsListeners := make(map[string]*tls.Config) for s, tlsListenersConf := range conf.Server.TLSListeners { config, err := tlsListenersConf.Config() if err != nil { - log.Fatal(err) + return nil, err } config.ClientAuth = tls.RequestClientCert tlsListeners[s] = config } - return tlsListeners + return tlsListeners, nil } // LoadConfig loads the given YAML configuration file. diff --git a/irc/logger/logger.go b/irc/logger/logger.go index 48cbb097..c6014482 100644 --- a/irc/logger/logger.go +++ b/irc/logger/logger.go @@ -124,7 +124,9 @@ func (logger *Manager) ApplyConfig(config []LoggingConfig) error { stdoutWriteLock: &logger.stdoutWriteLock, fileWriteLock: &logger.fileWriteLock, } - if typeMap["userinput"] || typeMap["useroutput"] || (typeMap["*"] && !(excludedTypeMap["userinput"] && excludedTypeMap["useroutput"])) { + ioEnabled := typeMap["userinput"] || typeMap["useroutput"] || (typeMap["*"] && !(excludedTypeMap["userinput"] && excludedTypeMap["useroutput"])) + // raw I/O is only logged at level debug; + if ioEnabled && logConfig.Level == LogDebug { atomic.StoreUint32(&logger.loggingRawIO, 1) } if sLogger.MethodFile.Enabled { @@ -177,13 +179,6 @@ func (logger *Manager) Error(logType string, messageParts ...string) { logger.Log(LogError, logType, messageParts...) } -// Fatal logs the given message as an error message, then exits. -func (logger *Manager) Fatal(logType string, messageParts ...string) { - logger.Error(logType, messageParts...) - logger.Error("FATAL", "Fatal error encountered, application exiting") - os.Exit(1) -} - type fileMethod struct { Enabled bool Filename string diff --git a/irc/nickserv.go b/irc/nickserv.go index fda9669d..addccd96 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -20,6 +20,11 @@ func servCmdRequiresAuthEnabled(server *Server) bool { return server.AccountConfig().AuthenticationEnabled } +func nsGroupEnabled(server *Server) bool { + conf := server.Config() + return conf.Accounts.AuthenticationEnabled && conf.Accounts.NickReservation.Enabled +} + const nickservHelp = `NickServ lets you register and login to an account. To see in-depth help for a specific NickServ command, try: @@ -55,7 +60,7 @@ same user account, letting you reclaim your nickname.`, GROUP links your current nickname with your logged-in account, preventing other users from changing to it (or forcing them to rename).`, helpShort: `$bGROUP$b links your current nickname to your user account.`, - enabled: servCmdRequiresAccreg, + enabled: nsGroupEnabled, authRequired: true, }, diff --git a/irc/server.go b/irc/server.go index c05767ab..cb53f3f8 100644 --- a/irc/server.go +++ b/irc/server.go @@ -10,7 +10,6 @@ import ( "crypto/tls" "encoding/base64" "fmt" - "log" "math/rand" "net" "net/http" @@ -328,8 +327,8 @@ func (server *Server) checkBans(ipaddr net.IP) (banned bool, message string) { // IRC protocol listeners // -// createListener starts the given listeners. -func (server *Server) createListener(addr string, tlsConfig *tls.Config) *ListenerWrapper { +// createListener starts a given listener. +func (server *Server) createListener(addr string, tlsConfig *tls.Config) (*ListenerWrapper, error) { // make listener var listener net.Listener var err error @@ -342,7 +341,7 @@ func (server *Server) createListener(addr string, tlsConfig *tls.Config) *Listen listener, err = net.Listen("tcp", addr) } if err != nil { - log.Fatal(server, "listen error: ", err) + return nil, err } // throw our details to the server so we can be modified/killed later @@ -385,7 +384,7 @@ func (server *Server) createListener(addr string, tlsConfig *tls.Config) *Listen } }() - return &wrapper + return &wrapper, nil } // generateMessageID returns a network-unique message ID. @@ -899,7 +898,7 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) { } // we are now open for business - server.setupListeners(config) + err = server.setupListeners(config) if !initial { // push new info to all of our clients @@ -914,7 +913,7 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) { } } - return nil + return err } func (server *Server) setupPprofListener(config *Config) { @@ -1024,15 +1023,20 @@ func (server *Server) loadDatastore(config *Config) error { return nil } -func (server *Server) setupListeners(config *Config) { +func (server *Server) setupListeners(config *Config) (err error) { logListener := func(addr string, tlsconfig *tls.Config) { server.logger.Info("listeners", fmt.Sprintf("now listening on %s, tls=%t.", addr, (tlsconfig != nil)), ) } + tlsListeners, err := config.TLSListeners() + if err != nil { + server.logger.Error("rehash", "failed to reload TLS certificates, aborting rehash", err.Error()) + return + } + // update or destroy all existing listeners - tlsListeners := config.TLSListeners() for addr := range server.listeners { currentListener := server.listeners[addr] var stillConfigured bool @@ -1068,7 +1072,13 @@ func (server *Server) setupListeners(config *Config) { if !exists { // make new listener tlsConfig := tlsListeners[newaddr] - server.listeners[newaddr] = server.createListener(newaddr, tlsConfig) + listener, listenerErr := server.createListener(newaddr, tlsConfig) + if listenerErr != nil { + server.logger.Error("rehash", "couldn't listen on", newaddr, listenerErr.Error()) + err = listenerErr + continue + } + server.listeners[newaddr] = listener logListener(newaddr, tlsConfig) } } @@ -1078,8 +1088,8 @@ func (server *Server) setupListeners(config *Config) { } var usesStandardTLSPort bool - for addr := range config.TLSListeners() { - if strings.Contains(addr, "6697") { + for addr := range tlsListeners { + if strings.HasSuffix(addr, ":6697") { usesStandardTLSPort = true break } @@ -1087,6 +1097,8 @@ func (server *Server) setupListeners(config *Config) { if 0 < len(tlsListeners) && !usesStandardTLSPort { server.logger.Warning("startup", "Port 6697 is the standard TLS port for IRC. You should (also) expose port 6697 as a TLS port to ensure clients can connect securely") } + + return } // elistMatcher takes and matches ELIST conditions From 578ca2fdf6351a38bb2e3751444d03231f430362 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 6 Aug 2018 09:21:29 -0400 Subject: [PATCH 2/8] add support for service command aliases --- irc/chanserv.go | 3 +++ irc/server.go | 16 ---------------- irc/services.go | 35 +++++++++++++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/irc/chanserv.go b/irc/chanserv.go index aac72967..bdf779c0 100644 --- a/irc/chanserv.go +++ b/irc/chanserv.go @@ -63,6 +63,9 @@ invoking the command without a code will display the necessary code.`, helpShort: `$bUNREGISTER$b deletes a channel registration.`, enabled: chanregEnabled, }, + "drop": { + aliasOf: "unregister", + }, "amode": { handler: csAmodeHandler, help: `Syntax: $bAMODE #channel [mode change] [account]$b diff --git a/irc/server.go b/irc/server.go index cb53f3f8..d0c6d37c 100644 --- a/irc/server.go +++ b/irc/server.go @@ -145,22 +145,6 @@ func NewServer(config *Config, logger *logger.Manager) (*Server, error) { return nil, err } - // confirm help entries for ChanServ exist. - // this forces people to write help entries for every single CS command. - for commandName, commandInfo := range chanservCommands { - if commandInfo.help == "" || commandInfo.helpShort == "" { - return nil, fmt.Errorf("Help entry does not exist for ChanServ command %s", commandName) - } - } - - // confirm help entries for NickServ exist. - // this forces people to write help entries for every single NS command. - for commandName, commandInfo := range nickservCommands { - if commandInfo.help == "" || commandInfo.helpShort == "" { - return nil, fmt.Errorf("Help entry does not exist for NickServ command %s", commandName) - } - } - // Attempt to clean up when receiving these signals. signal.Notify(server.signals, ServerExitSignals...) signal.Notify(server.rehashSignal, syscall.SIGHUP) diff --git a/irc/services.go b/irc/services.go index 175b65ec..674b84b1 100644 --- a/irc/services.go +++ b/irc/services.go @@ -5,6 +5,7 @@ package irc import ( "fmt" + "log" "sort" "strings" @@ -25,6 +26,7 @@ type ircService struct { // defines a command associated with a service, e.g., NICKSERV IDENTIFY type serviceCommand struct { + aliasOf string // marks this command as an alias of another capabs []string // oper capabs the given user has to have to access this command handler func(server *Server, client *Client, command, params string, rb *ResponseBuffer) help string @@ -33,6 +35,24 @@ type serviceCommand struct { enabled func(*Server) bool // is this command enabled in the server config? } +// looks up a command in the table of command definitions for a service, resolving aliases +func lookupServiceCommand(commands map[string]*serviceCommand, command string) *serviceCommand { + maxDepth := 1 + depth := 0 + for depth <= maxDepth { + result, ok := commands[command] + if !ok { + return nil + } else if result.aliasOf == "" { + return result + } else { + command = result.aliasOf + depth += 1 + } + } + return nil +} + // all services, by lowercase name var OragonoServices = map[string]*ircService{ "nickserv": { @@ -93,7 +113,7 @@ func servicePrivmsgHandler(service *ircService, server *Server, client *Client, rb.Add(nil, service.Name, "NOTICE", nick, notice) } - cmd := service.Commands[commandName] + cmd := lookupServiceCommand(service.Commands, commandName) if cmd == nil { sendNotice(fmt.Sprintf("%s /%s HELP", client.t("Unknown command. To see available commands, run"), service.ShortName)) return @@ -140,6 +160,9 @@ func serviceHelpHandler(service *ircService, server *Server, client *Client, par if 0 < len(commandInfo.capabs) && !client.HasRoleCapabs(commandInfo.capabs...) { continue } + if commandInfo.aliasOf != "" { + continue // don't show help lines for aliases + } if commandInfo.enabled != nil && !commandInfo.enabled(server) { disabledCommands = true continue @@ -164,7 +187,8 @@ func serviceHelpHandler(service *ircService, server *Server, client *Client, par sendNotice(line) } } else { - commandInfo := service.Commands[strings.ToLower(strings.TrimSpace(params))] + commandName := strings.ToLower(strings.TrimSpace(params)) + commandInfo := lookupServiceCommand(service.Commands, commandName) if commandInfo == nil { sendNotice(client.t(fmt.Sprintf("Unknown command. To see available commands, run /%s HELP", service.ShortName))) } else { @@ -196,5 +220,12 @@ func initializeServices() { Commands[ircCmd] = ircCmdDef oragonoServicesByCommandAlias[ircCmd] = service } + + // force devs to write a help entry for every command + for commandName, commandInfo := range service.Commands { + if commandInfo.aliasOf == "" && (commandInfo.help == "" || commandInfo.helpShort == "") { + log.Fatal(fmt.Sprintf("help entry missing for %s command %s", serviceName, commandName)) + } + } } } From 7cd5b8473cbe02e03449d1e072f95d10128fcbb4 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 6 Aug 2018 09:47:44 -0400 Subject: [PATCH 3/8] fix a bug in CS UNREGISTER --- irc/channelreg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc/channelreg.go b/irc/channelreg.go index 6dca4bc7..723cfdaa 100644 --- a/irc/channelreg.go +++ b/irc/channelreg.go @@ -250,7 +250,7 @@ func (reg *ChannelRegistry) deleteChannel(tx *buntdb.Tx, key string, info Regist founder, _ := tx.Get(fmt.Sprintf(keyChannelFounder, key)) // to see if we're deleting the right channel, confirm the founder and the registration time - if founder == info.Founder && registeredAt == info.RegisteredAt { + if founder == info.Founder && registeredAt.Unix() == info.RegisteredAt.Unix() { for _, keyFmt := range channelKeyStrings { tx.Delete(fmt.Sprintf(keyFmt, key)) } From a4546c418bebe05d624fc40c1ab40722e01ce8e8 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 8 Aug 2018 17:56:12 -0400 Subject: [PATCH 4/8] fix miscounting in LUSERS --- irc/client.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/irc/client.go b/irc/client.go index d5b6a3f3..245e64cd 100644 --- a/irc/client.go +++ b/irc/client.go @@ -765,11 +765,12 @@ func (client *Client) destroy(beingResumed bool) { // send quit messages to friends if !beingResumed { - client.server.stats.ChangeTotal(-1) + if client.Registered() { + client.server.stats.ChangeTotal(-1) + } if client.HasMode(modes.Invisible) { client.server.stats.ChangeInvisible(-1) } - if client.HasMode(modes.Operator) || client.HasMode(modes.LocalOperator) { client.server.stats.ChangeOperators(-1) } From b45b863fc4385f6004efb3278565dc2845baa686 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Tue, 14 Aug 2018 22:48:06 -0400 Subject: [PATCH 5/8] unregister capab was renamed to accreg, but i missed this occurrence --- irc/nickserv.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc/nickserv.go b/irc/nickserv.go index addccd96..57c982d2 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -99,7 +99,7 @@ certificate (and you will need to use that certificate to login in future).`, SADROP forcibly de-links the given nickname from the attached user account.`, helpShort: `$bSADROP$b forcibly de-links the given nickname from its user account.`, - capabs: []string{"unregister"}, + capabs: []string{"accreg"}, enabled: servCmdRequiresAccreg, }, "unregister": { From 6eda236eab01792cdf777a1a3c74515c8067d318 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Tue, 14 Aug 2018 22:50:20 -0400 Subject: [PATCH 6/8] remove allow-multiple-per-connection --- irc/config.go | 1 - irc/handlers.go | 8 ++------ irc/nickserv.go | 8 ++------ oragono.yaml | 4 ---- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/irc/config.go b/irc/config.go index b27891b6..be216aad 100644 --- a/irc/config.go +++ b/irc/config.go @@ -81,7 +81,6 @@ type AccountRegistrationConfig struct { VerifyMessage string `yaml:"verify-message"` } } - AllowMultiplePerConnection bool `yaml:"allow-multiple-per-connection"` } type VHostConfig struct { diff --git a/irc/handlers.go b/irc/handlers.go index 789cbdf8..643a6649 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -85,12 +85,8 @@ func parseCallback(spec string, config *AccountConfig) (callbackNamespace string func accRegisterHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool { // clients can't reg new accounts if they're already logged in if client.LoggedIntoAccount() { - if server.AccountConfig().Registration.AllowMultiplePerConnection { - server.accounts.Logout(client) - } else { - rb.Add(nil, server.name, ERR_REG_UNSPECIFIED_ERROR, client.nick, "*", client.t("You're already logged into an account")) - return false - } + rb.Add(nil, server.name, ERR_REG_UNSPECIFIED_ERROR, client.nick, "*", client.t("You're already logged into an account")) + return false } // get and sanitise account name diff --git a/irc/nickserv.go b/irc/nickserv.go index 57c982d2..cfd2ed5e 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -264,12 +264,8 @@ func nsRegisterHandler(server *Server, client *Client, command, params string, r } if client.LoggedIntoAccount() { - if server.AccountConfig().Registration.AllowMultiplePerConnection { - server.accounts.Logout(client) - } else { - nsNotice(rb, client.t("You're already logged into an account")) - return - } + nsNotice(rb, client.t("You're already logged into an account")) + return } config := server.AccountConfig() diff --git a/oragono.yaml b/oragono.yaml index 5ea4ffdd..628b0d3c 100644 --- a/oragono.yaml +++ b/oragono.yaml @@ -163,10 +163,6 @@ accounts: # password: "" # sender: "admin@my.network" - # allow multiple account registrations per connection - # this is for testing purposes and shouldn't be allowed on real networks - allow-multiple-per-connection: false - # is account authentication enabled? authentication-enabled: true From a2c2419084baa5d6c64cd8fcdf2a864483061ff8 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Tue, 14 Aug 2018 23:26:43 -0400 Subject: [PATCH 7/8] remove stackimpact --- Gopkg.lock | 74 ++++++++++++++++++++++++++++++++++++++++----------- Gopkg.toml | 4 --- irc/config.go | 8 ------ oragono.go | 15 ----------- oragono.yaml | 11 -------- 5 files changed, 58 insertions(+), 54 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index ac906fb8..45ef4275 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,132 +2,157 @@ [[projects]] + digest = "1:1bd4d273de93fce29ca3636145ccfcb932754f56e4c099297319e677e89f658d" name = "code.cloudfoundry.org/bytefmt" packages = ["."] + pruneopts = "" revision = "cbe033486cf0620d3bb77d8ef7f22ab346ad3628" [[projects]] branch = "master" + digest = "1:20da7140359cab99772431cbeb195bd8cbe76312fcf6509fd8125cf91ab2847b" name = "github.com/docopt/docopt-go" packages = ["."] + pruneopts = "" revision = "ee0de3bc6815ee19d4a46c7eb90f829db0e014b1" [[projects]] branch = "master" + digest = "1:5d1f0cdebbc2a5237b572fa539bdb0aefea36780cdc1dbeda3b2f5d39f8f375d" name = "github.com/goshuirc/e-nfa" packages = ["."] + pruneopts = "" revision = "7071788e394065e6456458a5e9cb503cad545154" [[projects]] branch = "master" + digest = "1:d7ff716c49f33735c9e25e11b67e70f9eac7eb6c21b9806b0552b52541a568f5" name = "github.com/goshuirc/irc-go" packages = [ "ircfmt", "ircmatch", - "ircmsg" + "ircmsg", ] + pruneopts = "" revision = "8d136c4f92871c1c132bf702022363add479291b" [[projects]] branch = "master" + digest = "1:5be6259a2ab7350284d8c25b8df78153dcca360247be48ea7c55be37689802f4" name = "github.com/mattn/go-colorable" packages = ["."] + pruneopts = "" revision = "7dc3415be66d7cc68bf0182f35c8d31f8d2ad8a7" [[projects]] + digest = "1:78229b46ddb7434f881390029bd1af7661294af31f6802e0e1bedaad4ab0af3c" name = "github.com/mattn/go-isatty" packages = ["."] + pruneopts = "" revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39" version = "v0.0.3" [[projects]] branch = "master" + digest = "1:50416da10e189bc201e122e20078fb8e680a439cbdd24aaece06c434b4415b60" name = "github.com/mgutz/ansi" packages = ["."] + pruneopts = "" revision = "9520e82c474b0a04dd04f8a40959027271bab992" [[projects]] branch = "master" + digest = "1:2251e6a17ea4a6eaa708882a1cda837aae3e425edbb190ef39b761ecf15a5c3d" name = "github.com/oragono/go-ident" packages = ["."] + pruneopts = "" revision = "337fed0fd21ad538725cfcb55053ea4cf8056abc" [[projects]] branch = "master" - name = "github.com/stackimpact/stackimpact-go" - packages = [ - ".", - "internal", - "internal/pprof/profile" - ] - revision = "8b5b02c181e477dafcf505342d8a79b5c8241da7" - -[[projects]] - branch = "master" + digest = "1:b28f2f9253cbb1bf2bcb3c0ab7421d2f88a245386199a6668b0a66eb09ce3e1f" name = "github.com/tidwall/btree" packages = ["."] + pruneopts = "" revision = "9876f1454cf0993a53d74c27196993e345f50dd1" [[projects]] + digest = "1:18342f164260096848ceff7c53cf797dbc1556d8161ad51cfc22281916209a5a" name = "github.com/tidwall/buntdb" packages = ["."] + pruneopts = "" revision = "2da7c106683f522198cdf55ed8db42b374de50d7" version = "v1.0.0" [[projects]] + digest = "1:82fa3d995465f05e4c5e7f44a94d084b84a547ad77e41458fe9ec0877d04dced" name = "github.com/tidwall/gjson" packages = ["."] + pruneopts = "" revision = "87033efcaec6215741137e8ca61952c53ef2685d" version = "v1.0.6" [[projects]] branch = "master" + digest = "1:bf59f997bab72b8ecd044aed35d706edb6abd6128afe0502c94398b2374f1f3f" name = "github.com/tidwall/grect" packages = ["."] + pruneopts = "" revision = "ba9a043346eba55344e40d66a5e74cfda3a9d293" [[projects]] branch = "master" + digest = "1:4db4f92bb9cb04cfc4fccb36aba2598b02a988008c4cc0692b241214ad8ac96e" name = "github.com/tidwall/match" packages = ["."] + pruneopts = "" revision = "1731857f09b1f38450e2c12409748407822dc6be" [[projects]] branch = "master" + digest = "1:5d9d865e55b95f001e52a7f5d1f812e8a80f0f05d5b04ede006f24206ebba33c" name = "github.com/tidwall/rtree" packages = [ ".", - "base" + "base", ] + pruneopts = "" revision = "6cd427091e0e662cb4f8e2c9eb1a41e1c46ff0d3" [[projects]] branch = "master" + digest = "1:261a5770e68d10884a6d334396842d69ddb57ac5ecef60057eb5bce6f4bc7512" name = "github.com/tidwall/tinyqueue" packages = ["."] + pruneopts = "" revision = "1feaf062ef04a231c9126f99a68eaa579fd0e390" [[projects]] branch = "master" + digest = "1:295363031beef7eb063d53138806b43f26c38d8a3e2543324ce2af3c766069de" name = "golang.org/x/crypto" packages = [ "bcrypt", "blowfish", - "ssh/terminal" + "ssh/terminal", ] + pruneopts = "" revision = "5119cf507ed5294cc409c092980c7497ee5d6fd2" [[projects]] branch = "master" + digest = "1:407b5f905024dd94ee08c1777fabb380fb3d380f92a7f7df2592be005337eeb3" name = "golang.org/x/sys" packages = [ "unix", - "windows" + "windows", ] + pruneopts = "" revision = "37707fdb30a5b38865cfb95e5aab41707daec7fd" [[projects]] branch = "master" + digest = "1:31985a0ed491dba5ba7fe92e18be008acd92ca9435ed9b35b06f3e6c00fd82cb" name = "golang.org/x/text" packages = [ "cases", @@ -148,19 +173,36 @@ "unicode/cldr", "unicode/norm", "unicode/rangetable", - "width" + "width", ] + pruneopts = "" revision = "4e4a3210bb54bb31f6ab2cdca2edcc0b50c420c1" [[projects]] branch = "v2" + digest = "1:4b4e5848dfe7f316f95f754df071bebfb40cf4482da62e17e7e1aebdf11f4918" name = "gopkg.in/yaml.v2" packages = ["."] + pruneopts = "" revision = "d670f9405373e636a5a2765eea47fac0c9bc91a4" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "1f6e6db999e9e75b04aee6f0018be1557848f8248a28cf21783188fdeb866718" + input-imports = [ + "code.cloudfoundry.org/bytefmt", + "github.com/docopt/docopt-go", + "github.com/goshuirc/irc-go/ircfmt", + "github.com/goshuirc/irc-go/ircmatch", + "github.com/goshuirc/irc-go/ircmsg", + "github.com/mattn/go-colorable", + "github.com/mgutz/ansi", + "github.com/oragono/go-ident", + "github.com/tidwall/buntdb", + "golang.org/x/crypto/bcrypt", + "golang.org/x/crypto/ssh/terminal", + "golang.org/x/text/secure/precis", + "gopkg.in/yaml.v2", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index bd71f751..96f1fadc 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -75,10 +75,6 @@ branch = "master" name = "github.com/mgutz/ansi" -[[dependencies]] - branch = "master" - name = "github.com/stackimpact/stackimpact-go" - [[dependencies]] branch = "master" name = "github.com/tidwall/buntdb" diff --git a/irc/config.go b/irc/config.go index be216aad..6ad2a724 100644 --- a/irc/config.go +++ b/irc/config.go @@ -200,13 +200,6 @@ func (sts *STSConfig) Value() string { return val } -// StackImpactConfig is the config used for StackImpact's profiling. -type StackImpactConfig struct { - Enabled bool - AgentKey string `yaml:"agent-key"` - AppName string `yaml:"app-name"` -} - type FakelagConfig struct { Enabled bool Window time.Duration @@ -273,7 +266,6 @@ type Config struct { Debug struct { RecoverFromErrors *bool `yaml:"recover-from-errors"` PprofListener *string `yaml:"pprof-listener"` - StackImpact StackImpactConfig } Limits Limits diff --git a/oragono.go b/oragono.go index 61547131..d93774a0 100644 --- a/oragono.go +++ b/oragono.go @@ -18,7 +18,6 @@ import ( "github.com/oragono/oragono/irc/logger" "github.com/oragono/oragono/irc/mkcerts" "github.com/oragono/oragono/irc/passwd" - stackimpact "github.com/stackimpact/stackimpact-go" "golang.org/x/crypto/ssh/terminal" ) @@ -127,20 +126,6 @@ Options: irc.Ver = fmt.Sprintf("%s-%s", irc.Ver, commit) } - // profiling - if config.Debug.StackImpact.Enabled { - if config.Debug.StackImpact.AgentKey == "" || config.Debug.StackImpact.AppName == "" { - logman.Error("startup", "Could not start StackImpact - agent-key or app-name are undefined") - return - } - - agent := stackimpact.NewAgent() - agent.Start(stackimpact.Options{AgentKey: config.Debug.StackImpact.AgentKey, AppName: config.Debug.StackImpact.AppName}) - defer agent.RecordPanic() - - logman.Info("startup", fmt.Sprintf("StackImpact profiling started as %s", config.Debug.StackImpact.AppName)) - } - // warning if running a non-final version if strings.Contains(irc.SemVer, "unreleased") { logman.Warning("startup", "You are currently running an unreleased beta version of Oragono that may be unstable and could corrupt your database.\nIf you are running a production network, please download the latest build from https://oragono.io/downloads.html and run that instead.") diff --git a/oragono.yaml b/oragono.yaml index 628b0d3c..7eca0472 100644 --- a/oragono.yaml +++ b/oragono.yaml @@ -355,17 +355,6 @@ debug: # set to `null`, "", leave blank, or omit to disable # pprof-listener: "localhost:6060" - # enabling StackImpact profiling - stackimpact: - # whether to use StackImpact - enabled: false - - # the AgentKey to use - agent-key: examplekeyhere - - # the app name to report - app-name: Oragono - # datastore configuration datastore: # path to the datastore From ea30e5824469b1a8c5336745e543352b1f0f0113 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 15 Aug 2018 08:12:24 -0400 Subject: [PATCH 8/8] bump vendor to remove stackimpact --- vendor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor b/vendor index 9dd7467d..77ddc3db 160000 --- a/vendor +++ b/vendor @@ -1 +1 @@ -Subproject commit 9dd7467d3dfc045cf5dee2f6f6951465437e2ac5 +Subproject commit 77ddc3dbc1ec085c73670510a8fece80599741ce