Skip to content

Commit

Permalink
Merge pull request #49 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 2.3.0
  • Loading branch information
andyone authored Nov 30, 2023
2 parents 11ee9b5 + 97b65ec commit 21aecf3
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 51 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check scripts with Shellcheck
uses: essentialkaos/shellcheck-action@v1
Expand All @@ -30,10 +30,10 @@ jobs:

steps:
- name: Code checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -52,7 +52,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check dockerfiles with Hadolint
uses: essentialkaos/hadolint-action@v1
Expand Down Expand Up @@ -83,11 +83,11 @@ jobs:
# More info about issue: https://github.com/actions/runner/issues/491
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request' }}

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
if: ${{ github.event_name == 'pull_request' && env.DOCKERHUB_USERNAME != '' }}
Expand All @@ -96,7 +96,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
if: ${{ github.event_name == 'pull_request' }}
with:
registry: ghcr.io
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
- name: Build and push Docker images (Docker)
if: ${{ steps.build_check.outputs.build == 'true' }}
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: true
context: .
Expand All @@ -148,7 +148,7 @@ jobs:
- name: Build and push Docker images (GHCR)
if: ${{ steps.build_check.outputs.build == 'true' }}
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: true
context: .
Expand Down
64 changes: 37 additions & 27 deletions SOURCES/web-utils
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ fi
APP="WEB Utils"

# Utility version
VER="2.2.1"
VER="2.3.0"

################################################################################

NORM=0
BOLD=1
ITLC=3
UNLN=4
RED=31
GREEN=32
Expand All @@ -29,24 +30,26 @@ CYAN=36
GREY=37
DARK=90

CL_NORM="\e[0m"
CL_BOLD="\e[0;${BOLD};49m"
CL_UNLN="\e[0;${UNLN};49m"
CL_RED="\e[0;${RED};49m"
CL_GREEN="\e[0;${GREEN};49m"
CL_YELLOW="\e[0;${YELLOW};49m"
CL_BLUE="\e[0;${BLUE};49m"
CL_MAG="\e[0;${MAG};49m"
CL_CYAN="\e[0;${CYAN};49m"
CL_GREY="\e[0;${GREY};49m"
CL_DARK="\e[0;${DARK};49m"
CL_BL_RED="\e[1;${RED};49m"
CL_BL_GREEN="\e[1;${GREEN};49m"
CL_BL_YELLOW="\e[1;${YELLOW};49m"
CL_BL_BLUE="\e[1;${BLUE};49m"
CL_BL_MAG="\e[1;${MAG};49m"
CL_BL_CYAN="\e[1;${CYAN};49m"
CL_BL_GREY="\e[1;${GREY};49m"
CL_NORM="\e[${NORM}m"
CL_BOLD="\e[${BOLD}m"
CL_ITLC="\e[${ITLC}m"
CL_UNLN="\e[${UNLN}m"
CL_RED="\e[${RED}m"
CL_GREEN="\e[${GREEN}m"
CL_YELLOW="\e[${YELLOW}m"
CL_BLUE="\e[${BLUE}m"
CL_MAG="\e[${MAG}m"
CL_CYAN="\e[${CYAN}m"
CL_GREY="\e[${GREY}m"
CL_DARK="\e[${DARK}m"
CL_BL_RED="\e[${BOLD};${RED}m"
CL_BL_GREEN="\e[${BOLD};${GREEN}m"
CL_BL_YELLOW="\e[${BOLD};${YELLOW}m"
CL_BL_BLUE="\e[${BOLD};${BLUE}m"
CL_BL_MAG="\e[${BOLD};${MAG}m"
CL_BL_CYAN="\e[${BOLD};${CYAN}m"
CL_BL_GREY="\e[${BOLD};${GREY}m"
CL_IT_DARK="\e[${ITLC};${DARK}m"

################################################################################

Expand Down Expand Up @@ -85,10 +88,11 @@ SHORT_OPTS="E:!ecc s:size h:!help v:!version nc:!no_color"
# Code: No
# Echo: No
main() {
if [[ ! -t 1 || -n "$no_color" || -n "$NO_COLOR" ]] ; then
unset NORM BOLD UNLN RED GREEN YELLOW BLUE MAG CYAN GREY DARK
if [[ ! -c /dev/stdout || -n "$no_color" || -n "$NO_COLOR" ]] ; then
unset NORM BOLD CL_ITLC UNLN RED GREEN YELLOW BLUE MAG CYAN GREY DARK
unset CL_NORM CL_BOLD CL_UNLN CL_RED CL_GREEN CL_YELLOW CL_BLUE CL_MAG CL_CYAN CL_GREY CL_DARK
unset CL_BL_RED CL_BL_GREEN CL_BL_YELLOW CL_BL_BLUE CL_BL_MAG CL_BL_CYAN CL_BL_GREY CL_BL_DARK
unset CL_BL_RED CL_BL_GREEN CL_BL_YELLOW CL_BL_BLUE CL_BL_MAG CL_BL_CYAN CL_BL_GREY CL_IT_DARK
no_color=true
fi

if [[ -n "$version" ]] ; then
Expand Down Expand Up @@ -918,19 +922,19 @@ usage() {
show "Examples" $BOLD
show ""
show " web-utils csr-gen domain.com"
show " Generate RSA key and a certificate signing request for domain.com" $DARK
show " ${CL_IT_DARK}Generate RSA key and a certificate signing request for domain.com${CL_NORM}"
show ""
show " web-utils hpkp-gen domain.com.csr domain.com.backup.key"
show " Generate HTTP public key pinning (HPKP) header with server and backup pins" $DARK
show " ${CL_IT_DARK}Generate HTTP public key pinning (HPKP) header with server and backup pins${CL_NORM}"
show ""
show " web-utils ocsp-gen sever.crt issuer.crt"
show " Generate OCSP stapling file using server and issuer certificates" $DARK
show " ${CL_IT_DARK}Generate OCSP stapling file using server and issuer certificates${CL_NORM}"
show ""
show " web-utils ocsp-gen sever-chain.crt"
show " Generate OCSP stapling file using certificate chain" $DARK
show " ${CL_IT_DARK}Generate OCSP stapling file using certificate chain${CL_NORM}"
show ""
show " web-utils ocsp-check essentialkaos.com"
show " Check OCSP response status for essentialkaos.com" $DARK
show " ${CL_IT_DARK}Check OCSP response status for essentialkaos.com${CL_NORM}"
show ""
}

Expand All @@ -939,8 +943,14 @@ usage() {
# Code: No
# Echo: No
about() {
local openssl_ver

openssl_ver=$(openssl version 2>/dev/null | tr -s ' ' | cut -f2 -d' ')

show ""
show "${CL_BL_CYAN}$APP${CL_NORM} ${CL_CYAN}$VER${CL_NORM} - Helpers for working with web server"
show "" $DARK
show "└ OpenSSL: ${openssl_ver:-—}" $DARK
show ""
show "Copyright (C) 2009-$(date +%Y) ESSENTIAL KAOS" $DARK
show "Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>" $DARK
Expand Down
28 changes: 16 additions & 12 deletions web-utils.spec
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
################################################################################

Summary: Helpers for working with web server
Name: web-utils
Version: 2.2.1
Release: 0%{?dist}
Group: Applications/System
License: Apache License, Version 2.0
URL: https://kaos.sh/web-utils
Summary: Helpers for working with web server
Name: web-utils
Version: 2.3.0
Release: 0%{?dist}
Group: Applications/System
License: Apache License, Version 2.0
URL: https://kaos.sh/web-utils

Source0: https://source.kaos.st/%{name}/%{name}-%{version}.tar.bz2
Source0: https://source.kaos.st/%{name}/%{name}-%{version}.tar.bz2

BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Requires: bash openssl
Requires: bash openssl

Provides: %{name} = %{version}-%{release}
Provides: %{name} = %{version}-%{release}

################################################################################

Expand Down Expand Up @@ -49,6 +49,10 @@ rm -rf %{buildroot}
################################################################################

%changelog
* Thu Nov 30 2023 Anton Novojilov <andy@essentialkaos.com> - 2.3.0-0
- Improved version output
- Code refactoring

* Tue Jan 31 2023 Anton Novojilov <andy@essentialkaos.com> - 2.2.1-0
- Minor fixes

Expand Down

0 comments on commit 21aecf3

Please sign in to comment.