Skip to content

Commit 4492b8e

Browse files
authored
Merge pull request #81 from essentialkaos/develop
Version 2.7.2
2 parents fc86c17 + c1a65e4 commit 4492b8e

File tree

8 files changed

+154
-61
lines changed

8 files changed

+154
-61
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515

1616
env:
1717
SRC_DIR: src/github.com/${{ github.repository }}
18-
GO111MODULE: auto
1918

2019
strategy:
2120
matrix:
@@ -28,12 +27,6 @@ jobs:
2827
go-version: ${{ matrix.go }}
2928
id: go
3029

31-
- name: Setup PATH
32-
run: |
33-
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
34-
echo "GOBIN=${{ github.workspace }}/bin" >> "$GITHUB_ENV"
35-
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
36-
3730
- name: Checkout
3831
uses: actions/checkout@v3
3932
with:
@@ -55,7 +48,6 @@ jobs:
5548

5649
env:
5750
SRC_DIR: src/github.com/${{ github.repository }}
58-
GO111MODULE: auto
5951

6052
steps:
6153
- name: Set up Go
@@ -64,12 +56,6 @@ jobs:
6456
go-version: '1.17.x'
6557
id: go
6658

67-
- name: Setup PATH
68-
run: |
69-
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
70-
echo "GOBIN=${{ github.workspace }}/bin" >> "$GITHUB_ENV"
71-
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
72-
7359
- name: Checkout
7460
uses: actions/checkout@v3
7561
with:
@@ -95,17 +81,15 @@ jobs:
9581
- name: Code checkout
9682
uses: actions/checkout@v3
9783

98-
- name: Login to DockerHub
84+
- name: Login to GitHub Container Registry
9985
uses: docker/login-action@v1
100-
env:
101-
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
102-
if: ${{ env.DOCKERHUB_USERNAME != '' }}
10386
with:
104-
username: ${{ secrets.DOCKERHUB_USERNAME }}
105-
password: ${{ secrets.DOCKERHUB_TOKEN }}
87+
registry: ghcr.io
88+
username: ${{ github.actor }}
89+
password: ${{ secrets.GITHUB_TOKEN }}
10690

10791
- name: Check specs with Perfecto
108-
uses: essentialkaos/perfecto-action@v1
92+
uses: essentialkaos/perfecto-action@v2
10993
with:
11094
files: common/sslcli.spec
11195

@@ -135,7 +119,7 @@ jobs:
135119
uses: actions/checkout@v3
136120

137121
- name: Login to DockerHub
138-
uses: docker/login-action@v1
122+
uses: docker/login-action@v2
139123
env:
140124
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
141125
if: ${{ env.DOCKERHUB_USERNAME != '' }}
@@ -146,3 +130,9 @@ jobs:
146130
- name: Build Docker image
147131
run: |
148132
docker build -f Dockerfile -t sslcli .
133+
134+
- name: Show info about built Docker image
135+
uses: essentialkaos/docker-info-action@v1
136+
with:
137+
image: sslcli
138+
show-labels: true

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
fetch-depth: 2
2626

2727
- name: Initialize CodeQL
28-
uses: github/codeql-action/init@v1
28+
uses: github/codeql-action/init@v2
2929
with:
3030
languages: go
3131

3232
- name: Perform CodeQL Analysis
33-
uses: github/codeql-action/analyze@v1
33+
uses: github/codeql-action/analyze@v2

.github/workflows/ghcr.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "GHCR Publish"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
packages: write
9+
contents: read
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
jobs:
16+
GHCR:
17+
name: GHCR Build & Publish
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Login to DockerHub
25+
uses: docker/login-action@v2
26+
env:
27+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
28+
if: ${{ env.DOCKERHUB_USERNAME != '' }}
29+
with:
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
33+
- name: Login to GitHub Container Registry
34+
uses: docker/login-action@v2
35+
with:
36+
registry: ${{ env.REGISTRY }}
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Extract metadata (tags, labels) for Docker
41+
id: meta
42+
uses: docker/metadata-action@v4
43+
with:
44+
images: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}
45+
flavor: latest=true
46+
47+
- name: Build and push Docker image
48+
uses: docker/build-push-action@v3
49+
with:
50+
context: .
51+
push: true
52+
tags: ${{ steps.meta.outputs.tags }}
53+
labels: ${{ steps.meta.outputs.labels }}
54+
55+
- name: Show info about built Docker image
56+
uses: essentialkaos/docker-info-action@v1
57+
with:
58+
image: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
59+
show-labels: true

Makefile

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
################################################################################
22

3-
# This Makefile generated by GoMakeGen 1.5.1 using next command:
3+
# This Makefile generated by GoMakeGen 2.0.0 using next command:
44
# gomakegen --mod .
55
#
66
# More info: https://kaos.sh/gomakegen
@@ -9,48 +9,88 @@
99

1010
export GO111MODULE=on
1111

12+
ifdef VERBOSE ## Print verbose information (Flag)
13+
VERBOSE_FLAG = -v
14+
endif
15+
16+
################################################################################
17+
1218
.DEFAULT_GOAL := help
13-
.PHONY = fmt vet all clean deps mod-init mod-update mod-vendor help
19+
.PHONY = fmt vet all clean deps update init vendor mod-init mod-update mod-download mod-vendor help
1420

1521
################################################################################
1622

1723
all: sslcli ## Build all binaries
1824

19-
sslcli: ## Build sslcli binary
20-
go build sslcli.go
25+
sslcli:
26+
go build $(VERBOSE_FLAG) sslcli.go
2127

2228
install: ## Install all binaries
2329
cp sslcli /usr/bin/sslcli
2430

2531
uninstall: ## Uninstall all binaries
2632
rm -f /usr/bin/sslcli
2733

28-
deps: mod-update ## Download dependencies
34+
init: mod-init ## Initialize new module
2935

30-
mod-init: ## Initialize new module
31-
go mod init
32-
go mod tidy
36+
deps: mod-download ## Download dependencies
3337

34-
mod-update: ## Download modules to local cache
38+
update: mod-update ## Update dependencies to the latest versions
39+
40+
vendor: mod-vendor ## Make vendored copy of dependencies
41+
42+
mod-init:
43+
ifdef MODULE_PATH ## Module path for initialization (String)
44+
go mod init $(MODULE_PATH)
45+
else
46+
go mod init
47+
endif
48+
49+
ifdef COMPAT ## Compatible Go version (String)
50+
go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
51+
else
52+
go mod tidy $(VERBOSE_FLAG)
53+
endif
54+
55+
mod-update:
56+
ifdef UPDATE_ALL ## Update all dependencies (Flag)
57+
go get -u $(VERBOSE_FLAG) all
58+
else
59+
go get -u $(VERBOSE_FLAG) ./...
60+
endif
61+
62+
ifdef COMPAT
63+
go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
64+
else
65+
go mod tidy $(VERBOSE_FLAG)
66+
endif
67+
68+
test -d vendor && go mod vendor $(VERBOSE_FLAG) || :
69+
70+
mod-download:
3571
go mod download
3672

37-
mod-vendor: ## Make vendored copy of dependencies
38-
go mod vendor
73+
mod-vendor:
74+
go mod vendor $(VERBOSE_FLAG)
3975

4076
fmt: ## Format source code with gofmt
4177
find . -name "*.go" -exec gofmt -s -w {} \;
4278

43-
vet: ## Runs go vet over sources
79+
vet: ## Runs 'go vet' over sources
4480
go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...
4581

4682
clean: ## Remove generated files
4783
rm -f sslcli
4884

4985
help: ## Show this info
50-
@echo -e '\n\033[1mSupported targets:\033[0m\n'
86+
@echo -e '\n\033[1mTargets:\033[0m\n'
5187
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
52-
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}'
88+
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-14s\033[0m %s\n", $$1, $$2}'
89+
@echo -e '\n\033[1mVariables:\033[0m\n'
90+
@grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \
91+
| sed 's/ifdef //' \
92+
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}'
5393
@echo -e ''
54-
@echo -e '\033[90mGenerated by GoMakeGen 1.5.1\033[0m\n'
94+
@echo -e '\033[90mGenerated by GoMakeGen 2.0.0\033[0m\n'
5595

5696
################################################################################

cli/cli.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636

3737
const (
3838
APP = "SSLScan Client"
39-
VER = "2.7.1"
39+
VER = "2.7.2"
4040
DESC = "Command-line client for the SSL Labs API"
4141
)
4242

@@ -193,12 +193,10 @@ func prepare() {
193193
}
194194

195195
// process starting request processing
196-
func process(args []string) {
197-
var (
198-
ok bool
199-
err error
200-
hosts []string
201-
)
196+
func process(args options.Arguments) {
197+
var ok bool
198+
var err error
199+
var hosts []string
202200

203201
api, err = sslscan.NewAPI("SSLCli", VER)
204202

@@ -210,17 +208,17 @@ func process(args []string) {
210208
os.Exit(1)
211209
}
212210

213-
// By default all fine
214-
ok = true
215-
hosts = args
211+
ok = true // By default everything is fine
216212

217-
if fsutil.CheckPerms("FR", hosts[0]) {
218-
hosts, err = readHostList(hosts[0])
213+
if fsutil.CheckPerms("FR", args.Get(0).String()) {
214+
hosts, err = readHostList(args.Get(0).String())
219215

220216
if err != nil && options.GetB(OPT_FORMAT) {
221217
printError(err.Error())
222218
os.Exit(1)
223219
}
220+
} else {
221+
hosts = args.Strings()
224222
}
225223

226224
var grade string

common/sslcli.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
Summary: Pretty awesome command-line client for public SSLLabs API
5050
Name: sslcli
51-
Version: 2.7.1
51+
Version: 2.7.2
5252
Release: 0%{?dist}
5353
Group: Applications/System
5454
License: Apache License, Version 2.0
@@ -134,6 +134,9 @@ fi
134134
################################################################################
135135

136136
%changelog
137+
* Tue May 10 2022 Anton Novojilov <andy@essentialkaos.com> - 2.7.2-0
138+
- Update for compatibility with the latest version of ek package
139+
137140
* Tue Mar 29 2022 Anton Novojilov <andy@essentialkaos.com> - 2.7.1-0
138141
- Removed pkg.re usage
139142
- Added module info

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/essentialkaos/sslcli
33
go 1.17
44

55
require (
6-
github.com/essentialkaos/ek/v12 v12.43.0
6+
github.com/essentialkaos/ek/v12 v12.45.0
77
github.com/essentialkaos/sslscan/v13 v13.1.1
88
)
99

@@ -12,5 +12,5 @@ require (
1212
github.com/klauspost/compress v1.15.0 // indirect
1313
github.com/valyala/bytebufferpool v1.0.0 // indirect
1414
github.com/valyala/fasthttp v1.34.0 // indirect
15-
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
15+
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
1616
)

go.sum

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
22
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
33
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
4-
github.com/essentialkaos/check v1.2.1 h1:avvyFy/1acUNwfxwuOLsHeCjfXtMygtbu0lVDr3nxFs=
54
github.com/essentialkaos/check v1.2.1/go.mod h1:PhxzfJWlf5L/skuyhzBLIvjMB5Xu9TIyDIsqpY5MvB8=
6-
github.com/essentialkaos/ek/v12 v12.43.0 h1:lnwrfGYQFJ3EjEF4ydW2qnshDcXCR2OnNRk0kwlFpFE=
7-
github.com/essentialkaos/ek/v12 v12.43.0/go.mod h1:Cv/tOZshmFg4pMJnBkg4aW/WyYhzzc41qzZIfk5RSi4=
5+
github.com/essentialkaos/check v1.3.0 h1:ria+8o22RCLdt2D/1SHQsEH5Mmy5S+iWHaGHrrbPUc0=
6+
github.com/essentialkaos/check v1.3.0/go.mod h1:PhxzfJWlf5L/skuyhzBLIvjMB5Xu9TIyDIsqpY5MvB8=
7+
github.com/essentialkaos/ek/v12 v12.45.0 h1:5KVZl5MAsPwxfjda+wb+cCxneQ747lU9zA5mjCA5Fyg=
8+
github.com/essentialkaos/ek/v12 v12.45.0/go.mod h1:uQUkpvaZHWR9aI8GfknZqOG5FC+G2PYJLFyMw9fdjbo=
89
github.com/essentialkaos/go-linenoise/v3 v3.3.5/go.mod h1:g4X3LhT83XT4h7xwrCLclAdMkJvS9qWBQTGNdS6y4vo=
910
github.com/essentialkaos/sslscan/v13 v13.1.1 h1:ic02wruXM5IqkWJ8IvDxrdLYSrTe0EGwDQCryBxxTNU=
1011
github.com/essentialkaos/sslscan/v13 v13.1.1/go.mod h1:kKofHxVvSMXfPKXPgtTYXNxi+t9XbV7ZxldSC6oj5dE=
@@ -17,24 +18,26 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
1718
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
1819
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
1920
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
20-
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
21+
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
2122
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
23+
github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
24+
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
2225
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
2326
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
2427
github.com/valyala/fasthttp v1.34.0 h1:d3AAQJ2DRcxJYHm7OXNXtXt2as1vMDfxeIcFvhmGGm4=
2528
github.com/valyala/fasthttp v1.34.0/go.mod h1:epZA5N+7pY6ZaEKRmstzOuYJx9HI8DI1oaCGZpdH4h0=
2629
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
2730
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
28-
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
31+
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
2932
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
3033
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
3134
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
3235
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
3336
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3437
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3538
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
36-
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 h1:OH54vjqzRWmbJ62fjuhxy7AxFFgoHN0/DPc/UrL8cAs=
37-
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
39+
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0=
40+
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3841
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
3942
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
4043
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

0 commit comments

Comments
 (0)