Compare commits
36 Commits
1.3.0
...
master_myf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a4403f595 | ||
|
|
d274323de8 | ||
|
|
cbf0f5a78a | ||
|
|
dd8bdad9fa | ||
|
|
274aa4bd91 | ||
|
|
f055b7c69a | ||
|
|
3b37a0a4aa | ||
|
|
c8496ebd12 | ||
|
|
2e75787914 | ||
|
|
f5afd835fc | ||
|
|
b24e0b2244 | ||
|
|
dd26146dc1 | ||
|
|
db03e844c1 | ||
|
|
590f04c82d | ||
|
|
51ef23df46 | ||
|
|
681fe2b58c | ||
|
|
76eacf55fa | ||
|
|
6af9492d59 | ||
|
|
53c4d6c0dc | ||
|
|
aa7bbd6a4c | ||
|
|
7800953960 | ||
|
|
1fc4581106 | ||
|
|
081447008c | ||
|
|
24ff5a8687 | ||
|
|
a55574ac9b | ||
|
|
9c736b4804 | ||
|
|
3efa16e19e | ||
|
|
c4d2bab59c | ||
|
|
05878ea230 | ||
|
|
809dc19c80 | ||
|
|
35f38ec86c | ||
|
|
a642a01029 | ||
|
|
5654b6d0b2 | ||
|
|
b34644c729 | ||
|
|
c9d7537387 | ||
|
|
8aab3c7dd2 |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Created from https://github.com/YunoHost/example_ynh/blob/master/.gitignore
|
||||
*~
|
||||
*.sw[op]
|
||||
14
.travis.yml
Normal file
14
.travis.yml
Normal 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"
|
||||
35
CHANGES.md
35
CHANGES.md
@@ -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
|
||||
|
||||
@@ -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,}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -42,4 +42,3 @@ bash ./upgrade
|
||||
|
||||
sudo rm -r "${tmpdir}/"
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -87,5 +87,3 @@ ynh_systemctl reload php5-fpm
|
||||
ynh_systemctl reload nginx
|
||||
|
||||
ynh_systemctl restart ynh-vpnclient
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user