From ce9b8dfffcfea8d825f27b203140fe2f14622c75 Mon Sep 17 00:00:00 2001 From: IcedComputer <31418197+IcedComputer@users.noreply.github.com> Date: Wed, 19 Jun 2019 15:48:46 -0700 Subject: [PATCH] Leverage the Hostname of the Server Historic versions leveraged a format of "server_$UUID" to name of the VPN server certificate for X509 verification. This seems very impersonal. The new code pulls the existing hostname of the machines and appends the 16 character UUID. The new format is $hostname_$UUID. Example: A machine named "Martian" with a UUID of 1234567890123456 would change from server_1234567890123456 to Martian_1234567890123456 --- auto_install/install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 59a3c3b..4cd6730 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -745,9 +745,12 @@ setCustomDomain() { } confOpenVPN() { - # Generate a random, alphanumeric identifier of 16 characters for this server so that we can use verify-x509-name later that is unique for this server installation. Source: Earthgecko (https://gist.github.com/earthgecko/3089509) + # Grab the existing Hostname + HOST_NAME=$(hostname) + # Generate a random, alphanumeric identifier of 16 characters for this server so that we can use verify-x509-name later that is unique for this server installation. Source: Earthgecko (https://gist.github.com/earthgecko/3089509) NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) - SERVER_NAME="server_${NEW_UUID}" + # Create a unique server name using the host name and UUID + SERVER_NAME="${HOST_NAME}_${NEW_UUID}" if [[ ${useUpdateVars} == false ]]; then # Ask user for desired level of encryption