Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/cloudflare-utils/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/v7"
"github.com/urfave/cli/v3"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/cloudflare-utils/dns-cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/Cyb3r-Jak3/common/v5"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/v7"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v3"
"gopkg.in/yaml.v3"
Expand Down
2 changes: 1 addition & 1 deletion cmd/cloudflare-utils/dns-purge.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/v7"
"github.com/urfave/cli/v3"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/cloudflare-utils/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"time"

"github.com/Cyb3r-Jak3/common/v5"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/v7"
"github.com/sirupsen/logrus"
docs "github.com/urfave/cli-docs/v3"
"github.com/urfave/cli/v3"
Expand All @@ -21,13 +21,13 @@
var (
version = "DEV"
date = "unknown"
APIClient *cloudflare.API

Check failure on line 24 in cmd/cloudflare-utils/main.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: cloudflare.API

Check failure on line 24 in cmd/cloudflare-utils/main.go

View workflow job for this annotation

GitHub Actions / Analyze

undefined: cloudflare.API

Check failure on line 24 in cmd/cloudflare-utils/main.go

View workflow job for this annotation

GitHub Actions / Test

undefined: cloudflare.API
logger = logrus.New()
ctx = context.Background()
startTime = time.Now()
versionString = fmt.Sprintf("%s (built %s)", version, date)
accountRC *cloudflare.ResourceContainer

Check failure on line 29 in cmd/cloudflare-utils/main.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: cloudflare.ResourceContainer

Check failure on line 29 in cmd/cloudflare-utils/main.go

View workflow job for this annotation

GitHub Actions / Analyze

undefined: cloudflare.ResourceContainer

Check failure on line 29 in cmd/cloudflare-utils/main.go

View workflow job for this annotation

GitHub Actions / Test

undefined: cloudflare.ResourceContainer
zoneRC *cloudflare.ResourceContainer

Check failure on line 30 in cmd/cloudflare-utils/main.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: cloudflare.ResourceContainer

Check failure on line 30 in cmd/cloudflare-utils/main.go

View workflow job for this annotation

GitHub Actions / Analyze

undefined: cloudflare.ResourceContainer

Check failure on line 30 in cmd/cloudflare-utils/main.go

View workflow job for this annotation

GitHub Actions / Test

undefined: cloudflare.ResourceContainer
)

func buildApp() *cli.Command {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cloudflare-utils/prune-deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"errors"
"fmt"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/v7"
"github.com/urfave/cli/v3"
)

Expand Down Expand Up @@ -56,7 +56,7 @@
type pruneDeploymentOptions struct {
c *cli.Command
ProjectName string
SelectedDeployments []cloudflare.PagesProjectDeployment

Check failure on line 59 in cmd/cloudflare-utils/prune-deployments.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: cloudflare.PagesProjectDeployment

Check failure on line 59 in cmd/cloudflare-utils/prune-deployments.go

View workflow job for this annotation

GitHub Actions / Analyze

undefined: cloudflare.PagesProjectDeployment

Check failure on line 59 in cmd/cloudflare-utils/prune-deployments.go

View workflow job for this annotation

GitHub Actions / Test

undefined: cloudflare.PagesProjectDeployment
}

func buildPruneDeploymentsCommand() *cli.Command {
Expand Down Expand Up @@ -187,7 +187,7 @@
}

// PruneBranchDeployments will return a list of deployments to delete based on the branch name.
func PruneBranchDeployments(branch string, options pruneDeploymentOptions) []cloudflare.PagesProjectDeployment {

Check failure on line 190 in cmd/cloudflare-utils/prune-deployments.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: cloudflare.PagesProjectDeployment

Check failure on line 190 in cmd/cloudflare-utils/prune-deployments.go

View workflow job for this annotation

GitHub Actions / Analyze

undefined: cloudflare.PagesProjectDeployment

Check failure on line 190 in cmd/cloudflare-utils/prune-deployments.go

View workflow job for this annotation

GitHub Actions / Test

undefined: cloudflare.PagesProjectDeployment
var toDelete []cloudflare.PagesProjectDeployment
logger.Debugf("Got %d deployments to check for branch: %s", len(options.SelectedDeployments), branch)
for _, deployment := range options.SelectedDeployments {
Expand All @@ -205,7 +205,7 @@
}

// PruneTimeDeployments will return a list of deployments to delete based on the time range.
func PruneTimeDeployments(options pruneDeploymentOptions) (toDelete []cloudflare.PagesProjectDeployment) {

Check failure on line 208 in cmd/cloudflare-utils/prune-deployments.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: cloudflare.PagesProjectDeployment

Check failure on line 208 in cmd/cloudflare-utils/prune-deployments.go

View workflow job for this annotation

GitHub Actions / Analyze

undefined: cloudflare.PagesProjectDeployment

Check failure on line 208 in cmd/cloudflare-utils/prune-deployments.go

View workflow job for this annotation

GitHub Actions / Test

undefined: cloudflare.PagesProjectDeployment
beforeTimestamp := options.c.Timestamp(beforeFlag)
afterTimestamp := options.c.Timestamp(afterFlag)
if !beforeTimestamp.IsZero() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cloudflare-utils/sync-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"time"

"github.com/Cyb3r-Jak3/common/v5"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/v7"
"github.com/google/go-github/v86/github"
"github.com/urfave/cli/v3"
)
Expand Down Expand Up @@ -211,7 +211,7 @@
return nil
}

func getFilteredIPs(ips []string, c *cli.Command) []cloudflare.ListItemCreateRequest {

Check failure on line 214 in cmd/cloudflare-utils/sync-list.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: cloudflare.ListItemCreateRequest

Check failure on line 214 in cmd/cloudflare-utils/sync-list.go

View workflow job for this annotation

GitHub Actions / Analyze

undefined: cloudflare.ListItemCreateRequest

Check failure on line 214 in cmd/cloudflare-utils/sync-list.go

View workflow job for this annotation

GitHub Actions / Test

undefined: cloudflare.ListItemCreateRequest
listItems := make([]cloudflare.ListItemCreateRequest, 0, len(ips))
ipVersion := c.String("ip-version")

Expand Down
2 changes: 1 addition & 1 deletion cmd/cloudflare-utils/tunnel-version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/v7"
"github.com/google/go-github/v86/github"
"github.com/urfave/cli/v3"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cloudflare-utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

"github.com/sourcegraph/conc/pool"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/v7"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v3"
)
Expand Down Expand Up @@ -92,7 +92,7 @@

// DeploymentsPaginate is a helper function to paginate through all deployments.
// This is necessary because we need to be able to adjust the per_page parameter for large projects.
func DeploymentsPaginate(params PagesDeploymentPaginationOptions) ([]cloudflare.PagesProjectDeployment, error) {

Check failure on line 95 in cmd/cloudflare-utils/utils.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: cloudflare.PagesProjectDeployment

Check failure on line 95 in cmd/cloudflare-utils/utils.go

View workflow job for this annotation

GitHub Actions / Analyze

undefined: cloudflare.PagesProjectDeployment

Check failure on line 95 in cmd/cloudflare-utils/utils.go

View workflow job for this annotation

GitHub Actions / Test

undefined: cloudflare.PagesProjectDeployment
var deployments []cloudflare.PagesProjectDeployment
resultInfo := &cloudflare.ResultInfo{}
if params.CLIContext.Bool(lotsOfDeploymentsFlag) {
Expand Down Expand Up @@ -127,7 +127,7 @@

// RapidDNSDelete is a helper function to delete DNS records quickly.
// Uses a pool of goroutines to delete records in parallel.
func RapidDNSDelete(rc *cloudflare.ResourceContainer, dnsRecords []cloudflare.DNSRecord) map[string]error {

Check failure on line 130 in cmd/cloudflare-utils/utils.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: cloudflare.DNSRecord

Check failure on line 130 in cmd/cloudflare-utils/utils.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: cloudflare.ResourceContainer

Check failure on line 130 in cmd/cloudflare-utils/utils.go

View workflow job for this annotation

GitHub Actions / Analyze

undefined: cloudflare.DNSRecord

Check failure on line 130 in cmd/cloudflare-utils/utils.go

View workflow job for this annotation

GitHub Actions / Analyze

undefined: cloudflare.ResourceContainer

Check failure on line 130 in cmd/cloudflare-utils/utils.go

View workflow job for this annotation

GitHub Actions / Test

undefined: cloudflare.DNSRecord

Check failure on line 130 in cmd/cloudflare-utils/utils.go

View workflow job for this annotation

GitHub Actions / Test

undefined: cloudflare.ResourceContainer
p := pool.NewWithResults[bool]()
results := make(map[string]error)
p.WithMaxGoroutines(maxGoRoutines)
Expand Down
11 changes: 6 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.25.0

require (
github.com/Cyb3r-Jak3/common/v5 v5.6.0
github.com/cloudflare/cloudflare-go v0.116.0
github.com/cloudflare/cloudflare-go/v7 v7.3.0
github.com/google/go-github/v86 v86.0.0
github.com/sirupsen/logrus v1.9.4
github.com/sourcegraph/conc v0.3.0
Expand All @@ -17,14 +17,15 @@ require (
require (
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/google/go-querystring v1.2.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/time v0.9.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
25 changes: 15 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
github.com/Cyb3r-Jak3/common/v5 v5.6.0 h1:jS3/zh+CGVSYMwKHrEcgaSg3LRnh+gy42nJDBDfpykE=
github.com/Cyb3r-Jak3/common/v5 v5.6.0/go.mod h1:RbXgHxB9rUJkU9TMwSYOa3vzTORBE4d/YWD3f4OjsBY=
github.com/cloudflare/cloudflare-go v0.116.0 h1:iRPMnTtnswRpELO65NTwMX4+RTdxZl+Xf/zi+HPE95s=
github.com/cloudflare/cloudflare-go v0.116.0/go.mod h1:Ds6urDwn/TF2uIU24mu7H91xkKP8gSAHxQ44DSZgVmU=
github.com/cloudflare/cloudflare-go/v7 v7.3.0 h1:QXoCzkccMWdqS6Eqa4a2EFQtuNLHG4g37WladuGeS7Y=
github.com/cloudflare/cloudflare-go/v7 v7.3.0/go.mod h1:9zcoIAtu6cmcoPszCNISvqYMXs8wObtVGXE1qGFMrNU=
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.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
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=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
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/go-github/v86 v86.0.0 h1:S/6aANJhwRm8EQmGKVML3j41yq0h2BsTP8FnDkO7kcA=
github.com/google/go-github/v86 v86.0.0/go.mod h1:zKv1l4SwDXNFMGByi2FWkq71KwSXqj/eQRZuqtmcot8=
github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0=
github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand All @@ -32,20 +33,24 @@ github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9yS
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM=
github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/urfave/cli-docs/v3 v3.1.0 h1:Sa5xm19IpE5gpm6tZzXdfjdFxn67PnEsE4dpXF7vsKw=
github.com/urfave/cli-docs/v3 v3.1.0/go.mod h1:59d+5Hz1h6GSGJ10cvcEkbIe3j233t4XDqI72UIx7to=
github.com/urfave/cli/v3 v3.9.0 h1:AV9lIiPv3ukYnxunaCUsHnEozptYmDN2F0+yWqLMn/c=
github.com/urfave/cli/v3 v3.9.0/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
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.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down
Loading