Browse Source

Merge branch 'testing' of github.com:Yunohost-Apps/vpnclient_ynh into auto-helpers-2.1

HgO 2 weeks ago
parent
commit
d9a1127d18

+ 0 - 11
ALL_README.md

@@ -1,11 +0,0 @@
-# All available README files by language
-
-- [Read the README in English](README.md)
-- [Lea el README en español](README_es.md)
-- [Irakurri README euskaraz](README_eu.md)
-- [Lire le README en français](README_fr.md)
-- [Le o README en galego](README_gl.md)
-- [Baca README dalam bahasa bahasa Indonesia](README_id.md)
-- [Lees de README in het Nederlands](README_nl.md)
-- [Прочитать README на русский](README_ru.md)
-- [阅读中文(简体)的 README](README_zh_Hans.md)

+ 25 - 37
README.md

@@ -1,52 +1,40 @@
 <!--
 <!--
-N.B.: This README was automatically generated by <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
+N.B.: This README was automatically generated by <https://github.com/YunoHost/apps_tools/blob/main/readme_generator>
 It shall NOT be edited by hand.
 It shall NOT be edited by hand.
 -->
 -->
 
 
-# VPN Client for YunoHost
+<h1>
+  <img src="https://raw.githubusercontent.com/YunoHost/apps/main/logos/vpnclient.png" width="32px" alt="Logo of VPN Client">
+  VPN Client, packaged for YunoHost
+</h1>
 
 
-[![Integration level](https://dash.yunohost.org/integration/vpnclient.svg)](https://ci-apps.yunohost.org/ci/apps/vpnclient/) ![Working status](https://ci-apps.yunohost.org/ci/badges/vpnclient.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/vpnclient.maintain.svg)
+Tunnel the internet traffic through a VPN
 
 
-[![Install VPN Client with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vpnclient)
+[![🌐 Official app website](https://img.shields.io/badge/Official_app_website-darkgreen?style=for-the-badge)](https://labriqueinter.net)
+[![Version: 2.3~ynh1](https://img.shields.io/badge/Version-2.3~ynh1-rgba(0,150,0,1)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/vpnclient/)
 
 
-*[Read this README in other languages.](./ALL_README.md)*
+<div align="center">
+<a href="https://apps.yunohost.org/app/vpnclient"><img height="100px" src="https://github.com/YunoHost/yunohost-artwork/raw/refs/heads/main/badges/neopossum-badges/badge_more_info_on_the_appstore.svg"/></a>
+<a href="https://github.com/YunoHost-Apps/vpnclient_ynh/issues"><img height="100px" src="https://github.com/YunoHost/yunohost-artwork/raw/refs/heads/main/badges/neopossum-badges/badge_report_an_issue.svg"/></a>
+</div>
 
 
-> *This package allows you to install VPN Client quickly and simply on a YunoHost server.*  
-> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.*
+## 📦 Developer info
 
 
-## Overview
+[![Automatic tests level](https://apps.yunohost.org/badge/cilevel/vpnclient)](https://ci-apps.yunohost.org/ci/apps/vpnclient/)
 
 
-Install a VPN connection on your self-hosted server.
-* Useful for hosting your server behind a filtered (and/or non-neutral) internet access.
-* Useful to have static IP addresses (IPv6 and IPv4).
-* Useful to easily move your server anywhere.
-* Strong firewalling (internet access and self-hosted services only available through the VPN, not leaking to your commercial ISP)
-* Combine with the [Hotspot app](https://github.com/YunoHost-Apps/hotspot_ynh) to broadcast VPN-protected WiFi to other laptops without any further technical configuration needed.
+🛠️ Upstream VPN Client repository: <>
 
 
+Pull request are welcome and should target the [`testing` branch](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing).
 
 
+The `testing` branch can be tested using:
+```
+# fresh install:
+sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing
 
 
-**Shipped version:** 2.2~ynh6
-
-## Screenshots
-
-![Screenshot of VPN Client](./doc/screenshots/vpnclient.png)
-
-## Documentation and resources
-
-- Official app website: <https://labriqueinter.net>
-- YunoHost Store: <https://apps.yunohost.org/app/vpnclient>
-- Report a bug: <https://github.com/YunoHost-Apps/vpnclient_ynh/issues>
-
-## Developer info
-
-Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing).
-
-To try the `testing` branch, please proceed like that:
-
-```bash
-sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-or
-sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
+# upgrade an existing install:
+sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing
 ```
 ```
 
 
-**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
+### 📚 App packaging documentation
+
+Please see <https://doc.yunohost.org/packaging_apps> for more information.

+ 0 - 52
README_es.md

@@ -1,52 +0,0 @@
-<!--
-Este archivo README esta generado automaticamente<https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
-No se debe editar a mano.
--->
-
-# VPN Client para Yunohost
-
-[![Nivel de integración](https://dash.yunohost.org/integration/vpnclient.svg)](https://ci-apps.yunohost.org/ci/apps/vpnclient/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/vpnclient.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/vpnclient.maintain.svg)
-
-[![Instalar VPN Client con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vpnclient)
-
-*[Leer este README en otros idiomas.](./ALL_README.md)*
-
-> *Este paquete le permite instalarVPN Client rapidamente y simplement en un servidor YunoHost.*  
-> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.*
-
-## Descripción general
-
-Install a VPN connection on your self-hosted server.
-* Useful for hosting your server behind a filtered (and/or non-neutral) internet access.
-* Useful to have static IP addresses (IPv6 and IPv4).
-* Useful to easily move your server anywhere.
-* Strong firewalling (internet access and self-hosted services only available through the VPN, not leaking to your commercial ISP)
-* Combine with the [Hotspot app](https://github.com/YunoHost-Apps/hotspot_ynh) to broadcast VPN-protected WiFi to other laptops without any further technical configuration needed.
-
-
-
-**Versión actual:** 2.2~ynh6
-
-## Capturas
-
-![Captura de VPN Client](./doc/screenshots/vpnclient.png)
-
-## Documentaciones y recursos
-
-- Sitio web oficial: <https://labriqueinter.net>
-- Catálogo YunoHost: <https://apps.yunohost.org/app/vpnclient>
-- Reportar un error: <https://github.com/YunoHost-Apps/vpnclient_ynh/issues>
-
-## Información para desarrolladores
-
-Por favor enviar sus correcciones a la [rama `testing`](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing).
-
-Para probar la rama `testing`, sigue asÍ:
-
-```bash
-sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-o
-sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-```
-
-**Mas informaciones sobre el empaquetado de aplicaciones:** <https://yunohost.org/packaging_apps>

+ 0 - 52
README_eu.md

@@ -1,52 +0,0 @@
-<!--
-Ohart ongi: README hau automatikoki sortu da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>ri esker
-EZ editatu eskuz.
--->
-
-# VPN Client YunoHost-erako
-
-[![Integrazio maila](https://dash.yunohost.org/integration/vpnclient.svg)](https://ci-apps.yunohost.org/ci/apps/vpnclient/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/vpnclient.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/vpnclient.maintain.svg)
-
-[![Instalatu VPN Client YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vpnclient)
-
-*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
-
-> *Pakete honek VPN Client YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*  
-> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
-
-## Aurreikuspena
-
-Install a VPN connection on your self-hosted server.
-* Useful for hosting your server behind a filtered (and/or non-neutral) internet access.
-* Useful to have static IP addresses (IPv6 and IPv4).
-* Useful to easily move your server anywhere.
-* Strong firewalling (internet access and self-hosted services only available through the VPN, not leaking to your commercial ISP)
-* Combine with the [Hotspot app](https://github.com/YunoHost-Apps/hotspot_ynh) to broadcast VPN-protected WiFi to other laptops without any further technical configuration needed.
-
-
-
-**Paketatutako bertsioa:** 2.2~ynh6
-
-## Pantaila-argazkiak
-
-![VPN Client(r)en pantaila-argazkia](./doc/screenshots/vpnclient.png)
-
-## Dokumentazioa eta baliabideak
-
-- Aplikazioaren webgune ofiziala: <https://labriqueinter.net>
-- YunoHost Denda: <https://apps.yunohost.org/app/vpnclient>
-- Eman errore baten berri: <https://github.com/YunoHost-Apps/vpnclient_ynh/issues>
-
-## Garatzaileentzako informazioa
-
-Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing).
-
-`testing` abarra probatzeko, ondorengoa egin:
-
-```bash
-sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-edo
-sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-```
-
-**Informazio gehiago aplikazioaren paketatzeari buruz:** <https://yunohost.org/packaging_apps>

+ 0 - 52
README_fr.md

@@ -1,52 +0,0 @@
-<!--
-Nota bene : ce README est automatiquement généré par <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
-Il NE doit PAS être modifié à la main.
--->
-
-# VPN Client pour YunoHost
-
-[![Niveau d’intégration](https://dash.yunohost.org/integration/vpnclient.svg)](https://ci-apps.yunohost.org/ci/apps/vpnclient/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/vpnclient.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/vpnclient.maintain.svg)
-
-[![Installer VPN Client avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vpnclient)
-
-*[Lire le README dans d'autres langues.](./ALL_README.md)*
-
-> *Ce package vous permet d’installer VPN Client rapidement et simplement sur un serveur YunoHost.*  
-> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.*
-
-## Vue d’ensemble
-
-Installez une connexion VPN sur votre serveur auto-hébergé
-* Utile pour héberger votre serveur derrière un accès internet filtré (et/ou non-neutre)
-* Utile pour obtenir une IP statique (v4 et v6)
-* Utile pour pouvoir facilement déplacer votre serveur
-* Pare-feu strict (le traffice entrant et sortant se fait seulement via le pare-feu et ne fuite pas de données à votre FAI commercial)
-* Peut-être combiné avec [l'application Hotspot](https://github.com/YunoHost-Apps/hotspot_ynh) pour diffuser un WiFi protégé par le VPN à d'autres laptop sans configuration technique requise sur les machines clientes.
-
-
-
-**Version incluse :** 2.2~ynh6
-
-## Captures d’écran
-
-![Capture d’écran de VPN Client](./doc/screenshots/vpnclient.png)
-
-## Documentations et ressources
-
-- Site officiel de l’app : <https://labriqueinter.net>
-- YunoHost Store : <https://apps.yunohost.org/app/vpnclient>
-- Signaler un bug : <https://github.com/YunoHost-Apps/vpnclient_ynh/issues>
-
-## Informations pour les développeurs
-
-Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing).
-
-Pour essayer la branche `testing`, procédez comme suit :
-
-```bash
-sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-ou
-sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-```
-
-**Plus d’infos sur le packaging d’applications :** <https://yunohost.org/packaging_apps>

+ 0 - 52
README_gl.md

@@ -1,52 +0,0 @@
-<!--
-NOTA: Este README foi creado automáticamente por <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
-NON debe editarse manualmente.
--->
-
-# VPN Client para YunoHost
-
-[![Nivel de integración](https://dash.yunohost.org/integration/vpnclient.svg)](https://ci-apps.yunohost.org/ci/apps/vpnclient/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/vpnclient.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/vpnclient.maintain.svg)
-
-[![Instalar VPN Client con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vpnclient)
-
-*[Le este README en outros idiomas.](./ALL_README.md)*
-
-> *Este paquete permíteche instalar VPN Client de xeito rápido e doado nun servidor YunoHost.*  
-> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.*
-
-## Vista xeral
-
-Install a VPN connection on your self-hosted server.
-* Useful for hosting your server behind a filtered (and/or non-neutral) internet access.
-* Useful to have static IP addresses (IPv6 and IPv4).
-* Useful to easily move your server anywhere.
-* Strong firewalling (internet access and self-hosted services only available through the VPN, not leaking to your commercial ISP)
-* Combine with the [Hotspot app](https://github.com/YunoHost-Apps/hotspot_ynh) to broadcast VPN-protected WiFi to other laptops without any further technical configuration needed.
-
-
-
-**Versión proporcionada:** 2.2~ynh6
-
-## Capturas de pantalla
-
-![Captura de pantalla de VPN Client](./doc/screenshots/vpnclient.png)
-
-## Documentación e recursos
-
-- Web oficial da app: <https://labriqueinter.net>
-- Tenda YunoHost: <https://apps.yunohost.org/app/vpnclient>
-- Informar dun problema: <https://github.com/YunoHost-Apps/vpnclient_ynh/issues>
-
-## Info de desenvolvemento
-
-Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing).
-
-Para probar a rama `testing`, procede deste xeito:
-
-```bash
-sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-ou
-sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-```
-
-**Máis info sobre o empaquetado da app:** <https://yunohost.org/packaging_apps>

+ 0 - 52
README_id.md

@@ -1,52 +0,0 @@
-<!--
-N.B.: README ini dibuat secara otomatis oleh <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
-Ini TIDAK boleh diedit dengan tangan.
--->
-
-# VPN Client untuk YunoHost
-
-[![Tingkat integrasi](https://dash.yunohost.org/integration/vpnclient.svg)](https://ci-apps.yunohost.org/ci/apps/vpnclient/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/vpnclient.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/vpnclient.maintain.svg)
-
-[![Pasang VPN Client dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vpnclient)
-
-*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)*
-
-> *Paket ini memperbolehkan Anda untuk memasang VPN Client secara cepat dan mudah pada server YunoHost.*  
-> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.*
-
-## Ringkasan
-
-Install a VPN connection on your self-hosted server.
-* Useful for hosting your server behind a filtered (and/or non-neutral) internet access.
-* Useful to have static IP addresses (IPv6 and IPv4).
-* Useful to easily move your server anywhere.
-* Strong firewalling (internet access and self-hosted services only available through the VPN, not leaking to your commercial ISP)
-* Combine with the [Hotspot app](https://github.com/YunoHost-Apps/hotspot_ynh) to broadcast VPN-protected WiFi to other laptops without any further technical configuration needed.
-
-
-
-**Versi terkirim:** 2.2~ynh6
-
-## Tangkapan Layar
-
-![Tangkapan Layar pada VPN Client](./doc/screenshots/vpnclient.png)
-
-## Dokumentasi dan sumber daya
-
-- Website aplikasi resmi: <https://labriqueinter.net>
-- Gudang YunoHost: <https://apps.yunohost.org/app/vpnclient>
-- Laporkan bug: <https://github.com/YunoHost-Apps/vpnclient_ynh/issues>
-
-## Info developer
-
-Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing).
-
-Untuk mencoba branch `testing`, silakan dilanjutkan seperti:
-
-```bash
-sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-atau
-sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-```
-
-**Info lebih lanjut mengenai pemaketan aplikasi:** <https://yunohost.org/packaging_apps>

+ 0 - 55
README_it.md

@@ -1,55 +0,0 @@
-<!--
-N.B.: Questo README è stato automaticamente generato da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
-NON DEVE essere modificato manualmente.
--->
-
-# VPN Client per YunoHost
-
-[![Livello di integrazione](https://dash.yunohost.org/integration/vpnclient.svg)](https://dash.yunohost.org/appci/app/vpnclient) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/vpnclient.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/vpnclient.maintain.svg)
-
-[![Installa VPN Client con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vpnclient)
-
-*[Leggi questo README in altre lingue.](./ALL_README.md)*
-
-> *Questo pacchetto ti permette di installare VPN Client su un server YunoHost in modo semplice e veloce.*  
-> *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.*
-
-## Panoramica
-
-* Install a VPN connection on your self-hosted server.
-* Useful for hosting your server behind a filtered (and/or non-neutral) internet access.
-* Useful to have static IP addresses (IPv6 and IPv4).
-* Useful to easily move your server anywhere.
-* Strong firewalling (internet access and self-hosted services only available through the VPN, not leaking to your commercial ISP)
-* Combine with the [Hotspot app](https://github.com/YunoHost-Apps/hotspot_ynh) to broadcast VPN-protected WiFi to other laptops without any further technical configuration needed.
-
-
-
-**Versione pubblicata:** 2.1.2~ynh1
-
-## Screenshot
-
-![Screenshot di VPN Client](./doc/screenshots/vpnclient.png)
-
-## Attenzione/informazioni importanti
-
-Please note that this application is designed to interface with **dedicated, public IP VPNs accepting inbound traffic**, preferably with an associated `.cube` (or `.ovpn/.conf`) configuration file. **Do not** expect that any VPN you randomly bought on the Internet can be used! Checkout the [list of known compatible providers](https://yunohost.org/providers/vpn) for more info.
-
-## Documentazione e risorse
-
-- Store di YunoHost: <https://apps.yunohost.org/app/vpnclient>
-- Segnala un problema: <https://github.com/YunoHost-Apps/vpnclient_ynh/issues>
-
-## Informazioni per sviluppatori
-
-Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing).
-
-Per provare la branch di `testing`, si prega di procedere in questo modo:
-
-```bash
-sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-o
-sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-```
-
-**Maggiori informazioni riguardo il pacchetto di quest’app:** <https://yunohost.org/packaging_apps>

+ 0 - 52
README_nl.md

@@ -1,52 +0,0 @@
-<!--
-NB: Deze README is automatisch gegenereerd door <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
-Hij mag NIET handmatig aangepast worden.
--->
-
-# VPN Client voor Yunohost
-
-[![Integratieniveau](https://dash.yunohost.org/integration/vpnclient.svg)](https://ci-apps.yunohost.org/ci/apps/vpnclient/) ![Mate van functioneren](https://ci-apps.yunohost.org/ci/badges/vpnclient.status.svg) ![Onderhoudsstatus](https://ci-apps.yunohost.org/ci/badges/vpnclient.maintain.svg)
-
-[![VPN Client met Yunohost installeren](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vpnclient)
-
-*[Deze README in een andere taal lezen.](./ALL_README.md)*
-
-> *Met dit pakket kun je VPN Client snel en eenvoudig op een YunoHost-server installeren.*  
-> *Als je nog geen YunoHost hebt, lees dan [de installatiehandleiding](https://yunohost.org/install), om te zien hoe je 'm installeert.*
-
-## Overzicht
-
-Install a VPN connection on your self-hosted server.
-* Useful for hosting your server behind a filtered (and/or non-neutral) internet access.
-* Useful to have static IP addresses (IPv6 and IPv4).
-* Useful to easily move your server anywhere.
-* Strong firewalling (internet access and self-hosted services only available through the VPN, not leaking to your commercial ISP)
-* Combine with the [Hotspot app](https://github.com/YunoHost-Apps/hotspot_ynh) to broadcast VPN-protected WiFi to other laptops without any further technical configuration needed.
-
-
-
-**Geleverde versie:** 2.2~ynh6
-
-## Schermafdrukken
-
-![Schermafdrukken van VPN Client](./doc/screenshots/vpnclient.png)
-
-## Documentatie en bronnen
-
-- Officiele website van de app: <https://labriqueinter.net>
-- YunoHost-store: <https://apps.yunohost.org/app/vpnclient>
-- Meld een bug: <https://github.com/YunoHost-Apps/vpnclient_ynh/issues>
-
-## Ontwikkelaarsinformatie
-
-Stuur je pull request alsjeblieft naar de [`testing`-branch](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing).
-
-Om de `testing`-branch uit te proberen, ga als volgt te werk:
-
-```bash
-sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-of
-sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-```
-
-**Verdere informatie over app-packaging:** <https://yunohost.org/packaging_apps>

+ 0 - 52
README_ru.md

@@ -1,52 +0,0 @@
-<!--
-Важно: этот README был автоматически сгенерирован <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
-Он НЕ ДОЛЖЕН редактироваться вручную.
--->
-
-# VPN Client для YunoHost
-
-[![Уровень интеграции](https://dash.yunohost.org/integration/vpnclient.svg)](https://ci-apps.yunohost.org/ci/apps/vpnclient/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/vpnclient.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/vpnclient.maintain.svg)
-
-[![Установите VPN Client с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vpnclient)
-
-*[Прочтите этот README на других языках.](./ALL_README.md)*
-
-> *Этот пакет позволяет Вам установить VPN Client быстро и просто на YunoHost-сервер.*  
-> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.*
-
-## Обзор
-
-Install a VPN connection on your self-hosted server.
-* Useful for hosting your server behind a filtered (and/or non-neutral) internet access.
-* Useful to have static IP addresses (IPv6 and IPv4).
-* Useful to easily move your server anywhere.
-* Strong firewalling (internet access and self-hosted services only available through the VPN, not leaking to your commercial ISP)
-* Combine with the [Hotspot app](https://github.com/YunoHost-Apps/hotspot_ynh) to broadcast VPN-protected WiFi to other laptops without any further technical configuration needed.
-
-
-
-**Поставляемая версия:** 2.2~ynh6
-
-## Снимки экрана
-
-![Снимок экрана VPN Client](./doc/screenshots/vpnclient.png)
-
-## Документация и ресурсы
-
-- Официальный веб-сайт приложения: <https://labriqueinter.net>
-- Магазин YunoHost: <https://apps.yunohost.org/app/vpnclient>
-- Сообщите об ошибке: <https://github.com/YunoHost-Apps/vpnclient_ynh/issues>
-
-## Информация для разработчиков
-
-Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing).
-
-Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого:
-
-```bash
-sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-или
-sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-```
-
-**Больше информации о пакетировании приложений:** <https://yunohost.org/packaging_apps>

+ 0 - 52
README_zh_Hans.md

@@ -1,52 +0,0 @@
-<!--
-注意:此 README 由 <https://github.com/YunoHost/apps/tree/master/tools/readme_generator> 自动生成
-请勿手动编辑。
--->
-
-# YunoHost 上的 VPN Client
-
-[![集成程度](https://dash.yunohost.org/integration/vpnclient.svg)](https://ci-apps.yunohost.org/ci/apps/vpnclient/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/vpnclient.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/vpnclient.maintain.svg)
-
-[![使用 YunoHost 安装 VPN Client](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vpnclient)
-
-*[阅读此 README 的其它语言版本。](./ALL_README.md)*
-
-> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 VPN Client。*  
-> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。*
-
-## 概况
-
-Install a VPN connection on your self-hosted server.
-* Useful for hosting your server behind a filtered (and/or non-neutral) internet access.
-* Useful to have static IP addresses (IPv6 and IPv4).
-* Useful to easily move your server anywhere.
-* Strong firewalling (internet access and self-hosted services only available through the VPN, not leaking to your commercial ISP)
-* Combine with the [Hotspot app](https://github.com/YunoHost-Apps/hotspot_ynh) to broadcast VPN-protected WiFi to other laptops without any further technical configuration needed.
-
-
-
-**分发版本:** 2.2~ynh6
-
-## 截图
-
-![VPN Client 的截图](./doc/screenshots/vpnclient.png)
-
-## 文档与资源
-
-- 官方应用网站: <https://labriqueinter.net>
-- YunoHost 商店: <https://apps.yunohost.org/app/vpnclient>
-- 报告 bug: <https://github.com/YunoHost-Apps/vpnclient_ynh/issues>
-
-## 开发者信息
-
-请向 [`testing` 分支](https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing) 发送拉取请求。
-
-如要尝试 `testing` 分支,请这样操作:
-
-```bash
-sudo yunohost app install https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-或
-sudo yunohost app upgrade vpnclient -u https://github.com/YunoHost-Apps/vpnclient_ynh/tree/testing --debug
-```
-
-**有关应用打包的更多信息:** <https://yunohost.org/packaging_apps>

+ 31 - 28
conf/hook_post-iptable-rules

@@ -1,27 +1,32 @@
 #!/bin/bash
 #!/bin/bash
 
 
-server_names=$(grep -o -P '^\s*remote\s+\K([^\s]+)' /etc/openvpn/client.conf | sort | uniq)
-
-# In case an ip has been provided in ovpn conf
-host4=""
-host6=""
-for i in ${server_names}; do
-  if [[ "${i}" =~ : ]]; then
+if [[ -z "${trusted_ip}" && -z "${trusted_ip6}" ]]; then
+  server_names=$(grep -o -P '^\s*remote\s+\K([^\s]+)' /etc/openvpn/client.conf | sort | uniq)
+
+  # In case an ip has been provided in ovpn conf
+  host4=""
+  host6=""
+  for i in ${server_names}; do
+    if [[ "${i}" =~ : ]]; then
       host6+=" ${i}"
       host6+=" ${i}"
-  elif [[ "${i}" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
+    elif [[ "${i}" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
       host4+=" ${i}"
       host4+=" ${i}"
+    else
+      host6+=" $(dig AAAA +short "${i}" @127.0.0.1 | grep -v '\.$' | grep -v "timed out")"
+      host4+=" $(dig A +short "${i}" @127.0.0.1 | grep -v '\.$' | grep -v "timed out")"
+    fi
+  done
+else
+  if [[ -n "${trusted_ip6}" ]]; then
+    host6=${trusted_ip6}
   fi
   fi
-done
 
 
-if [[ -z "${host6}" ]]; then
-  host6=$(dig AAAA +short $server_names @127.0.0.1 | grep -v '\.$' | grep -v "timed out")
-fi
-
-if [[ -z "${host4}" ]]; then
-  host4=$(dig A +short $server_names @127.0.0.1 | grep -v '\.$' | grep -v "timed out")
+  if [[ -n "${trusted_ip}" ]]; then
+    host4=${trusted_ip}
+  fi
 fi
 fi
 
 
-interface=$(ip route | awk '/default via/ { print $5; }')
+wired_device=$(ip route | awk '/default via/ { print $5; }')
 dns=$(grep -o -P '^\s*nameserver\s+\K[a-fA-F\d.:]+$' /etc/resolv.dnsmasq.conf | sort | uniq)
 dns=$(grep -o -P '^\s*nameserver\s+\K[a-fA-F\d.:]+$' /etc/resolv.dnsmasq.conf | sort | uniq)
 
 
 # IPv6
 # IPv6
@@ -37,14 +42,13 @@ ip6tables -w -A vpnclient_in -p tcp --dport 443 -j ACCEPT
 ip6tables -w -A vpnclient_in -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
 ip6tables -w -A vpnclient_in -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
 ip6tables -w -A vpnclient_in -j DROP
 ip6tables -w -A vpnclient_in -j DROP
 
 
-if [ ! -z "${host6}" ]; then
+if [[ ! -z "${host6}" ]]; then
   for i in ${host6}; do
   for i in ${host6}; do
     ip6tables -w -A vpnclient_out -d "${i}" -j ACCEPT
     ip6tables -w -A vpnclient_out -d "${i}" -j ACCEPT
   done
   done
 fi
 fi
 
 
-for i in ${dns};
-do
+for i in ${dns}; do
   if [[ "${i}" =~ : ]]; then
   if [[ "${i}" =~ : ]]; then
     ip6tables -w -A vpnclient_out -p udp -d "${i}" --dport 53 -j ACCEPT
     ip6tables -w -A vpnclient_out -p udp -d "${i}" --dport 53 -j ACCEPT
   fi
   fi
@@ -58,9 +62,9 @@ ip6tables -w -A vpnclient_out -j DROP
 
 
 ip6tables -w -A vpnclient_fwd -j DROP
 ip6tables -w -A vpnclient_fwd -j DROP
 
 
-ip6tables -w -I INPUT 1 -i $interface -j vpnclient_in
-ip6tables -w -I OUTPUT 1 -o $interface -j vpnclient_out
-ip6tables -w -I FORWARD 1 -o $interface -j vpnclient_fwd
+ip6tables -w -I INPUT 1 -i $wired_device -j vpnclient_in
+ip6tables -w -I OUTPUT 1 -o $wired_device -j vpnclient_out
+ip6tables -w -I FORWARD 1 -o $wired_device -j vpnclient_fwd
 
 
 # IPv4
 # IPv4
 
 
@@ -75,14 +79,13 @@ iptables -w -A vpnclient_in -p tcp --dport 443 -j ACCEPT
 iptables -w -A vpnclient_in -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
 iptables -w -A vpnclient_in -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
 iptables -w -A vpnclient_in -j DROP
 iptables -w -A vpnclient_in -j DROP
 
 
-if [ ! -z "${host4}" ]; then
+if [[ ! -z "${host4}" ]]; then
   for i in ${host4}; do
   for i in ${host4}; do
     iptables -w -A vpnclient_out -d "${i}" -j ACCEPT
     iptables -w -A vpnclient_out -d "${i}" -j ACCEPT
   done
   done
 fi
 fi
 
 
-for i in ${dns};
-do
+for i in ${dns}; do
   if [[ "${i}" =~ \. ]]; then
   if [[ "${i}" =~ \. ]]; then
     iptables -w -A vpnclient_out -p udp -d "${i}" --dport 53 -j ACCEPT
     iptables -w -A vpnclient_out -p udp -d "${i}" --dport 53 -j ACCEPT
   fi
   fi
@@ -95,8 +98,8 @@ iptables -w -A vpnclient_out -j DROP
 
 
 iptables -w -A vpnclient_fwd -j DROP
 iptables -w -A vpnclient_fwd -j DROP
 
 
-iptables -w -I INPUT 1 -i $interface -j vpnclient_in
-iptables -w -I OUTPUT 1 -o $interface -j vpnclient_out
-iptables -w -I FORWARD 1 -o  $interface -j vpnclient_fwd
+iptables -w -I INPUT 1 -i $wired_device -j vpnclient_in
+iptables -w -I OUTPUT 1 -o $wired_device -j vpnclient_out
+iptables -w -I FORWARD 1 -o  $wired_device -j vpnclient_fwd
 
 
 exit 0
 exit 0

+ 4 - 0
conf/optional-scripts/route-down.d/50-vpnclient-unset-ipv6-send-over-tun

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+ip -6 route flush table send_over_tun
+rm -f /etc/iproute2/rt_tables.d/vpnclient_ynh.conf

+ 31 - 0
conf/optional-scripts/route-up.d/50-vpnclient-set-ipv6-send-over-tun

@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# cf https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/#environmental-variables
+# to have a list of variables provided by OpenVPN, i.e:
+# - dev
+# - net_gateway_ipv6
+# - ifconfig_ipv6_local
+gateway_interface=${dev}
+ip6_gw=${net_gateway_ipv6}
+
+if [[ -n "${net_gateway_ipv6}" ]]; then
+  echo "[INFO] Native IPv6 detected"
+  echo "[INFO] Autodetected native IPv6 gateway: ${ip6_gw}"
+
+  ip6_addr=$(yunohost app setting "vpnclient" "ip6_addr")
+  if [[ -z "${ip6_addr}" ]] || [[ "${ip6_addr}" == none ]]; then
+    if [[ -z ${ifconfig_ipv6_local} ]]; then
+      echo "[FAIL] Cannot find IPv6 address"
+      exit 1
+    fi
+    ip6_addr="${ifconfig_ipv6_local}"
+  fi
+
+  echo "[INFO] Found IPv6 address: ${ip6_addr}"
+
+  echo "1 send_over_tun" > /etc/iproute2/rt_tables.d/vpnclient_ynh.conf
+  ip -6 route flush table send_over_tun || true
+  ip -6 route add default via "${ip6_gw}" dev "${gateway_interface}" table send_over_tun proto static
+  ip -6 rule flush lookup send_over_tun
+  ip -6 rule add from "${ip6_addr}/64" pref 1 table send_over_tun
+fi

+ 16 - 17
conf/scripts/route-down.d/30-vpnclient-unset-server-ipv6-route

@@ -1,36 +1,35 @@
 #!/bin/bash
 #!/bin/bash
 
 
 is_serverip6route_set() {
 is_serverip6route_set() {
-  local server_ip6s=${1}
+  local server_ip6=${1}
 
 
-  if [[ -z "${server_ip6s}" ]]; then
+  if [[ -z "${server_ip6}" ]]; then
     return 0
     return 0
   fi
   fi
 
 
-  for server_ip6 in ${server_ip6s}; do
-    if ! ip -6 route | grep -q "^${server_ip6}"; then
-      return 1
-    fi
-  done
+  if ! ip -6 route | grep -q "^${server_ip6}"; then
+    return 1
+  fi
 }
 }
 
 
 unset_serverip6route() {
 unset_serverip6route() {
-  local server_ip6s=${1}
+  local server_ip6=${1}
   local ip6_gw=${2}
   local ip6_gw=${2}
   local wired_device=${3}
   local wired_device=${3}
 
 
-  for server_ip6 in ${server_ip6s}; do
-    ip route delete "${server_ip6}/128" via "${ip6_gw}" dev "${wired_device}"
-  done
+  ip route delete "${server_ip6}/128" via "${ip6_gw}" dev "${wired_device}"
 }
 }
 
 
-old_ip6_gw=$(yunohost app setting vpnclient ip6_gw)
-old_wired_device=$(yunohost app setting vpnclient wired_device)
-old_server_ip6=$(yunohost app setting vpnclient server_ip6)
+wired_device=$(ip route | awk '/default via/ { print $5; }')
+
+# See https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/#environmental-variables
+# to have a list of variables provided by OpenVPN, i.e:
+# - ifconfig_ipv6_remote
+# - net_gateway_ipv6
 
 
 # Check old state of the server ipv6 route
 # Check old state of the server ipv6 route
-if [[ -n "${old_server_ip6}" && -n "${old_ip6_gw}" && -n "${old_wired_device}" ]]; then
-  if is_serverip6route_set "${old_server_ip6}"; then
-    unset_serverip6route "${old_server_ip6}" "${old_ip6_gw}" "${old_wired_device}"
+if [[ -n "${ifconfig_ipv6_remote}" && -n "${net_gateway_ipv6}" && -n "${wired_device}" ]]; then
+  if is_serverip6route_set "${ifconfig_ipv6_remote}"; then
+    unset_serverip6route "${ifconfig_ipv6_remote}" "${net_gateway_ipv6}" "${wired_device}"
   fi
   fi
 fi
 fi

+ 5 - 2
conf/scripts/route-down.d/40-vpnclient-unset-ipv6

@@ -2,10 +2,13 @@
 
 
 is_ip6addr_set() {
 is_ip6addr_set() {
   local ip6_addr=${1}
   local ip6_addr=${1}
-  ip address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/"
+  ip address show dev "${gateway_interface}" 2> /dev/null | grep -q "${ip6_addr}/"
 }
 }
 
 
 ip6_addr=$(yunohost app setting "vpnclient" "ip6_addr")
 ip6_addr=$(yunohost app setting "vpnclient" "ip6_addr")
+# cf https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/#environmental-variables for where 'dev' comes from
+gateway_interface=${dev}
+
 if [[ -n "${ip6_addr}" ]] && [[ "${ip6_addr}" != none ]] && is_ip6addr_set "${ip6_addr}"; then
 if [[ -n "${ip6_addr}" ]] && [[ "${ip6_addr}" != none ]] && is_ip6addr_set "${ip6_addr}"; then
-  ip address delete "${ip6_addr}/64" dev tun0
+  ip address delete "${ip6_addr}/64" dev "${gateway_interface}"
 fi
 fi

+ 26 - 65
conf/scripts/route-up.d/30-vpnclient-set-server-ipv6-route

@@ -1,88 +1,53 @@
 #!/bin/bash
 #!/bin/bash
 
 
-has_nativeip6() {
-  ip -6 route | grep -q "default via"
-}
-
 is_serverip6route_set() {
 is_serverip6route_set() {
-  local server_ip6s=${1}
+  local server_ip6=${1}
 
 
-  if [[ -z "${server_ip6s}" ]]; then
+  if [[ -z "${server_ip6}" ]]; then
     return 0
     return 0
   fi
   fi
 
 
-  for server_ip6 in ${server_ip6s}; do
-    if ! ip -6 route | grep -q "^${server_ip6}"; then
-      return 1
-    fi
-  done
+  if ! ip -6 route | grep -q "^${server_ip6}"; then
+    return 1
+  fi
 }
 }
 
 
 set_serverip6route() {
 set_serverip6route() {
-  local server_ip6s=${1}
-  local ip6_gw=${2}
-  local wired_device=${3}
-
-  for server_ip6 in ${server_ip6s}; do
-    ip route add "${server_ip6}/128" via "${ip6_gw}" dev "${wired_device}"
-  done
-}
-
-unset_serverip6route() {
-  local server_ip6s=${1}
+  local server_ip6=${1}
   local ip6_gw=${2}
   local ip6_gw=${2}
   local wired_device=${3}
   local wired_device=${3}
 
 
-  for server_ip6 in ${server_ip6s}; do
-    ip route delete "${server_ip6}/128" via "${ip6_gw}" dev "${wired_device}"
-  done
+  ip route add "${server_ip6}/128" via "${ip6_gw}" dev "${wired_device}"
 }
 }
 
 
-old_ip6_gw=$(yunohost app setting vpnclient ip6_gw)
-old_wired_device=$(yunohost app setting vpnclient wired_device)
-old_server_ip6=$(yunohost app setting vpnclient server_ip6)
+wired_device=$(ip route | awk '/default via/ { print $5; }')
 
 
-new_ip6_gw=$(ip -6 route | awk '/default via/ { print $3 }')
-new_wired_device=$(ip route | awk '/default via/ { print $5; }')
-ynh_server_names=$(grep -o -P '^\s*remote\s+\K([^\s]+)' /etc/openvpn/client.conf | sort | uniq)
+# See https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/#environmental-variables
+# to have a list of variables provided by OpenVPN, i.e:
+# - ifconfig_ipv6_remote
+# - net_gateway_ipv6
+server_ip6=${ifconfig_ipv6_remote}
+ip6_gw=${net_gateway_ipv6}
 
 
-# In case an ip has been provided in ovpn conf
-new_server_ip6=""
-new_server_ip4=""
-for i in $ynh_server_names; do
-  if [[ "${i}" =~ : ]]; then
-    new_server_ip6+=" ${i}"
-  elif [[ "${i}" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
-    new_server_ip4+=" ${i}"
-  fi
-done
-
-if [[ -z "${new_server_ip6}" && -z "${new_server_ip4}" ]]; then
-  new_server_ip6=$(dig AAAA +short $ynh_server_names @127.0.0.1 | grep -v '\.$' | grep -v "timed out" | sort | uniq)
-fi
-
-echo "[INFO] Autodetected internet interface: ${new_wired_device} (last start: ${old_wired_device})"
-echo "[INFO] Autodetected IPv6 address for the VPN server: ${new_server_ip6} (last start: ${old_server_ip6})"
-
-# Check old state of the server ipv6 route
-if [[ -n "${old_server_ip6}" && -n "${old_ip6_gw}" && -n "${old_wired_device}" ]]; then
-  if [[ "${new_server_ip6}" != "${old_server_ip6}" || "${new_ip6_gw}" != "${old_ip6_gw}" || "${new_wired_device}" != "${old_wired_device}" ]]; then
-    if is_serverip6route_set "${old_server_ip6}"; then
-      unset_serverip6route "${old_server_ip6}" "${old_ip6_gw}" "${old_wired_device}"
-    fi
-  fi
+echo "[INFO] Autodetected internet interface: ${wired_device}"
+if [[ -n "${server_ip6}" ]]; then
+  echo "[INFO] Autodetected IPv6 address for the VPN server: ${server_ip6}"
+else
+  echo "[INFO] No IPv6 address for the VPN server detected"
+  echo "[INFO] No IPv6 route set"
+  exit 0
 fi
 fi
 
 
 # Set the new server ipv6 route
 # Set the new server ipv6 route
-if has_nativeip6; then
-  if ! is_serverip6route_set "${new_server_ip6}"; then
-    set_serverip6route "${new_server_ip6}" "${new_ip6_gw}" "${new_wired_device}"
+if [[ -n "${ip6_gw}" ]]; then
+  if ! is_serverip6route_set "${server_ip6}"; then
+    set_serverip6route "${server_ip6}" "${ip6_gw}" "${wired_device}"
   fi
   fi
 
 
   echo "[INFO] Native IPv6 detected"
   echo "[INFO] Native IPv6 detected"
-  echo "[INFO] Autodetected native IPv6 gateway: ${new_ip6_gw} (last start: ${old_ip6_gw})"
+  echo "[INFO] Autodetected native IPv6 gateway: ${ip6_gw}"
 
 
-  if is_serverip6route_set "${new_server_ip6}"; then
+  if is_serverip6route_set "${server_ip6}"; then
     echo "[ OK ] IPv6 server route correctly set"
     echo "[ OK ] IPv6 server route correctly set"
   else
   else
     echo "[FAIL] No IPv6 server route set" >&2
     echo "[FAIL] No IPv6 server route set" >&2
@@ -92,7 +57,3 @@ else
   echo "[INFO] No native IPv6 detected"
   echo "[INFO] No native IPv6 detected"
   echo "[INFO] No IPv6 server route to set"
   echo "[INFO] No IPv6 server route to set"
 fi
 fi
-
-yunohost app setting vpnclient server_ip6 --value "${new_server_ip6}"
-yunohost app setting vpnclient ip6_gw --value "${new_ip6_gw}"
-yunohost app setting vpnclient wired_device --value "${new_wired_device}"

+ 5 - 2
conf/scripts/route-up.d/40-vpnclient-set-ipv6

@@ -2,13 +2,16 @@
 
 
 is_ip6addr_set() {
 is_ip6addr_set() {
   local ip6_addr=${1}
   local ip6_addr=${1}
-  ip address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/"
+  ip address show dev "${gateway_interface}" 2> /dev/null | grep -q "${ip6_addr}/"
 }
 }
 
 
 ip6_addr=$(yunohost app setting "vpnclient" "ip6_addr")
 ip6_addr=$(yunohost app setting "vpnclient" "ip6_addr")
+# cf https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/#environmental-variables for where 'dev' comes from
+gateway_interface=${dev}
+
 if [[ -n "${ip6_addr}" ]] && [[ "${ip6_addr}" != none ]]; then
 if [[ -n "${ip6_addr}" ]] && [[ "${ip6_addr}" != none ]]; then
   if ! is_ip6addr_set "${ip6_addr}"; then
   if ! is_ip6addr_set "${ip6_addr}"; then
-    ip address add "${ip6_addr}/64" dev tun0
+    ip address add "${ip6_addr}/64" dev "${gateway_interface}"
   fi
   fi
 
 
   echo "[INFO] IPv6 delegated prefix found"
   echo "[INFO] IPv6 delegated prefix found"

+ 6 - 0
config_panel.toml

@@ -130,3 +130,9 @@ name = "DNS & IPv6"
         help = "If no IPv6 address is pushed directly by your VPN provider, you can indicate a specific IP to use here."
         help = "If no IPv6 address is pushed directly by your VPN provider, you can indicate a specific IP to use here."
         pattern.regexp = "^[0-9a-fA-F:]+$"
         pattern.regexp = "^[0-9a-fA-F:]+$"
         pattern.error = "Please provide a valid IPv6"
         pattern.error = "Please provide a valid IPv6"
+
+        [advanced.ipv6.ip6_send_over_tun_enabled]
+        ask = "IPv6 local routing over tun"
+        type = "boolean"
+        help = "If enabled, local IPv6 traffic will be routed through internet. You should enable this if you can't reach your server in IPv6 from your local network."
+

+ 1 - 1
manifest.toml

@@ -7,7 +7,7 @@ name = "VPN Client"
 description.en = "Tunnel the internet traffic through a VPN"
 description.en = "Tunnel the internet traffic through a VPN"
 description.fr = "Fait passer le trafic internet à travers un VPN"
 description.fr = "Fait passer le trafic internet à travers un VPN"
 
 
-version = "2.2~ynh6"
+version = "2.3~ynh1"
 
 
 maintainers = []
 maintainers = []
 
 

+ 10 - 8
scripts/_common.sh

@@ -16,7 +16,6 @@ function vpnclient_deploy_files_and_services()
   mkdir -pm 0755 /etc/yunohost/hooks.d/post_iptable_rules/
   mkdir -pm 0755 /etc/yunohost/hooks.d/post_iptable_rules/
   mkdir -pm 0755 /etc/systemd/system/openvpn@.service.d/
   mkdir -pm 0755 /etc/systemd/system/openvpn@.service.d/
 
 
-  install -b -o root -g root -m 0755 ../conf/hook_post-iptable-rules /etc/yunohost/hooks.d/90-vpnclient.tpl
   install -b -o root -g root -m 0644 ../conf/openvpn@.service /etc/systemd/system/openvpn@.service.d/override.conf
   install -b -o root -g root -m 0644 ../conf/openvpn@.service /etc/systemd/system/openvpn@.service.d/override.conf
 
 
   # Create certificates directory
   # Create certificates directory
@@ -56,16 +55,18 @@ function read_cube() {
   local config_file="$1"
   local config_file="$1"
   local key="$2"
   local key="$2"
   local tmp_dir=$(dirname "$config_file")
   local tmp_dir=$(dirname "$config_file")
+  local default_value="${3:-}"
 
 
   setting_value="$(jq --raw-output ".$key" "$config_file")"
   setting_value="$(jq --raw-output ".$key" "$config_file")"
-  if [[ "$setting_value" == "null" ]]
-  then
-    setting_value=''
+  if [[ "$setting_value" == "null" ]]; then
+    setting_value="$default_value"
+  elif [[ "$setting_value" == "true" ]]; then
+    setting_value=1
+  elif [[ "$setting_value" == "false" ]]; then
+    setting_value=0
   # Save file in tmp dir
   # Save file in tmp dir
-  elif [[ "$key" == "crt_"* ]]
-  then
-    if [ -n "${setting_value}" ]
-    then
+  elif [[ "$key" == "crt_"* ]]; then
+    if [ -n "${setting_value}" ]; then
       echo "${setting_value}" | sed 's/|/\n/g' > "$tmp_dir/$key"
       echo "${setting_value}" | sed 's/|/\n/g' > "$tmp_dir/$key"
       setting_value="$tmp_dir/$key"
       setting_value="$tmp_dir/$key"
     fi
     fi
@@ -84,6 +85,7 @@ function convert_cube_file()
   server_proto="$(read_cube $config_file server_proto)"
   server_proto="$(read_cube $config_file server_proto)"
   ip6_net="$(read_cube $config_file ip6_net)"
   ip6_net="$(read_cube $config_file ip6_net)"
   ip6_addr="$(read_cube $config_file ip6_addr)"
   ip6_addr="$(read_cube $config_file ip6_addr)"
+  ip6_send_over_tun_enabled="$(read_cube $config_file ip6_send_over_tun 0)"
   login_user="$(read_cube $config_file login_user)"
   login_user="$(read_cube $config_file login_user)"
   login_passphrase="$(read_cube $config_file login_passphrase)"
   login_passphrase="$(read_cube $config_file login_passphrase)"
   dns0="$(read_cube $config_file dns0)"
   dns0="$(read_cube $config_file dns0)"

+ 0 - 2
scripts/backup

@@ -10,8 +10,6 @@ ynh_print_info "Backing up the main app directory..."
 
 
 ynh_backup "/usr/local/bin/$service_name-loadcubefile.sh"
 ynh_backup "/usr/local/bin/$service_name-loadcubefile.sh"
 
 
-ynh_backup "/etc/yunohost/hooks.d/90-vpnclient.tpl"
-
 ynh_backup "/etc/openvpn/client.conf" || true
 ynh_backup "/etc/openvpn/client.conf" || true
 ynh_backup "/etc/openvpn/client.cube" || true
 ynh_backup "/etc/openvpn/client.cube" || true
 ynh_backup "/etc/openvpn/client.ovpn" || true
 ynh_backup "/etc/openvpn/client.ovpn" || true

+ 42 - 22
scripts/config

@@ -100,6 +100,7 @@ get__login_passphrase() {
 #=================================================
 #=================================================
 # SPECIFIC VALIDATORS FOR TOML SHORT KEYS
 # SPECIFIC VALIDATORS FOR TOML SHORT KEYS
 #=================================================
 #=================================================
+
 validate__login_user() {
 validate__login_user() {
 
 
     if grep -q '^\s*auth-user-pass' ${config_file}
     if grep -q '^\s*auth-user-pass' ${config_file}
@@ -167,9 +168,11 @@ validate__nameservers() {
         echo "You need to choose DNS resolvers or select an other method to provide DNS resolvers"
         echo "You need to choose DNS resolvers or select an other method to provide DNS resolvers"
     fi
     fi
 }
 }
+
 #=================================================
 #=================================================
 # SPECIFIC SETTERS FOR TOML SHORT KEYS
 # SPECIFIC SETTERS FOR TOML SHORT KEYS
 #=================================================
 #=================================================
+
 set__login_user() {
 set__login_user() {
     if [ -n "${login_user}" ]
     if [ -n "${login_user}" ]
     then
     then
@@ -188,33 +191,32 @@ set__login_passphrase() {
 #=================================================
 #=================================================
 # OVERWRITING VALIDATE STEP
 # OVERWRITING VALIDATE STEP
 #=================================================
 #=================================================
+
 ynh_app_config_validate() {
 ynh_app_config_validate() {
     # At this moment this var is not already set with the old value
     # At this moment this var is not already set with the old value
-    if [ -z ${config_file+x} ]
-    then
-        config_file="${old[config_file]}"
-
-    # Overwrite form response with cube files data before validation process
+    if [[ -n "${config_file:-}" ]]; then
+        # Overwrite form response with cube files data before validation process
 
 
-    # We don't have the extension, so we use this ugly hack to check that this is a json-like
-    # (i.e. it starts with { ..)
-    elif [ -f "${config_file}" ] && [[ "$(cat ${config_file} | tr -d ' ' | grep -v "^$" | head -c1)" == "{" ]]
-    then
-        local tmp_dir=$(dirname "$config_file")
+        # We don't have the extension, so we use this ugly hack to check that this is a json-like
+        # (i.e. it starts with { ..)
+        if [[ -f "${config_file}" ]]; then
+            if [[ "$(cat ${config_file} | tr -d ' ' | grep -v "^$" | head -c1)" == "{" ]]; then
+                local tmp_dir=$(dirname "$config_file")
 
 
-        cube_file="$tmp_dir/client.cube"
-        cp -f "$config_file" "$cube_file"
+                cube_file="$tmp_dir/client.cube"
+                cp -f "$config_file" "$cube_file"
 
 
-        convert_cube_file "$config_file"
-    # Othewise, assume that it's a .ovpn / .conf
-    elif [ -f "${config_file}" ]
-    then
-        local tmp_dir=$(dirname "$config_file")
+                convert_cube_file "$config_file"
+            # Othewise, assume that it's a .ovpn / .conf
+            else
+                local tmp_dir=$(dirname "$config_file")
 
 
-        ovpn_file="$tmp_dir/client.ovpn"
-        cp -f "$config_file" "$ovpn_file"
+                ovpn_file="$tmp_dir/client.ovpn"
+                cp -f "$config_file" "$ovpn_file"
 
 
-        convert_ovpn_file "$config_file"
+                convert_ovpn_file "$config_file"
+            fi
+        fi
     fi
     fi
 
 
     _ynh_app_config_validate
     _ynh_app_config_validate
@@ -223,6 +225,7 @@ ynh_app_config_validate() {
 #=================================================
 #=================================================
 # OVERWRITING APPLY STEP
 # OVERWRITING APPLY STEP
 #=================================================
 #=================================================
+
 ynh_app_config_apply() {
 ynh_app_config_apply() {
 
 
     # Stop vpn client
     # Stop vpn client
@@ -235,6 +238,23 @@ ynh_app_config_apply() {
 
 
     _ynh_app_config_apply
     _ynh_app_config_apply
 
 
+    # If we are uploading a cube file, then the file would be in a temporary folder
+    # Otherwise, we aren't uploading a cube file, then the path is either empty 
+    # or takes the value of the previous upload, that is, the target path for the cube file.
+    if [[ -n "${cube_file:-}" && "$cube_file" != "/etc/openvpn/client.cube" ]]; then
+      ynh_app_setting_set $app ip6_addr "$ip6_addr"
+      ynh_app_setting_set $app ip6_net "$ip6_net"
+      ynh_app_setting_set $app ip6_send_over_tun_enabled "$ip6_send_over_tun_enabled"
+    fi
+
+    if [[ ${ip6_send_over_tun_enabled} -eq 1 ]]; then
+        install -b -o root -g root -m 0755 ../conf/optional-scripts/route-up.d/50-vpnclient-set-ipv6-send-over-tun /etc/openvpn/scripts/route-up.d/
+        install -b -o root -g root -m 0755 ../conf/optional-scripts/route-down.d/50-vpnclient-unset-ipv6-send-over-tun /etc/openvpn/scripts/route-down.d/
+    else
+        ynh_secure_remove /etc/openvpn/scripts/route-up.d/50-vpnclient-set-ipv6-send-over-tun
+        ynh_secure_remove /etc/openvpn/scripts/route-down.d/50-vpnclient-unset-ipv6-send-over-tun
+    fi
+
     set_permissions /etc/openvpn/client.conf
     set_permissions /etc/openvpn/client.conf
     set_permissions /etc/openvpn/keys/ca-server.crt
     set_permissions /etc/openvpn/keys/ca-server.crt
     set_permissions /etc/openvpn/keys/user.crt
     set_permissions /etc/openvpn/keys/user.crt
@@ -242,8 +262,8 @@ ynh_app_config_apply() {
     set_permissions /etc/openvpn/keys/user_ta.key
     set_permissions /etc/openvpn/keys/user_ta.key
 
 
     # Cleanup previously uploaded config file
     # Cleanup previously uploaded config file
-    [[ "$cube_file" == "/etc/openvpn/client.cube" ]] && rm -f "$cube_file"
-    [[ "$ovpn_file" == "/etc/openvpn/client.ovpn" ]] && rm -f "$ovpn_file"
+    [[ -n "${cube_file:-}" && "$cube_file" == "/etc/openvpn/client.cube" ]] && rm -f "$cube_file"
+    [[ -n "${ovpn_file:-}" && "$ovpn_file" == "/etc/openvpn/client.ovpn" ]] && rm -f "$ovpn_file"
 
 
     # Start vpn client
     # Start vpn client
     ynh_print_info "Starting vpnclient service if needed"
     ynh_print_info "Starting vpnclient service if needed"

+ 4 - 0
scripts/install

@@ -9,6 +9,7 @@ ynh_app_setting_set "$app" dns_method "yunohost"
 ynh_app_setting_set "$app" nameservers ""
 ynh_app_setting_set "$app" nameservers ""
 ynh_app_setting_set "$app" ip6_addr ""
 ynh_app_setting_set "$app" ip6_addr ""
 ynh_app_setting_set "$app" ip6_net ""
 ynh_app_setting_set "$app" ip6_net ""
+ynh_app_setting_set "$app" ip6_send_over_tun_enabled 0
 
 
 #=================================================
 #=================================================
 # DEPLOY FILES FROM PACKAGE
 # DEPLOY FILES FROM PACKAGE
@@ -33,6 +34,9 @@ systemctl stop openvpn
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
 yunohost service enable $service_name
 yunohost service enable $service_name
 
 
+ynh_use_logrotate --logfile="/var/log/ynh-vpnclient.log"
+ynh_use_logrotate --logfile="/var/log/openvpn-client.log"
+
 # checker service
 # checker service
 
 
 systemctl start $service_checker_name
 systemctl start $service_checker_name

+ 1 - 5
scripts/remove

@@ -14,10 +14,9 @@ systemctl stop $service_checker_name
 systemctl disable $service_checker_name --quiet
 systemctl disable $service_checker_name --quiet
 
 
 if ynh_hide_warnings yunohost service status $service_name >/dev/null; then
 if ynh_hide_warnings yunohost service status $service_name >/dev/null; then
-    yunohost service stop $service_name
-    yunohost service disable $service_name --quiet
     yunohost service remove $service_name
     yunohost service remove $service_name
 fi
 fi
+ynh_remove_logrotate
 
 
 for FILE in $(ls /etc/systemd/system/$service_name* /usr/local/bin/ynh-vpnclient* /tmp/.ynh-vpnclient-*); do
 for FILE in $(ls /etc/systemd/system/$service_name* /usr/local/bin/ynh-vpnclient* /tmp/.ynh-vpnclient-*); do
     ynh_safe_rm "$FILE"
     ynh_safe_rm "$FILE"
@@ -40,9 +39,6 @@ for FILE in $(ls /etc/openvpn/scripts/route-up.d/*-vpnclient-* /etc/openvpn/scri
     ynh_safe_rm "$FILE"
     ynh_safe_rm "$FILE"
 done
 done
 
 
-# Remove YunoHost hook
-ynh_safe_rm /etc/yunohost/hooks.d/90-vpnclient.tpl
-
 # Remove openvpn service
 # Remove openvpn service
 ynh_safe_rm /etc/systemd/system/openvpn@.service.d/override.conf
 ynh_safe_rm /etc/systemd/system/openvpn@.service.d/override.conf
 
 

+ 3 - 0
scripts/restore

@@ -27,6 +27,9 @@ systemctl stop openvpn
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
 yunohost service enable "$service_name"
 yunohost service enable "$service_name"
 
 
+ynh_use_logrotate --logfile="/var/log/ynh-vpnclient.log"
+ynh_use_logrotate --logfile="/var/log/openvpn-client.log"
+
 # checker service
 # checker service
 
 
 systemctl start "$service_checker_name"
 systemctl start "$service_checker_name"

+ 10 - 0
scripts/upgrade

@@ -36,6 +36,10 @@ if [ -e "/etc/sudoers.d/${app}_ynh" ]; then
   ynh_safe_rm "/etc/sudoers.d/${app}_ynh"
   ynh_safe_rm "/etc/sudoers.d/${app}_ynh"
 fi
 fi
 
 
+if [ -e "/etc/yunohost/hooks.d/90-vpnclient.tpl" ]; then
+  ynh_secure_remove "/etc/yunohost/hooks.d/90-vpnclient.tpl"
+fi
+
 if [ -e "/etc/openvpn/client.conf.tpl" ]; then
 if [ -e "/etc/openvpn/client.conf.tpl" ]; then
   ynh_safe_rm "/etc/openvpn/client.conf.tpl"
   ynh_safe_rm "/etc/openvpn/client.conf.tpl"
 fi
 fi
@@ -59,6 +63,9 @@ fi
 if [ -z "${ip6_net:-}" ]; then
 if [ -z "${ip6_net:-}" ]; then
     ynh_app_setting_set --key=ip6_net --value=""
     ynh_app_setting_set --key=ip6_net --value=""
 fi
 fi
+if [ -z "${ip6_send_over_tun_enabled:-}" ]; then
+    ynh_app_setting_set --app=$app --key=ip6_send_over_tun_enabled --value=0
+fi
 
 
 #=================================================
 #=================================================
 # UPGRADE FROM BUSTER TO BULLSEYE
 # UPGRADE FROM BUSTER TO BULLSEYE
@@ -122,6 +129,9 @@ ynh_print_info "Configuring VPN client services..."
 # main service
 # main service
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
 
 
+ynh_use_logrotate --logfile="/var/log/ynh-vpnclient.log"
+ynh_use_logrotate --logfile="/var/log/openvpn-client.log"
+
 # checker service (this service was previously integrated in yunohost but we do not do this anymore)
 # checker service (this service was previously integrated in yunohost but we do not do this anymore)
 if ynh_hide_warnings yunohost service status $service_checker_name >/dev/null
 if ynh_hide_warnings yunohost service status $service_checker_name >/dev/null
 then
 then