diff --git a/.codebeatsettings b/.codebeatsettings deleted file mode 100644 index 470fe02..0000000 --- a/.codebeatsettings +++ /dev/null @@ -1,9 +0,0 @@ -{ - "GOLANG": { - "ABC": [15, 25, 50, 70], - "LOC": [75, 100, 150, 250], - "TOO_MANY_IVARS": [12, 16, 20, 24], - "TOO_MANY_FUNCTIONS": [50, 70, 90, 120], - "TOTAL_LOC": [500, 750, 1000, 2000] - } -} diff --git a/.docker/alpine.docker b/.docker/alpine.docker index 755d9ab..e5d33ac 100644 --- a/.docker/alpine.docker +++ b/.docker/alpine.docker @@ -4,7 +4,7 @@ ARG REGISTRY="docker.io" ## BUILDER ##################################################################### -FROM ${REGISTRY}/essentialkaos/golang:alpine3.18 as builder +FROM ${REGISTRY}/essentialkaos/golang:alpine3.20 as builder WORKDIR /go/src/github.com/essentialkaos/sslcli @@ -14,7 +14,7 @@ RUN make deps && make all ## FINAL IMAGE ################################################################# -FROM ${REGISTRY}/essentialkaos/alpine:3.18 +FROM ${REGISTRY}/essentialkaos/alpine:3.20 LABEL org.opencontainers.image.title="sslcli" \ org.opencontainers.image.description="Pretty awesome command-line client for public SSLLabs API" \ diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 3e9787f..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,51 +0,0 @@ -_Before opening an issue, search for similar bug reports or feature requests on GitHub Issues. If yes, please add a_ 👍 _reaction to the existing issue. If no similar issue can be found, fill out either the "Bug Report" or the "Feature Request" section below. Erase the other section and everything on and above this line._ - -### Bug report - -**System info:** - -* **Verbose version info (`sslcli -vv`):** -* **Install tools:** - -**Steps to reproduce:** - -1. [First Step] -2. [Second Step] -3. [and so on...] - -**Expected behavior:** - -[What you expected to happen] - -**Actual behavior:** - -[What actually happened] - -**Additional info:** - -[Include gist of relevant config, logs, etc.] - -Please run those if possible and link them from a [gist](http://gist.github.com). - ---- - -### Feature Request - -Opening a feature request kicks off a discussion. Requests may be closed if we're not actively planning to work on them. - -**Proposal:** - -[Description of the feature] - -**Current behavior:** - -[What currently happens] - -**Desired behavior:** - -[What you would like to happen] - -**Use case:** - -[Why is this important (helps with prioritizing requests)] - diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000..854e604 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,64 @@ +name: ❗ Bug Report +description: File a bug report +title: "[Bug]: " +labels: ["issue • bug"] +assignees: + - andyone + +body: + - type: markdown + attributes: + value: | + > [!IMPORTANT] + > Before you open an issue, search GitHub Issues for a similar bug reports. If so, please add a 👍 reaction to the existing issue. + + - type: textarea + attributes: + label: Verbose application info + description: Output of `sslcli -vv` command + render: shell + validations: + required: true + + - type: dropdown + id: version + attributes: + label: Install tools + description: How did you install this application + options: + - From Sources + - RPM Package + - Prebuilt Binary + default: 0 + validations: + required: true + + - type: textarea + attributes: + label: Steps to reproduce + description: Short guide on how to reproduce this problem on our site + placeholder: | + 1. [First Step] + 2. [Second Step] + 3. [and so on...] + validations: + required: true + + - type: textarea + attributes: + label: Expected behavior + description: What you expected to happen + validations: + required: true + + - type: textarea + attributes: + label: Actual behavior + description: What actually happened + validations: + required: true + + - type: textarea + attributes: + label: Additional info + description: Include gist of relevant config, logs, etc. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000..6ab4ee6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,26 @@ +name: ❓ Question +description: Question about application, configuration or code +title: "[Question]: " +labels: ["issue • question"] +assignees: + - andyone + +body: + - type: markdown + attributes: + value: | + > [!IMPORTANT] + > Before you open an issue, search GitHub Issues for a similar question. If so, please add a 👍 reaction to the existing issue. + + - type: textarea + attributes: + label: Question + description: Detailed question + validations: + required: true + + - type: textarea + attributes: + label: Related version application info + description: Output of `sslcli -vv` command + render: shell diff --git a/.github/ISSUE_TEMPLATE/suggestion.yml b/.github/ISSUE_TEMPLATE/suggestion.yml new file mode 100644 index 0000000..39c69e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/suggestion.yml @@ -0,0 +1,43 @@ +name: ➕ Suggestion +description: Suggest new feature or improvement +title: "[Suggestion]: " +labels: ["issue • suggestion"] +assignees: + - andyone + +body: + - type: markdown + attributes: + value: | + > [!IMPORTANT] + > Before you open an issue, search GitHub Issues for a similar feature requests. If so, please add a 👍 reaction to the existing issue. + > + > Opening a feature request kicks off a discussion. Requests may be closed if we're not actively planning to work on them. + + - type: textarea + attributes: + label: Proposal + description: Description of the feature + validations: + required: true + + - type: textarea + attributes: + label: Current behavior + description: What currently happens + validations: + required: true + + - type: textarea + attributes: + label: Desired behavior + description: What you would like to happen + validations: + required: true + + - type: textarea + attributes: + label: Use case + description: Why is this important (helps with prioritizing requests) + validations: + required: true diff --git a/.github/workflows/docker-push.yml b/.github/workflows/cd-release.yml similarity index 96% rename from .github/workflows/docker-push.yml rename to .github/workflows/cd-release.yml index 5980e6b..43539a0 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/cd-release.yml @@ -1,4 +1,4 @@ -name: "Docker Push" +name: CD (Release) on: release: @@ -19,15 +19,13 @@ permissions: env: IMAGE_NAME: ${{ github.repository }} + DOCKER_FILE: alpine jobs: - Docker: - name: Docker Build & Publish + BuildImage: + name: Image Build & Publish runs-on: ubuntu-latest - env: - DOCKER_FILE: alpine - steps: - name: Checkout uses: actions/checkout@v4 @@ -92,7 +90,7 @@ jobs: - name: Check if build/rebuild is required id: build_check run: | - if [[ "${{github.event_name}}" == "release" ]] ; then + if [[ "$GITHUB_EVENT_NAME" == "release" ]] ; then echo "build=true" >> $GITHUB_OUTPUT exit 0 fi diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml new file mode 100644 index 0000000..0624c2f --- /dev/null +++ b/.github/workflows/ci-pr.yml @@ -0,0 +1,69 @@ +name: CI (PR) + +on: + pull_request: + branches: [master] + workflow_dispatch: + inputs: + force_run: + description: 'Force workflow run' + required: true + type: choice + options: [yes, no] + +permissions: + actions: read + contents: read + statuses: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + CI: + uses: ./.github/workflows/ci.yml + secrets: inherit + + ImageBuild: + name: Container Image Build Check + runs-on: ubuntu-latest + + needs: CI + + env: + REGISTRY: ghcr.io + + strategy: + matrix: + image: [ 'alpine' ] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to DockerHub + uses: docker/login-action@v3 + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + if: ${{ env.DOCKERHUB_USERNAME != '' }} + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Docker image + run: | + docker build --build-arg REGISTRY=${REGISTRY} -f .docker/${{matrix.image}}.docker -t ${{matrix.image}} . + + - name: Show info about built Docker image + uses: essentialkaos/docker-info-action@v1 + with: + image: ${{matrix.image}} + show-labels: true diff --git a/.github/workflows/ci-push.yml b/.github/workflows/ci-push.yml new file mode 100644 index 0000000..04d2363 --- /dev/null +++ b/.github/workflows/ci-push.yml @@ -0,0 +1,26 @@ +name: CI (Push) + +on: + push: + branches: [master, develop] + workflow_dispatch: + inputs: + force_run: + description: 'Force workflow run' + required: true + type: choice + options: [yes, no] + +permissions: + actions: read + contents: read + statuses: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + CI: + uses: ./.github/workflows/ci.yml + secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94fc1ce..9969033 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,29 +1,13 @@ name: CI on: - push: - branches: [master, develop] - pull_request: - branches: [master] - schedule: - - cron: '0 13 */15 * *' - workflow_dispatch: - inputs: - force_run: - description: 'Force workflow run' - required: true - type: choice - options: [yes, no] + workflow_call: permissions: actions: read contents: read statuses: write -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: Go: name: Go @@ -121,59 +105,3 @@ jobs: - name: Check spelling continue-on-error: true uses: crate-ci/typos@master - - DockerBuild: - name: Docker Build Check - runs-on: ubuntu-latest - - needs: [Hadolint, Perfecto, Aligo] - - env: - REGISTRY: ghcr.io - - strategy: - matrix: - image: [ 'alpine' ] - - steps: - - name: Check event type - run: | - if [[ "${{github.event_name}}" != "pull_request" ]] ; then - echo "::notice::Event type is not 'pull_request', all job actions will be skipped" - fi - - # This step is a hack for needs+if issue with actions - # More info about issue: https://github.com/actions/runner/issues/491 - - - name: Checkout - uses: actions/checkout@v4 - if: ${{ github.event_name == 'pull_request' }} - - - name: Login to DockerHub - uses: docker/login-action@v3 - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - if: ${{ github.event_name == 'pull_request' && env.DOCKERHUB_USERNAME != '' }} - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - if: ${{ github.event_name == 'pull_request' }} - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build Docker image - if: ${{ github.event_name == 'pull_request' }} - run: | - docker build --build-arg REGISTRY=${REGISTRY} -f .docker/${{matrix.image}}.docker -t ${{matrix.image}} . - - - name: Show info about built Docker image - uses: essentialkaos/docker-info-action@v1 - if: ${{ github.event_name == 'pull_request' }} - with: - image: ${{matrix.image}} - show-labels: true diff --git a/README.md b/README.md index 5f8b000..7c252a0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@
@@ -28,14 +28,14 @@ To build the SSLScan Client from scratch, make sure you have a working Go 1.21+ workspace ([instructions](https://go.dev/doc/install)), then: ``` -go install github.com/essentialkaos/sslcli@latest +go install github.com/essentialkaos/sslcli/v3@latest ``` #### From [ESSENTIAL KAOS Public Repository](https://kaos.sh/kaos-repo) ```bash -sudo yum install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm -sudo yum install sslcli +sudo dnf install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm +sudo dnf install sslcli ``` #### Prebuilt binaries @@ -73,8 +73,8 @@ docker run --rm -it ghcr.io/essentialkaos/sslcli:latest mydomain.com | Branch | Status | |------------|--------| -| `master` | [![CI](https://kaos.sh/w/sslcli/ci.svg?branch=master)](https://kaos.sh/w/sslcli/ci?query=branch:master) | -| `develop` | [![CI](https://kaos.sh/w/sslcli/ci.svg?branch=develop)](https://kaos.sh/w/sslcli/ci?query=branch:develop) | +| `master` | [![CI](https://kaos.sh/w/sslcli/ci-push.svg?branch=master)](https://kaos.sh/w/sslcli/ci-push?query=branch:master) | +| `develop` | [![CI](https://kaos.sh/w/sslcli/ci-push.svg?branch=develop)](https://kaos.sh/w/sslcli/ci-push?query=branch:develop) | ### Contributing diff --git a/cli/cli.go b/cli/cli.go index 6a166ed..5012c16 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -15,23 +15,23 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/pager" - "github.com/essentialkaos/ek/v12/req" - "github.com/essentialkaos/ek/v12/strutil" - "github.com/essentialkaos/ek/v12/support" - "github.com/essentialkaos/ek/v12/support/deps" - "github.com/essentialkaos/ek/v12/terminal" - "github.com/essentialkaos/ek/v12/timeutil" - "github.com/essentialkaos/ek/v12/usage" - "github.com/essentialkaos/ek/v12/usage/completion/bash" - "github.com/essentialkaos/ek/v12/usage/completion/fish" - "github.com/essentialkaos/ek/v12/usage/completion/zsh" - "github.com/essentialkaos/ek/v12/usage/man" - "github.com/essentialkaos/ek/v12/usage/update" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/pager" + "github.com/essentialkaos/ek/v13/req" + "github.com/essentialkaos/ek/v13/strutil" + "github.com/essentialkaos/ek/v13/support" + "github.com/essentialkaos/ek/v13/support/deps" + "github.com/essentialkaos/ek/v13/terminal" + "github.com/essentialkaos/ek/v13/timeutil" + "github.com/essentialkaos/ek/v13/usage" + "github.com/essentialkaos/ek/v13/usage/completion/bash" + "github.com/essentialkaos/ek/v13/usage/completion/fish" + "github.com/essentialkaos/ek/v13/usage/completion/zsh" + "github.com/essentialkaos/ek/v13/usage/man" + "github.com/essentialkaos/ek/v13/usage/update" sslscan "github.com/essentialkaos/sslscan/v14" ) @@ -40,7 +40,7 @@ import ( const ( APP = "SSLScan Client" - VER = "3.0.1" + VER = "3.0.2" DESC = "Command-line client for the SSL Labs API" ) diff --git a/cli/details.go b/cli/details.go index 9ce317d..0047fa5 100644 --- a/cli/details.go +++ b/cli/details.go @@ -12,14 +12,14 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/httputil" - "github.com/essentialkaos/ek/v12/pluralize" - "github.com/essentialkaos/ek/v12/sliceutil" - "github.com/essentialkaos/ek/v12/strutil" - "github.com/essentialkaos/ek/v12/terminal" - "github.com/essentialkaos/ek/v12/timeutil" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/httputil" + "github.com/essentialkaos/ek/v13/pluralize" + "github.com/essentialkaos/ek/v13/sliceutil" + "github.com/essentialkaos/ek/v13/strutil" + "github.com/essentialkaos/ek/v13/terminal" + "github.com/essentialkaos/ek/v13/timeutil" sslscan "github.com/essentialkaos/sslscan/v14" ) diff --git a/common/sslcli.spec b/common/sslcli.spec index 40f8c18..e452db5 100644 --- a/common/sslcli.spec +++ b/common/sslcli.spec @@ -10,7 +10,7 @@ Summary: Pretty awesome command-line client for public SSLLabs API Name: sslcli -Version: 3.0.1 +Version: 3.0.2 Release: 0%{?dist} Group: Applications/System License: Apache License, Version 2.0 @@ -103,6 +103,10 @@ fi ################################################################################ %changelog +* Tue Aug 06 2024 Anton Novojilov