Browse Source

Some stuff

Julien VAUBOURG 10 years ago
parent
commit
0a95db6aed
5 changed files with 12 additions and 11 deletions
  1. 4 4
      README.md
  2. 0 3
      scripts/install
  3. 0 1
      scripts/remove
  4. 7 2
      sources/controller.php
  5. 1 1
      sources/views/settings.html.php

+ 4 - 4
README.md

@@ -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))

+ 0 - 3
scripts/install

@@ -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

+ 0 - 1
scripts/remove

@@ -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

+ 7 - 2
sources/controller.php

@@ -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'));

+ 1 - 1
sources/views/settings.html.php

@@ -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>