From ad4b3e41fe494a1198929b90cf18ff30cf0b10ac Mon Sep 17 00:00:00 2001 From: Paul Rock Date: Tue, 30 Jan 2018 19:59:33 +0300 Subject: [PATCH] server scripts written on bash was moved to different folder --- .env.example | 5 +++-- {scripts/installation => configs}/server.conf | 17 +++++++++-------- .../scripts => auth-bash}/config.sh | 0 .../scripts => auth-bash}/connect.sh | 0 .../scripts => auth-bash}/disconnect.sh | 0 .../scripts => auth-bash}/functions.sh | 0 .../scripts => auth-bash}/login.sh | 0 7 files changed, 12 insertions(+), 10 deletions(-) rename {scripts/installation => configs}/server.conf (91%) rename scripts/{installation/scripts => auth-bash}/config.sh (100%) rename scripts/{installation/scripts => auth-bash}/connect.sh (100%) rename scripts/{installation/scripts => auth-bash}/disconnect.sh (100%) rename scripts/{installation/scripts => auth-bash}/functions.sh (100%) rename scripts/{installation/scripts => auth-bash}/login.sh (100%) diff --git a/.env.example b/.env.example index 3a2c2c5..24ccfbd 100644 --- a/.env.example +++ b/.env.example @@ -10,12 +10,13 @@ DB_PASS=openvpn_pass # OpenVPN settings VPN_CONF=/etc/openvpn -VPN_ADDR=localhost +VPN_LOCAL=192.168.1.2 +VPN_REMOTE=172.10.12.15 VPN_PORT=1194 VPN_PROTO=tcp -VPN_GROUP=nogroup VPN_INIF=tun0 VPN_OUTIF=eth0 +VPN_SERVER="10.8.0.0 255.255.255.0" VPN_NET=10.8.0.0/24 # OpenVPN key parameters diff --git a/scripts/installation/server.conf b/configs/server.conf similarity index 91% rename from scripts/installation/server.conf rename to configs/server.conf index 8ce7bc1..a2c5ee0 100644 --- a/scripts/installation/server.conf +++ b/configs/server.conf @@ -2,9 +2,9 @@ # TCP or UDP, port 443, tunneling mode server -proto tcp -port 443 -dev tun +proto VPN_PROTO +port VPN_PORT +dev VPN_INIF ## KEY, CERTS AND NETWORK CONFIGURATION ## # Identity @@ -23,7 +23,7 @@ cipher AES-256-CBC # Network # Subnetwork, the server will be the 10.8.0.1 and clients will take the other ips -server 10.8.0.0 255.255.255.0 +server VPN_SERVER # Redirect all IP network traffic originating on client machines to pass through the OpenVPN server push "redirect-gateway def1" @@ -81,10 +81,11 @@ script-security 3 username-as-common-name # Client certificate is not required verify-client-cert none -# Use the connection script when a user wants to login -auth-user-pass-verify scripts/login.sh via-env # Maximum of clients max-clients 50 + +# Use the connection script when a user wants to login +auth-user-pass-verify SCRIPTS_LOGIN via-env # Run this scripts when the client connects/disconnects -client-connect scripts/connect.sh -client-disconnect scripts/disconnect.sh +client-connect SCRIPTS_CONNECT +client-disconnect SCRIPTS_DISCONNECT diff --git a/scripts/installation/scripts/config.sh b/scripts/auth-bash/config.sh similarity index 100% rename from scripts/installation/scripts/config.sh rename to scripts/auth-bash/config.sh diff --git a/scripts/installation/scripts/connect.sh b/scripts/auth-bash/connect.sh similarity index 100% rename from scripts/installation/scripts/connect.sh rename to scripts/auth-bash/connect.sh diff --git a/scripts/installation/scripts/disconnect.sh b/scripts/auth-bash/disconnect.sh similarity index 100% rename from scripts/installation/scripts/disconnect.sh rename to scripts/auth-bash/disconnect.sh diff --git a/scripts/installation/scripts/functions.sh b/scripts/auth-bash/functions.sh similarity index 100% rename from scripts/installation/scripts/functions.sh rename to scripts/auth-bash/functions.sh diff --git a/scripts/installation/scripts/login.sh b/scripts/auth-bash/login.sh similarity index 100% rename from scripts/installation/scripts/login.sh rename to scripts/auth-bash/login.sh