mirror of
https://github.com/YunoHost-Apps/wireguard_ynh.git
synced 2024-09-03 20:35:58 +02:00
commit
86f08902e0
15 changed files with 43 additions and 76 deletions
|
@ -15,9 +15,9 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
|||
|
||||
## Overview
|
||||
|
||||
Virtual Private Networks (VPN) via WireGuard, with a web UI to ease configuration
|
||||
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.2.7~ynh8
|
||||
**Shipped version:** 0.3.2~ynh1
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
|||
|
||||
## Vue d'ensemble
|
||||
|
||||
Réseaux Privés Virtuels (VPN) via WireGuard, avec une web UI pour faciliter sa configuration
|
||||
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.2.7~ynh8
|
||||
**Version incluse :** 0.3.2~ynh1
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
SOURCE_URL=https://github.com/ngoduykhanh/wireguard-ui/releases/download/v0.2.7/wireguard-ui-v0.2.7-linux-386.tar.gz
|
||||
SOURCE_SUM=16EA7A77E5BAC17C1B680ABF9CFF31E3F8313F8E00F9B88F8F6151D8F6A6EE12
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=false
|
||||
SOURCE_FILENAME=
|
|
@ -1,6 +1,5 @@
|
|||
SOURCE_URL=https://github.com/ngoduykhanh/wireguard-ui/releases/download/v0.2.7/wireguard-ui-v0.2.7-linux-amd64.tar.gz
|
||||
SOURCE_SUM=DC0FF54ABD2E08DB5ED722E07CEDA6E007CD5E6DFABD3A3B5A948CC8275D8100
|
||||
SOURCE_URL=https://github.com/ngoduykhanh/wireguard-ui/releases/download/v0.3.2/wireguard-ui-v0.3.2-linux-amd64.tar.gz
|
||||
SOURCE_SUM=71972b81f2d2ade50484cc1501a5896c8a08cfd82297f81c1d6279d7e0ff1f35
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=false
|
||||
SOURCE_FILENAME=
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
SOURCE_URL=https://github.com/ngoduykhanh/wireguard-ui/releases/download/v0.2.7/wireguard-ui-v0.2.7-linux-arm.tar.gz
|
||||
SOURCE_SUM=07003BF178A81C3D699CB3977028DB728C5E4D44003A7972855C3488F416E467
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=false
|
||||
SOURCE_FILENAME=
|
|
@ -1,6 +1,5 @@
|
|||
SOURCE_URL=https://github.com/ngoduykhanh/wireguard-ui/releases/download/v0.2.7/wireguard-ui-v0.2.7-linux-arm64.tar.gz
|
||||
SOURCE_SUM=32331E591B0C3B9E4EC360B53B967A3CCEEEFE5B7FFEC3ADD61A9483B50B9F0D
|
||||
SOURCE_URL=https://github.com/ngoduykhanh/wireguard-ui/releases/download/v0.3.2/wireguard-ui-v0.3.2-linux-arm64.tar.gz
|
||||
SOURCE_SUM=8d31fc39495f8a6480531859f225f0fee36788515532d75d9cfaaa866000f52f
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=false
|
||||
SOURCE_FILENAME=
|
||||
|
|
5
conf/armhf.src
Normal file
5
conf/armhf.src
Normal file
|
@ -0,0 +1,5 @@
|
|||
SOURCE_URL=https://github.com/ngoduykhanh/wireguard-ui/releases/download/v0.3.2/wireguard-ui-v0.3.2-linux-arm.tar.gz
|
||||
SOURCE_SUM=4632fd96c7574321031907695fbbe6535884a8006b517c7f7d3ab289fb94be5f
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=false
|
5
conf/i386.src
Normal file
5
conf/i386.src
Normal file
|
@ -0,0 +1,5 @@
|
|||
SOURCE_URL=https://github.com/ngoduykhanh/wireguard-ui/releases/download/v0.3.2/wireguard-ui-v0.3.2-linux-386.tar.gz
|
||||
SOURCE_SUM=f76fc030d54e735977236d1984a906e749abb038208f410b406a2972498e3b9e
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=false
|
|
@ -1,11 +1,6 @@
|
|||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||
location __PATH__/ {
|
||||
|
||||
# Force usage of https
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
proxy_pass http://127.0.0.1:__PORT__/;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
|
|
1
doc/DESCRIPTION.md
Normal file
1
doc/DESCRIPTION.md
Normal file
|
@ -0,0 +1 @@
|
|||
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.
|
|
@ -3,10 +3,10 @@
|
|||
"id": "wireguard",
|
||||
"packaging_format": 1,
|
||||
"description": {
|
||||
"en": "Virtual Private Networks (VPN) via WireGuard, with a web UI to ease configuration",
|
||||
"fr": "Réseaux Privés Virtuels (VPN) via WireGuard, avec une web UI pour faciliter sa configuration"
|
||||
"en": "Web user interface to manage your WireGuard setup",
|
||||
"fr": "Interface utilisateur Web pour gérer votre configuration WireGuard"
|
||||
},
|
||||
"version": "0.2.7~ynh8",
|
||||
"version": "0.3.2~ynh1",
|
||||
"url": "https://github.com/ngoduykhanh/wireguard-ui",
|
||||
"upstream": {
|
||||
"license": "MIT",
|
||||
|
@ -19,7 +19,7 @@
|
|||
"email": "tituspijean@outlook.com"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.2"
|
||||
"yunohost": ">= 4.3.0"
|
||||
},
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
|
@ -37,17 +37,11 @@
|
|||
},
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"example": "wg.example.com",
|
||||
"help": {
|
||||
"en": "The web UI requires its own dedicated domain.",
|
||||
"fr": "L'interface web nécessite son propre domaine."
|
||||
}
|
||||
"type": "domain"
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"type": "user",
|
||||
"example": "johndoe"
|
||||
"type": "user"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -4,11 +4,16 @@
|
|||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
# dependencies used by the app
|
||||
if grep "Raspberry Pi" /proc/device-tree/model; then
|
||||
pkg_headers="raspberrypi-kernel-headers"
|
||||
# WireGuard was integrated in Linux kernel 5.6
|
||||
# Before that, we need Linux Headers
|
||||
if dpkg --compare-versions $(uname -r) lt 5.6; then
|
||||
if grep "Raspberry Pi" /proc/device-tree/model; then
|
||||
pkg_headers="raspberrypi-kernel-headers"
|
||||
else
|
||||
pkg_headers="linux-headers-$(uname -r)"
|
||||
fi
|
||||
else
|
||||
pkg_headers="linux-headers-$(uname -r)"
|
||||
pkg_headers=""
|
||||
fi
|
||||
|
||||
# dependencies used by the app
|
||||
|
@ -63,30 +68,6 @@ ynh_install_repo_gpg () {
|
|||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
||||
# Check the architecture
|
||||
#
|
||||
# example: architecture=$(ynh_detect_arch)
|
||||
#
|
||||
# usage: ynh_detect_arch
|
||||
#
|
||||
# Requires YunoHost version 2.2.4 or higher.
|
||||
|
||||
ynh_detect_arch(){
|
||||
local architecture
|
||||
if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
|
||||
architecture="arm64"
|
||||
elif [ -n "$(uname -m | grep 64)" ]; then
|
||||
architecture="amd64"
|
||||
elif [ -n "$(uname -m | grep 86)" ]; then
|
||||
architecture="386"
|
||||
elif [ -n "$(uname -m | grep arm)" ]; then
|
||||
architecture="arm"
|
||||
else
|
||||
architecture="unknown"
|
||||
fi
|
||||
echo $architecture
|
||||
}
|
||||
|
||||
# Send an email to inform the administrator
|
||||
#
|
||||
# usage: ynh_send_readme_to_admin --app_message=app_message [--recipients=recipients] [--type=type]
|
||||
|
|
|
@ -27,6 +27,7 @@ ynh_abort_if_errors
|
|||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path_url="/"
|
||||
admin=$YNH_APP_ARG_ADMIN
|
||||
architecture=$YNH_ARCH
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -98,7 +99,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1
|
|||
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path" --source_id="$(ynh_detect_arch)"
|
||||
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
@ -198,7 +199,7 @@ ynh_permission_update --permission="main" --remove="all_users" --add="$admin"
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." --weight=1
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -39,8 +39,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||
|
||||
test ! -d $final_path \
|
||||
|| ynh_die --message="There is already a directory: $final_path "
|
||||
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
|
|
|
@ -21,6 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
|||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
port_wg=$(ynh_app_setting_get --app=$app --key=port_wg)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
architecture=$YNH_ARCH
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -70,14 +71,13 @@ then
|
|||
fi
|
||||
|
||||
# Downgrade linux-image-$arch if updated to the buster-backports version
|
||||
arch=$(ynh_detect_arch)
|
||||
linuximage_version=$(ynh_package_version --package=linux-image-$arch)
|
||||
linuximage_version=$(ynh_package_version --package=linux-image-$architecture)
|
||||
if [[ $linuximage_version == *"bpo10"* ]]
|
||||
then
|
||||
# Downgrading using ynh_package_install apt command without "--no-remove" and with "--allow-downgrades"
|
||||
# It will remove wireguard-ynh-deps and wireguard but they will be reinstalled throught upgrade process
|
||||
ynh_apt --allow-downgrades --option Dpkg::Options::=--force-confdef \
|
||||
--option Dpkg::Options::=--force-confold install linux-image-$arch/stable
|
||||
--option Dpkg::Options::=--force-confold install linux-image-$architecture/stable
|
||||
|
||||
#Remove backports kernel if running on it and send a mail to the admin to ask him to reboot
|
||||
linuxkernel_version=$(uname -r)
|
||||
|
@ -124,13 +124,13 @@ then
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path" --source_id="$(ynh_detect_arch)"
|
||||
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
|
Loading…
Add table
Reference in a new issue