Parcourir la source

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
agentcobra il y a 7 ans
Parent
commit
8aab3c7dd2
10 fichiers modifiés avec 35 ajouts et 24 suppressions
  1. 3 0
      .gitignore
  2. 8 0
      .travis.yml
  3. 1 0
      README.md
  4. 22 8
      manifest.json
  5. 0 1
      scripts/backup
  6. 1 3
      scripts/install
  7. 0 8
      scripts/prerequisites
  8. 0 1
      scripts/remove
  9. 0 1
      scripts/restore
  10. 0 2
      scripts/upgrade

+ 3 - 0
.gitignore

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

+ 8 - 0
.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

+ 1 - 0
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/).

+ 22 - 8
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"

+ 0 - 1
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

+ 1 - 3
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

+ 0 - 8
scripts/prerequisites

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

+ 0 - 1
scripts/remove

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

+ 0 - 1
scripts/restore

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

+ 0 - 2
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