From d899c3ba8e1a17adb3b271b26bc87c227b40b52d Mon Sep 17 00:00:00 2001 From: casjay Date: Tue, 11 Oct 2022 16:08:50 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/ca-install.sh | 17 ++++++++++------- bin/ca-revoke.sh | 4 +++- bin/entrypoint-ssl-ca.sh | 16 ++++++++-------- bin/mydomains.sh | 4 ++++ bin/server-setup.sh | 4 ++++ bin/setup-dh.sh | 4 ++++ 6 files changed, 33 insertions(+), 16 deletions(-) diff --git a/bin/ca-install.sh b/bin/ca-install.sh index 76c6cc5..2666cfc 100644 --- a/bin/ca-install.sh +++ b/bin/ca-install.sh @@ -14,17 +14,20 @@ # @Resource : # @sudo/root : no # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Set bash options +[ -n "$DEBUG" ] && set -x +set -o pipefail +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - APPNAME="$(basename "$0")" VERSION="202207112331-git" USER="${SUDO_USER:-${USER}}" HOME="${USER_HOME:-${HOME}}" SRC_DIR="${BASH_SOURCE%/*}" -SSL_DIR="${MY_SSL_HOME:-$(cd "$SRC_DIR/../CA" && echo "$PWD" || exit 1)}" +SSL_DIR="${MY_SSL_HOME:-$SSL_DIR}" SSL_SYS_DIR="${SSL_DIR}" +[ -n "$SSL_DIR" ] || SSL_DIR="/config/ssl" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Set bash options -if [[ "$1" == "--debug" ]]; then shift 1 && set -xo pipefail && export SCRIPT_OPTS="--debug" && export _DEBUG="on"; fi -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -cd "$SSL_DIR/.." || exit 1 -sudo mkdir -p "$SSL_SYS_DIR" -sudo rsync -avhP "." "$SSL_SYS_DIR/" +mkdir -p "$SSL_SYS_DIR" "$SSL_DIR" +cd "$SSL_DIR" +[ "$SSL_DIR" = "$SSL_SYS_DIR" ] || rsync -avhP "$SSL_DIR/." "$SSL_SYS_DIR/" + diff --git a/bin/ca-revoke.sh b/bin/ca-revoke.sh index f485bfa..b6e79ee 100644 --- a/bin/ca-revoke.sh +++ b/bin/ca-revoke.sh @@ -19,11 +19,13 @@ VERSION="202207112331-git" USER="${SUDO_USER:-${USER}}" HOME="${USER_HOME:-${HOME}}" SRC_DIR="${BASH_SOURCE%/*}" -SSL_DIR="${MY_SSL_HOME:-$(cd "$SRC_DIR/../CasjaysDev" && echo "$PWD" || exit 1)}" +SSL_DIR="${MY_SSL_HOME:-$SSL_DIR}" REVOKE_FILE="revoke.crl" +[ -n "$SSL_DIR" ] || SSL_DIR="/config/ssl" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mkdir -p "$SSL_DIR" "$SSL_DIR/crl" "$SSL_DIR/private" "$SSL_DIR/certs" "$SSL_DIR/p12" "$SSL_DIR/requests" cd "$SSL_DIR" || exit 1 [[ -f "$SSL_DIR/certs/ca.crt" ]] || "$SRC_DIR/ca-setup.sh" openssl ca -config "$SSL_DIR/openssl.cnf" -gencrl -keyfile $SSL_DIR/private/ca.key -cert $SSL_DIR/certs/ca.crt -out "$SSL_DIR/crl/$REVOKE_FILE" -passin file:$SSL_DIR/passwd openssl crl -inform PEM -in "$SSL_DIR/crl/revoke.crl.pem" -outform DER -out "$SSL_DIR/crl/$REVOKE_FILE" + diff --git a/bin/entrypoint-ssl-ca.sh b/bin/entrypoint-ssl-ca.sh index 0261fa6..7a7fb3e 100755 --- a/bin/entrypoint-ssl-ca.sh +++ b/bin/entrypoint-ssl-ca.sh @@ -8,22 +8,22 @@ # @Copyright : Copyright: (c) 2022 Jason Hempstead, Casjays Developments # @Created : Monday, Jul 11, 2022 23:39 EDT # @File : entrypoint-ssl-ca.sh -# @Description : -# @TODO : -# @Other : -# @Resource : +# @Description : +# @TODO : +# @Other : +# @Resource : # @sudo/root : no # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Set bash options +[ -n "$DEBUG" ] && set -x +set -o pipefail +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - APPNAME="$(basename "$0" 2>/dev/null)" VERSION="202207112339-git" HOME="${USER_HOME:-$HOME}" USER="${SUDO_USER:-$USER}" RUN_USER="${SUDO_USER:-$USER}" SRC_DIR="${BASH_SOURCE%/*}" -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Set bash options -if [[ "$1" == "--debug" ]]; then shift 1 && set -xo pipefail && export SCRIPT_OPTS="--debug" && export _DEBUG="on"; fi - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Set functions __exec_bash() { diff --git a/bin/mydomains.sh b/bin/mydomains.sh index 398515d..5df8ae3 100644 --- a/bin/mydomains.sh +++ b/bin/mydomains.sh @@ -14,6 +14,10 @@ # @Resource : # @sudo/root : no # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Set bash options +[ -n "$DEBUG" ] && set -x +set -o pipefail +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - APPNAME="$(basename "$0")" VERSION="202207112331-git" USER="${SUDO_USER:-${USER}}" diff --git a/bin/server-setup.sh b/bin/server-setup.sh index 7a17e24..ebb5827 100644 --- a/bin/server-setup.sh +++ b/bin/server-setup.sh @@ -14,6 +14,10 @@ # @Resource : # @sudo/root : no # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Set bash options +[ -n "$DEBUG" ] && set -x +set -o pipefail +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - APPNAME="$(basename "$0")" VERSION="202207112331-git" USER="${SUDO_USER:-${USER}}" diff --git a/bin/setup-dh.sh b/bin/setup-dh.sh index 4dd3794..170b275 100644 --- a/bin/setup-dh.sh +++ b/bin/setup-dh.sh @@ -14,6 +14,10 @@ # @Resource : # @sudo/root : no # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Set bash options +[ -n "$DEBUG" ] && set -x +set -o pipefail +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - APPNAME="$(basename "$0")" VERSION="202207112331-git" USER="${SUDO_USER:-${USER}}"