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
This commit is contained in:
IcedComputer 2019-06-19 15:48:46 -07:00 committed by GitHub
parent 33ee77d2b0
commit ce9b8dfffc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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