Skip to content

Commit

Permalink
More directions, handle domain as a param
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Mar 14, 2024
1 parent cf4b84f commit 69a5b8c
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions support/custom_url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -22,19 +27,32 @@ 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)"
read ACCEPT
if [[ "${ACCEPT^}" == "Y" ]]; then
xdg-open 'https://apps.nrs.gov.bc.ca/int/jira/secure/CreateIssue!default.jspa'
fi


# Follow link
#

# => Create

0 comments on commit 69a5b8c

Please sign in to comment.