diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1cfaba4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created from https://github.com/YunoHost/example_ynh/blob/master/.gitignore +*~ +*.sw[op] \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..83744ac --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +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 \ No newline at end of file diff --git a/README.md b/README.md index 9a668d7..d7d3ebc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # VPN Client +[![Build Status](https://travis-ci.org/labriqueinternet/vpnclient_ynh.svg?branch=master)](https://travis-ci.org/labriqueinternet/vpnclient_ynh) ## Overview VPN Client app for [YunoHost](http://yunohost.org/). diff --git a/manifest.json b/manifest.json index 902fa42..d27b67a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,32 +1,46 @@ { "name": "VPN Client", "id": "vpnclient", + "packaging_format": 1, "description": { "en": "VPN Client", "fr": "Client VPN" }, - "license": "AGPL-3", - "developer": { + "url": "https://github.com/labriqueinternet/vpnclient_ynh", + "version": "1.0.0", + "license": "AGPL-3.0", + "maintainer": { "name": "Julien Vaubourg", "email": "julien@vaubourg.com", "url": "http://julien.vaubourg.com" }, - "multi_instance": "false", + "requirements": { + "yunohost": ">= 2.2.0", + "moulinette": ">= 2.4.0" + }, + "multi_instance": false, + "services": [ + "nginx", + "php5-fpm", + "ynh-vpnclient" + ], "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" diff --git a/scripts/backup b/scripts/backup index 43b6047..e314070 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,4 +6,3 @@ mkdir -p "${backup_dir}/" sudo cp -a /etc/openvpn/keys/ "${backup_dir}/" sudo cp -a /etc/openvpn/client.conf.tpl "${backup_dir}/" -exit 0 diff --git a/scripts/install b/scripts/install index b7747be..efbde6a 100644 --- a/scripts/install +++ b/scripts/install @@ -26,11 +26,10 @@ url_path=${2} if ! $upgrade; then source ./helpers - source ./prerequisites fi # Check domain/path availability -ynh_webpath_register vpnclient $domain $url_path || exit 1 +ynh_webpath_register vpnclient $domain $url_path || ynh_die "problem on domain/path availability" 1 # Install packages packages='php5-fpm sipcalc dnsutils openvpn curl' @@ -150,4 +149,3 @@ fi sudo yunohost app ssowatconf -exit 0 diff --git a/scripts/prerequisites b/scripts/prerequisites deleted file mode 100644 index 4b18fc3..0000000 --- a/scripts/prerequisites +++ /dev/null @@ -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 diff --git a/scripts/remove b/scripts/remove index 1d92f61..011c908 100644 --- a/scripts/remove +++ b/scripts/remove @@ -50,4 +50,3 @@ sudo systemctl reload nginx # Remove sources sudo rm -rf /var/www/vpnadmin/ -exit 0 diff --git a/scripts/restore b/scripts/restore index 7b88ea1..59f9f4b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -18,4 +18,3 @@ bash ./upgrade sudo rm -r "${tmpdir}/" -exit 0 diff --git a/scripts/upgrade b/scripts/upgrade index 6d4dd7b..f5a8567 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,7 +8,6 @@ ynh_setting() { } source ./helpers -source ./prerequisites domain=$(ynh_setting vpnclient domain) path=$(ynh_setting vpnclient path) @@ -44,4 +43,3 @@ fi ynh_systemctl start ynh-vpnclient -exit 0