Compare commits
	
		
			6 Commits
		
	
	
		
			v0.2.1
			...
			398160e6eb
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 398160e6eb | |||
| 3a5fa290e2 | |||
| e4327cd3a8 | |||
| cdbcf0e03b | |||
| 46d9f4d64a | |||
| 49553fa965 | 
| @@ -3,6 +3,7 @@ package main | ||||
| import ( | ||||
| 	"context" | ||||
| 	"fmt" | ||||
| 	"log/slog" | ||||
| 	"net/http" | ||||
| 	"os" | ||||
| 	"os/signal" | ||||
| @@ -17,8 +18,6 @@ import ( | ||||
| 	"github.com/coreos/go-systemd/daemon" | ||||
| 	sshlib "github.com/gliderlabs/ssh" | ||||
| 	"github.com/urfave/cli/v2" | ||||
| 	"go.uber.org/zap" | ||||
| 	"go.uber.org/zap/zapcore" | ||||
| 	"golang.org/x/crypto/acme/autocert" | ||||
| ) | ||||
|  | ||||
| @@ -55,17 +54,17 @@ func ActionServe(c *cli.Context) error { | ||||
|  | ||||
| 	// Setup logging | ||||
| 	loggers := setupLoggers(cfg) | ||||
| 	loggers.rootLogger.Infow("Starting apiary.", "version", apiary.FullVersion()) | ||||
| 	loggers.rootLogger.Info("Starting apiary.", "version", apiary.FullVersion()) | ||||
|  | ||||
| 	// Setup store | ||||
| 	var s store.LoginAttemptStore | ||||
| 	switch cfg.Store.Type { | ||||
| 	case "MEMORY", "memory": | ||||
| 		loggers.rootLogger.Infow("Initialized store.", "store_type", "memory") | ||||
| 		loggers.rootLogger.Info("Initialized store.", "store_type", "memory") | ||||
| 		s = &store.MemoryStore{} | ||||
| 	case "POSTGRES", "postgres": | ||||
| 		pgStartTime := time.Now() | ||||
| 		loggers.rootLogger.Debugw("Initializing store.", "store_type", "postgres") | ||||
| 		loggers.rootLogger.Debug("Initializing store.", "store_type", "postgres") | ||||
| 		pgStore, err := store.NewPostgresStore(cfg.Store.Postgres.DSN) | ||||
| 		if err != nil { | ||||
| 			return err | ||||
| @@ -73,36 +72,16 @@ func ActionServe(c *cli.Context) error { | ||||
| 		if err := pgStore.InitDB(); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 		loggers.rootLogger.Infow("Initialized store.", "store_type", "postgres", "init_time", time.Since(pgStartTime)) | ||||
| 		loggers.rootLogger.Info("Initialized store.", "store_type", "postgres", "init_time", time.Since(pgStartTime)) | ||||
| 		if cfg.Store.EnableCache { | ||||
| 			loggers.rootLogger.Debugw("Initializing store.", "store_type", "cache-postgres") | ||||
| 			loggers.rootLogger.Debug("Initializing store.", "store_type", "cache-postgres") | ||||
| 			startTime := time.Now() | ||||
| 			cachingStore := store.NewCachingStore(pgStore) | ||||
| 			s = cachingStore | ||||
| 			loggers.rootLogger.Infow("Initialized store.", "store_type", "cache-postgres", "init_time", time.Since(startTime)) | ||||
| 			loggers.rootLogger.Info("Initialized store.", "store_type", "cache-postgres", "init_time", time.Since(startTime)) | ||||
| 		} else { | ||||
| 			s = pgStore | ||||
| 		} | ||||
| 	case "bolt", "BOLT": | ||||
| 		boltStartTime := time.Now() | ||||
| 		loggers.rootLogger.Debugw("Initializing store.", "store_type", "bolt") | ||||
| 		boltStore, err := store.NewBBoltStore(cfg.Store.Bolt.DBPath) | ||||
| 		if err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 		defer boltStore.Close() | ||||
|  | ||||
| 		loggers.rootLogger.Infow("Initialized store.", "store_type", "bolt", "init_time", time.Since(boltStartTime)) | ||||
|  | ||||
| 		if cfg.Store.EnableCache { | ||||
| 			loggers.rootLogger.Debugw("Initializing store.", "store_type", "cache-bolt") | ||||
| 			startTime := time.Now() | ||||
| 			cachingStore := store.NewCachingStore(boltStore) | ||||
| 			s = cachingStore | ||||
| 			loggers.rootLogger.Infow("Initialized store.", "store_type", "cache-bolt", "init_time", time.Since(startTime)) | ||||
| 		} else { | ||||
| 			s = boltStore | ||||
| 		} | ||||
| 	default: | ||||
| 		return fmt.Errorf("Invalid store configured") | ||||
| 	} | ||||
| @@ -153,18 +132,18 @@ func ActionServe(c *cli.Context) error { | ||||
|  | ||||
| 	// Start ssh server | ||||
| 	go func() { | ||||
| 		loggers.rootLogger.Infow("Starting SSH server.", "addr", cfg.Honeypot.ListenAddr) | ||||
| 		loggers.rootLogger.Info("Starting SSH server.", "addr", cfg.Honeypot.ListenAddr) | ||||
| 		if err := hs.ListenAndServe(); err != nil && err != sshlib.ErrServerClosed { | ||||
| 			loggers.rootLogger.Warnw("SSH server returned error.", "error", err) | ||||
| 			loggers.rootLogger.Warn("SSH server returned error.", "error", err) | ||||
| 		} | ||||
| 		loggers.rootLogger.Infow("SSH server stopped.") | ||||
| 		loggers.rootLogger.Info("SSH server stopped.") | ||||
| 	}() | ||||
|  | ||||
| 	// Start web server | ||||
| 	go func() { | ||||
| 		loggers.rootLogger.Infow("Starting web server.", "addr", cfg.Frontend.ListenAddr) | ||||
| 		loggers.rootLogger.Info("Starting web server.", "addr", cfg.Frontend.ListenAddr) | ||||
| 		if err := web.StartServe(); err != nil && err != http.ErrServerClosed { | ||||
| 			loggers.rootLogger.Warnw("Web server returned error.", "error", err) | ||||
| 			loggers.rootLogger.Warn("Web server returned error.", "error", err) | ||||
| 		} | ||||
| 	}() | ||||
|  | ||||
| @@ -184,7 +163,7 @@ func ActionServe(c *cli.Context) error { | ||||
| 			return | ||||
| 		} | ||||
| 		if err != nil { | ||||
| 			loggers.rootLogger.Warnw("Unable to connect to NOTIFY_SOCKET.", "error", err) | ||||
| 			loggers.rootLogger.Warn("Unable to connect to NOTIFY_SOCKET.", "error", err) | ||||
| 			return | ||||
| 		} | ||||
| 		loggers.rootLogger.Debug("Sent READY=1 to NOTIFY_SOCKET.") | ||||
| @@ -192,11 +171,11 @@ func ActionServe(c *cli.Context) error { | ||||
| 		// Setup timer | ||||
| 		timeout, err := daemon.SdWatchdogEnabled(false) | ||||
| 		if err != nil { | ||||
| 			loggers.rootLogger.Warnw("Unable to get watchdog timeout.", "error", err) | ||||
| 			loggers.rootLogger.Warn("Unable to get watchdog timeout.", "error", err) | ||||
| 			return | ||||
| 		} | ||||
| 		if timeout == 0 { | ||||
| 			loggers.rootLogger.Infow("Systemd watchdog not enabled.") | ||||
| 			loggers.rootLogger.Info("Systemd watchdog not enabled.") | ||||
| 			return | ||||
| 		} | ||||
|  | ||||
| @@ -209,14 +188,14 @@ func ActionServe(c *cli.Context) error { | ||||
| 			case <-ticker.C: | ||||
| 				if healthy == nil { | ||||
| 					if _, err := daemon.SdNotify(false, daemon.SdNotifyWatchdog); err != nil { | ||||
| 						loggers.rootLogger.Warnw("Error notifying watchdog.", "err", err) | ||||
| 						loggers.rootLogger.Warn("Error notifying watchdog.", "err", err) | ||||
| 					} | ||||
| 					continue | ||||
| 				} | ||||
| 				// TODO: If unhealthy, should we retry healthcheck immediately, otherwise service will most likely get killed by watchdog. | ||||
| 				loggers.rootLogger.Errorw("Store reported not healthy, might get killed by watchdog.", "err", healthy) | ||||
| 				loggers.rootLogger.Error("Store reported not healthy, might get killed by watchdog.", "err", healthy) | ||||
| 			case <-notifyCtx.Done(): | ||||
| 				loggers.rootLogger.Debugw("Notify context cancelled.") | ||||
| 				loggers.rootLogger.Debug("Notify context cancelled.") | ||||
| 				return | ||||
| 			} | ||||
| 		} | ||||
| @@ -230,7 +209,7 @@ func ActionServe(c *cli.Context) error { | ||||
| 		defer sshShutdownCancel() | ||||
| 		loggers.rootLogger.Info("SSH server shutdown started.") | ||||
| 		if err := hs.Shutdown(sshShutdownCtx); err != nil { | ||||
| 			loggers.rootLogger.Infow("Error shutting down SSH server.", "error", err) | ||||
| 			loggers.rootLogger.Info("Error shutting down SSH server.", "error", err) | ||||
| 		} | ||||
| 		loggers.rootLogger.Info("SSH server shutdown complete.") | ||||
|  | ||||
| @@ -240,7 +219,7 @@ func ActionServe(c *cli.Context) error { | ||||
|  | ||||
| 		loggers.rootLogger.Info("Web server shutdown started.") | ||||
| 		if err := web.Shutdown(webShutdownCtx); err != nil { | ||||
| 			loggers.rootLogger.Infow("Error shutting down web server.", "error", err) | ||||
| 			loggers.rootLogger.Info("Error shutting down web server.", "error", err) | ||||
| 		} | ||||
| 		loggers.rootLogger.Info("Web server shutdown complete.") | ||||
| 		rootCancel() | ||||
| @@ -252,49 +231,36 @@ func ActionServe(c *cli.Context) error { | ||||
| } | ||||
|  | ||||
| type loggerCollection struct { | ||||
| 	rootLogger      *zap.SugaredLogger | ||||
| 	honeypotLogger  *zap.SugaredLogger | ||||
| 	webAccessLogger *zap.SugaredLogger | ||||
| 	webServerLogger *zap.SugaredLogger | ||||
| 	rootLogger      *slog.Logger | ||||
| 	honeypotLogger  *slog.Logger | ||||
| 	webAccessLogger *slog.Logger | ||||
| 	webServerLogger *slog.Logger | ||||
| } | ||||
|  | ||||
| func setupLoggers(cfg config.Config) *loggerCollection { | ||||
| 	logEncoderCfg := zap.NewProductionEncoderConfig() | ||||
| 	logEncoderCfg.EncodeCaller = func(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder) {} | ||||
|  | ||||
| 	var level zap.AtomicLevel | ||||
| 	opts := &slog.HandlerOptions{} | ||||
| 	switch strings.ToUpper(cfg.Honeypot.LogLevel) { | ||||
| 	case "INFO": | ||||
| 		level = zap.NewAtomicLevelAt(zap.InfoLevel) | ||||
| 		opts.Level = slog.LevelInfo | ||||
| 	case "DEBUG": | ||||
| 		level = zap.NewAtomicLevelAt(zap.DebugLevel) | ||||
| 		opts.Level = slog.LevelDebug | ||||
| 		opts.AddSource = true | ||||
| 	case "WARN", "WARNING": | ||||
| 		level = zap.NewAtomicLevelAt(zap.WarnLevel) | ||||
| 		opts.Level = slog.LevelWarn | ||||
| 	case "ERR", "ERROR": | ||||
| 		level = zap.NewAtomicLevelAt(zap.WarnLevel) | ||||
| 		opts.Level = slog.LevelError | ||||
| 	default: | ||||
| 		level = zap.NewAtomicLevelAt(zap.InfoLevel) | ||||
| 	} | ||||
| 	logEncoderCfg.EncodeLevel = zapcore.CapitalColorLevelEncoder | ||||
| 	logEncoderCfg.EncodeTime = zapcore.ISO8601TimeEncoder | ||||
| 	logEncoderCfg.EncodeDuration = zapcore.StringDurationEncoder | ||||
| 	rootLoggerCfg := &zap.Config{ | ||||
| 		Level:            level, | ||||
| 		OutputPaths:      []string{"stdout"}, | ||||
| 		ErrorOutputPaths: []string{"stderr"}, | ||||
| 		Encoding:         "console", | ||||
| 		EncoderConfig:    logEncoderCfg, | ||||
| 	} | ||||
| 	rootLogger, err := rootLoggerCfg.Build() | ||||
| 	if err != nil { | ||||
| 		panic(err) | ||||
| 		opts.Level = slog.LevelInfo | ||||
| 	} | ||||
|  | ||||
| 	handler := slog.NewTextHandler(os.Stdout, opts) | ||||
| 	rootLogger := slog.New(handler) | ||||
|  | ||||
| 	return &loggerCollection{ | ||||
| 		rootLogger:      rootLogger.Named("APP").Sugar(), | ||||
| 		honeypotLogger:  rootLogger.Named("HON").Sugar(), | ||||
| 		webAccessLogger: rootLogger.Named("ACC").Sugar(), | ||||
| 		webServerLogger: rootLogger.Named("WEB").Sugar(), | ||||
| 		rootLogger:      rootLogger.With("module", "application"), | ||||
| 		honeypotLogger:  rootLogger.With("module", "honeypot"), | ||||
| 		webAccessLogger: rootLogger.With("module", "web-access-log"), | ||||
| 		webServerLogger: rootLogger.With("module", "web-server"), | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -18,17 +18,12 @@ type StoreConfig struct { | ||||
| 	Type        string              `toml:"Type"` | ||||
| 	EnableCache bool                `toml:"EnableCache"` | ||||
| 	Postgres    PostgresStoreConfig `toml:"Postgres"` | ||||
| 	Bolt        BoltStoreConfig     `toml:"Bolt"` | ||||
| } | ||||
|  | ||||
| type PostgresStoreConfig struct { | ||||
| 	DSN string `toml:"DSN"` | ||||
| } | ||||
|  | ||||
| type BoltStoreConfig struct { | ||||
| 	DBPath string `toml:"DBPath"` | ||||
| } | ||||
|  | ||||
| type HoneypotConfig struct { | ||||
| 	ListenAddr    string  `toml:"ListenAddr"` | ||||
| 	LogLevel      string  `toml:"LogLevel"` | ||||
|   | ||||
| @@ -75,7 +75,7 @@ | ||||
|                 mkdir -p web/frontend/dist | ||||
|                 cp -r ${frontend}/* web/frontend/dist | ||||
|               ''; | ||||
|               vendorHash = "sha256-griWN9fQ0X2ClPDOzVXV80MpdcEFZfe/WaYm7L7fAc8="; | ||||
|               vendorHash = "sha256-RtYKwUx5m8pL6MUinmK7yNFNxybnN+Xs0k6Cv1CITEU="; | ||||
|               ldflags = [ "-X git.t-juice.club/torjus/apiary.Build=${rev}" ]; | ||||
|               tags = [ | ||||
|                 "embed" | ||||
|   | ||||
| @@ -188,6 +188,7 @@ input[type=text] { | ||||
| .live_table th, | ||||
| .live_table td { | ||||
|     padding: 12px 15px; | ||||
|     text-align: left; | ||||
| } | ||||
| .live_table tbody tr { | ||||
|     border-bottom: 1px solid var(--table-row-odd); | ||||
|   | ||||
							
								
								
									
										57
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										57
									
								
								go.mod
									
									
									
									
									
								
							| @@ -1,46 +1,45 @@ | ||||
| module git.t-juice.club/torjus/apiary | ||||
|  | ||||
| go 1.18 | ||||
| go 1.23.0 | ||||
|  | ||||
| toolchain go1.24.1 | ||||
|  | ||||
| require ( | ||||
| 	github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf | ||||
| 	github.com/fujiwara/shapeio v1.0.0 | ||||
| 	github.com/gliderlabs/ssh v0.3.5 | ||||
| 	github.com/go-chi/chi/v5 v5.0.10 | ||||
| 	github.com/google/uuid v1.3.1 | ||||
| 	github.com/jackc/pgx/v4 v4.18.1 | ||||
| 	github.com/oschwald/maxminddb-golang v1.12.0 | ||||
| 	github.com/gliderlabs/ssh v0.3.8 | ||||
| 	github.com/go-chi/chi/v5 v5.2.1 | ||||
| 	github.com/google/uuid v1.6.0 | ||||
| 	github.com/jackc/pgx/v4 v4.18.3 | ||||
| 	github.com/oschwald/maxminddb-golang v1.13.1 | ||||
| 	github.com/pelletier/go-toml v1.9.5 | ||||
| 	github.com/prometheus/client_golang v1.17.0 | ||||
| 	github.com/urfave/cli/v2 v2.25.7 | ||||
| 	go.etcd.io/bbolt v1.3.7 | ||||
| 	go.uber.org/zap v1.26.0 | ||||
| 	golang.org/x/crypto v0.14.0 | ||||
| 	github.com/prometheus/client_golang v1.21.1 | ||||
| 	github.com/urfave/cli/v2 v2.27.6 | ||||
| 	golang.org/x/crypto v0.36.0 | ||||
| ) | ||||
|  | ||||
| require ( | ||||
| 	github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect | ||||
| 	github.com/beorn7/perks v1.0.1 // indirect | ||||
| 	github.com/cespare/xxhash/v2 v2.2.0 // indirect | ||||
| 	github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect | ||||
| 	github.com/golang/protobuf v1.5.3 // indirect | ||||
| 	github.com/cespare/xxhash/v2 v2.3.0 // indirect | ||||
| 	github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect | ||||
| 	github.com/jackc/chunkreader/v2 v2.0.1 // indirect | ||||
| 	github.com/jackc/pgconn v1.14.1 // indirect | ||||
| 	github.com/jackc/pgconn v1.14.3 // indirect | ||||
| 	github.com/jackc/pgio v1.0.0 // indirect | ||||
| 	github.com/jackc/pgpassfile v1.0.0 // indirect | ||||
| 	github.com/jackc/pgproto3/v2 v2.3.2 // indirect | ||||
| 	github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect | ||||
| 	github.com/jackc/pgtype v1.14.0 // indirect | ||||
| 	github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect | ||||
| 	github.com/prometheus/client_model v0.5.0 // indirect | ||||
| 	github.com/prometheus/common v0.44.0 // indirect | ||||
| 	github.com/prometheus/procfs v0.12.0 // indirect | ||||
| 	github.com/jackc/pgproto3/v2 v2.3.3 // indirect | ||||
| 	github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect | ||||
| 	github.com/jackc/pgtype v1.14.4 // indirect | ||||
| 	github.com/klauspost/compress v1.18.0 // indirect | ||||
| 	github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | ||||
| 	github.com/prometheus/client_model v0.6.1 // indirect | ||||
| 	github.com/prometheus/common v0.63.0 // indirect | ||||
| 	github.com/prometheus/procfs v0.16.0 // indirect | ||||
| 	github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||||
| 	github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect | ||||
| 	go.uber.org/multierr v1.11.0 // indirect | ||||
| 	golang.org/x/net v0.17.0 // indirect | ||||
| 	golang.org/x/sys v0.13.0 // indirect | ||||
| 	golang.org/x/text v0.13.0 // indirect | ||||
| 	golang.org/x/time v0.3.0 // indirect | ||||
| 	google.golang.org/protobuf v1.31.0 // indirect | ||||
| 	github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect | ||||
| 	golang.org/x/net v0.37.0 // indirect | ||||
| 	golang.org/x/sys v0.31.0 // indirect | ||||
| 	golang.org/x/text v0.23.0 // indirect | ||||
| 	golang.org/x/time v0.11.0 // indirect | ||||
| 	google.golang.org/protobuf v1.36.5 // indirect | ||||
| ) | ||||
|   | ||||
							
								
								
									
										146
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										146
									
								
								go.sum
									
									
									
									
									
								
							| @@ -5,16 +5,16 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFI | ||||
| github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= | ||||
| github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= | ||||
| github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= | ||||
| github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= | ||||
| github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= | ||||
| github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= | ||||
| github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= | ||||
| github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= | ||||
| github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= | ||||
| github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= | ||||
| github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= | ||||
| github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= | ||||
| github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= | ||||
| github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= | ||||
| github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= | ||||
| github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= | ||||
| github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= | ||||
| github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= | ||||
| github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||||
| github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||||
| @@ -23,24 +23,20 @@ github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4 | ||||
| github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= | ||||
| github.com/fujiwara/shapeio v1.0.0 h1:xG5D9oNqCSUUbryZ/jQV3cqe1v2suEjwPIcEg1gKM8M= | ||||
| github.com/fujiwara/shapeio v1.0.0/go.mod h1:LmEmu6L/8jetyj1oewewFb7bZCNRwE7wLCUNzDLaLVA= | ||||
| github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= | ||||
| github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= | ||||
| github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= | ||||
| github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= | ||||
| github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= | ||||
| github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= | ||||
| github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8= | ||||
| github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= | ||||
| github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= | ||||
| github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= | ||||
| github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= | ||||
| github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= | ||||
| github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= | ||||
| github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | ||||
| github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= | ||||
| github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= | ||||
| github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= | ||||
| github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= | ||||
| github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= | ||||
| github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= | ||||
| github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= | ||||
| github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= | ||||
| github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= | ||||
| github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||||
| github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= | ||||
| github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||||
| github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= | ||||
| github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= | ||||
| github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= | ||||
| @@ -51,9 +47,8 @@ github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsU | ||||
| github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= | ||||
| github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= | ||||
| github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= | ||||
| github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= | ||||
| github.com/jackc/pgconn v1.14.1 h1:smbxIaZA08n6YuxEX1sDyjV/qkbtUtkH20qLkR9MUR4= | ||||
| github.com/jackc/pgconn v1.14.1/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= | ||||
| github.com/jackc/pgconn v1.14.3 h1:bVoTr12EGANZz66nZPkMInAV/KHD2TxH9npjXXgiB3w= | ||||
| github.com/jackc/pgconn v1.14.3/go.mod h1:RZbme4uasqzybK2RK5c65VsHxoyaml09lx3tXOcO/VM= | ||||
| github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= | ||||
| github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= | ||||
| github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= | ||||
| @@ -69,34 +64,41 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvW | ||||
| github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= | ||||
| github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= | ||||
| github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= | ||||
| github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0= | ||||
| github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= | ||||
| github.com/jackc/pgproto3/v2 v2.3.3 h1:1HLSx5H+tXR9pW3in3zaztoEwQYRC9SQaYUHjTSUOag= | ||||
| github.com/jackc/pgproto3/v2 v2.3.3/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= | ||||
| github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= | ||||
| github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= | ||||
| github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= | ||||
| github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= | ||||
| github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= | ||||
| github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= | ||||
| github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= | ||||
| github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= | ||||
| github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= | ||||
| github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw= | ||||
| github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= | ||||
| github.com/jackc/pgtype v1.14.4 h1:fKuNiCumbKTAIxQwXfB/nsrnkEI6bPJrrSiMKgbJ2j8= | ||||
| github.com/jackc/pgtype v1.14.4/go.mod h1:aKeozOde08iifGosdJpz9MBZonJOUJxqNpPBcMJTlVA= | ||||
| github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= | ||||
| github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= | ||||
| github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= | ||||
| github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= | ||||
| github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0= | ||||
| github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE= | ||||
| github.com/jackc/pgx/v4 v4.18.2/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= | ||||
| github.com/jackc/pgx/v4 v4.18.3 h1:dE2/TrEsGX3RBprb3qryqSV9Y60iZN1C6i8IrmW9/BA= | ||||
| github.com/jackc/pgx/v4 v4.18.3/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= | ||||
| github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= | ||||
| github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= | ||||
| github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= | ||||
| github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= | ||||
| github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= | ||||
| github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= | ||||
| github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= | ||||
| github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= | ||||
| github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= | ||||
| github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= | ||||
| github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= | ||||
| github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= | ||||
| github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= | ||||
| github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= | ||||
| github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= | ||||
| github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= | ||||
| github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= | ||||
| github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= | ||||
| @@ -107,24 +109,24 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope | ||||
| github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= | ||||
| github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= | ||||
| github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= | ||||
| github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= | ||||
| github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= | ||||
| github.com/oschwald/maxminddb-golang v1.12.0 h1:9FnTOD0YOhP7DGxGsq4glzpGy5+w7pq50AS6wALUMYs= | ||||
| github.com/oschwald/maxminddb-golang v1.12.0/go.mod h1:q0Nob5lTCqyQ8WT6FYgS1L7PXKVVbgiymefNwIjPzgY= | ||||
| github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= | ||||
| github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= | ||||
| github.com/oschwald/maxminddb-golang v1.13.1 h1:G3wwjdN9JmIK2o/ermkHM+98oX5fS+k5MbwsmL4MRQE= | ||||
| github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk4IsCNThNdTmnaBZ/F8= | ||||
| github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= | ||||
| github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= | ||||
| github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= | ||||
| github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||||
| github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||||
| github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||||
| github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= | ||||
| github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= | ||||
| github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= | ||||
| github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= | ||||
| github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= | ||||
| github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= | ||||
| github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= | ||||
| github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= | ||||
| github.com/prometheus/client_golang v1.21.1 h1:DOvXXTqVzvkIewV/CDPFdejpMCGeMcbGCQ8YOmu+Ibk= | ||||
| github.com/prometheus/client_golang v1.21.1/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg= | ||||
| github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= | ||||
| github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= | ||||
| github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k= | ||||
| github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18= | ||||
| github.com/prometheus/procfs v0.16.0 h1:xh6oHhKwnOJKMYiYBDWmkHqQPyiY40sny36Cmx2bbsM= | ||||
| github.com/prometheus/procfs v0.16.0/go.mod h1:8veyXUu3nGP7oaCxhX6yeaM5u4stL2FeMXnCqhDthZg= | ||||
| github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= | ||||
| github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= | ||||
| github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= | ||||
| @@ -150,31 +152,25 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ | ||||
| github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||||
| github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= | ||||
| github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= | ||||
| github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= | ||||
| github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= | ||||
| github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= | ||||
| github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= | ||||
| github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= | ||||
| github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= | ||||
| github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= | ||||
| github.com/urfave/cli/v2 v2.27.6 h1:VdRdS98FNhKZ8/Az8B7MTyGQmpIr36O1EHybx/LaZ4g= | ||||
| github.com/urfave/cli/v2 v2.27.6/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ= | ||||
| github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= | ||||
| github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= | ||||
| github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= | ||||
| github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= | ||||
| go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= | ||||
| go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= | ||||
| go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= | ||||
| go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= | ||||
| go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= | ||||
| go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= | ||||
| go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= | ||||
| go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= | ||||
| go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= | ||||
| go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= | ||||
| go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= | ||||
| go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= | ||||
| go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= | ||||
| go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= | ||||
| go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= | ||||
| go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= | ||||
| go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= | ||||
| go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= | ||||
| golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | ||||
| golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= | ||||
| golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | ||||
| @@ -185,28 +181,29 @@ golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWP | ||||
| golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= | ||||
| golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= | ||||
| golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= | ||||
| golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= | ||||
| golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= | ||||
| golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= | ||||
| golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= | ||||
| golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= | ||||
| golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= | ||||
| golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= | ||||
| golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= | ||||
| golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= | ||||
| golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= | ||||
| golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= | ||||
| golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= | ||||
| golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= | ||||
| golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||||
| golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||||
| golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= | ||||
| golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= | ||||
| golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= | ||||
| golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= | ||||
| golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= | ||||
| golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= | ||||
| golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= | ||||
| golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= | ||||
| golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= | ||||
| golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= | ||||
| golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= | ||||
| golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| @@ -218,21 +215,22 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w | ||||
| golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= | ||||
| golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= | ||||
| golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= | ||||
| golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= | ||||
| golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= | ||||
| golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= | ||||
| golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= | ||||
| golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= | ||||
| golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= | ||||
| golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= | ||||
| golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= | ||||
| golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= | ||||
| golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= | ||||
| golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= | ||||
| golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||||
| golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= | ||||
| golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | ||||
| @@ -240,11 +238,13 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | ||||
| golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | ||||
| golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= | ||||
| golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= | ||||
| golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= | ||||
| golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= | ||||
| golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= | ||||
| golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= | ||||
| golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= | ||||
| golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= | ||||
| golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | ||||
| golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= | ||||
| golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | ||||
| golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= | ||||
| golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= | ||||
| golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= | ||||
| golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= | ||||
| @@ -255,16 +255,14 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn | ||||
| golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||
| golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= | ||||
| golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= | ||||
| golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
| golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
| golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
| golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
| golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
| golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
| google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= | ||||
| google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= | ||||
| google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= | ||||
| google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= | ||||
| google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= | ||||
| google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= | ||||
| gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||||
| gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||||
| gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= | ||||
|   | ||||
| @@ -1,11 +0,0 @@ | ||||
| package ssh | ||||
|  | ||||
| type ActionType int | ||||
|  | ||||
| const ( | ||||
| 	ActionTypeLogPassword ActionType = iota | ||||
| 	ActionTypeLogPasswordSlow | ||||
| 	ActionTypeLogCommandAndExit | ||||
| 	ActionTypeSendGarbage | ||||
| ) | ||||
| const ActionTypeDefault ActionType = ActionTypeLogPassword | ||||
| @@ -13,7 +13,7 @@ var mmdb []byte | ||||
| func (s *HoneypotServer) LookupCountry(ip net.IP) string { | ||||
| 	db, err := maxminddb.FromBytes(mmdb) | ||||
| 	if err != nil { | ||||
| 		s.Logger.Warnw("Error opening geoip database", "error", err) | ||||
| 		s.Logger.Warn("Error opening geoip database", "error", err) | ||||
| 		return "??" | ||||
| 	} | ||||
|  | ||||
| @@ -25,7 +25,7 @@ func (s *HoneypotServer) LookupCountry(ip net.IP) string { | ||||
|  | ||||
| 	err = db.Lookup(ip, &record) | ||||
| 	if err != nil { | ||||
| 		s.Logger.Warnw("Error doing geoip lookup", "error", err) | ||||
| 		s.Logger.Warn("Error doing geoip lookup", "error", err) | ||||
| 		return "??" | ||||
| 	} | ||||
| 	if record.Country.ISOCode == "None" { | ||||
|   | ||||
| @@ -3,6 +3,7 @@ package ssh | ||||
| import ( | ||||
| 	"context" | ||||
| 	"io" | ||||
| 	"log/slog" | ||||
| 	"net" | ||||
| 	"os" | ||||
| 	"time" | ||||
| @@ -16,11 +17,10 @@ import ( | ||||
| 	"git.t-juice.club/torjus/apiary/models" | ||||
| 	sshlib "github.com/gliderlabs/ssh" | ||||
| 	"github.com/google/uuid" | ||||
| 	"go.uber.org/zap" | ||||
| ) | ||||
|  | ||||
| type HoneypotServer struct { | ||||
| 	Logger *zap.SugaredLogger | ||||
| 	Logger *slog.Logger | ||||
|  | ||||
| 	sshServer *sshlib.Server | ||||
|  | ||||
| @@ -33,7 +33,7 @@ type HoneypotServer struct { | ||||
| func NewHoneypotServer(cfg config.HoneypotConfig, store store.LoginAttemptStore) (*HoneypotServer, error) { | ||||
| 	var hs HoneypotServer | ||||
| 	hs.attemptStore = store | ||||
| 	hs.Logger = zap.NewNop().Sugar() | ||||
| 	hs.Logger = slog.New(slog.NewTextHandler(io.Discard, nil)) | ||||
|  | ||||
| 	hs.sshServer = &sshlib.Server{ | ||||
| 		Addr:            cfg.ListenAddr, | ||||
| @@ -94,19 +94,19 @@ func (hs *HoneypotServer) passwordHandler(ctx sshlib.Context, password string) b | ||||
| 	} | ||||
| 	country := hs.LookupCountry(la.RemoteIP) | ||||
| 	if utf8.RuneCountInString(country) > 2 { | ||||
| 		hs.Logger.Warnw("Too many characters in country", "country", country, "runecount", utf8.RuneCountInString(country)) | ||||
| 		hs.Logger.Warn("Too many characters in country", "country", country, "runecount", utf8.RuneCountInString(country)) | ||||
| 		country = "??" | ||||
| 	} | ||||
|  | ||||
| 	la.Country = country | ||||
| 	hs.Logger.Infow("Login attempt", | ||||
| 	hs.Logger.Info("Login attempt", | ||||
| 		"remote_ip", la.RemoteIP.String(), | ||||
| 		"username", la.Username, | ||||
| 		"password", la.Password, | ||||
| 		"country", la.Country) | ||||
|  | ||||
| 	if err := hs.attemptStore.AddAttempt(&la); err != nil { | ||||
| 		hs.Logger.Warnw("Error adding attempt to store", "error", err) | ||||
| 		hs.Logger.Warn("Error adding attempt to store", "error", err) | ||||
| 	} | ||||
|  | ||||
| 	for _, cFunc := range hs.attemptsCallbacks { | ||||
| @@ -117,7 +117,7 @@ func (hs *HoneypotServer) passwordHandler(ctx sshlib.Context, password string) b | ||||
| } | ||||
|  | ||||
| func (s *HoneypotServer) connCallback(ctx sshlib.Context, conn net.Conn) net.Conn { | ||||
| 	s.Logger.Debugw("Connection received.", "remote_addr", conn.RemoteAddr()) | ||||
| 	s.Logger.Debug("Connection received.", "remote_addr", conn.RemoteAddr()) | ||||
|  | ||||
| 	throttledConn := newThrottledConn(conn) | ||||
| 	throttledConn.SetSpeed(s.throttleSpeed) | ||||
|   | ||||
| @@ -1,235 +0,0 @@ | ||||
| package store | ||||
|  | ||||
| import ( | ||||
| 	"encoding/binary" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"sort" | ||||
| 	"strings" | ||||
|  | ||||
| 	"git.t-juice.club/torjus/apiary/models" | ||||
| 	bolt "go.etcd.io/bbolt" | ||||
| ) | ||||
|  | ||||
| // var _ LoginAttemptStore = &BBoltStore{} | ||||
|  | ||||
| var bktKeyLogins []byte = []byte("logins") | ||||
|  | ||||
| type BBoltStore struct { | ||||
| 	db *bolt.DB | ||||
| } | ||||
|  | ||||
| func NewBBoltStore(path string) (*BBoltStore, error) { | ||||
| 	db, err := bolt.Open(path, 0o666, nil) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("error opening database: %w", err) | ||||
| 	} | ||||
|  | ||||
| 	var store BBoltStore | ||||
| 	store.db = db | ||||
|  | ||||
| 	err = db.Update(func(tx *bolt.Tx) error { | ||||
| 		_, err := tx.CreateBucketIfNotExists(bktKeyLogins) | ||||
| 		return err | ||||
| 	}) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("error creating database bucket: %w", err) | ||||
| 	} | ||||
|  | ||||
| 	return &store, nil | ||||
| } | ||||
|  | ||||
| func (s *BBoltStore) Close() error { | ||||
| 	return s.db.Close() | ||||
| } | ||||
|  | ||||
| func (s *BBoltStore) AddAttempt(l *models.LoginAttempt) error { | ||||
| 	data, err := json.Marshal(l) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return s.db.Update(func(tx *bolt.Tx) error { | ||||
| 		bkt := tx.Bucket(bktKeyLogins) | ||||
| 		seq, err := bkt.NextSequence() | ||||
| 		if err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 		key := itob(seq) | ||||
| 		return bkt.Put(key, data) | ||||
| 	}) | ||||
| } | ||||
|  | ||||
| func (s *BBoltStore) All() (<-chan models.LoginAttempt, error) { | ||||
| 	ch := make(chan models.LoginAttempt) | ||||
|  | ||||
| 	go func() { | ||||
| 		_ = s.db.View(func(tx *bolt.Tx) error { | ||||
| 			bkt := tx.Bucket(bktKeyLogins) | ||||
|  | ||||
| 			c := bkt.Cursor() | ||||
|  | ||||
| 			for k, v := c.First(); k != nil; k, v = c.Next() { | ||||
| 				var l models.LoginAttempt | ||||
| 				if err := json.Unmarshal(v, &l); err != nil { | ||||
| 					close(ch) | ||||
| 					panic(err) | ||||
| 				} | ||||
| 				ch <- l | ||||
| 			} | ||||
|  | ||||
| 			close(ch) | ||||
|  | ||||
| 			return nil | ||||
| 		}) | ||||
| 	}() | ||||
|  | ||||
| 	return ch, nil | ||||
| } | ||||
|  | ||||
| func (s *BBoltStore) Stats(statType LoginStats, limit int) ([]StatsResult, error) { | ||||
| 	if statType == LoginStatsTotals { | ||||
| 		return s.statTotals() | ||||
| 	} | ||||
|  | ||||
| 	counts := make(map[string]int) | ||||
| 	err := s.db.View(func(tx *bolt.Tx) error { | ||||
| 		bkt := tx.Bucket(bktKeyLogins) | ||||
|  | ||||
| 		c := bkt.Cursor() | ||||
|  | ||||
| 		for k, v := c.First(); k != nil; k, v = c.Next() { | ||||
| 			var l models.LoginAttempt | ||||
| 			if err := json.Unmarshal(v, &l); err != nil { | ||||
| 				return err | ||||
| 			} | ||||
|  | ||||
| 			switch statType { | ||||
| 			case LoginStatsPasswords: | ||||
| 				counts[l.Password]++ | ||||
| 			case LoginStatsCountry: | ||||
| 				counts[l.Country]++ | ||||
| 			case LoginStatsIP: | ||||
| 				counts[l.RemoteIP.String()]++ | ||||
| 			case LoginStatsUsername: | ||||
| 				counts[l.Username]++ | ||||
| 			default: | ||||
| 				return fmt.Errorf("invalid stat type") | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		return nil | ||||
| 	}) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("error generating stats: %w", err) | ||||
| 	} | ||||
|  | ||||
| 	if limit < 1 { | ||||
| 		return toResults(counts), nil | ||||
| 	} | ||||
| 	if limit >= len(counts) { | ||||
| 		return toResults(counts), nil | ||||
| 	} | ||||
|  | ||||
| 	var si StatItems | ||||
| 	for key := range counts { | ||||
| 		si = append(si, StatItem{Key: key, Count: counts[key]}) | ||||
| 	} | ||||
| 	sort.Sort(si) | ||||
|  | ||||
| 	output := make(map[string]int) | ||||
| 	for i := len(si) - 1; i > len(si)-limit-1; i-- { | ||||
| 		output[si[i].Key] = si[i].Count | ||||
| 	} | ||||
|  | ||||
| 	return toResults(output), nil | ||||
| } | ||||
|  | ||||
| func (s *BBoltStore) statTotals() ([]StatsResult, error) { | ||||
| 	passwords := make(map[string]int) | ||||
| 	usernames := make(map[string]int) | ||||
| 	ips := make(map[string]int) | ||||
| 	countries := make(map[string]int) | ||||
| 	var count int | ||||
|  | ||||
| 	err := s.db.View(func(tx *bolt.Tx) error { | ||||
| 		bkt := tx.Bucket(bktKeyLogins) | ||||
|  | ||||
| 		c := bkt.Cursor() | ||||
|  | ||||
| 		for k, v := c.First(); k != nil; k, v = c.Next() { | ||||
| 			var l models.LoginAttempt | ||||
| 			if err := json.Unmarshal(v, &l); err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 			passwords[l.Password] += 1 | ||||
| 			usernames[l.Username] += 1 | ||||
| 			ips[l.RemoteIP.String()] += 1 | ||||
| 			countries[l.Country] += 1 | ||||
| 			count++ | ||||
| 		} | ||||
|  | ||||
| 		return nil | ||||
| 	}) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
|  | ||||
| 	stats := []StatsResult{ | ||||
| 		{Name: "UniquePasswords", Count: len(passwords)}, | ||||
| 		{Name: "UniqueUsernames", Count: len(usernames)}, | ||||
| 		{Name: "UniqueIPs", Count: len(ips)}, | ||||
| 		{Name: "UniqueCountries", Count: len(countries)}, | ||||
| 		{Name: "TotalLoginAttempts", Count: count}, | ||||
| 	} | ||||
| 	return stats, nil | ||||
| } | ||||
|  | ||||
| func (s *BBoltStore) Query(query AttemptQuery) ([]models.LoginAttempt, error) { | ||||
| 	var results []models.LoginAttempt | ||||
| 	err := s.db.View(func(tx *bolt.Tx) error { | ||||
| 		bkt := tx.Bucket(bktKeyLogins) | ||||
|  | ||||
| 		c := bkt.Cursor() | ||||
|  | ||||
| 		for k, v := c.First(); k != nil; k, v = c.Next() { | ||||
| 			var l models.LoginAttempt | ||||
| 			if err := json.Unmarshal(v, &l); err != nil { | ||||
| 				return err | ||||
| 			} | ||||
|  | ||||
| 			switch query.QueryType { | ||||
| 			case AttemptQueryTypeIP: | ||||
| 				if l.RemoteIP.String() == query.Query { | ||||
| 					results = append(results, l) | ||||
| 				} | ||||
| 			case AttemptQueryTypePassword: | ||||
| 				if strings.Contains(l.Password, query.Query) { | ||||
| 					results = append(results, l) | ||||
| 				} | ||||
| 			case AttemptQueryTypeUsername: | ||||
| 				if strings.Contains(l.Username, query.Query) { | ||||
| 					results = append(results, l) | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 		} | ||||
|  | ||||
| 		return nil | ||||
| 	}) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	return results, nil | ||||
| } | ||||
|  | ||||
| func (s *BBoltStore) IsHealthy() error { | ||||
| 	// TODO: Do actual healthcheck | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func itob(v uint64) []byte { | ||||
| 	b := make([]byte, 8) | ||||
| 	binary.BigEndian.PutUint64(b, v) | ||||
| 	return b | ||||
| } | ||||
| @@ -1,38 +0,0 @@ | ||||
| package store_test | ||||
|  | ||||
| import ( | ||||
| 	"os" | ||||
| 	"testing" | ||||
|  | ||||
| 	"git.t-juice.club/torjus/apiary/honeypot/ssh/store" | ||||
| ) | ||||
|  | ||||
| func TestBBoltStore(t *testing.T) { | ||||
| 	dir := t.TempDir() | ||||
| 	f, err := os.CreateTemp(dir, "apiary-test-bbolt") | ||||
| 	if err != nil { | ||||
| 		t.Fatal(err) | ||||
| 	} | ||||
| 	fname := f.Name() | ||||
| 	f.Close() | ||||
| 	s, err := store.NewBBoltStore(fname) | ||||
| 	if err != nil { | ||||
| 		t.Fatal(err) | ||||
| 	} | ||||
| 	testLoginAttemptStore(s, t) | ||||
| } | ||||
|  | ||||
| func FuzzBBoltStore(f *testing.F) { | ||||
| 	dir := f.TempDir() | ||||
| 	file, err := os.CreateTemp(dir, "apiary-test-bbolt") | ||||
| 	if err != nil { | ||||
| 		f.Fatal(err) | ||||
| 	} | ||||
| 	fname := file.Name() | ||||
| 	file.Close() | ||||
| 	s, err := store.NewBBoltStore(fname) | ||||
| 	if err != nil { | ||||
| 		f.Fatal(err) | ||||
| 	} | ||||
| 	fuzzLoginAttemptStore(s, f) | ||||
| } | ||||
| @@ -1,32 +0,0 @@ | ||||
| package models | ||||
|  | ||||
| import ( | ||||
| 	"fmt" | ||||
|  | ||||
| 	"golang.org/x/crypto/bcrypt" | ||||
| ) | ||||
|  | ||||
| var ErrInvalidPassword = fmt.Errorf("invalid password") | ||||
|  | ||||
| type User struct { | ||||
| 	Username     string `json:"username"` | ||||
| 	PasswordHash []byte `json:"passwordHash"` | ||||
| } | ||||
|  | ||||
| func (u *User) SetPassword(password string) error { | ||||
| 	newHash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) | ||||
| 	if err != nil { | ||||
| 		return fmt.Errorf("error hashing new password: %w", err) | ||||
| 	} | ||||
|  | ||||
| 	u.PasswordHash = newHash | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (u *User) VerifyPassword(password string) error { | ||||
| 	err := bcrypt.CompareHashAndPassword([]byte(u.PasswordHash), []byte(password)) | ||||
| 	if err != nil { | ||||
| 		return ErrInvalidPassword | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -6,7 +6,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| var ( | ||||
| 	Version = "v0.2.1" | ||||
| 	Version = "v0.2.4" | ||||
| 	Build   string | ||||
| ) | ||||
|  | ||||
|   | ||||
| @@ -40,7 +40,7 @@ func (s *Server) serveIndex(frontendDir string) http.HandlerFunc { | ||||
| 		defer f.Close() | ||||
|  | ||||
| 		if _, err := io.Copy(w, f); err != nil { | ||||
| 			s.ServerLogger.Warnw("Error writing frontend to client.", "err", err) | ||||
| 			s.ServerLogger.Warn("Error writing frontend to client.", "err", err) | ||||
| 		} | ||||
| 	} | ||||
| 	return fn | ||||
|   | ||||
| @@ -21,7 +21,7 @@ func (s *Server) LoggingMiddleware(next http.Handler) http.Handler { | ||||
| 			if s.cfg.AccessLogIgnoreMetrics && r.URL.Path == "/metrics" && ww.Status() == http.StatusOK { | ||||
| 				return | ||||
| 			} | ||||
| 			s.AccessLogger.Infow(r.Method, | ||||
| 			s.AccessLogger.Info(r.Method, | ||||
| 				"path", r.URL.Path, | ||||
| 				"status", ww.Status(), | ||||
| 				"written", ww.BytesWritten(), | ||||
|   | ||||
| @@ -6,6 +6,7 @@ import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
| 	"log/slog" | ||||
| 	"net/http" | ||||
| 	"strconv" | ||||
| 	"sync" | ||||
| @@ -20,7 +21,6 @@ import ( | ||||
| 	"github.com/go-chi/chi/v5/middleware" | ||||
| 	"github.com/google/uuid" | ||||
| 	"github.com/prometheus/client_golang/prometheus/promhttp" | ||||
| 	"go.uber.org/zap" | ||||
| 	"golang.org/x/crypto/acme/autocert" | ||||
| ) | ||||
|  | ||||
| @@ -35,8 +35,8 @@ type Server struct { | ||||
| 	honeypotServer *ssh.HoneypotServer | ||||
| 	store          store.LoginAttemptStore | ||||
|  | ||||
| 	ServerLogger *zap.SugaredLogger | ||||
| 	AccessLogger *zap.SugaredLogger | ||||
| 	ServerLogger *slog.Logger | ||||
| 	AccessLogger *slog.Logger | ||||
|  | ||||
| 	attemptListenersLock sync.RWMutex | ||||
| 	attemptListeners     map[string]chan models.LoginAttempt | ||||
| @@ -44,9 +44,10 @@ type Server struct { | ||||
| } | ||||
|  | ||||
| func NewServer(cfg config.FrontendConfig, hs *ssh.HoneypotServer, store store.LoginAttemptStore) *Server { | ||||
| 	discardLogger := slog.New(slog.NewTextHandler(io.Discard, nil)) | ||||
| 	s := &Server{ | ||||
| 		ServerLogger: zap.NewNop().Sugar(), | ||||
| 		AccessLogger: zap.NewNop().Sugar(), | ||||
| 		ServerLogger: discardLogger, | ||||
| 		AccessLogger: discardLogger, | ||||
| 		store:        store, | ||||
| 		cfg:          cfg, | ||||
| 	} | ||||
| @@ -125,7 +126,7 @@ func (s *Server) StartServe() error { | ||||
| 			s.ServerLogger.Debug("Starting HTTP redirect server") | ||||
| 			go func() { | ||||
| 				if err := s.httpRedirectServer.ListenAndServe(); err != nil && err != http.ErrServerClosed { | ||||
| 					s.ServerLogger.Warnw("HTTP redirect server returned error", "error", err) | ||||
| 					s.ServerLogger.Warn("HTTP redirect server returned error", "error", err) | ||||
| 				} | ||||
| 			}() | ||||
| 		} | ||||
| @@ -174,7 +175,7 @@ func (s *Server) HandlerAttemptStream(w http.ResponseWriter, r *http.Request) { | ||||
| 			} | ||||
| 			_, err = io.WriteString(w, fmt.Sprintf("data: %s\n\n", string(data))) | ||||
| 			if err != nil { | ||||
| 				s.ServerLogger.Warnw("Error writing event", "error", err) | ||||
| 				s.ServerLogger.Warn("Error writing event", "error", err) | ||||
| 			} | ||||
| 			flusher.Flush() | ||||
| 			ticker.Reset(streamKeepAliveDuration) | ||||
| @@ -184,7 +185,7 @@ func (s *Server) HandlerAttemptStream(w http.ResponseWriter, r *http.Request) { | ||||
| 			return | ||||
| 		case <-ticker.C: | ||||
| 			if _, err := io.WriteString(w, ": keep-alive\n\n"); err != nil { | ||||
| 				s.ServerLogger.Warnw("Error writing event", "error", err) | ||||
| 				s.ServerLogger.Warn("Error writing event", "error", err) | ||||
| 			} | ||||
| 			flusher.Flush() | ||||
| 		} | ||||
| @@ -207,14 +208,14 @@ func (s *Server) HandlerStats(w http.ResponseWriter, r *http.Request) { | ||||
|  | ||||
| 	stats, err := s.store.Stats(statType, limit) | ||||
| 	if err != nil { | ||||
| 		s.ServerLogger.Warnw("Error fetching stats", "error", err) | ||||
| 		s.ServerLogger.Warn("Error fetching stats", "error", err) | ||||
| 		s.WriteAPIError(w, r, http.StatusInternalServerError, "Error fetching stats") | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	encoder := json.NewEncoder(w) | ||||
| 	if err := encoder.Encode(stats); err != nil { | ||||
| 		s.ServerLogger.Debugf("Error encoding or writing response", "remote_ip", r.RemoteAddr, "error", err) | ||||
| 		s.ServerLogger.Debug("Error encoding or writing response", "remote_ip", r.RemoteAddr, "error", err) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @@ -241,13 +242,13 @@ func (s *Server) HandlerQuery(w http.ResponseWriter, r *http.Request) { | ||||
| 		userResults, err := s.store.Query(uq) | ||||
| 		if err != nil { | ||||
| 			s.WriteAPIError(w, r, http.StatusInternalServerError, "Unable to perform query") | ||||
| 			s.ServerLogger.Warnw("Error performing query", "error", err) | ||||
| 			s.ServerLogger.Warn("Error performing query", "error", err) | ||||
| 			return | ||||
| 		} | ||||
| 		passwordResults, err := s.store.Query(pq) | ||||
| 		if err != nil { | ||||
| 			s.WriteAPIError(w, r, http.StatusInternalServerError, "Unable to perform query") | ||||
| 			s.ServerLogger.Warnw("Error performing query", "error", err) | ||||
| 			s.ServerLogger.Warn("Error performing query", "error", err) | ||||
| 			return | ||||
| 		} | ||||
|  | ||||
| @@ -263,7 +264,7 @@ func (s *Server) HandlerQuery(w http.ResponseWriter, r *http.Request) { | ||||
| 		queryResults, err := s.store.Query(aq) | ||||
| 		if err != nil { | ||||
| 			s.WriteAPIError(w, r, http.StatusInternalServerError, "Unable to perform query") | ||||
| 			s.ServerLogger.Warnw("Error performing query", "error", err) | ||||
| 			s.ServerLogger.Warn("Error performing query", "error", err) | ||||
| 			return | ||||
| 		} | ||||
|  | ||||
| @@ -272,7 +273,7 @@ func (s *Server) HandlerQuery(w http.ResponseWriter, r *http.Request) { | ||||
|  | ||||
| 	encoder := json.NewEncoder(w) | ||||
| 	if err := encoder.Encode(&results); err != nil { | ||||
| 		s.ServerLogger.Warnw("Error writing query results", "error", err) | ||||
| 		s.ServerLogger.Warn("Error writing query results", "error", err) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @@ -294,6 +295,6 @@ func (s *Server) WriteAPIError(w http.ResponseWriter, r *http.Request, status in | ||||
| 	apiErr := APIErrorResponse{Error: message} | ||||
| 	w.WriteHeader(status) | ||||
| 	if err := encoder.Encode(&apiErr); err != nil { | ||||
| 		s.ServerLogger.Debugf("Error encoding or writing error response", "remote_ip", r.RemoteAddr, "error", err) | ||||
| 		s.ServerLogger.Debug("Error encoding or writing error response", "remote_ip", r.RemoteAddr, "error", err) | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user