2 changed files with 46 additions and 49 deletions
@ -1,28 +1,44 @@ |
|||||||
client |
<?php |
||||||
dev <?php echo $vpn_dev . "\n" ?> |
|
||||||
proto <?php echo $vpn_proto ?>-client
|
$_ovpn = new EvilFreelancer\OpenVPN(); |
||||||
remote <?php echo $vpn_remote . "\n" ?> |
|
||||||
resolv-retry infinite |
$_ovpn->dev = getenv('VPN_INIF'); |
||||||
cipher AES-256-CBC |
$_ovpn->proto = getenv('VPN_PROTO'); |
||||||
redirect-gateway |
$_ovpn->port = getenv('VPN_PORT'); |
||||||
|
$_ovpn->remote = getenv('VPN_REMOTE'); |
||||||
# Keys |
$_ovpn->resolvRetry = 'infinite'; |
||||||
ca [inline] |
$_ovpn->cipher = 'AES-256-CBC'; |
||||||
<?php echo file_get_contents("/etc/openvpn/ca.crt") . "\n" ?> |
$_ovpn->redirectGateway = true; |
||||||
tls-auth [inline] 1 |
|
||||||
<?php echo file_get_contents("/etc/openvpn/ta.key") . "\n" ?> |
$_ovpn->addCert('ca', getenv('VPN_CONF') . '/ca.crt', true) |
||||||
|
->addCert('tls-auth', getenv('VPN_CONF') . '/ta.key', true); |
||||||
key-direction 1 |
|
||||||
remote-cert-tls server |
$_ovpn->keyDirection = 1; |
||||||
auth-user-pass |
$_ovpn->remoteCertTls = 'server'; |
||||||
auth-nocache |
$_ovpn->authUserPass = true; |
||||||
|
$_ovpn->authNocache = true; |
||||||
# Security |
|
||||||
nobind |
$_ovpn->nobind = true; |
||||||
persist-key |
$_ovpn->persistKey = true; |
||||||
persist-tun |
$_ovpn->persistTun = true; |
||||||
comp-lzo |
$_ovpn->compLzo = true; |
||||||
verb 3 |
$_ovpn->verb = 3; |
||||||
|
|
||||||
# Proxy ? |
$config = $_ovpn->getClientConfig(); |
||||||
# http-proxy cache.univ.fr 3128 |
|
||||||
|
switch ($_POST['configuration_os']) { |
||||||
|
case 'gnu_linux': |
||||||
|
case 'configuration_os': |
||||||
|
$filename = 'client.conf'; |
||||||
|
break; |
||||||
|
default: |
||||||
|
$filename = 'client.ovpn'; |
||||||
|
break; |
||||||
|
} |
||||||
|
|
||||||
|
header('Content-Type:text/plain'); |
||||||
|
header("Content-Disposition: attachment; filename=$filename"); |
||||||
|
header("Pragma: no-cache"); |
||||||
|
header("Expires: 0"); |
||||||
|
|
||||||
|
die("$config"); |
Loading…
Reference in new issue