7 Commits

Author SHA1 Message Date
agentcobra
4c00ff92ef Update README.md
add integration from jenkins
2018-10-02 23:41:31 +02:00
Sebastien Badia
8f2ba6cdcd doc: s/NextCloud/LaBriqueInterNet VPNclient/ thx agentcorba 2018-10-02 23:41:14 +02:00
Sebastien Badia
2e0fbfddff doc: Update syntax (badges) 2018-10-02 23:40:52 +02:00
Sebastien Badia
4aa7062213 doc: Added install badge 2018-10-02 23:40:18 +02:00
ljf (zamentur)
033abdcb69 [enh] Update version number 2018-10-02 23:35:39 +02:00
ljf (zamentur)
84a4e1a319 [fix] Sync the date with http if ntp can't (#37)
* [fix] Sync the date with http if ntp can't
2018-10-02 23:31:46 +02:00
agentcobra
8b3a04fb90 emergency fix
with 
- 5654b6d0b2
- 081447008c
- a642a01029
2018-09-10 21:50:47 +02:00
11 changed files with 47 additions and 40 deletions

3
.gitignore vendored
View File

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

View File

@@ -1,13 +0,0 @@
language: php
before_script:
- git clone --depth 1 git://github.com/YunoHost/package_linter ../package_linter && cd ../package_linter
- mv ../vpnclient_ynh vpnclient_ynh
script:
- ./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,5 +1,6 @@
# VPN Client
[![Build Status](https://travis-ci.org/labriqueinternet/vpnclient_ynh.svg?branch=master)](https://travis-ci.org/labriqueinternet/vpnclient_ynh)
# VPN Client [![Build Status](https://travis-ci.org/labriqueinternet/vpnclient_ynh.svg?branch=master)](https://travis-ci.org/labriqueinternet/vpnclient_ynh) [![Integration level](https://dash.yunohost.org/integration/vpnclient.svg)](https://ci-apps.yunohost.org/jenkins/job/vpnclient%20%28Community%29/lastBuild/consoleFull)
[![Install LaBriqueInterNet VPNclient with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=vpnclient)
## Overview
VPN Client app for [YunoHost](http://yunohost.org/).

View File

@@ -129,6 +129,10 @@ start_openvpn() {
[ "${ynh_server_proto}" == tcp ] && proto=tcp-client
fi
# 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,}
@@ -200,6 +204,20 @@ stop_openvpn() {
sync_time() {
systemctl stop ntp
timeout 20 ntpd -qg &> /dev/null
# Some networks drop ntp port (udp 123).
# Try to get the date with an http request on the internetcube web site
if [ $? -ne 0 ]; then
http_date=`curl -sD - labriqueinter.net | grep '^Date:' | cut -d' ' -f3-6`
http_date_seconds=`date -d "${http_date}" +%s`
curr_date_seconds=`date +%s`
# Set the new date if it's greater than the current date
# So it does if 1970 year or if old fake-hwclock date is used
if [ $http_date_seconds -ge $curr_date_seconds ]; then
date -s "${http_date}"
fi
fi
systemctl start ntp
}

View File

@@ -1,46 +1,34 @@
{
"name": "VPN Client",
"id": "vpnclient",
"packaging_format": 1,
"description": {
"en": "VPN Client",
"fr": "Client VPN"
},
"license": "AGPL-3",
"url": "https://github.com/labriqueinternet/vpnclient_ynh",
"version": "1.0.1",
"license": "AGPL-3.0",
"version": "1.1.1",
"maintainer": {
"name": "Julien Vaubourg",
"email": "julien@vaubourg.com",
"url": "http://julien.vaubourg.com"
},
"requirements": {
"yunohost": ">= 2.2.0",
"moulinette": ">= 2.4.0"
},
"multi_instance": false,
"services": [
"nginx",
"php5-fpm",
"ynh-vpnclient"
],
"multi_instance": "false",
"arguments": {
"install": [
"install" : [
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain for the web administration",
"fr": "Choisissez un domaine pour l'administration web"
"en": "Choose a domain for the web administration",
"fr": "Choisissez un domaine pour l'administration web"
},
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for the web administration",
"fr": "Choisissez un chemin pour l'administration web"
"en": "Choose a path for the web administration",
"fr": "Choisissez un chemin pour l'administration web"
},
"example": "/vpnadmin",
"default": "/vpnadmin"

View File

@@ -6,3 +6,4 @@ mkdir -p "${backup_dir}/"
sudo cp -a /etc/openvpn/keys/ "${backup_dir}/"
sudo cp -a /etc/openvpn/client.conf.tpl "${backup_dir}/"
exit 0

View File

@@ -26,10 +26,11 @@ url_path=${2}
if ! $upgrade; then
source ./helpers
source ./prerequisites
fi
# Check domain/path availability
ynh_webpath_register vpnclient $domain $url_path || ynh_die "problem on domain/path availability" 1
ynh_webpath_register vpnclient $domain $url_path || exit 1
# Install packages
packages='php5-fpm sipcalc dnsutils openvpn curl fake-hwclock'
@@ -149,3 +150,4 @@ fi
sudo yunohost app ssowatconf
exit 0

8
scripts/prerequisites Normal file
View File

@@ -0,0 +1,8 @@
# 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

@@ -50,3 +50,4 @@ sudo systemctl reload nginx
# Remove sources
sudo rm -rf /var/www/vpnadmin/
exit 0

View File

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

View File

@@ -3,10 +3,12 @@
ynh_setting() {
app=${1}
setting=${2}
ynh_app_setting_get $app $setting
sudo grep "^${setting}:" "/etc/yunohost/apps/${app}/settings.yml" | sed s/^[^:]\\+:\\s*[\"\']\\?// | sed s/\\s*[\"\']\$//
}
source ./helpers
source ./prerequisites
domain=$(ynh_setting vpnclient domain)
path=$(ynh_setting vpnclient path)
@@ -42,3 +44,4 @@ fi
ynh_systemctl start ynh-vpnclient
exit 0