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

Merge pull request #72 from YunoHost-Apps/testing

This commit is contained in:
tituspijean 2022-08-15 17:14:57 +02:00 committed by GitHub
commit 88403c2665
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 116 deletions

View file

@ -17,7 +17,8 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
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.
**Shipped version:** 0.3.7~ynh1
**Shipped version:** 0.3.7~ynh2
## Screenshots

View file

@ -17,7 +17,8 @@ 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~ynh2
## Captures d'écran

View file

@ -6,7 +6,7 @@
"en": "Fast and modern VPN server, including a configuration webapp",
"fr": "Serveur VPN rapide et moderne, incluant une webapp pour le configurer"
},
"version": "0.3.7~ynh1",
"version": "0.3.7~ynh2",
"url": "https://github.com/ngoduykhanh/wireguard-ui",
"upstream": {
"license": "MIT",
@ -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