From 69a5b8c60b3ad20dfe10d179a3804362860933c0 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Thu, 14 Mar 2024 10:54:17 -0700 Subject: [PATCH] More directions, handle domain as a param --- support/custom_url.sh | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/support/custom_url.sh b/support/custom_url.sh index a105bc6d4..9e40e4651 100755 --- a/support/custom_url.sh +++ b/support/custom_url.sh @@ -6,9 +6,14 @@ set -euo nounset ### Get inputs -# Vanity URL -echo "Enter the fully qualified domain name (FQDN) name for the certificate:" -read DOMAIN +# Vanity URL (DOMAIN) +if [[ -z "${1:-}" ]]; then + echo "Enter the fully qualified domain name (FQDN) name for the certificate:" + read DOMAIN +else + DOMAIN="${1}" +fi +echo "Domain: ${DOMAIN}" # Default subject SUBJECT="/C=CA/ST=British Columbia/L=Victoria/O=Government of the Province of British Columbia/CN=${DOMAIN}" @@ -22,15 +27,22 @@ if [[ "${ACCEPT^}" != "Y" ]]; then fi # Generate the key and csr -openssl req -new -newkey ed25519 -nodes -keyout ${DOMAIN}.key -out ${DOMAIN}.csr -subj "${SUBJECT}" +openssl req -new -newkey rsa:2048 -nodes -keyout ${DOMAIN}.key -out ${DOMAIN}.csr -subj "${SUBJECT}" echo -e "The following have been created:" ls -l ${DOMAIN}.{csr,key} -echo -e "\nBC Gov Only! --- \n" +echo -e "\nBC Gov Natural Resources Only! --- \n" echo "Create a JIRA issue with the following" + +echo " Project: Service Desk (SD)" +echo " Issue Type: Service Request" echo " Title: SSL Certificate Request for ${DOMAIN}" +echo " Summary: SSL Certificate Request for ${DOMAIN}" +echo " Component/s: Other - N/A - Not Applicable" +echo " Assignee: NRIDS Infrastructure and Middle Tier WLRS:EX" +echo " Teams Involved: Tier 3 - Infrastructure" echo " Description: Please create an SSL certificate for: ${DOMAIN}" -echo " Provide the generated Attach both generated files" +echo -e "=> Attach the newly generated CSR file only" # Open JIRA - optional echo "Would you like to be redirected to Natural Resources JIRA? (y/n)" @@ -38,3 +50,9 @@ read ACCEPT if [[ "${ACCEPT^}" == "Y" ]]; then xdg-open 'https://apps.nrs.gov.bc.ca/int/jira/secure/CreateIssue!default.jspa' fi + + +# Follow link +# + +# => Create