Some stuff

This commit is contained in:
Julien VAUBOURG 2014-11-10 22:26:56 +01:00
parent 743553bdc7
commit 0a95db6aed
5 changed files with 12 additions and 11 deletions

View File

@ -2,6 +2,7 @@
## Overview
**Warning: work in progress**
**Warning: currently, there is no checking on input parameters**
VPN Client app for [YunoHost](http://yunohost.org/).
@ -11,13 +12,12 @@ VPN Client app for [YunoHost](http://yunohost.org/).
* Useful to easily move your server anywhere.
* With the [Hotspot app for YunoHost](https://github.com/jvaubourg/hotspot_ynh), you can broadcast your VPN access by Wifi for using a clean internet connection (depending on your VPN provider) on your laptop (or those of your friends) without have to configure it.
Small computers like [Olimex](https://www.olimex.com) or [Raspberry PI](http://www.raspberrypi.org/) boxes and an USB Wifi dongle like [this one](https://www.olimex.com/Products/USB-Modules/MOD-WIFI-R5370-ANT/) are perfect for a nomade access with low power consumption.
## Features
* IPv6 compliant (with a delegated prefix)
* Port selection, with UDP or TCP
* Use native IPv6 if available for creating the tunnel
* Authentication based on certificates (and an optional login)
* IPv6 compliant (with a delegated prefix)
* Set an IPv6 from your delegated prefix (*prefix::1*) on the server, to use for the AAAA records
* Use native IPv6 if available for creating the tunnel
* The internet provider can be a 3/4G connection with tethering
* Web interface ([screenshot](https://raw.githubusercontent.com/jvaubourg/vpnclient_ynh/master/screenshot.png))

View File

@ -22,9 +22,6 @@ fi
# Install packages
sudo apt-get --assume-yes --force-yes install openvpn php5-fpm
# Install extra packages
sudo apt-get --assume-yes --force-yes install sipcalc
# Save arguments
sudo yunohost app setting vpnclient server_name -v "${server_name}"
sudo yunohost app setting vpnclient server_port -v 1194

View File

@ -37,6 +37,5 @@ fi
# Remove packets
# The yunohost policy is currently to not uninstall packets (dependency problems)
## sudo apt-get --assume-yes --force-yes remove openvpn php5-fpm
## sudo apt-get --assume-yes --force-yes remove sipcalc
exit 0

View File

@ -8,8 +8,11 @@ function moulinette_set($var, $value) {
return exec("sudo yunohost app setting vpnclient ".escapeshellarg($var)." -v ".escapeshellarg($value));
}
function restart_service() {
function stop_service() {
exec('sudo service ynh-vpnclient stop');
}
function start_service() {
exec('sudo service ynh-vpnclient start', $output, $retcode);
return $retcode;
@ -32,6 +35,8 @@ dispatch('/', function() {
dispatch_put('/settings', function() {
$ip6_net = empty($_POST['ip6_net']) ? 'none' : $_POST['ip6_net'];
stop_service();
moulinette_set('server_name', $_POST['server_name']);
moulinette_set('server_port', $_POST['server_port']);
moulinette_set('server_proto', $_POST['server_proto']);
@ -59,7 +64,7 @@ dispatch_put('/settings', function() {
move_uploaded_file($_FILES['crt_server_ca']['tmp_name'], '/etc/openvpn/keys/ca-server.crt');
}
$retcode = restart_service();
$retcode = start_service();
if($retcode == 0) {
flash('success', T_('Configuration updated and service successfully reloaded'));

View File

@ -51,7 +51,7 @@
<div class="form-group">
<label for="ip6_net" class="col-sm-3 control-label"><?= T_('Delegated prefix') ?></label>
<div class="col-sm-9">
<input type="text" data-toggle="tooltip" data-title="<?= T_('Leave empty if your internet provider is a dirty provider that does not give you a delegated prefix') ?>" class="form-control" name="ip6_net" id="ip6_net" placeholder="2001:db8:42::" value="<?= $ip6_net ?>" />
<input type="text" data-toggle="tooltip" data-title="<?= T_('Leave empty if your Internet Service Provider does not give you a delegated prefix') ?>" class="form-control" name="ip6_net" id="ip6_net" placeholder="2001:db8:42::" value="<?= $ip6_net ?>" />
</div>
</div>
</div>