Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.1.0 Release changes #7

Merged
merged 4 commits into from
May 30, 2022
Merged
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 .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ jobs:
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.17.6.linux-amd64.tar.gz"
project_path: "./cmd/zapgo"
project_path: "."
binary_name: "zapgo"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# Dependency directories (remove the comment below to include it)
# vendor/

# zapggo binary
/bin
zapgo
#zapgo test files
zap.log
zap-report*
Expand Down
10 changes: 8 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ issues:
- text: "G107: Potential HTTP request made with variable url"
linters:
- gosec
- text: "composites: `github.com/1azunna/zapgo/internal/zapgo.Zapgo` composite literal uses unkeyed fields"
- text: "G304: Potential file inclusion via variable"
linters:
- govet
- gosec
- text: "composites: `github.com/1azunna/zapgo/internal/docker.Docker` composite literal uses unkeyed fields"
linters:
- govet
- text: "SA5008: duplicate struct tag \"choice\""
linters:
- staticcheck
6 changes: 6 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
builds:
- flags:
- -tags={{.Tag}}
- -v
- ldflags:
- -s -w -X main.version={{.Version}} -X main.date={{.Date}}
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,29 @@ This package was created to make it easy for developers to perform dynamic appli

- Ensure docker is installed. If running in CI environment, ensure there is support for docker in docker.


### Using Go (Recommended)

```
go install github.com/1azunna/zapgo@latest
```

### Github Release

See [Releases](https://github.com/1azunna/zapgo/releases)

Using Wget

```bash
wget -qO- https://github.com/1azunna/zapgo/releases/download/v0.0.1/zapgo-v0.0.1-<OS>-<Arch>.tar.gz | tar -xvzf - -C .
wget -qO- https://github.com/1azunna/zapgo/releases/download/v0.1.0/zapgo-v0.1.0-<OS>-<Arch>.tar.gz | tar -xvzf - -C .
mv ./zapgo /usr/local/bin/zapgo
chmod +x /usr/local/bin/zapgo

```

Using Curl
```bash
curl -sSfL https://github.com/1azunna/zapgo/releases/download/v0.0.1/zapgo-v0.0.1-<OS>-<Arch>.tar.gz | tar -xvzf - -C .
curl -sSfL https://github.com/1azunna/zapgo/releases/download/v0.1.0/zapgo-v0.1.0-<OS>-<Arch>.tar.gz | tar -xvzf - -C .
mv ./zapgo /usr/local/bin/zapgo
chmod +x /usr/local/bin/zapgo
```
Expand Down
40 changes: 40 additions & 0 deletions arguments/arguments.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package arguments

import (
"fmt"
"os"

"github.com/jessevdk/go-flags"
)

type cmdArgs struct {
// Example of verbosity with level
Verbose []bool `short:"v" long:"verbose" description:"Show verbose output"`
Release string `long:"release" choice:"stable" choice:"weekly" choice:"live" choice:"bare" default:"stable" description:"The docker image tag to use"`
Port *int `long:"port" default:"8080" description:"Initialize ZAP with a custom port."`
Pull bool `short:"p" long:"pull" description:"Pull the latest ZAP image from dockerhub"`
Configs []string `long:"opts" description:"Additional ZAP command line options to use when initializing ZAP"`
}

var Options cmdArgs
var Parser = flags.NewParser(&Options, flags.Default)

func CheckArgs() {
introtext := `ZapGo is a command line utility for dynamic security testing based on the OWASP ZAP Project.
See zapgo --help for usage details.`

if _, err := Parser.Parse(); err != nil {
if len(os.Args) == 1 {
fmt.Println(introtext)
}
switch flagsErr := err.(type) {
case flags.ErrorType:
if flagsErr == flags.ErrHelp {
os.Exit(0)
}
os.Exit(1)
default:
os.Exit(1)
}
}
}
43 changes: 0 additions & 43 deletions cmd/zapgo/clean.go

This file was deleted.

45 changes: 0 additions & 45 deletions cmd/zapgo/init.go

This file was deleted.

109 changes: 0 additions & 109 deletions cmd/zapgo/main.go

This file was deleted.

Loading