From 21d2c73d93cefb2435bdb2e0e1bb7ea1de2637b6 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 15 Aug 2022 17:12:27 +0200 Subject: [PATCH] Bullseye: drop linux headers requirements (#41) Co-authored-by: yunohost-bot --- README.md | 20 ++++++++--------- README_fr.md | 28 +++++++++++++---------- manifest.json | 10 +-------- scripts/_common.sh | 55 +++------------------------------------------- scripts/install | 17 +------------- scripts/restore | 19 +--------------- scripts/upgrade | 19 +--------------- 7 files changed, 33 insertions(+), 135 deletions(-) diff --git a/README.md b/README.md index 7b6a557..4a714bc 100644 --- a/README.md +++ b/README.md @@ -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: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## 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 \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 6e5868f..950035e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # 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 : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## 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 \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** diff --git a/manifest.json b/manifest.json index af48319..0f28fdd 100644 --- a/manifest.json +++ b/manifest.json @@ -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" diff --git a/scripts/_common.sh b/scripts/_common.sh index 502eb89..ee62c6f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -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 #================================================= diff --git a/scripts/install b/scripts/install index fd862ce..242a382 100644 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/restore b/scripts/restore index cf7bda3..e4e888b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index 249fbe6..56065d5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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