Skip to content

Commit

Permalink
Try to add support for AL2 vpn
Browse files Browse the repository at this point in the history
  • Loading branch information
jawadqur committed Feb 16, 2024
1 parent 9fe369e commit b62e0b2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions files/openvpn_management_scripts/create_ovpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ set -e
set -u


USER_CERT_PATH="$KEY_PATH/$1.crt"
USER_KEY_PATH="$KEY_PATH/$1.key"
USER_CERT_PATH="$KEY_PATH/issued/$1.crt"
USER_KEY_PATH="$KEY_PATH/private/$1.key"


#HEADER
Expand Down
4 changes: 2 additions & 2 deletions files/openvpn_management_scripts/create_seperated_vpn_zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ username=${username// /_}
# now, clean out anything that's not alphanumeric or an underscore
username=${username//[^a-zA-Z0-9_-.]/}

USER_CERT_PATH="$KEY_PATH/$1.crt"
USER_KEY_PATH="$KEY_PATH/$1.key"
USER_CERT_PATH="$KEY_PATH/issued/$1.crt"
USER_KEY_PATH="$KEY_PATH/private/$1.key"

#make a temp dir
TEMP_NAME="$username-$CLOUD_NAME-seperated"
Expand Down
13 changes: 8 additions & 5 deletions files/openvpn_management_scripts/create_vpn_user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@ export KEY_EMAIL=$email
export KEY_ALTNAMES="DNS:${KEY_CN}"

#This create the key's for the road warrior
echo -e "running ${YELLOW} build-batch-key"
build-key-batch $username &>/dev/null && echo -e "${GREEN}success!" || echo -e "${RED}failure";echo -e $CLEAR
echo -e "running ${YELLOW} easyrsa build-client-full"
(
cd $EASYRSA_PATH
easyrsa build-client-full $username nopass &>/dev/null && echo -e "${GREEN}success!" || echo -e "${RED}failure";echo -e $CLEAR
)
#&& echo -e "${GREEN}success!" || echo -e "${RED}failure";echo -e $CLEAR

echo "Backup certs so we can revoke them if ever needed"
[ -d $KEY_DIR/user_certs/ ] || mkdir $KEY_DIR/user_certs/
cp $KEY_DIR/$username.crt $KEY_DIR/user_certs/$username.crt-$(date +%F-%T) && echo -e "${GREEN}success!" || echo -e "${RED}failure";echo -e $CLEAR
# echo "Backup certs so we can revoke them if ever needed"
# [ -d $KEY_DIR/user_certs/ ] || mkdir $KEY_DIR/user_certs/
# cp $KEY_DIR/$username.crt $KEY_DIR/user_certs/$username.crt-$(date +%F-%T) && echo -e "${GREEN}success!" || echo -e "${RED}failure";echo -e $CLEAR

echo "Create the OVPN file for $username"
$VPN_BIN_ROOT/create_ovpn.sh $KEY_CN $KEY_EMAIL > $KEY_DIR/ovpn_files/${username}-${CLOUD_NAME}.ovpn 2> /dev/null && echo -e "${GREEN}success!" || echo -e "${RED}failure";echo -e $CLEAR
Expand Down
3 changes: 2 additions & 1 deletion flavors/vpn_nlb_central/vpnvm_new.sh
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ build_PKI() {
./easyrsa build-ca nopass
./easyrsa gen-dh
./easyrsa gen-crl
./easyrsa gen-req $VPN_NLB_NAME.planx-pla.net nopass
./easyrsa build-server-full $VPN_NLB_NAME.planx-pla.net nopass
# ./easyrsa gen-req $VPN_NLB_NAME.planx-pla.net nopass
openvpn --genkey --secret ta.key
mv ta.key $EASYRSA_PATH/pki/ta.key

Expand Down

0 comments on commit b62e0b2

Please sign in to comment.