From e5f5e64cdbb62506ecfae49f5862f8206eb79a26 Mon Sep 17 00:00:00 2001 From: zach rice Date: Sun, 10 Nov 2019 17:05:36 -0500 Subject: [PATCH] fixing module name, updating gitignore and travis --- .gitignore | 4 ++-- .travis.yml | 2 +- Dockerfile | 9 +++++---- Makefile | 6 +++--- audit/audit.go | 2 +- audit/repo.go | 4 ++-- audit/util.go | 4 ++-- config/config.go | 2 +- config/config_test.go | 2 +- go.mod | 3 +-- go.sum | 4 ---- hosts/github.go | 6 +++--- hosts/gitlab.go | 6 +++--- hosts/host.go | 2 +- hosts/hosts_test.go | 6 +++--- main.go | 12 ++++++------ manager/manager.go | 4 ++-- manager/manager_test.go | 4 ++-- options/options.go | 2 +- 19 files changed, 40 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index 14452e7e..51140440 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ *.dylib *.DS_STORE *.idea -*gitleaks-ng +gitleaks # Test binary -*.out \ No newline at end of file +*.out diff --git a/.travis.yml b/.travis.yml index 0c1aa3ee..bbf74fb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: required language: go go: -- 1.11 +- 1.13 services: - docker script: diff --git a/Dockerfile b/Dockerfile index d4474387..d48120ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ FROM golang:1.13.0 AS build -WORKDIR /go/src/github.com/zricethezav/gitleaks-ng +WORKDIR /go/src/github.com/zricethezav/gitleaks COPY . . -RUN GO111MODULE=on CGO_ENABLED=0 go build -o bin/gitleaks-ng *.go +RUN GO111MODULE=on CGO_ENABLED=0 go build -o bin/gitleaks *.go FROM alpine:3.7 RUN apk add --no-cache bash git openssh -COPY --from=build /go/src/github.com/zricethezav/gitleaks-ng/bin/* /usr/bin/ -ENTRYPOINT ["gitleaks-ng"] +COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/ +ENTRYPOINT ["gitleaks"] # How to use me : @@ -14,3 +14,4 @@ ENTRYPOINT ["gitleaks-ng"] # docker run --rm --name=gitleaks gitleaks --repo=https://github.com/zricethezav/gitleaks # This will check for secrets in https://github.com/zricethezav/gitleaks + diff --git a/Makefile b/Makefile index 33671c85..cc205d6c 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ .PHONY: test test-cover build release-builds VERSION := `git fetch --tags && git tag | sort -V | tail -1` -PKG=github.com/zricethezav/gitleaks-ng -LDFLAGS=-ldflags "-X=github.com/zricethezav/gitleaks-ng/version.Version=$(VERSION)" +PKG=github.com/zricethezav/gitleaks +LDFLAGS=-ldflags "-X=github.com/zricethezav/gitleaks/version.Version=$(VERSION)" COVER=--cover --coverprofile=cover.out test-cover: @@ -16,7 +16,7 @@ test: go test ./... --race $(PKG) -v test-integration: - go test github.com/zricethezav/gitleaks-ng/hosts -v -integration + go test github.com/zricethezav/gitleaks/hosts -v -integration build: go mod tidy diff --git a/audit/audit.go b/audit/audit.go index 490db0b5..2127cac8 100644 --- a/audit/audit.go +++ b/audit/audit.go @@ -2,7 +2,7 @@ package audit import ( "fmt" - "github.com/zricethezav/gitleaks-ng/manager" + "github.com/zricethezav/gitleaks/manager" "io/ioutil" "path" ) diff --git a/audit/repo.go b/audit/repo.go index e6f2dc27..24755978 100644 --- a/audit/repo.go +++ b/audit/repo.go @@ -7,8 +7,8 @@ import ( "github.com/BurntSushi/toml" "github.com/sergi/go-diff/diffmatchpatch" log "github.com/sirupsen/logrus" - "github.com/zricethezav/gitleaks-ng/config" - "github.com/zricethezav/gitleaks-ng/manager" + "github.com/zricethezav/gitleaks/config" + "github.com/zricethezav/gitleaks/manager" "gopkg.in/src-d/go-billy.v4" "gopkg.in/src-d/go-git.v4" "gopkg.in/src-d/go-git.v4/plumbing" diff --git a/audit/util.go b/audit/util.go index 972255e4..95b8e0c0 100644 --- a/audit/util.go +++ b/audit/util.go @@ -3,8 +3,8 @@ package audit import ( "fmt" log "github.com/sirupsen/logrus" - "github.com/zricethezav/gitleaks-ng/config" - "github.com/zricethezav/gitleaks-ng/manager" + "github.com/zricethezav/gitleaks/config" + "github.com/zricethezav/gitleaks/manager" "gopkg.in/src-d/go-git.v4" "gopkg.in/src-d/go-git.v4/plumbing" fdiff "gopkg.in/src-d/go-git.v4/plumbing/format/diff" diff --git a/config/config.go b/config/config.go index 7d9d73c8..adc4eb9a 100644 --- a/config/config.go +++ b/config/config.go @@ -3,7 +3,7 @@ package config import ( "fmt" "github.com/BurntSushi/toml" - "github.com/zricethezav/gitleaks-ng/options" + "github.com/zricethezav/gitleaks/options" "regexp" "strconv" "strings" diff --git a/config/config_test.go b/config/config_test.go index 11647214..3c2f014b 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -2,7 +2,7 @@ package config import ( "fmt" - "github.com/zricethezav/gitleaks-ng/options" + "github.com/zricethezav/gitleaks/options" "regexp" "testing" ) diff --git a/go.mod b/go.mod index d238d593..5e59de03 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/zricethezav/gitleaks-ng +module github.com/zricethezav/gitleaks go 1.12 @@ -11,7 +11,6 @@ require ( github.com/sergi/go-diff v1.0.0 github.com/sirupsen/logrus v1.4.2 github.com/xanzy/go-gitlab v0.21.0 - golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 gopkg.in/src-d/go-billy.v4 v4.3.2 gopkg.in/src-d/go-git.v4 v4.13.1 diff --git a/go.sum b/go.sum index bdd73087..490b8647 100644 --- a/go.sum +++ b/go.sum @@ -74,12 +74,9 @@ golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -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-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk= @@ -102,7 +99,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 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-20190729092621-ff9f1409240a h1:mEQZbbaBjWyLNy0tmZmgEuQAR8XOQ3hL8GYi3J/NG64= golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/hosts/github.go b/hosts/github.go index cd1a9418..3da5ee08 100644 --- a/hosts/github.go +++ b/hosts/github.go @@ -5,9 +5,9 @@ import ( "fmt" "github.com/google/go-github/github" log "github.com/sirupsen/logrus" - "github.com/zricethezav/gitleaks-ng/audit" - "github.com/zricethezav/gitleaks-ng/manager" - "github.com/zricethezav/gitleaks-ng/options" + "github.com/zricethezav/gitleaks/audit" + "github.com/zricethezav/gitleaks/manager" + "github.com/zricethezav/gitleaks/options" "golang.org/x/oauth2" "gopkg.in/src-d/go-git.v4" "gopkg.in/src-d/go-git.v4/plumbing" diff --git a/hosts/gitlab.go b/hosts/gitlab.go index ac8c5ffe..111699b4 100644 --- a/hosts/gitlab.go +++ b/hosts/gitlab.go @@ -5,9 +5,9 @@ import ( "fmt" log "github.com/sirupsen/logrus" "github.com/xanzy/go-gitlab" - "github.com/zricethezav/gitleaks-ng/audit" - "github.com/zricethezav/gitleaks-ng/manager" - "github.com/zricethezav/gitleaks-ng/options" + "github.com/zricethezav/gitleaks/audit" + "github.com/zricethezav/gitleaks/manager" + "github.com/zricethezav/gitleaks/options" "sync" ) diff --git a/hosts/host.go b/hosts/host.go index c3e67a2a..055a35fb 100644 --- a/hosts/host.go +++ b/hosts/host.go @@ -1,7 +1,7 @@ package hosts import ( - "github.com/zricethezav/gitleaks-ng/manager" + "github.com/zricethezav/gitleaks/manager" "strings" ) diff --git a/hosts/hosts_test.go b/hosts/hosts_test.go index 6d9205b8..7815982c 100644 --- a/hosts/hosts_test.go +++ b/hosts/hosts_test.go @@ -3,9 +3,9 @@ package hosts import ( "flag" "fmt" - "github.com/zricethezav/gitleaks-ng/config" - "github.com/zricethezav/gitleaks-ng/manager" - "github.com/zricethezav/gitleaks-ng/options" + "github.com/zricethezav/gitleaks/config" + "github.com/zricethezav/gitleaks/manager" + "github.com/zricethezav/gitleaks/options" "os" "testing" ) diff --git a/main.go b/main.go index 43814bda..b7608640 100644 --- a/main.go +++ b/main.go @@ -3,18 +3,18 @@ package main import ( "github.com/hako/durafmt" log "github.com/sirupsen/logrus" - "github.com/zricethezav/gitleaks-ng/audit" - "github.com/zricethezav/gitleaks-ng/config" - "github.com/zricethezav/gitleaks-ng/hosts" - "github.com/zricethezav/gitleaks-ng/manager" - "github.com/zricethezav/gitleaks-ng/options" + "github.com/zricethezav/gitleaks/audit" + "github.com/zricethezav/gitleaks/config" + "github.com/zricethezav/gitleaks/hosts" + "github.com/zricethezav/gitleaks/manager" + "github.com/zricethezav/gitleaks/options" "io/ioutil" "os" "time" ) // TODO documentation for -// 1. ./gitleaks-ng --repo=https://github.com/gitleakstest/gronit -v | jq -R 'fromjson?' +// 1. ./gitleaks --repo=https://github.com/gitleakstest/gronit -v | jq -R 'fromjson?' // 2. Dockerfile // 3. need to add tests for --repo-config // 4. look over comments and code diff --git a/manager/manager.go b/manager/manager.go index cfdcc167..32a0ddb5 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -6,8 +6,8 @@ import ( "github.com/hako/durafmt" "github.com/mattn/go-colorable" log "github.com/sirupsen/logrus" - "github.com/zricethezav/gitleaks-ng/config" - "github.com/zricethezav/gitleaks-ng/options" + "github.com/zricethezav/gitleaks/config" + "github.com/zricethezav/gitleaks/options" "gopkg.in/src-d/go-git.v4" "os" "os/signal" diff --git a/manager/manager_test.go b/manager/manager_test.go index 10cdbcd2..9e7926d5 100644 --- a/manager/manager_test.go +++ b/manager/manager_test.go @@ -1,8 +1,8 @@ package manager import ( - "github.com/zricethezav/gitleaks-ng/config" - "github.com/zricethezav/gitleaks-ng/options" + "github.com/zricethezav/gitleaks/config" + "github.com/zricethezav/gitleaks/options" "testing" ) diff --git a/options/options.go b/options/options.go index 5be977e6..de275dd4 100644 --- a/options/options.go +++ b/options/options.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/jessevdk/go-flags" log "github.com/sirupsen/logrus" - "github.com/zricethezav/gitleaks-ng/version" + "github.com/zricethezav/gitleaks/version" "gopkg.in/src-d/go-git.v4" "gopkg.in/src-d/go-git.v4/plumbing/transport/http" "gopkg.in/src-d/go-git.v4/plumbing/transport/ssh"