From f8383e654aa41d9576a99ff8dd91a096ae4b4b22 Mon Sep 17 00:00:00 2001 From: Kartik Date: Sat, 4 Oct 2025 19:01:18 +0530 Subject: [PATCH 1/7] add cpu and memory logs on healthcheck --- $HOME/.beast/beast_authorized_keys | 2 ++ _examples/simple/beast.toml | 3 ++ cmd/beast/healthprobe.go | 4 ++- core/manager/health_check.go | 47 ++++++++++++++++++++++++ pkg/cr/containers.go | 58 +++++++++++++++++++++++++++++- 5 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 $HOME/.beast/beast_authorized_keys diff --git a/$HOME/.beast/beast_authorized_keys b/$HOME/.beast/beast_authorized_keys new file mode 100644 index 00000000..fc9dc7d0 --- /dev/null +++ b/$HOME/.beast/beast_authorized_keys @@ -0,0 +1,2 @@ + +command="/home/kartik/.beast/scripts/60ced46738be4be3655bc289164df893f12fe67390d541621d9dae65849519b0",environment="SSH_USER=2",no-agent-forwarding,no-port-forwarding,no-X11-forwarding hi \ No newline at end of file diff --git a/_examples/simple/beast.toml b/_examples/simple/beast.toml index 661245f3..a6979552 100644 --- a/_examples/simple/beast.toml +++ b/_examples/simple/beast.toml @@ -22,3 +22,6 @@ apt_deps = ["gcc", "socat"] setup_scripts = ["setup.sh"] run_cmd = "socat tcp-l:10005,fork,reuseaddr exec:./pwn" ports = [10005] + +[resource] +memory_limit = 67108864 diff --git a/cmd/beast/healthprobe.go b/cmd/beast/healthprobe.go index 65bc5691..b027f934 100644 --- a/cmd/beast/healthprobe.go +++ b/cmd/beast/healthprobe.go @@ -4,6 +4,7 @@ import ( "github.com/sdslabs/beastv4/core/config" "github.com/sdslabs/beastv4/core/manager" "github.com/spf13/cobra" + "github.com/sdslabs/beastv4/core/database" ) var healthProbeCmd = &cobra.Command{ @@ -13,7 +14,8 @@ var healthProbeCmd = &cobra.Command{ Run: func(cmd *cobra.Command, args []string) { config.InitConfig() + database.Init() - go manager.BeastHeathCheckProber(config.Cfg.TickerFrequency) + manager.BeastHeathCheckProber(config.Cfg.TickerFrequency) }, } diff --git a/core/manager/health_check.go b/core/manager/health_check.go index 767dcd10..19c0eebd 100644 --- a/core/manager/health_check.go +++ b/core/manager/health_check.go @@ -57,6 +57,44 @@ func containerProber(chall database.Challenge) error { return err } } + + memory_usage, cpu_percent, err := cr.GetContainerStats(chall.ContainerId) + if err != nil { + err = fmt.Errorf("error while fetching container stats with id %s ", chall.ContainerId) + return err + } + + memory_limit, cpu_shares_limit, err := cr.GetContainerLimits(chall.ContainerId) + if err != nil { + err = fmt.Errorf("error while fetching container limits with id %s ", chall.ContainerId) + return err + } + memory_perc := (float64(memory_usage) / float64(memory_limit)) * 100 + + log.WithFields(log.Fields{ + "ChallName": chall.Name, + }).Infof("Container ID: %s", chall.ContainerId) + log.WithFields(log.Fields{ + "ChallName": chall.Name, + }).Infof("Memory Usage: %.2f MB", float64(memory_usage)/1024/1024) + log.WithFields(log.Fields{ + "ChallName": chall.Name, + }).Infof("Memory Limit: %.2f MB", float64(memory_limit)/1024/1024) + log.WithFields(log.Fields{ + "ChallName": chall.Name, + }).Infof("Memory Usage Percentage: %.2f%%", memory_perc) + log.WithFields(log.Fields{ + "ChallName": chall.Name, + }).Infof("CPU Percent Usage: %.2f%%", cpu_percent) + log.WithFields(log.Fields{ + "ChallName": chall.Name, + }).Infof("CPU Shares Limit: %d", cpu_shares_limit) + + if memory_perc > 100 { + err = fmt.Errorf("Memory limit exceeded for container with id %s ", chall.ContainerId) + return err + } + return nil } @@ -74,6 +112,15 @@ func ChallengesHealthProber(waitTime int) { } for _, chall := range challs { + // err := containerProber(chall) + // if err!=nil { + // msg := fmt.Sprintf("CONTAINER HEALTH CHECK %s: %s", chall.Name, err) + // log.WithFields(log.Fields{ + // "ChallName": chall.Name, + // }).Error(msg) + // go notify.SendNotification(notify.Error, msg) + // } + if chall.Format != core.STATIC_CHALLENGE_TYPE_NAME { allocatedPorts, err := database.GetAllocatedPorts(chall) if err != nil { diff --git a/pkg/cr/containers.go b/pkg/cr/containers.go index 777e8f4c..83a5b79e 100644 --- a/pkg/cr/containers.go +++ b/pkg/cr/containers.go @@ -4,7 +4,7 @@ import ( "fmt" "io/ioutil" "strconv" - + "encoding/json" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" @@ -279,3 +279,59 @@ func CommitContainer(containerId string) (string, error) { return commitResp.ID, nil } + +func GetContainerStats(containerId string) (int64, float64, error) { + ctx := context.Background() + var data1 types.StatsJSON + var data2 types.StatsJSON + cli, err := client.NewClientWithOpts(client.FromEnv) + if err != nil { + log.Error("Failed to connect to docker sdk") + return 0, 0, err + } + defer cli.Close() + + stats, err := cli.ContainerStats(ctx, containerId, true) + if err != nil { + log.Error("Failed to fetch container stats : ", containerId) + return 0, 0, err + } + defer stats.Body.Close() + + json.NewDecoder(stats.Body).Decode(&data1) + json.NewDecoder(stats.Body).Decode(&data2) + + memoryUsage := data2.MemoryStats.Usage + + cpuDelta := data2.CPUStats.CPUUsage.TotalUsage - data1.CPUStats.CPUUsage.TotalUsage + systemDelta := data2.CPUStats.SystemUsage - data1.CPUStats.SystemUsage + numCPUs := float64(len(data2.CPUStats.CPUUsage.PercpuUsage)) + cpuPercent := 0.0 + if systemDelta > 0 && cpuDelta > 0 { + cpuPercent = (float64(cpuDelta) / float64(systemDelta)) * numCPUs * 100 + } + + return int64(memoryUsage), cpuPercent, nil + +} + +func GetContainerLimits(containerId string) (int64, int64, error) { + ctx := context.Background() + cli, err := client.NewClientWithOpts(client.FromEnv) + if err != nil { + log.Error("Failed to connect to docker sdk") + return 0, 0, err + } + defer cli.Close() + + stats, err := cli.ContainerInspect(ctx, containerId) + if err != nil { + log.Error("Failed to fetch container stats : ", containerId) + return 0, 0, err + } + + memory_limit := stats.HostConfig.Resources.Memory + cpu_shares := stats.HostConfig.Resources.CPUShares + + return memory_limit, cpu_shares, nil +} From ee6fd3e3640749d0e18989a6ce418c1342346d9e Mon Sep 17 00:00:00 2001 From: Kartik Date: Sun, 5 Oct 2025 02:50:02 +0530 Subject: [PATCH 2/7] container restart on error or memory exceed --- $HOME/.beast/beast_authorized_keys | 3 +- _examples/web-php/beast.toml | 3 ++ core/manager/health_check.go | 56 +++++++++++++++++++----- pkg/cr/containers.go | 70 +++++++++++++++++++++++++++++- 4 files changed, 118 insertions(+), 14 deletions(-) diff --git a/$HOME/.beast/beast_authorized_keys b/$HOME/.beast/beast_authorized_keys index fc9dc7d0..e9f7a7ce 100644 --- a/$HOME/.beast/beast_authorized_keys +++ b/$HOME/.beast/beast_authorized_keys @@ -1,2 +1,3 @@ -command="/home/kartik/.beast/scripts/60ced46738be4be3655bc289164df893f12fe67390d541621d9dae65849519b0",environment="SSH_USER=2",no-agent-forwarding,no-port-forwarding,no-X11-forwarding hi \ No newline at end of file +command="/home/kartik/.beast/scripts/60ced46738be4be3655bc289164df893f12fe67390d541621d9dae65849519b0",environment="SSH_USER=2",no-agent-forwarding,no-port-forwarding,no-X11-forwarding hi +command="/home/kartik/.beast/scripts/8027ef0d2bdea68f0c2e04e2e5dbc4d649bfaba68d7baa2f7223a04cd6c41edf",environment="SSH_USER=4",no-agent-forwarding,no-port-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1y \ No newline at end of file diff --git a/_examples/web-php/beast.toml b/_examples/web-php/beast.toml index 3caf7425..d4d37443 100644 --- a/_examples/web-php/beast.toml +++ b/_examples/web-php/beast.toml @@ -23,3 +23,6 @@ points = 20 ports = [10002] web_root = "challenge" default_port = 10002 + +[resource] +memory_limit = 6710886 diff --git a/core/manager/health_check.go b/core/manager/health_check.go index 19c0eebd..a1edbb68 100644 --- a/core/manager/health_check.go +++ b/core/manager/health_check.go @@ -19,6 +19,45 @@ import ( var HEALTH_CHECKER = false +func RestartChallenge(chall *database.Challenge) error { + const maxRetries = 3; + success := false + var newContainerId string + var restartErr error + + for i:=0; i 100 { - err = fmt.Errorf("Memory limit exceeded for container with id %s ", chall.ContainerId) + if memory_perc > 1 { + err := fmt.Errorf("Memory limit exceeded for container with id %s ", chall.ContainerId) return err } @@ -112,15 +151,6 @@ func ChallengesHealthProber(waitTime int) { } for _, chall := range challs { - // err := containerProber(chall) - // if err!=nil { - // msg := fmt.Sprintf("CONTAINER HEALTH CHECK %s: %s", chall.Name, err) - // log.WithFields(log.Fields{ - // "ChallName": chall.Name, - // }).Error(msg) - // go notify.SendNotification(notify.Error, msg) - // } - if chall.Format != core.STATIC_CHALLENGE_TYPE_NAME { allocatedPorts, err := database.GetAllocatedPorts(chall) if err != nil { @@ -148,7 +178,8 @@ func ChallengesHealthProber(waitTime int) { } err = containerProber(chall) if err != nil { - msg := fmt.Sprintf("CONTAINER HEALTH CHECK %s: %s : %s", result, chall.Name, err) + go RestartChallenge(&chall) + msg := fmt.Sprintf("CONTAINER HEALTH CHECK %s: %s : %s", result, chall.Name, err) log.WithFields(log.Fields{ "ChallName": chall.Name, }).Error(msg) @@ -162,6 +193,7 @@ func ChallengesHealthProber(waitTime int) { } else { err := CheckStaticChallenge(chall) if err != nil { + go RestartChallenge(&chall) msg := fmt.Sprintf("HEALTHCHECK Failure: %s : %s", chall.Name, err) log.WithFields(log.Fields{ "ChallName": chall.Name, diff --git a/pkg/cr/containers.go b/pkg/cr/containers.go index 83a5b79e..45f8cb32 100644 --- a/pkg/cr/containers.go +++ b/pkg/cr/containers.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/client" "github.com/docker/go-connections/nat" "github.com/sdslabs/beastv4/pkg/defaults" - + "time" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) @@ -335,3 +335,71 @@ func GetContainerLimits(containerId string) (int64, int64, error) { return memory_limit, cpu_shares, nil } + +func RestartContainer(containerId string, name string) (string,error) { + log.Infof("Attempting to restart container for challenge: %s (ID: %s)", name, containerId) + + cli, err := client.NewClientWithOpts() + if err != nil { + return "", fmt.Errorf("could not create docker client: %w", err) + } + + oldContainer, err := cli.ContainerInspect(context.Background(), containerId) + if err != nil { + return "", fmt.Errorf("could not inspect old container %s: %w", containerId, err) + } + + err = StopAndRemoveContainer(containerId) + if err!=nil { + return "", err + } + + mountsMap := make(map[string]string) + for _, m := range oldContainer.HostConfig.Mounts { + if m.Type == mount.TypeBind { + mountsMap[m.Source] = m.Target + } + } + + var portMappings []PortMapping + for containerPort, hostBindings := range oldContainer.HostConfig.PortBindings { + if len(hostBindings) > 0 { + hostPortStr := hostBindings[0].HostPort + hostPort, _ := strconv.ParseUint(hostPortStr, 10, 32) + containerPortInt, _ := strconv.ParseUint(containerPort.Port(), 10, 32) + + portMappings = append(portMappings, PortMapping{ + HostPort: uint32(hostPort), + ContainerPort: uint32(containerPortInt), + }) + } + } + + newName := fmt.Sprintf("%s-restarted-%d", name, time.Now().Unix()) + + config := &CreateContainerConfig{ + ImageId: oldContainer.Config.Image, + ContainerName: newName, + ContainerEnv: oldContainer.Config.Env, + ContainerNetwork: string(oldContainer.HostConfig.NetworkMode), + MountsMap: mountsMap, + PortMapping: portMappings, + Memory: oldContainer.HostConfig.Resources.Memory, + CPUShares: oldContainer.HostConfig.Resources.CPUShares, + } + if oldContainer.HostConfig.Resources.PidsLimit != nil { + config.PidsLimit = *oldContainer.HostConfig.Resources.PidsLimit + } + + newContainerId, err := CreateContainerFromImage(config) + if err != nil { + return "", fmt.Errorf("failed to create new container: %w", err) + } + log.Infof("Successfully created new container %s for challenge %s", newContainerId, name) + + return newContainerId, nil +} + + + + From 7f9505ebb0a0656b57388d409e8c376dc5bfd0d0 Mon Sep 17 00:00:00 2001 From: Kartik Date: Tue, 7 Oct 2025 16:28:33 +0530 Subject: [PATCH 3/7] shift memory tracker from health probe to api --- $HOME/.beast/beast_authorized_keys | 4 ++- api/router.go | 2 ++ api/status.go | 45 +++++++++++++++++++++++++++++- core/manager/health_check.go | 17 ++--------- pkg/cr/containers.go | 16 +++++++++-- 5 files changed, 65 insertions(+), 19 deletions(-) diff --git a/$HOME/.beast/beast_authorized_keys b/$HOME/.beast/beast_authorized_keys index e9f7a7ce..6d8512ac 100644 --- a/$HOME/.beast/beast_authorized_keys +++ b/$HOME/.beast/beast_authorized_keys @@ -1,3 +1,5 @@ command="/home/kartik/.beast/scripts/60ced46738be4be3655bc289164df893f12fe67390d541621d9dae65849519b0",environment="SSH_USER=2",no-agent-forwarding,no-port-forwarding,no-X11-forwarding hi -command="/home/kartik/.beast/scripts/8027ef0d2bdea68f0c2e04e2e5dbc4d649bfaba68d7baa2f7223a04cd6c41edf",environment="SSH_USER=4",no-agent-forwarding,no-port-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1y \ No newline at end of file +command="/home/kartik/.beast/scripts/8027ef0d2bdea68f0c2e04e2e5dbc4d649bfaba68d7baa2f7223a04cd6c41edf",environment="SSH_USER=4",no-agent-forwarding,no-port-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1y +command="/home/kartik/.beast/scripts/8027ef0d2bdea68f0c2e04e2e5dbc4d649bfaba68d7baa2f7223a04cd6c41edf",environment="SSH_USER=4",no-agent-forwarding,no-port-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1y +command="/home/kartik/.beast/scripts/169c1d8053fee22df8553f8eb0957cf8cad6dca68fd77c2adf5ca10fe94fb2af",environment="SSH_USER=6",no-agent-forwarding,no-port-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1y \ No newline at end of file diff --git a/api/router.go b/api/router.go index cd98d4e8..a571a5c1 100644 --- a/api/router.go +++ b/api/router.go @@ -74,6 +74,7 @@ func initGinRouter() *gin.Engine { statusGroup.GET("/challenge/:name", challengeStatusHandler) statusGroup.GET("/all", statusHandler) statusGroup.GET("/all/:filter", statusHandler) + statusGroup.GET("/health/:name", ChallengeHealthHandler) } // Info route group @@ -92,6 +93,7 @@ func initGinRouter() *gin.Engine { infoGroup.GET("/tags", tagHandler) infoGroup.GET("/hint/:hintID", hintHandler) infoGroup.POST("/hint/:hintID", hintHandler) + } // Notification route group diff --git a/api/status.go b/api/status.go index 54ae4943..6e9acaab 100644 --- a/api/status.go +++ b/api/status.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" "time" - + "github.com/sdslabs/beastv4/pkg/cr" "github.com/gin-gonic/gin" "github.com/sdslabs/beastv4/core" "github.com/sdslabs/beastv4/core/database" @@ -109,3 +109,46 @@ func statusHandler(c *gin.Context) { c.JSON(http.StatusOK, resp) } } + +func ChallengeHealthHandler(c *gin.Context) { + name := c.Param("name") + if name == "" { + c.JSON(http.StatusBadRequest, HTTPPlainResp{ + Message: "Name of the challenge is a required parameter to process request.", + }) + return + } + + challenge, err := database.QueryChallengeEntries("name", name) + if err != nil { + c.JSON(http.StatusInternalServerError, HTTPPlainResp{ + Message: "DATABASE ERROR while processing the request.", + }) + return + } + chall := challenge[0] + + memory_usage, cpu_perc, err := cr.GetContainerStats(chall.ContainerId) + if err != nil { + c.JSON(http.StatusInternalServerError, HTTPPlainResp{ + Message: "error while fetching container stats", + }) + return + } + + memory_limit, _, err := cr.GetContainerLimits(chall.ContainerId) + if err != nil { + c.JSON(http.StatusInternalServerError, HTTPPlainResp{ + Message: "error while fetching container limits", + }) + return + } + memory_perc := (float64(memory_usage) / float64(memory_limit)) * 100 + + c.JSON(http.StatusOK, gin.H{ + "status": "healthy", + "memory(bytes)": memory_usage, + "memory_perc": memory_perc, + "cpu_perc": cpu_perc, + }) +} \ No newline at end of file diff --git a/core/manager/health_check.go b/core/manager/health_check.go index a1edbb68..a8fab12f 100644 --- a/core/manager/health_check.go +++ b/core/manager/health_check.go @@ -97,13 +97,13 @@ func containerProber(chall database.Challenge) error { } } - memory_usage, cpu_percent, err := cr.GetContainerStats(chall.ContainerId) + memory_usage, _, err := cr.GetContainerStats(chall.ContainerId) if err != nil { err = fmt.Errorf("error while fetching container stats with id %s ", chall.ContainerId) return err } - memory_limit, cpu_shares_limit, err := cr.GetContainerLimits(chall.ContainerId) + memory_limit, _, err := cr.GetContainerLimits(chall.ContainerId) if err != nil { err = fmt.Errorf("error while fetching container limits with id %s ", chall.ContainerId) return err @@ -116,20 +116,11 @@ func containerProber(chall database.Challenge) error { log.WithFields(log.Fields{ "ChallName": chall.Name, }).Infof("Memory Usage: %.2f MB", float64(memory_usage)/1024/1024) - log.WithFields(log.Fields{ - "ChallName": chall.Name, - }).Infof("Memory Limit: %.2f MB", float64(memory_limit)/1024/1024) log.WithFields(log.Fields{ "ChallName": chall.Name, }).Infof("Memory Usage Percentage: %.2f%%", memory_perc) - log.WithFields(log.Fields{ - "ChallName": chall.Name, - }).Infof("CPU Percent Usage: %.2f%%", cpu_percent) - log.WithFields(log.Fields{ - "ChallName": chall.Name, - }).Infof("CPU Shares Limit: %d", cpu_shares_limit) - if memory_perc > 1 { + if memory_perc > 100 { err := fmt.Errorf("Memory limit exceeded for container with id %s ", chall.ContainerId) return err } @@ -178,7 +169,6 @@ func ChallengesHealthProber(waitTime int) { } err = containerProber(chall) if err != nil { - go RestartChallenge(&chall) msg := fmt.Sprintf("CONTAINER HEALTH CHECK %s: %s : %s", result, chall.Name, err) log.WithFields(log.Fields{ "ChallName": chall.Name, @@ -193,7 +183,6 @@ func ChallengesHealthProber(waitTime int) { } else { err := CheckStaticChallenge(chall) if err != nil { - go RestartChallenge(&chall) msg := fmt.Sprintf("HEALTHCHECK Failure: %s : %s", chall.Name, err) log.WithFields(log.Fields{ "ChallName": chall.Name, diff --git a/pkg/cr/containers.go b/pkg/cr/containers.go index 45f8cb32..b40d547c 100644 --- a/pkg/cr/containers.go +++ b/pkg/cr/containers.go @@ -291,15 +291,25 @@ func GetContainerStats(containerId string) (int64, float64, error) { } defer cli.Close() - stats, err := cli.ContainerStats(ctx, containerId, true) + stats, err := cli.ContainerStats(ctx, containerId, false) + if err != nil { + log.Error("Failed to fetch container stats : ", containerId) + return 0, 0, err + } + time.Sleep(1 * time.Second) + stats2, err := cli.ContainerStats(ctx, containerId, false) if err != nil { log.Error("Failed to fetch container stats : ", containerId) return 0, 0, err } defer stats.Body.Close() - json.NewDecoder(stats.Body).Decode(&data1) - json.NewDecoder(stats.Body).Decode(&data2) + if err := json.NewDecoder(stats.Body).Decode(&data1); err != nil { + return 0, 0, err + } + if err := json.NewDecoder(stats2.Body).Decode(&data2); err != nil { + return 0, 0, err + } memoryUsage := data2.MemoryStats.Usage From 1040227141f84e9eab6332b9f2fe1432f2e1c72d Mon Sep 17 00:00:00 2001 From: Kartik Date: Fri, 10 Oct 2025 09:52:30 +0530 Subject: [PATCH 4/7] remove restart container functions --- core/manager/health_check.go | 39 ---------------------- pkg/cr/containers.go | 64 ------------------------------------ 2 files changed, 103 deletions(-) diff --git a/core/manager/health_check.go b/core/manager/health_check.go index a8fab12f..35382b26 100644 --- a/core/manager/health_check.go +++ b/core/manager/health_check.go @@ -19,45 +19,6 @@ import ( var HEALTH_CHECKER = false -func RestartChallenge(chall *database.Challenge) error { - const maxRetries = 3; - success := false - var newContainerId string - var restartErr error - - for i:=0; i 0 { - hostPortStr := hostBindings[0].HostPort - hostPort, _ := strconv.ParseUint(hostPortStr, 10, 32) - containerPortInt, _ := strconv.ParseUint(containerPort.Port(), 10, 32) - - portMappings = append(portMappings, PortMapping{ - HostPort: uint32(hostPort), - ContainerPort: uint32(containerPortInt), - }) - } - } - - newName := fmt.Sprintf("%s-restarted-%d", name, time.Now().Unix()) - - config := &CreateContainerConfig{ - ImageId: oldContainer.Config.Image, - ContainerName: newName, - ContainerEnv: oldContainer.Config.Env, - ContainerNetwork: string(oldContainer.HostConfig.NetworkMode), - MountsMap: mountsMap, - PortMapping: portMappings, - Memory: oldContainer.HostConfig.Resources.Memory, - CPUShares: oldContainer.HostConfig.Resources.CPUShares, - } - if oldContainer.HostConfig.Resources.PidsLimit != nil { - config.PidsLimit = *oldContainer.HostConfig.Resources.PidsLimit - } - - newContainerId, err := CreateContainerFromImage(config) - if err != nil { - return "", fmt.Errorf("failed to create new container: %w", err) - } - log.Infof("Successfully created new container %s for challenge %s", newContainerId, name) - - return newContainerId, nil -} - From 41603bafefde8fdb8d6b15ae1e3a75ad38a92775 Mon Sep 17 00:00:00 2001 From: kartik Date: Mon, 8 Dec 2025 21:24:09 +0530 Subject: [PATCH 5/7] remove beast_auth_keys file --- $HOME/.beast/beast_authorized_keys | 5 --- _examples/service/beast.toml | 3 ++ api/router.go | 3 +- go.mod | 47 +++++++++++++++--------- go.sum | 59 ++++++++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 23 deletions(-) delete mode 100644 $HOME/.beast/beast_authorized_keys diff --git a/$HOME/.beast/beast_authorized_keys b/$HOME/.beast/beast_authorized_keys deleted file mode 100644 index 6d8512ac..00000000 --- a/$HOME/.beast/beast_authorized_keys +++ /dev/null @@ -1,5 +0,0 @@ - -command="/home/kartik/.beast/scripts/60ced46738be4be3655bc289164df893f12fe67390d541621d9dae65849519b0",environment="SSH_USER=2",no-agent-forwarding,no-port-forwarding,no-X11-forwarding hi -command="/home/kartik/.beast/scripts/8027ef0d2bdea68f0c2e04e2e5dbc4d649bfaba68d7baa2f7223a04cd6c41edf",environment="SSH_USER=4",no-agent-forwarding,no-port-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1y -command="/home/kartik/.beast/scripts/8027ef0d2bdea68f0c2e04e2e5dbc4d649bfaba68d7baa2f7223a04cd6c41edf",environment="SSH_USER=4",no-agent-forwarding,no-port-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1y -command="/home/kartik/.beast/scripts/169c1d8053fee22df8553f8eb0957cf8cad6dca68fd77c2adf5ca10fe94fb2af",environment="SSH_USER=6",no-agent-forwarding,no-port-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1y \ No newline at end of file diff --git a/_examples/service/beast.toml b/_examples/service/beast.toml index e95a4a2d..b5fafcda 100644 --- a/_examples/service/beast.toml +++ b/_examples/service/beast.toml @@ -24,3 +24,6 @@ apt_deps = ["gcc", "socat"] setup_scripts = ["setup.sh"] service_path = "pwn" ports = [10004] + +[resource] +memory_limit = 6710886 diff --git a/api/router.go b/api/router.go index a571a5c1..f1257f79 100644 --- a/api/router.go +++ b/api/router.go @@ -50,7 +50,8 @@ func initGinRouter() *gin.Engine { router.GET("/api/info/download", serveAssets) // API routes group - apiGroup := router.Group("/api", authorize) + apiGroup := router.Group("/api", +) { // Deploy route group manageGroup := apiGroup.Group("/manage", managerAuthorize) diff --git a/go.mod b/go.mod index 2299d231..46a14210 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/sdslabs/beastv4 require ( - github.com/BurntSushi/toml v1.4.0 + github.com/BurntSushi/toml v1.5.0 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de github.com/dgrijalva/jwt-go v3.2.0+incompatible @@ -18,9 +18,9 @@ require ( github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v0.0.3 github.com/swaggo/gin-swagger v1.0.0 - github.com/swaggo/swag v1.16.4 - golang.org/x/crypto v0.29.0 - golang.org/x/net v0.31.0 + github.com/swaggo/swag v1.16.6 + golang.org/x/crypto v0.43.0 + golang.org/x/net v0.46.0 google.golang.org/grpc v1.19.0 gopkg.in/src-d/go-git.v4 v4.7.0 gorm.io/driver/postgres v1.5.11 @@ -34,6 +34,7 @@ require ( github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 // indirect github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect github.com/cpuguy83/go-md2man v1.0.10 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/denisenkom/go-mssqldb v0.0.0-20180901172138-1eb28afdf9b6 // indirect github.com/docker/distribution v2.8.1+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect @@ -41,10 +42,17 @@ require ( github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/gliderlabs/ssh v0.1.1 // indirect - github.com/go-openapi/jsonpointer v0.21.0 // indirect - github.com/go-openapi/jsonreference v0.21.0 // indirect - github.com/go-openapi/spec v0.21.0 // indirect - github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-openapi/jsonpointer v0.22.1 // indirect + github.com/go-openapi/jsonreference v0.21.2 // indirect + github.com/go-openapi/spec v0.22.0 // indirect + github.com/go-openapi/swag v0.25.1 // indirect + github.com/go-openapi/swag/conv v0.25.1 // indirect + github.com/go-openapi/swag/jsonname v0.25.1 // indirect + github.com/go-openapi/swag/jsonutils v0.25.1 // indirect + github.com/go-openapi/swag/loading v0.25.1 // indirect + github.com/go-openapi/swag/stringutils v0.25.1 // indirect + github.com/go-openapi/swag/typeutils v0.25.1 // indirect + github.com/go-openapi/swag/yamlutils v0.25.1 // indirect github.com/go-playground/locales v0.13.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-playground/validator/v10 v10.4.1 // indirect @@ -62,7 +70,7 @@ require ( github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e // indirect github.com/leodido/go-urn v1.2.0 // indirect github.com/lib/pq v1.0.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect + github.com/mailru/easyjson v0.9.1 // indirect github.com/mattn/go-isatty v0.0.12 // indirect github.com/mattn/go-runewidth v0.0.10 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect @@ -77,17 +85,23 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/rivo/uniseg v0.1.0 // indirect github.com/russross/blackfriday v1.5.2 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sergi/go-diff v1.0.0 // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/spf13/pflag v1.0.2 // indirect github.com/src-d/gcfg v1.3.0 // indirect github.com/ugorji/go/codec v1.1.7 // indirect + github.com/urfave/cli/v2 v2.27.7 // indirect github.com/xanzy/ssh-agent v0.2.0 // indirect - golang.org/x/mod v0.22.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/mod v0.29.0 // indirect + golang.org/x/sync v0.17.0 // indirect + golang.org/x/sys v0.37.0 // indirect + golang.org/x/text v0.30.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.27.0 // indirect + golang.org/x/tools v0.38.0 // indirect google.golang.org/appengine v1.2.0 // indirect google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 // indirect gopkg.in/src-d/go-billy.v4 v4.3.0 // indirect @@ -96,10 +110,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.4.0 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect ) replace github.com/docker/docker v1.13.1 => github.com/docker/engine v1.13.1 -go 1.22.0 - -toolchain go1.22.5 +go 1.24.0 diff --git a/go.sum b/go.sum index d85c1fe5..615b02c2 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,7 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg6 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= @@ -21,6 +22,8 @@ github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoU github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= +github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= 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= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -54,12 +57,34 @@ github.com/gliderlabs/ssh v0.1.1 h1:j3L6gSLQalDETeEg/Jg0mGY0/y/N6zI2xX1978P0Uqw= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonpointer v0.22.1 h1:sHYI1He3b9NqJ4wXLoJDKmUmHkWy/L7rtEo92JUxBNk= +github.com/go-openapi/jsonpointer v0.22.1/go.mod h1:pQT9OsLkfz1yWoMgYFy4x3U5GY5nUlsOn1qSBH5MkCM= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/jsonreference v0.21.2 h1:Wxjda4M/BBQllegefXrY/9aq1fxBA8sI5M/lFU6tSWU= +github.com/go-openapi/jsonreference v0.21.2/go.mod h1:pp3PEjIsJ9CZDGCNOyXIQxsNuroxm8FAJ/+quA0yKzQ= github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= +github.com/go-openapi/spec v0.22.0 h1:xT/EsX4frL3U09QviRIZXvkh80yibxQmtoEvyqug0Tw= +github.com/go-openapi/spec v0.22.0/go.mod h1:K0FhKxkez8YNS94XzF8YKEMULbFrRw4m15i2YUht4L0= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-openapi/swag v0.25.1 h1:6uwVsx+/OuvFVPqfQmOOPsqTcm5/GkBhNwLqIR916n8= +github.com/go-openapi/swag v0.25.1/go.mod h1:bzONdGlT0fkStgGPd3bhZf1MnuPkf2YAys6h+jZipOo= +github.com/go-openapi/swag/conv v0.25.1 h1:+9o8YUg6QuqqBM5X6rYL/p1dpWeZRhoIt9x7CCP+he0= +github.com/go-openapi/swag/conv v0.25.1/go.mod h1:Z1mFEGPfyIKPu0806khI3zF+/EUXde+fdeksUl2NiDs= +github.com/go-openapi/swag/jsonname v0.25.1 h1:Sgx+qbwa4ej6AomWC6pEfXrA6uP2RkaNjA9BR8a1RJU= +github.com/go-openapi/swag/jsonname v0.25.1/go.mod h1:71Tekow6UOLBD3wS7XhdT98g5J5GR13NOTQ9/6Q11Zo= +github.com/go-openapi/swag/jsonutils v0.25.1 h1:AihLHaD0brrkJoMqEZOBNzTLnk81Kg9cWr+SPtxtgl8= +github.com/go-openapi/swag/jsonutils v0.25.1/go.mod h1:JpEkAjxQXpiaHmRO04N1zE4qbUEg3b7Udll7AMGTNOo= +github.com/go-openapi/swag/loading v0.25.1 h1:6OruqzjWoJyanZOim58iG2vj934TysYVptyaoXS24kw= +github.com/go-openapi/swag/loading v0.25.1/go.mod h1:xoIe2EG32NOYYbqxvXgPzne989bWvSNoWoyQVWEZicc= +github.com/go-openapi/swag/stringutils v0.25.1 h1:Xasqgjvk30eUe8VKdmyzKtjkVjeiXx1Iz0zDfMNpPbw= +github.com/go-openapi/swag/stringutils v0.25.1/go.mod h1:JLdSAq5169HaiDUbTvArA2yQxmgn4D6h4A+4HqVvAYg= +github.com/go-openapi/swag/typeutils v0.25.1 h1:rD/9HsEQieewNt6/k+JBwkxuAHktFtH3I3ysiFZqukA= +github.com/go-openapi/swag/typeutils v0.25.1/go.mod h1:9McMC/oCdS4BKwk2shEB7x17P6HmMmA6dQRtAkSnNb8= +github.com/go-openapi/swag/yamlutils v0.25.1 h1:mry5ez8joJwzvMbaTGLhw8pXUnhDK91oSJLDPF1bmGk= +github.com/go-openapi/swag/yamlutils v0.25.1/go.mod h1:cm9ywbzncy3y6uPm/97ysW8+wZ09qsks+9RS8fLWKqg= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= @@ -126,6 +151,8 @@ github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8= +github.com/mailru/easyjson v0.9.1/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -166,9 +193,13 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= @@ -183,27 +214,42 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/swaggo/gin-swagger v1.0.0 h1:k6Nn1jV49u+SNIWt7kejQS/iENZKZVMCNQrKOYatNF8= github.com/swaggo/gin-swagger v1.0.0/go.mod h1:Mt37wE46iUaTAOv+HSnHbJYssKGqbS25X19lNF4YpBo= github.com/swaggo/swag v1.16.4 h1:clWJtd9LStiG3VeijiCfOVODP6VpHtKdQy9ELFG3s1A= github.com/swaggo/swag v1.16.4/go.mod h1:VBsHJRsDvfYvqoiMKnsdwhNV9LEMHgEDZcyVYX0sxPg= +github.com/swaggo/swag v1.16.6 h1:qBNcx53ZaX+M5dxVyTrgQ0PJ/ACK+NzhwcbieTt+9yI= +github.com/swaggo/swag v1.16.6/go.mod h1:ngP2etMK5a0P3QBizic5MEwpRmluJZPHjXcMoj4Xesg= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU= +github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4= github.com/xanzy/ssh-agent v0.2.0 h1:Adglfbi5p9Z0BmK2oKU9nTG+zKfniSfnaMYB+ULd+Ro= github.com/xanzy/ssh-agent v0.2.0/go.mod h1:0NyE30eGUDliuLEHJgYte/zncp2zdTStcOnWhgSqHD8= +github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg= +github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= +go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= +golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= +golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -212,6 +258,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4= +golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -219,6 +267,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -230,13 +280,18 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= +golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q= 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= golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k= +golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM= 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/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -247,6 +302,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= +golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= 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= @@ -286,3 +343,5 @@ gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= From 9c580330f1d621939d5e2ab93a6beb91fba2939b Mon Sep 17 00:00:00 2001 From: kartikgoyal137 Date: Sun, 14 Dec 2025 20:33:37 +0530 Subject: [PATCH 6/7] revert to existing package versions --- go.mod | 47 +++++++++++++++++----------------------------- go.sum | 59 ---------------------------------------------------------- 2 files changed, 17 insertions(+), 89 deletions(-) diff --git a/go.mod b/go.mod index 46a14210..2299d231 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/sdslabs/beastv4 require ( - github.com/BurntSushi/toml v1.5.0 + github.com/BurntSushi/toml v1.4.0 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de github.com/dgrijalva/jwt-go v3.2.0+incompatible @@ -18,9 +18,9 @@ require ( github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v0.0.3 github.com/swaggo/gin-swagger v1.0.0 - github.com/swaggo/swag v1.16.6 - golang.org/x/crypto v0.43.0 - golang.org/x/net v0.46.0 + github.com/swaggo/swag v1.16.4 + golang.org/x/crypto v0.29.0 + golang.org/x/net v0.31.0 google.golang.org/grpc v1.19.0 gopkg.in/src-d/go-git.v4 v4.7.0 gorm.io/driver/postgres v1.5.11 @@ -34,7 +34,6 @@ require ( github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 // indirect github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect github.com/cpuguy83/go-md2man v1.0.10 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/denisenkom/go-mssqldb v0.0.0-20180901172138-1eb28afdf9b6 // indirect github.com/docker/distribution v2.8.1+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect @@ -42,17 +41,10 @@ require ( github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/gliderlabs/ssh v0.1.1 // indirect - github.com/go-openapi/jsonpointer v0.22.1 // indirect - github.com/go-openapi/jsonreference v0.21.2 // indirect - github.com/go-openapi/spec v0.22.0 // indirect - github.com/go-openapi/swag v0.25.1 // indirect - github.com/go-openapi/swag/conv v0.25.1 // indirect - github.com/go-openapi/swag/jsonname v0.25.1 // indirect - github.com/go-openapi/swag/jsonutils v0.25.1 // indirect - github.com/go-openapi/swag/loading v0.25.1 // indirect - github.com/go-openapi/swag/stringutils v0.25.1 // indirect - github.com/go-openapi/swag/typeutils v0.25.1 // indirect - github.com/go-openapi/swag/yamlutils v0.25.1 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/spec v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/go-playground/locales v0.13.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-playground/validator/v10 v10.4.1 // indirect @@ -70,7 +62,7 @@ require ( github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e // indirect github.com/leodido/go-urn v1.2.0 // indirect github.com/lib/pq v1.0.0 // indirect - github.com/mailru/easyjson v0.9.1 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.12 // indirect github.com/mattn/go-runewidth v0.0.10 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect @@ -85,23 +77,17 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/rivo/uniseg v0.1.0 // indirect github.com/russross/blackfriday v1.5.2 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sergi/go-diff v1.0.0 // indirect - github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/spf13/pflag v1.0.2 // indirect github.com/src-d/gcfg v1.3.0 // indirect github.com/ugorji/go/codec v1.1.7 // indirect - github.com/urfave/cli/v2 v2.27.7 // indirect github.com/xanzy/ssh-agent v0.2.0 // indirect - github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect - go.yaml.in/yaml/v2 v2.4.3 // indirect - go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/mod v0.29.0 // indirect - golang.org/x/sync v0.17.0 // indirect - golang.org/x/sys v0.37.0 // indirect - golang.org/x/text v0.30.0 // indirect + golang.org/x/mod v0.22.0 // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/text v0.20.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.38.0 // indirect + golang.org/x/tools v0.27.0 // indirect google.golang.org/appengine v1.2.0 // indirect google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 // indirect gopkg.in/src-d/go-billy.v4 v4.3.0 // indirect @@ -110,9 +96,10 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.4.0 // indirect - sigs.k8s.io/yaml v1.6.0 // indirect ) replace github.com/docker/docker v1.13.1 => github.com/docker/engine v1.13.1 -go 1.24.0 +go 1.22.0 + +toolchain go1.22.5 diff --git a/go.sum b/go.sum index 615b02c2..d85c1fe5 100644 --- a/go.sum +++ b/go.sum @@ -6,7 +6,6 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg6 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= -github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= @@ -22,8 +21,6 @@ github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoU github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= -github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= 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= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -57,34 +54,12 @@ github.com/gliderlabs/ssh v0.1.1 h1:j3L6gSLQalDETeEg/Jg0mGY0/y/N6zI2xX1978P0Uqw= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= -github.com/go-openapi/jsonpointer v0.22.1 h1:sHYI1He3b9NqJ4wXLoJDKmUmHkWy/L7rtEo92JUxBNk= -github.com/go-openapi/jsonpointer v0.22.1/go.mod h1:pQT9OsLkfz1yWoMgYFy4x3U5GY5nUlsOn1qSBH5MkCM= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= -github.com/go-openapi/jsonreference v0.21.2 h1:Wxjda4M/BBQllegefXrY/9aq1fxBA8sI5M/lFU6tSWU= -github.com/go-openapi/jsonreference v0.21.2/go.mod h1:pp3PEjIsJ9CZDGCNOyXIQxsNuroxm8FAJ/+quA0yKzQ= github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= -github.com/go-openapi/spec v0.22.0 h1:xT/EsX4frL3U09QviRIZXvkh80yibxQmtoEvyqug0Tw= -github.com/go-openapi/spec v0.22.0/go.mod h1:K0FhKxkez8YNS94XzF8YKEMULbFrRw4m15i2YUht4L0= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= -github.com/go-openapi/swag v0.25.1 h1:6uwVsx+/OuvFVPqfQmOOPsqTcm5/GkBhNwLqIR916n8= -github.com/go-openapi/swag v0.25.1/go.mod h1:bzONdGlT0fkStgGPd3bhZf1MnuPkf2YAys6h+jZipOo= -github.com/go-openapi/swag/conv v0.25.1 h1:+9o8YUg6QuqqBM5X6rYL/p1dpWeZRhoIt9x7CCP+he0= -github.com/go-openapi/swag/conv v0.25.1/go.mod h1:Z1mFEGPfyIKPu0806khI3zF+/EUXde+fdeksUl2NiDs= -github.com/go-openapi/swag/jsonname v0.25.1 h1:Sgx+qbwa4ej6AomWC6pEfXrA6uP2RkaNjA9BR8a1RJU= -github.com/go-openapi/swag/jsonname v0.25.1/go.mod h1:71Tekow6UOLBD3wS7XhdT98g5J5GR13NOTQ9/6Q11Zo= -github.com/go-openapi/swag/jsonutils v0.25.1 h1:AihLHaD0brrkJoMqEZOBNzTLnk81Kg9cWr+SPtxtgl8= -github.com/go-openapi/swag/jsonutils v0.25.1/go.mod h1:JpEkAjxQXpiaHmRO04N1zE4qbUEg3b7Udll7AMGTNOo= -github.com/go-openapi/swag/loading v0.25.1 h1:6OruqzjWoJyanZOim58iG2vj934TysYVptyaoXS24kw= -github.com/go-openapi/swag/loading v0.25.1/go.mod h1:xoIe2EG32NOYYbqxvXgPzne989bWvSNoWoyQVWEZicc= -github.com/go-openapi/swag/stringutils v0.25.1 h1:Xasqgjvk30eUe8VKdmyzKtjkVjeiXx1Iz0zDfMNpPbw= -github.com/go-openapi/swag/stringutils v0.25.1/go.mod h1:JLdSAq5169HaiDUbTvArA2yQxmgn4D6h4A+4HqVvAYg= -github.com/go-openapi/swag/typeutils v0.25.1 h1:rD/9HsEQieewNt6/k+JBwkxuAHktFtH3I3ysiFZqukA= -github.com/go-openapi/swag/typeutils v0.25.1/go.mod h1:9McMC/oCdS4BKwk2shEB7x17P6HmMmA6dQRtAkSnNb8= -github.com/go-openapi/swag/yamlutils v0.25.1 h1:mry5ez8joJwzvMbaTGLhw8pXUnhDK91oSJLDPF1bmGk= -github.com/go-openapi/swag/yamlutils v0.25.1/go.mod h1:cm9ywbzncy3y6uPm/97ysW8+wZ09qsks+9RS8fLWKqg= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= @@ -151,8 +126,6 @@ github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8= -github.com/mailru/easyjson v0.9.1/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -193,13 +166,9 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= @@ -214,42 +183,27 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/swaggo/gin-swagger v1.0.0 h1:k6Nn1jV49u+SNIWt7kejQS/iENZKZVMCNQrKOYatNF8= github.com/swaggo/gin-swagger v1.0.0/go.mod h1:Mt37wE46iUaTAOv+HSnHbJYssKGqbS25X19lNF4YpBo= github.com/swaggo/swag v1.16.4 h1:clWJtd9LStiG3VeijiCfOVODP6VpHtKdQy9ELFG3s1A= github.com/swaggo/swag v1.16.4/go.mod h1:VBsHJRsDvfYvqoiMKnsdwhNV9LEMHgEDZcyVYX0sxPg= -github.com/swaggo/swag v1.16.6 h1:qBNcx53ZaX+M5dxVyTrgQ0PJ/ACK+NzhwcbieTt+9yI= -github.com/swaggo/swag v1.16.6/go.mod h1:ngP2etMK5a0P3QBizic5MEwpRmluJZPHjXcMoj4Xesg= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU= -github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4= github.com/xanzy/ssh-agent v0.2.0 h1:Adglfbi5p9Z0BmK2oKU9nTG+zKfniSfnaMYB+ULd+Ro= github.com/xanzy/ssh-agent v0.2.0/go.mod h1:0NyE30eGUDliuLEHJgYte/zncp2zdTStcOnWhgSqHD8= -github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg= -github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= -go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= -go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= -go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= -golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= -golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= -golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -258,8 +212,6 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= -golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4= -golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -267,8 +219,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= -golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -280,18 +230,13 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= -golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= -golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q= 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= golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= -golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k= -golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM= 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/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -302,8 +247,6 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= -golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= -golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= 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= @@ -343,5 +286,3 @@ gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= -sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= From cab9569a28d1f34189147f9629018ffa011ddeab Mon Sep 17 00:00:00 2001 From: kartikgoyal137 Date: Tue, 23 Dec 2025 15:20:32 +0530 Subject: [PATCH 7/7] put authorize middleware in healthcheck route Signed-off-by: kartikgoyal137 --- api/router.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/router.go b/api/router.go index f1257f79..95aabb0d 100644 --- a/api/router.go +++ b/api/router.go @@ -49,6 +49,9 @@ func initGinRouter() *gin.Engine { router.GET("/api/info/competition-info", competitionInfoHandler) router.GET("/api/info/download", serveAssets) + router.GET("/api/health/:name", adminAuthorize, ChallengeHealthHandler) + + // API routes group apiGroup := router.Group("/api", ) @@ -75,7 +78,6 @@ func initGinRouter() *gin.Engine { statusGroup.GET("/challenge/:name", challengeStatusHandler) statusGroup.GET("/all", statusHandler) statusGroup.GET("/all/:filter", statusHandler) - statusGroup.GET("/health/:name", ChallengeHealthHandler) } // Info route group