mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Merge pull request #772 from IcedComputer/patch-1
Leverage the Hostname of the Server
This commit is contained in:
commit
df41057dde
1 changed files with 6 additions and 4 deletions
|
@ -21,7 +21,6 @@ PKG_CACHE="/var/lib/apt/lists/"
|
||||||
UPDATE_PKG_CACHE="${PKG_MANAGER} update"
|
UPDATE_PKG_CACHE="${PKG_MANAGER} update"
|
||||||
PKG_INSTALL="${PKG_MANAGER} --yes --no-install-recommends install"
|
PKG_INSTALL="${PKG_MANAGER} --yes --no-install-recommends install"
|
||||||
PKG_COUNT="${PKG_MANAGER} -s -o Debug::NoLocking=true upgrade | grep -c ^Inst || true"
|
PKG_COUNT="${PKG_MANAGER} -s -o Debug::NoLocking=true upgrade | grep -c ^Inst || true"
|
||||||
|
|
||||||
PIVPN_DEPS=(openvpn git tar wget grep iptables-persistent dnsutils expect whiptail net-tools grepcidr jq)
|
PIVPN_DEPS=(openvpn git tar wget grep iptables-persistent dnsutils expect whiptail net-tools grepcidr jq)
|
||||||
|
|
||||||
### ###
|
### ###
|
||||||
|
@ -761,9 +760,12 @@ setCustomDomain() {
|
||||||
}
|
}
|
||||||
|
|
||||||
confOpenVPN() {
|
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
|
||||||
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
HOST_NAME=$(hostname -s)
|
||||||
SERVER_NAME="server_${NEW_UUID}"
|
# Generate a random UUID for this server so that we can use verify-x509-name later that is unique for this server installation.
|
||||||
|
NEW_UUID=$(</proc/sys/kernel/random/uuid)
|
||||||
|
# Create a unique server name using the host name and UUID
|
||||||
|
SERVER_NAME="${HOST_NAME}_${NEW_UUID}"
|
||||||
|
|
||||||
declare -A ECDSA_MAP=(["256"]="prime256v1" ["384"]="secp384r1" ["521"]="secp521r1")
|
declare -A ECDSA_MAP=(["256"]="prime256v1" ["384"]="secp384r1" ["521"]="secp521r1")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue