From 0a3b3d034eeca7006e4d92541552ba3bb5b97f4b Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sun, 9 Jun 2024 02:01:53 +0300 Subject: [PATCH 1/5] Improve automatic disabling of color output usage --- SOURCES/web-utils | 4 ++-- web-utils.spec | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/SOURCES/web-utils b/SOURCES/web-utils index a34fe37..1e0e968 100755 --- a/SOURCES/web-utils +++ b/SOURCES/web-utils @@ -13,7 +13,7 @@ fi APP="WEB Utils" # Utility version -VER="2.3.0" +VER="2.3.1" ################################################################################ @@ -88,7 +88,7 @@ SHORT_OPTS="E:!ecc s:size h:!help v:!version nc:!no_color" # Code: No # Echo: No main() { - if [[ ! -c /dev/stdout || -n "$no_color" || -n "$NO_COLOR" ]] ; then + if [[ -n "$no_color" || -n "$NO_COLOR" ]] || [[ ! -c /dev/stdout && -z $FAKETTY ]] ; 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_IT_DARK diff --git a/web-utils.spec b/web-utils.spec index 404c8d6..cd5ca1d 100644 --- a/web-utils.spec +++ b/web-utils.spec @@ -2,7 +2,7 @@ Summary: Helpers for working with web server Name: web-utils -Version: 2.3.0 +Version: 2.3.1 Release: 0%{?dist} Group: Applications/System License: Apache License, Version 2.0 @@ -49,6 +49,9 @@ rm -rf %{buildroot} ################################################################################ %changelog +* Sun Jun 09 2024 Anton Novojilov - 2.3.1-0 +- Improved automatic disabling of color output usage + * Thu Nov 30 2023 Anton Novojilov - 2.3.0-0 - Improved version output - Code refactoring From f7a3f2502ada2cb048e24a197aed4e3d379618a2 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sun, 9 Jun 2024 02:05:05 +0300 Subject: [PATCH 2/5] Improve README --- .github/images/usage.svg | 89 ++++++++++++++++++++++++++++++++++++++++ README.md | 44 +------------------- 2 files changed, 90 insertions(+), 43 deletions(-) create mode 100644 .github/images/usage.svg diff --git a/.github/images/usage.svg b/.github/images/usage.svg new file mode 100644 index 0000000..74c836b --- /dev/null +++ b/.github/images/usage.svg @@ -0,0 +1,89 @@ + + + + Web-Utils Usage + + + + + + + + + + + + + + + + + + Terminal + Usage: web-utils command args… + Commands + csr-gen host ...................... Generate key and a certificate signing request + csr-gen config .................... Generate key and a certificate signing request from OpenSSL configuration file + csr-info csr ...................... Print info from certificate signing request + csr-config-gen host ............... Generate OpenSSL configuration file for certificate signing request generation + crt-info crt ...................... Print info from certificate + hpkp-gen csr backup ............... Generate HTTP public key pinning (HPKP) header from CSR file + hpkp-gen key backup ............... Generate HTTP public key pinning (HPKP) header from KEY file + hpkp-gen crt backup ............... Generate HTTP public key pinning (HPKP) header from CRT file + ocsp-gen server-cert issuer-cert .. Generate OCSP stapling file from server certificate + ocsp-gen cert-chain ............... Generate OCSP stapling file from server certificate chain + ocsp-check host server-name ....... Check OCSP response status for some host + 0rtt-check host server-name ....... Check 0-RTT support + htpasswd user password ............ Generate record with MD5 password hash for .htpasswd files + Options + --ecc, -E ........ Generate ECC certificate signing request + --size, -S size .. Key size (ECC: 256-384 / RSA: 2048-8192) + --no-color, -nc .. Disable colors in output + --help, -h ....... Show this help message + --version, -v .... Show information about version + Examples + web-utils csr-gen domain.com + Generate RSA key and a certificate signing request for domain.com + web-utils hpkp-gen domain.com.csr domain.com.backup.key + Generate HTTP public key pinning (HPKP) header with server and backup pins + web-utils ocsp-gen sever.crt issuer.crt + Generate OCSP stapling file using server and issuer certificates + web-utils ocsp-gen sever-chain.crt + Generate OCSP stapling file using certificate chain + web-utils ocsp-check essentialkaos.com + Check OCSP response status for essentialkaos.com + + + diff --git a/README.md b/README.md index c54c1c6..efb701e 100644 --- a/README.md +++ b/README.md @@ -58,49 +58,7 @@ docker run --rm -it -v "$(pwd):/data" ghcr.io/essentialkaos/web-utils:latest # p ### Usage -``` -Usage: web-utils command args… - -Commands - -┌ csr-gen host Generate key and a certificate signing request -└ csr-gen config Generate key and a certificate signing request from OpenSSL configuration file - csr-info csr Print info from certificate signing request - csr-config-gen host Generate OpenSSL configuration file for certificate signing request generation - crt-info crt Print info from certificate -┌ hpkp-gen csr backup Generate HTTP public key pinning (HPKP) header from CSR file -│ hpkp-gen key backup Generate HTTP public key pinning (HPKP) header from KEY file -└ hpkp-gen crt backup Generate HTTP public key pinning (HPKP) header from CRT file -┌ ocsp-gen server-cert issuer-cert Generate OCSP stapling file from server certificate -└ ocsp-gen cert-chain Generate OCSP stapling file from server certificate chain - ocsp-check host server-name Check OCSP response status for some host - 0rtt-check host server-name Check 0-RTT support - htpasswd user password Generate record with MD5 password hash for .htpasswd files - -Options - - --ecc, -E Generate ECC certificate signing request - --size, -s size Key size (ECC: 256-384 / RSA: 2048-8192) - --help, -h Show this help message - --version, -v Show information about version - -Examples - - web-utils csr-gen domain.com - Generate RSA key and a certificate signing request for domain.com - - web-utils hpkp-gen domain.com.csr domain.com.backup.key - Generate HTTP public key pinning (HPKP) header with server and backup pins - - web-utils ocsp-gen sever.crt issuer.crt - Generate OCSP stapling file using server and issuer certificates - - web-utils ocsp-gen sever-chain.crt - Generate OCSP stapling file using certificate chain - - web-utils ocsp-check essentialkaos.com - Check OCSP response status for essentialkaos.com -``` + ### Build Status From 0d80488ae079012329b147983de45899ea562213 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sun, 9 Jun 2024 02:07:47 +0300 Subject: [PATCH 3/5] Improve README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efb701e..8bf3911 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ #### From ESSENTIAL KAOS Public repository ``` -sudo yum install -y https://yum.kaos.st/get/$(uname -r).rpm +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 web-utils ``` From f84ed36bfa1a5e6e67679fe7daa4fc4c2813fefb Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 12 Jun 2024 01:28:42 +0300 Subject: [PATCH 4/5] Improve README --- .github/images/card.svg | 5 +++ .github/images/license.svg | 1 + .github/images/usage.svg | 88 +++++++++++++++++++------------------- README.md | 4 +- 4 files changed, 53 insertions(+), 45 deletions(-) create mode 100644 .github/images/card.svg create mode 100644 .github/images/license.svg diff --git a/.github/images/card.svg b/.github/images/card.svg new file mode 100644 index 0000000..5bfb7dc --- /dev/null +++ b/.github/images/card.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/.github/images/license.svg b/.github/images/license.svg new file mode 100644 index 0000000..8990e77 --- /dev/null +++ b/.github/images/license.svg @@ -0,0 +1 @@ +license: Apache-2.0licenseApache-2.0 \ No newline at end of file diff --git a/.github/images/usage.svg b/.github/images/usage.svg index 74c836b..a613747 100644 --- a/.github/images/usage.svg +++ b/.github/images/usage.svg @@ -1,7 +1,7 @@ - - + + - Web-Utils Usage + Web Utils Usage @@ -18,7 +18,7 @@ .italic { font-style: italic; } .underline { text-decoration-line: underline; } .dim { opacity: 0.75; } - .terminal { font-weight: bold; } + .terminal { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-weight: 500; font-size: 15px; } text { fill: #F5F5F5; } .terminal { fill: #DDD; } @@ -44,46 +44,48 @@ - - + + + - - - + + + - Terminal - Usage: web-utils command args… - Commands - csr-gen host ...................... Generate key and a certificate signing request - csr-gen config .................... Generate key and a certificate signing request from OpenSSL configuration file - csr-info csr ...................... Print info from certificate signing request - csr-config-gen host ............... Generate OpenSSL configuration file for certificate signing request generation - crt-info crt ...................... Print info from certificate - hpkp-gen csr backup ............... Generate HTTP public key pinning (HPKP) header from CSR file - hpkp-gen key backup ............... Generate HTTP public key pinning (HPKP) header from KEY file - hpkp-gen crt backup ............... Generate HTTP public key pinning (HPKP) header from CRT file - ocsp-gen server-cert issuer-cert .. Generate OCSP stapling file from server certificate - ocsp-gen cert-chain ............... Generate OCSP stapling file from server certificate chain - ocsp-check host server-name ....... Check OCSP response status for some host - 0rtt-check host server-name ....... Check 0-RTT support - htpasswd user password ............ Generate record with MD5 password hash for .htpasswd files - Options - --ecc, -E ........ Generate ECC certificate signing request - --size, -S size .. Key size (ECC: 256-384 / RSA: 2048-8192) - --no-color, -nc .. Disable colors in output - --help, -h ....... Show this help message - --version, -v .... Show information about version - Examples - web-utils csr-gen domain.com - Generate RSA key and a certificate signing request for domain.com - web-utils hpkp-gen domain.com.csr domain.com.backup.key - Generate HTTP public key pinning (HPKP) header with server and backup pins - web-utils ocsp-gen sever.crt issuer.crt - Generate OCSP stapling file using server and issuer certificates - web-utils ocsp-gen sever-chain.crt - Generate OCSP stapling file using certificate chain - web-utils ocsp-check essentialkaos.com - Check OCSP response status for essentialkaos.com + Terminal - + Usage: web-utils command args… + Commands + csr-gen host ...................... Generate key and a certificate signing request + csr-gen config .................... Generate key and a certificate signing request from OpenSSL configuration file + csr-info csr ...................... Print info from certificate signing request + csr-config-gen host ............... Generate OpenSSL configuration file for certificate signing request generation + crt-info crt ...................... Print info from certificate + hpkp-gen csr backup ............... Generate HTTP public key pinning (HPKP) header from CSR file + hpkp-gen key backup ............... Generate HTTP public key pinning (HPKP) header from KEY file + hpkp-gen crt backup ............... Generate HTTP public key pinning (HPKP) header from CRT file + ocsp-gen server-cert issuer-cert .. Generate OCSP stapling file from server certificate + ocsp-gen cert-chain ............... Generate OCSP stapling file from server certificate chain + ocsp-check host server-name ....... Check OCSP response status for some host + 0rtt-check host server-name ....... Check 0-RTT support + htpasswd user password ............ Generate record with MD5 password hash for .htpasswd files + Options + --ecc, -E ........ Generate ECC certificate signing request + --size, -S size .. Key size (ECC: 256-384 / RSA: 2048-8192) + --no-color, -nc .. Disable colors in output + --help, -h ....... Show this help message + --version, -v .... Show information about version + Examples + web-utils csr-gen domain.com + Generate RSA key and a certificate signing request for domain.com + web-utils hpkp-gen domain.com.csr domain.com.backup.key + Generate HTTP public key pinning (HPKP) header with server and backup pins + web-utils ocsp-gen sever.crt issuer.crt + Generate OCSP stapling file using server and issuer certificates + web-utils ocsp-gen sever-chain.crt + Generate OCSP stapling file using certificate chain + web-utils ocsp-check essentialkaos.com + Check OCSP response status for essentialkaos.com + + diff --git a/README.md b/README.md index 8bf3911..22f2b4e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -

+

GitHub Actions CI Status - +

InstallationUsageBuild StatusLicense

From c093c73dd8aeccc53bd185045b22a440738991f3 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sun, 16 Jun 2024 15:45:03 +0300 Subject: [PATCH 5/5] Improve README --- .github/images/usage.svg | 79 ++++++++++++++++++++-------------------- README.md | 6 +-- 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/.github/images/usage.svg b/.github/images/usage.svg index a613747..b9682a5 100644 --- a/.github/images/usage.svg +++ b/.github/images/usage.svg @@ -1,5 +1,5 @@ - - + + Web Utils Usage @@ -14,12 +14,13 @@ text { font-family: ui-monospace, 'JetBrains Mono', 'Fira Code', 'Iosevka', SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 14px; font-display: swap; white-space: pre; } tspan { white-space: pre; } - .bold { font-weight: bold; } - .italic { font-style: italic; } - .underline { text-decoration-line: underline; } - .dim { opacity: 0.75; } .terminal { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-weight: 500; font-size: 15px; } + tspan.BB { font-weight: bold; } + tspan.II { font-style: italic; } + tspan.UU { text-decoration-line: underline; } + tspan.DD { opacity: 0.75; } + text { fill: #F5F5F5; } .terminal { fill: #DDD; } .bg { fill: #222; stop-color: #222; } @@ -30,8 +31,8 @@ tspan.b { fill: #5C9AD8; } tspan.m { fill: #B6419E; } tspan.c { fill: #38AFC5; } - tspan.LG { fill: #AAA; } - tspan.DG { fill: #696969; } + tspan.s { fill: #AAA; } + tspan.d { fill: #696969; } tspan.R { fill: #EF5A56; } tspan.G { fill: #49E471; } tspan.Y { fill: #E3E342; } @@ -44,9 +45,9 @@ - - - + + + @@ -54,38 +55,38 @@ Terminal - Usage: web-utils command args… - Commands - csr-gen host ...................... Generate key and a certificate signing request - csr-gen config .................... Generate key and a certificate signing request from OpenSSL configuration file - csr-info csr ...................... Print info from certificate signing request - csr-config-gen host ............... Generate OpenSSL configuration file for certificate signing request generation - crt-info crt ...................... Print info from certificate - hpkp-gen csr backup ............... Generate HTTP public key pinning (HPKP) header from CSR file - hpkp-gen key backup ............... Generate HTTP public key pinning (HPKP) header from KEY file - hpkp-gen crt backup ............... Generate HTTP public key pinning (HPKP) header from CRT file - ocsp-gen server-cert issuer-cert .. Generate OCSP stapling file from server certificate - ocsp-gen cert-chain ............... Generate OCSP stapling file from server certificate chain - ocsp-check host server-name ....... Check OCSP response status for some host - 0rtt-check host server-name ....... Check 0-RTT support - htpasswd user password ............ Generate record with MD5 password hash for .htpasswd files - Options - --ecc, -E ........ Generate ECC certificate signing request - --size, -S size .. Key size (ECC: 256-384 / RSA: 2048-8192) - --no-color, -nc .. Disable colors in output - --help, -h ....... Show this help message - --version, -v .... Show information about version - Examples + Usage: web-utils command args… + Commands + csr-gen host ...................... Generate key and a certificate signing request + csr-gen config .................... Generate key and a certificate signing request from OpenSSL configuration file + csr-info csr ...................... Print info from certificate signing request + csr-config-gen host ............... Generate OpenSSL configuration file for certificate signing request generation + crt-info crt ...................... Print info from certificate + hpkp-gen csr backup ............... Generate HTTP public key pinning (HPKP) header from CSR file + hpkp-gen key backup ............... Generate HTTP public key pinning (HPKP) header from KEY file + hpkp-gen crt backup ............... Generate HTTP public key pinning (HPKP) header from CRT file + ocsp-gen server-cert issuer-cert .. Generate OCSP stapling file from server certificate + ocsp-gen cert-chain ............... Generate OCSP stapling file from server certificate chain + ocsp-check host server-name ....... Check OCSP response status for some host + 0rtt-check host server-name ....... Check 0-RTT support + htpasswd user password ............ Generate record with MD5 password hash for .htpasswd files + Options + --ecc, -E ........ Generate ECC certificate signing request + --size, -S size .. Key size (ECC: 256-384 / RSA: 2048-8192) + --no-color, -nc .. Disable colors in output + --help, -h ....... Show this help message + --version, -v .... Show information about version + Examples web-utils csr-gen domain.com - Generate RSA key and a certificate signing request for domain.com + Generate RSA key and a certificate signing request for domain.com web-utils hpkp-gen domain.com.csr domain.com.backup.key - Generate HTTP public key pinning (HPKP) header with server and backup pins + Generate HTTP public key pinning (HPKP) header with server and backup pins web-utils ocsp-gen sever.crt issuer.crt - Generate OCSP stapling file using server and issuer certificates + Generate OCSP stapling file using server and issuer certificates web-utils ocsp-gen sever-chain.crt - Generate OCSP stapling file using certificate chain + Generate OCSP stapling file using certificate chain web-utils ocsp-check essentialkaos.com - Check OCSP response status for essentialkaos.com + Check OCSP response status for essentialkaos.com - + diff --git a/README.md b/README.md index 22f2b4e..4cabc96 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

-

InstallationUsageBuild StatusLicense

+

InstallationUsageCI StatusLicense


@@ -13,7 +13,7 @@ ### Installation -#### From ESSENTIAL KAOS Public repository +#### From [ESSENTIAL KAOS Public Repository](https://kaos.sh/kaos-repo) ``` 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 @@ -60,7 +60,7 @@ docker run --rm -it -v "$(pwd):/data" ghcr.io/essentialkaos/web-utils:latest # p -### Build Status +### CI Status | Branch | Status | |--------|--------|