1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wireguard_ynh.git synced 2024-09-03 20:35:58 +02:00

Bullseye: drop linux headers requirements (#41)

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
tituspijean 2022-08-15 17:12:27 +02:00 committed by GitHub
parent 6960cc9532
commit 21d2c73d93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 135 deletions

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# WireGuard for YunoHost
[![Integration level](https://dash.yunohost.org/integration/wireguard.svg)](https://dash.yunohost.org/appci/app/wireguard) ![](https://ci-apps.yunohost.org/ci/badges/wireguard.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/wireguard.maintain.svg)
[![Integration level](https://dash.yunohost.org/integration/wireguard.svg)](https://dash.yunohost.org/appci/app/wireguard) ![Working status](https://ci-apps.yunohost.org/ci/badges/wireguard.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/wireguard.maintain.svg)
[![Install WireGuard with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wireguard)
*[Lire ce readme en français.](./README_fr.md)*
@ -20,11 +20,10 @@ WireGuard® is fast and modern VPN that utilizes state-of-the-art cryptography.
**Shipped version:** 0.3.7~ynh1
## Screenshots
![](./doc/screenshots/screenshot.png)
![](./doc/screenshots/screenshot.png:Zone.Identifier)
![Screenshot of WireGuard](./doc/screenshots/screenshot.png)
![Screenshot of WireGuard](./doc/screenshots/screenshot.png:Zone.Identifier)
## Disclaimers / important information
@ -40,20 +39,21 @@ After installation, you need to `Apply Config` once in the UI before the VPN ser
## Documentation and resources
* Official app website: https://www.wireguard.com/
* Upstream app code repository: https://github.com/ngoduykhanh/wireguard-ui
* YunoHost documentation for this app: https://yunohost.org/app_wireguard
* Report a bug: https://github.com/YunoHost-Apps/wireguard_ynh/issues
* Official app website: <https://www.wireguard.com/>
* Upstream app code repository: <https://github.com/ngoduykhanh/wireguard-ui>
* YunoHost documentation for this app: <https://yunohost.org/app_wireguard>
* Report a bug: <https://github.com/YunoHost-Apps/wireguard_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/wireguard_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/wireguard_ynh/tree/testing --debug
or
sudo yunohost app upgrade wireguard -u https://github.com/YunoHost-Apps/wireguard_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,10 +1,14 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# WireGuard pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/wireguard.svg)](https://dash.yunohost.org/appci/app/wireguard) ![](https://ci-apps.yunohost.org/ci/badges/wireguard.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/wireguard.maintain.svg)
[![Niveau d'intégration](https://dash.yunohost.org/integration/wireguard.svg)](https://dash.yunohost.org/appci/app/wireguard) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/wireguard.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/wireguard.maintain.svg)
[![Installer WireGuard avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wireguard)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer WireGuard rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
@ -13,14 +17,13 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
WireGuard® is fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN.
**Version incluse :** 0.3.7~ynh1
**Version incluse :** 0.3.7~ynh1
## Captures d'écran
![](./doc/screenshots/screenshot.png)
![](./doc/screenshots/screenshot.png:Zone.Identifier)
![Capture d'écran de WireGuard](./doc/screenshots/screenshot.png)
![Capture d'écran de WireGuard](./doc/screenshots/screenshot.png:Zone.Identifier)
## Avertissements / informations importantes
@ -36,20 +39,21 @@ Après installation, vous devrez cliquer sur `Apply Config` une fois dans l'UI a
## Documentations et ressources
* Site officiel de l'app : https://www.wireguard.com/
* Dépôt de code officiel de l'app : https://github.com/ngoduykhanh/wireguard-ui
* Documentation YunoHost pour cette app : https://yunohost.org/app_wireguard
* Signaler un bug : https://github.com/YunoHost-Apps/wireguard_ynh/issues
* Site officiel de l'app : <https://www.wireguard.com/>
* Dépôt de code officiel de l'app : <https://github.com/ngoduykhanh/wireguard-ui>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_wireguard>
* Signaler un bug : <https://github.com/YunoHost-Apps/wireguard_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/wireguard_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/wireguard_ynh/tree/testing --debug
ou
sudo yunohost app upgrade wireguard -u https://github.com/YunoHost-Apps/wireguard_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

View file

@ -19,7 +19,7 @@
"email": "tituspijean@outlook.com"
},
"requirements": {
"yunohost": ">= 4.3.0"
"yunohost": ">= 11"
},
"multi_instance": false,
"services": [
@ -27,14 +27,6 @@
],
"arguments": {
"install": [
{
"name": "warning",
"type": "display_text",
"ask": {
"en": "WireGuard installs a Linux kernel module and will most likely require a reboot of your server to work properly.",
"fr": "WireGuard installe un module au noyau Linux et nécessite probablement un redémarrage du serveur pour fonctionner correctement."
}
},
{
"name": "domain",
"type": "domain"

View file

@ -4,66 +4,17 @@
# COMMON VARIABLES
#=================================================
# WireGuard was integrated in Linux kernel 5.6
# Before that, we need Linux Headers
if dpkg --compare-versions $(uname -r) lt 5.6; then
pkg_headers="raspberrypi-kernel-headers|linux-headers-generic|linux-headers-virtual|linux-headers-$(uname -r)|linux-headers-${YNH_ARCH}|linux-headers-cloud-${YNH_ARCH}"
else
pkg_headers=""
fi
# dependencies used by the app
pkg_dependencies="$pkg_headers dkms wireguard-dkms wireguard"
interface=$(ip route | awk '/default/ { print $5 }' | head -n1)
main_domain=$(cat /etc/yunohost/current_host)
# dependencies used by the app
pkg_dependencies="wireguard"
#=================================================
# PERSONAL HELPERS
#=================================================
# Add gpg keys for repositories
#
# [internal]
#
# usage: ynh_install_repo_gpg --key=key_url --name=name [--append]
# | arg: -k, --key= - url to get the public key.
# | arg: -n, --name= - Name for the files for this repo, $app as default value.
# | arg: -a, --append - Do not overwrite existing files.
#
# Requires YunoHost version 3.8.1 or higher.
ynh_install_repo_gpg () {
# Declare an array to define the options of this helper.
local legacy_args=kna
local -A args_array=( [k]=key= [n]=name= [a]=append )
local key
local name
local append
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
name="${name:-$app}"
append=${append:-0}
key=${key:-}
if [ $append -eq 1 ]
then
append="--append"
wget_append="tee --append"
else
append=""
wget_append="tee"
fi
# Get the public key for the repo
if [ -n "$key" ]
then
mkdir --parents "/etc/apt/trusted.gpg.d"
# Timeout option is here to enforce the timeout on dns query and tcp connect (c.f. man wget)
wget --timeout 900 --quiet "$key" --output-document=- | gpg --dearmor | $wget_append /etc/apt/trusted.gpg.d/$name.gpg > /dev/null
fi
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================

View file

@ -76,22 +76,7 @@ ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port_wg
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=7
# Add buster-backports gpg key
ynh_install_repo_gpg --key="https://ftp-master.debian.org/keys/archive-key-10.asc" --name="$app"
# Add buster-backports repo
ynh_add_repo --uri="http://deb.debian.org/debian" --suite="buster-backports" --component="main" --name="$app"
# Add pin-priority for wireguard packages
ynh_pin_repo --package="wireguard*" --pin="origin deb http://deb.debian.org/debian buster-backports main" --priority=995 --name="$app"
# Update the list of package with the new repo
ynh_package_update
ynh_add_app_dependencies --package="$pkg_dependencies"
# Remove buster-backports repo and pin-priority
ynh_remove_extra_repo --name=$app
ynh_install_app_dependencies "$pkg_dependencies"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE

View file

@ -85,24 +85,7 @@ chown -R $app: /etc/wireguard
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=5
# Define and install dependencies
# Add buster-backports gpg key
ynh_install_repo_gpg --key="https://ftp-master.debian.org/keys/archive-key-10.asc" --name="$app"
# Add buster-backports repo
ynh_add_repo --uri="http://deb.debian.org/debian" --suite="buster-backports" --component="main" --name="$app"
# Add pin-priority for wireguard packages
ynh_pin_repo --package="wireguard*" --pin="origin deb http://deb.debian.org/debian buster-backports main" --priority=995 --name="$app"
# Update the list of package with the new repo
ynh_package_update
ynh_add_app_dependencies --package="$pkg_dependencies"
#Remove buster-backports repo and pin-priority
ynh_remove_extra_repo --name=$app
ynh_install_app_dependencies "$pkg_dependencies"
#=================================================
# RESTORE SYSTEMD

View file

@ -156,24 +156,7 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=7
#TODO: remove buster-backports kernel
# Add buster-backports gpg key
ynh_install_repo_gpg --key="https://ftp-master.debian.org/keys/archive-key-10.asc" --name="$app"
# Add buster-backports repo
ynh_add_repo --uri="http://deb.debian.org/debian" --suite="buster-backports" --component="main" --name="$app"
# Add pin-priority for wireguard packages
ynh_pin_repo --package="wireguard*" --pin="origin deb http://deb.debian.org/debian buster-backports main" --priority=995 --name="$app"
# Update the list of package with the new repo
ynh_package_update
ynh_add_app_dependencies --package="$pkg_dependencies"
# Remove buster-backports repo and pin-priority
ynh_remove_extra_repo --name=$app
ynh_install_app_dependencies "$pkg_dependencies"
#=================================================
# CREATE DEDICATED USER