mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-19 11:20:15 +00:00
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:
parent
33ee77d2b0
commit
ce9b8dfffc
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue