Skip to content

Commit c50cb25

Browse files
authored
Merge pull request #272 from essentialkaos/develop
Version 3.1.0
2 parents ddf2997 + 7f77b49 commit c50cb25

16 files changed

Lines changed: 168 additions & 41 deletions

File tree

.docker/alpine.docker

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG REGISTRY="ghcr.io"
44

55
## BUILDER #####################################################################
66

7-
FROM ${REGISTRY}/essentialkaos/golang:alpine3.21 AS builder
7+
FROM ${REGISTRY}/essentialkaos/golang:alpine3.23 AS builder
88

99
WORKDIR /go/src/github.com/essentialkaos/sslcli
1010

@@ -14,7 +14,7 @@ RUN make deps && make all
1414

1515
## FINAL IMAGE #################################################################
1616

17-
FROM ${REGISTRY}/essentialkaos/alpine:3.21
17+
FROM ${REGISTRY}/essentialkaos/alpine:3.23 AS final
1818

1919
LABEL org.opencontainers.image.title="sslcli" \
2020
org.opencontainers.image.description="Pretty awesome command-line client for public SSLLabs API" \

.github/workflows/cd-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@v4
31+
uses: actions/checkout@v6
3232
with:
3333
fetch-depth: 0
3434

.github/workflows/ci-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
steps:
4242
- name: Checkout
43-
uses: actions/checkout@v4
43+
uses: actions/checkout@v6
4444

4545
- name: Login to DockerHub
4646
uses: docker/login-action@v3

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919

2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323

2424
- name: Set up Go
25-
uses: actions/setup-go@v5
25+
uses: actions/setup-go@v6
2626
with:
2727
go-version: ${{ matrix.go }}
2828

@@ -40,10 +40,10 @@ jobs:
4040

4141
steps:
4242
- name: Checkout
43-
uses: actions/checkout@v4
43+
uses: actions/checkout@v6
4444

4545
- name: Set up Go
46-
uses: actions/setup-go@v5
46+
uses: actions/setup-go@v6
4747
with:
4848
go-version: 'stable'
4949

@@ -64,7 +64,7 @@ jobs:
6464

6565
steps:
6666
- name: Code checkout
67-
uses: actions/checkout@v4
67+
uses: actions/checkout@v6
6868

6969
- name: Login to GitHub Container Registry
7070
uses: docker/login-action@v3
@@ -86,7 +86,7 @@ jobs:
8686

8787
steps:
8888
- name: Checkout
89-
uses: actions/checkout@v4
89+
uses: actions/checkout@v6
9090

9191
- name: Check dockerfiles with Hadolint
9292
uses: essentialkaos/hadolint-action@v1
@@ -101,7 +101,7 @@ jobs:
101101

102102
steps:
103103
- name: Checkout
104-
uses: actions/checkout@v4
104+
uses: actions/checkout@v6
105105

106106
- name: Check spelling
107107
uses: crate-ci/typos@master

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020

2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v6
2424
with:
2525
fetch-depth: 2
2626

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

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

Makefile

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

3-
# This Makefile generated by GoMakeGen 3.3.2 using next command:
3+
# This Makefile generated by GoMakeGen 3.3.3 using next command:
44
# gomakegen --mod .
55
#
66
# More info: https://kaos.sh/gomakegen
@@ -123,15 +123,15 @@ clean: ## Remove generated files
123123
@rm -f sslcli
124124

125125
help: ## Show this info
126-
@echo -e '\n\033[1mTargets:\033[0m\n'
126+
@printf '\n\033[1mTargets:\033[0m\n\n'
127127
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
128128
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-9s\033[0m %s\n", $$1, $$2}'
129-
@echo -e '\n\033[1mVariables:\033[0m\n'
129+
@printf '\n\033[1mVariables:\033[0m\n\n'
130130
@grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \
131131
| sed 's/ifdef //' \
132132
| sort -h \
133133
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-11s\033[0m %s\n", $$1, $$2}'
134-
@echo -e ''
135-
@echo -e '\033[90mGenerated by GoMakeGen 3.3.2\033[0m\n'
134+
@echo ''
135+
@printf '\033[90mGenerated by GoMakeGen 3.3.3\033[0m\n\n'
136136

137137
################################################################################

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ podman run --rm -it ghcr.io/essentialkaos/sslcli:latest mydomain.com
5656
docker run --rm -it ghcr.io/essentialkaos/sslcli:latest mydomain.com
5757
```
5858

59+
### Upgrading
60+
61+
Since version `3.1.0` you can update `sslcli` to the latest release using [self-update feature](https://github.com/essentialkaos/.github/blob/master/APPS-UPDATE.md):
62+
63+
```bash
64+
sslcli --update
65+
```
66+
67+
This command will runs a self-update in interactive mode. If you want to run a quiet update (_no output_), use the following command:
68+
69+
```bash
70+
sslcli --update=quiet
71+
```
72+
73+
> [!NOTE]
74+
> Please note that the self-update feature only works with binaries that are downloaded from the [EK Apps Repository](https://apps.kaos.st/sslcli/latest). Binaries from packages do not have a self-update feature and must be upgraded via the package manager.
75+
5976
### Feature list
6077

6178
* Superb UI

cli/cli.go

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cli
22

33
// ////////////////////////////////////////////////////////////////////////////////// //
44
// //
5-
// Copyright (c) 2025 ESSENTIAL KAOS //
5+
// Copyright (c) 2026 ESSENTIAL KAOS //
66
// Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> //
77
// //
88
// ////////////////////////////////////////////////////////////////////////////////// //
@@ -25,6 +25,7 @@ import (
2525
"github.com/essentialkaos/ek/v13/support"
2626
"github.com/essentialkaos/ek/v13/support/deps"
2727
"github.com/essentialkaos/ek/v13/terminal"
28+
"github.com/essentialkaos/ek/v13/terminal/tty"
2829
"github.com/essentialkaos/ek/v13/timeutil"
2930
"github.com/essentialkaos/ek/v13/usage"
3031
"github.com/essentialkaos/ek/v13/usage/completion/bash"
@@ -40,7 +41,7 @@ import (
4041

4142
const (
4243
APP = "SSLScan Client"
43-
VER = "3.0.3"
44+
VER = "3.1.0"
4445
DESC = "Command-line client for the SSL Labs API"
4546
)
4647

@@ -64,6 +65,7 @@ const (
6465
OPT_NAME = "name"
6566
OPT_ORG = "org"
6667

68+
OPT_UPDATE = "U:update"
6769
OPT_VERB_VER = "vv:verbose-version"
6870
OPT_COMPLETION = "completion"
6971
OPT_GENERATE_MAN = "generate-man"
@@ -155,6 +157,9 @@ func Run(gitRev string, gomod []byte) {
155157

156158
runtime.GOMAXPROCS(2)
157159

160+
preConfigureUI()
161+
preConfigureOptions()
162+
158163
args, errs := options.Parse(optMap)
159164

160165
if !errs.IsEmpty() {
@@ -181,6 +186,8 @@ func Run(gitRev string, gomod []byte) {
181186
WithChecks(checkAPIAvailability()).
182187
Print()
183188
os.Exit(0)
189+
case withSelfUpdate && options.GetB(OPT_UPDATE):
190+
os.Exit(updateBinary())
184191
case options.GetB(OPT_HELP) || (len(args) == 0 && !options.GetB(OPT_REGISTER)):
185192
genUsage().Print()
186193
os.Exit(0)
@@ -211,9 +218,9 @@ func Run(gitRev string, gomod []byte) {
211218
}
212219
}
213220

214-
// configureUI configures user interface
215-
func configureUI() {
216-
if options.GetB(OPT_NO_COLOR) {
221+
// preConfigureUI preconfigures UI based on information about user terminal
222+
func preConfigureUI() {
223+
if !tty.IsTTY() {
217224
fmtc.DisableColors = true
218225
}
219226

@@ -230,6 +237,18 @@ func configureUI() {
230237
}
231238
}
232239

240+
// preConfigureOptions preconfigures command-line options based on build tags
241+
func preConfigureOptions() {
242+
optMap.SetIf(withSelfUpdate, OPT_UPDATE, &options.V{Type: options.MIXED})
243+
}
244+
245+
// configureUI configures user interface
246+
func configureUI() {
247+
if options.GetB(OPT_NO_COLOR) {
248+
fmtc.DisableColors = true
249+
}
250+
}
251+
233252
// prepare prepares utility for processing data
234253
func prepare() error {
235254
if !options.Has(OPT_MAX_LEFT) {
@@ -753,6 +772,11 @@ func genUsage() *usage.Info {
753772
info.AddOption(OPT_QUIET, "Don't show any output")
754773
info.AddOption(OPT_PAGER, "Use pager for long output")
755774
info.AddOption(OPT_NO_COLOR, "Disable colors in output")
775+
776+
if withSelfUpdate {
777+
info.AddOption(OPT_UPDATE, "Update application to the latest version")
778+
}
779+
756780
info.AddOption(OPT_HELP, "Show this help message")
757781
info.AddOption(OPT_VER, "Show version")
758782

cli/details.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cli
22

33
// ////////////////////////////////////////////////////////////////////////////////// //
44
// //
5-
// Copyright (c) 2025 ESSENTIAL KAOS //
5+
// Copyright (c) 2026 ESSENTIAL KAOS //
66
// Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> //
77
// //
88
// ////////////////////////////////////////////////////////////////////////////////// //
@@ -1180,12 +1180,12 @@ func printTestInfo(info *sslscan.EndpointInfo) {
11801180
fmtc.Printfn(
11811181
" %-24s {s}|{!} %s {s-}(%s ago){!}", "Test date",
11821182
timeutil.Format(testDate, "%Y/%m/%d %H:%M:%S"),
1183-
timeutil.PrettyDuration(time.Since(testDate)),
1183+
timeutil.Pretty(time.Since(testDate)),
11841184
)
11851185

11861186
fmtc.Printfn(
11871187
" %-24s {s}|{!} %s", "Test duration",
1188-
timeutil.PrettyDuration(info.Duration/1000),
1188+
timeutil.Pretty(info.Duration/1000),
11891189
)
11901190

11911191
if details.HTTPStatusCode == 0 {

cli/encoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cli
22

33
// ////////////////////////////////////////////////////////////////////////////////// //
44
// //
5-
// Copyright (c) 2025 ESSENTIAL KAOS //
5+
// Copyright (c) 2026 ESSENTIAL KAOS //
66
// Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> //
77
// //
88
// ////////////////////////////////////////////////////////////////////////////////// //

0 commit comments

Comments
 (0)