36 Commits

Author SHA1 Message Date
pitchum
0a4403f595 [enh] Purge apt dependencies on remove. 2018-10-12 08:13:42 +02:00
pitchum
d274323de8 [fix] Create a dedicated system user with proper sudo permissions.
Ref. #41.
2018-10-12 08:13:31 +02:00
pitchum
cbf0f5a78a [wip] Disabling backup and restore scripts (temporarily). 2018-09-14 07:02:08 +02:00
pitchum
dd8bdad9fa [mod] Release v1.2.1 2018-09-10 15:41:33 +02:00
pitchum
274aa4bd91 [fix] user/group = www-data in php-fpm config. 2018-09-10 15:40:07 +02:00
pitchum
f055b7c69a [mod] Release v1.2.0 2018-09-10 14:16:03 +02:00
pitchum
3b37a0a4aa [fix] upgrade script sets 'final_path' setting. 2018-08-31 10:21:58 +02:00
pitchum
c8496ebd12 Removed hard-coded "vpnadmin" string. 2018-08-31 10:21:58 +02:00
pitchum
2e75787914 Rewriting packages scripts. backup (WIP). 2018-08-31 10:21:58 +02:00
pitchum
f5afd835fc Moar experimental helpers needed. 2018-08-31 10:21:58 +02:00
pitchum
b24e0b2244 Bugfix: revert changes not compatible with stable yunohost. 2018-08-31 10:21:58 +02:00
pitchum
dd26146dc1 Add missing helpers.
- read_json
- read_manifest
- abort_if_up_to_date
2018-08-31 10:21:58 +02:00
pitchum
db03e844c1 [mod] upgrade, disable auto-backup/restore 2018-08-31 10:21:58 +02:00
pitchum
590f04c82d [fix] Do not start vpnclient service on first install. 2018-08-31 10:21:58 +02:00
pitchum
51ef23df46 [mod] install and upgrade scripts share some common code. 2018-08-31 10:21:58 +02:00
pitchum
681fe2b58c [mod] backup script rewritten (inspired and adpated from example_ynh).
Currently neither backup nor restore are useful but are safe enough to
not break the upgrade script. That's what matters for now.
2018-08-31 10:21:58 +02:00
pitchum
76eacf55fa [fix] upgrade script renames paths to comply with the new ones. 2018-08-31 10:21:58 +02:00
pitchum
6af9492d59 [mod] upgrade script simplified: does nothing except a backup. 2018-08-31 10:21:58 +02:00
pitchum
53c4d6c0dc [mod] Hard-coded occurrences of "vpnadmin" replaced with ${app} (where appropriate). 2018-08-31 10:21:58 +02:00
pitchum
aa7bbd6a4c [mod] Created file check_process for driving CI builds. 2018-08-29 10:40:12 +02:00
pitchum
7800953960 [fix] upgrade script requires some helpers.
```
Warning: Upgrading app vpnclient...
Warning: ./upgrade: line 35: ynh_abort_if_up_to_date: command not found
Warning: !!
Warning:   vpnclient's script has encountered an error. Its execution was cancelled.
Warning: !!
Warning:
Error: Unable to upgrade vpnclient
```
2018-08-25 19:24:31 +02:00
ljf (zamentur)
1fc4581106 [fix] Sync the date with http if ntp can't (#37)
* [fix] Sync the date with http if ntp can't
2018-06-13 11:30:43 +02:00
ljf (zamentur)
081447008c [fix] Let VPN mount (#38) 2018-05-22 09:43:35 +02:00
Bastien
24ff5a8687 travis improvement
with manifest check JSON
2018-05-13 12:33:59 +02:00
agentcobra
a55574ac9b Update README.md
add integration from jenkins
2018-05-13 11:48:07 +02:00
Sebastien Badia
9c736b4804 doc: s/NextCloud/LaBriqueInterNet VPNclient/ thx agentcorba 2018-05-13 11:38:27 +02:00
Sebastien Badia
3efa16e19e doc: Update syntax (badges) 2018-05-13 11:25:37 +02:00
Sebastien Badia
c4d2bab59c doc: Added install badge 2018-05-13 11:22:56 +02:00
agentcobra
05878ea230 Merge pull request #34 from keomabrun/master
using new helpers and script formatting
2018-04-25 20:18:55 +02:00
Keoma Brun
809dc19c80 using new helpers and script formatting 2018-04-09 16:11:08 +02:00
ljf (zamentur)
35f38ec86c [enh] Update version number 2018-04-08 13:55:09 +02:00
ljf (zamentur)
a642a01029 [fix] Add fake-hwclock to avoid RTC 1970 date
A20 Allwinner seems to have a RTC but i think this one can't work when the board is shutdown (during several minutes/hours/days ?).  This package register the last date and set it early in the boot process.
2018-04-08 13:55:09 +02:00
ljf (zamentur)
5654b6d0b2 [fix] ntpd blocked cause firewall to strict 2018-04-08 13:54:28 +02:00
agentcobra
b34644c729 Update upgrade
quick fix for ci building failling
2018-04-06 13:09:02 +02:00
Sebastien Badia
c9d7537387 cr: Update notifications settings 2018-03-23 10:29:24 +01:00
agentcobra
8aab3c7dd2 Package improvement (#31)
* fix manifest

* fix tabs

* add Services section in manifest

* Fix invalid JSON
open an issue https://dev.yunohost.org/issues/1097

* fix "Impossible de satisfaire les pré-requis pour vpnclient : Paquet «
yunohost-moulinette » inconnu"

* finalisation manifest.json et harmonisation avec
https://yunohost.org/#/packaging_apps_manifest_fr

* ajout de du CI avec .travis.yml

* Update README.md

* lifting manifest.json

* remove exit 0 from scrits and add .gitignore

* fix lint error with exit

* fix #31

* refix #31
2018-03-23 09:23:57 +01:00
16 changed files with 32 additions and 132 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
# Created from https://github.com/YunoHost/example_ynh/blob/master/.gitignore
*~
*.sw[op]

14
.travis.yml Normal file
View File

@@ -0,0 +1,14 @@
language: python
before_script:
- git clone --depth 1 git://github.com/YunoHost/package_linter ../package_linter && cd ../package_linter
- mv ../vpnclient_ynh vpnclient_ynh
script:
- python -m json.tool vpnclient_ynh/manifest.json
- ./package_linter.py vpnclient_ynh
notifications:
email: false
irc:
on_success: always
on_failure: always
channels:
- "irc.geeknode.org#labriqueinter.net-dev"

View File

@@ -1,35 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is (partially) based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## Unreleasead
## 1.3.0 - 2018-12-02
- [fix] Create a dedicated system user with proper sudo permissions. (#41)
- [fix] CSRF vulnerability (#43)
## 1.2.1 - 2018-09-10
- [fix] user/group = www-data in php-fpm config.
## 1.2.0 - 2018-09-06
- [fix] upgrade script is now functional
- [mod] lots of refactoring to apply app packaging best-practices
## 1.1.1 - 2018-04-06
- [fix] Sync the date with http if ntp can't (#37)
## 0.0.0 - 2016-05-14
First release

View File

@@ -132,7 +132,7 @@ start_openvpn() {
# Unset firewall to let DNS and NTP resolution works
# Firewall is reset after vpn is mounted (more details on #1016)
unset_firewall
sync_time
cp /etc/openvpn/client.conf{.tpl,}

View File

@@ -96,7 +96,7 @@ fi
# Upload cube file
output=$(curl -kL -H "X-Requested-With: yunohost-config" -F "service_enabled=${ynh_service_enabled}" -F _method=put -F "cubefile=@${cubefile_path}" "https://${ynh_domain}/${ynh_path}/?/settings" --resolve "${ynh_domain}:443:127.0.0.1" -b "${tmpdir}/cookies" 2> /dev/null | grep RETURN_MSG | sed 's/<!-- RETURN_MSG -->//' | sed 's/<\/?[^>]\+>//g' | sed 's/^ \+//g')
output=$(curl -kL -F "service_enabled=${ynh_service_enabled}" -F _method=put -F "cubefile=@${cubefile_path}" "https://${ynh_domain}/${ynh_path}/?/settings" --resolve "${ynh_domain}:443:127.0.0.1" -b "${tmpdir}/cookies" 2> /dev/null | grep RETURN_MSG | sed 's/<!-- RETURN_MSG -->//' | sed 's/<\/?[^>]\+>//g' | sed 's/^ \+//g')
# Configure IPv6 Delegated Prefix on Hotspot

View File

@@ -1,24 +1,23 @@
{
"name": "VPN Client",
"id": "vpnclient",
"version": "1.3.0",
"version": "1.2.1",
"packaging_format": 1,
"description": {
"en": "VPN Client",
"fr": "Client VPN"
},
"license": "AGPL-3",
"url": "https://github.com/labriqueinternet/vpnclient_ynh",
"license": "AGPL-3.0",
"maintainer": {
"name": "pitchum",
"email": "pitchum@users.noreply.github.com"
},
"multi_instance": false,
"requirements": {
"yunohost": ">= 2.2.0",
"moulinette": ">= 2.4.0"
},
"multi_instance": false,
"services": [
"nginx",
"php5-fpm",

View File

@@ -78,5 +78,3 @@ ynh_backup "/etc/systemd/system/ynh-vpnclient-checker.service"
ynh_backup "/etc/systemd/system/ynh-vpnclient-checker.timer"
ynh_backup "/etc/cron.d/$app"
exit 0

View File

@@ -1,39 +0,0 @@
#!/bin/bash
source /usr/share/yunohost/helpers
#
# Helper to start/stop/.. a systemd service from a yunohost context,
# *and* the systemd service itself needs to be able to run yunohost
# commands.
#
# Hence the need to release the lock during the operation
#
# usage : ynh_systemctl yolo restart
#
function ynh_systemctl()
{
local ACTION="$1"
local SERVICE="$2"
local LOCKFILE="/var/run/moulinette_yunohost.lock"
# Launch the action
sudo systemctl "$ACTION" "$SERVICE" &
local SYSCTLACTION=$!
# Save and release the lock...
cp $LOCKFILE $LOCKFILE.bkp.$$
rm $LOCKFILE
# Wait for the end of the action
wait $SYSCTLACTION
# Make sure the lock is released...
while [ -f $LOCKFILE ]
do
sleep 0.1
done
# Restore the old lock
mv $LOCKFILE.bkp.$$ $LOCKFILE
}

View File

@@ -1,19 +1,19 @@
#!/bin/bash
# VPN Client app for YunoHost
# VPN Client app for YunoHost
# Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
# Contribute at https://github.com/labriqueinternet/vpnclient_ynh
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -105,4 +105,3 @@ sudo systemctl enable ynh-vpnclient-checker.timer
sudo yunohost app ssowatconf
exit 0

View File

@@ -1,8 +0,0 @@
# Source me
# Check YunoHost version (firewall hook in Moulinette)
ynh_version=$(sudo dpkg -l yunohost | grep ii | awk '{ print $3 }' | sed 's/\.//g')
if [ "${ynh_version}" -lt 240 ]; then
echo "WARN: You need a YunoHost's version equals or greater than 2.4.0 for activating the firewalling" >&2
fi

View File

@@ -68,6 +68,3 @@ sudo rm -rf /var/www/${app}/
# Removed system user
ynh_system_user_delete ${app}
sudo rm -f /etc/sudoers.d/${app}_ynh
exit 0

View File

@@ -42,4 +42,3 @@ bash ./upgrade
sudo rm -r "${tmpdir}/"
exit 0

View File

@@ -87,5 +87,3 @@ ynh_systemctl reload php5-fpm
ynh_systemctl reload nginx
ynh_systemctl restart ynh-vpnclient
exit 0

View File

@@ -117,11 +117,6 @@ dispatch('/', function() {
});
dispatch_put('/settings', function() {
if(!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
throw new Exception('CSRF protection');
}
$service_enabled = isset($_POST['service_enabled']) ? 1 : 0;
if($service_enabled == 1) {

View File

@@ -28,7 +28,7 @@ function tabsClick() {
return false;
}
function ready() {
$(document).ready(function() {
$('.btn-group').button();
$('[data-toggle="tooltip"]').tooltip();
@@ -73,29 +73,11 @@ function ready() {
$(choosertxtid).val($(this).val().replace(/^.*[\/\\]/, ''));
});
$('#form').on("submit", function(event) {
event.preventDefault()
$('#save').prop('disabled', true);
$('#save').click(function() {
$(this).prop('disabled', true);
$('#save-loading').show();
$.ajax({
url: this.action,
type: this.method,
contentType: false,
processData: false,
cache: false,
data: new FormData(this),
headers: {
'X-Requested-With': 'jQuery',
},
timeout: 5000,
dataType: "html",
// success: function() {}, // XXX will never happen because the VPN connection will be restarted after the form is posted.
complete: function() {
console.log("Forcing page reload after a few seconds...");
setTimeout(function() {document.location.reload();}, 45000)
},
});
})
$('#form').submit();
});
$('#status .close').click(function() {
$(this).parent().hide();
@@ -128,6 +110,4 @@ function ready() {
$('.enabled').show('slow');
}
});
}
$(document).ready(ready)
});

View File

@@ -200,7 +200,7 @@
<div class="form-group">
<label for="login_passphrase" class="col-sm-3 control-label"><?= _('Password') ?></label>
<div class="col-sm-9">
<input type="password" data-toggle="tooltip" data-title="<?= _('Leave empty if not necessary') ?>" class="form-control" name="login_passphrase" id="login_passphrase" placeholder="XVCwSbDkxnqQ" value="<?= $login_passphrase ?>" />
<input type="text" data-toggle="tooltip" data-title="<?= _('Leave empty if not necessary') ?>" class="form-control" name="login_passphrase" id="login_passphrase" placeholder="XVCwSbDkxnqQ" value="<?= $login_passphrase ?>" />
</div>
</div>
</div>