Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(): tcp support #31

Merged
merged 4 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ovpn/scripts/process.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function substituteTemplateParameters() {
sed -i "s;<vpn-network>;${VPN_NETWORK};g" ${VPN_FQDN}/$file
sed -i "s;<vpn-mask>;${VPN_MASK};g" ${VPN_FQDN}/$file
sed -i "s;<vpn-cipher>;${VPN_CIPHER};g" ${VPN_FQDN}/$file
sed -i "s;<gateway-protocol>;${GATEWAY_PROTOCOL};g" ${VPN_FQDN}/$file
done
popd
log "All parameters were substituted."
Expand Down
10 changes: 10 additions & 0 deletions ovpn/scripts/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ function validateIndividualCertRequest() {
FAIL=YES
fi

if [[ -z ${GATEWAY_PROTOCOL} ]]; then
GATEWAY_PROTOCOL="udp"
else
GATEWAY_PROTOCOL=$(echo "${GATEWAY_PROTOCOL}" | tr '[:upper:]' '[:lower:]')
if [[ ${GATEWAY_PROTOCOL} != "udp" && ${GATEWAY_PROTOCOL} != "tcp" ]]; then
GATEWAY_PROTOCOL="udp"
fi
fi


if [[ "${FAIL}" == "YES" ]]; then
log "One or more required parameters were missing."
finish
Expand Down
1 change: 1 addition & 0 deletions ovpn/template/client-openvpn-combined.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tls-auth ta.key 1
cipher <vpn-cipher>
auth SHA256
tun-mtu 1300
proto <gateway-protocol>

<key>
<client-key>
Expand Down
2 changes: 1 addition & 1 deletion ovpn/template/server-openvpn.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keepalive 10 60
persist-key
persist-tun

proto udp
proto <gateway-protocol>
txqueuelen 5000
tun-mtu 1300

Expand Down