From 39650c2122aadf4f6db82d3a90ef069a884df51e Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Tue, 30 Dec 2025 00:34:27 -0600 Subject: [PATCH] tweaked output --- scripts/setup_wizard.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/scripts/setup_wizard.sh b/scripts/setup_wizard.sh index d38ae6c..813ee89 100755 --- a/scripts/setup_wizard.sh +++ b/scripts/setup_wizard.sh @@ -141,25 +141,21 @@ else log_success "Step CA installed\n" fi - -# 1. Collect Inputs -# Example: get_input "CERT_DIR" "Enter directory for certificates" "/var/lib/tls" "false" get_input "CERT_FILENAME" "Name for cert file" "cert.pem" "false" get_input "KEY_FILENAME" "Name for private key" "key.pem" "false" -# These need to get set so that they get filled into the service correctly. -export CERT_LOCATION=$(readlink -f ${CERT_DIR}/$CERT_FILENAME) -export KEY_LOCATION=$(readlink -f ${CERT_DIR}/$KEY_FILENAME) - -# 2. Confirm -confirm_inputs "CERT_LOCATION" "KEY_LOCATION" - if [ ! -e "$CERT_DIR" ]; then (umask 077; mkdir -p "${CERT_DIR}") log_info "Created ${CERT_DIR}" fi +# These need to get set so that they get filled into the service correctly. +export CERT_LOCATION=$(readlink -f ${CERT_DIR}/$CERT_FILENAME) +export KEY_LOCATION=$(readlink -f ${CERT_DIR}/$KEY_FILENAME) + +confirm_inputs "CERT_LOCATION" "KEY_LOCATION" + if [ ! -e "${CERT_DIR}/root_ca.crt" ]; then step ca root "${CERT_DIR}/root_ca.crt" fi @@ -175,18 +171,23 @@ if [ ! -f "$CERT_LOCATION" ] || [ ! -f "$KEY_LOCATION" ]; then --provisioner admin fi -# 3. Configure +echo "Cert information:" +echo "-----------------------------" +openssl x509 -noout -subject -issuer -ext extendedKeyUsage -ext subjectAltName -enddate -in "$CERT_LOCATION" + SERVICE_FILE="cert-renewer.service" TIMER_FILE="cert-renewer.timer" REPO_URL_BASE=https://gitea.john-stream.com/john/soteria/raw/branch/main/ SERVICE_TEMPLATE_URL="${REPO_URL_BASE}systemd/${SERVICE_FILE}" TIMER_TEMPLATE_URL="${REPO_URL_BASE}systemd/${TIMER_FILE}" -# 3. Execute -# echo "Configuring $HOST_NAME..." +echo "Installing rotation services" +echo "-----------------------------" install_unit ${SERVICE_TEMPLATE_URL} install_unit ${TIMER_TEMPLATE_URL} +echo "Reloading services" +echo "-----------------------------" systemctl daemon-reload systemctl enable --now "${TIMER_FILE}" "${SERVICE_FILE}" systemctl list-unit-files $SERVICE_FILE $TIMER_FILE