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
|
## 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
|
## 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_URL=https://github.com/ngoduykhanh/wireguard-ui/releases/download/v0.3.2/wireguard-ui-v0.3.2-linux-amd64.tar.gz
|
||||||
SOURCE_SUM=DC0FF54ABD2E08DB5ED722E07CEDA6E007CD5E6DFABD3A3B5A948CC8275D8100
|
SOURCE_SUM=71972b81f2d2ade50484cc1501a5896c8a08cfd82297f81c1d6279d7e0ff1f35
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=false
|
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_URL=https://github.com/ngoduykhanh/wireguard-ui/releases/download/v0.3.2/wireguard-ui-v0.3.2-linux-arm64.tar.gz
|
||||||
SOURCE_SUM=32331E591B0C3B9E4EC360B53B967A3CCEEEFE5B7FFEC3ADD61A9483B50B9F0D
|
SOURCE_SUM=8d31fc39495f8a6480531859f225f0fee36788515532d75d9cfaaa866000f52f
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=false
|
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;
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||||
location __PATH__/ {
|
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_pass http://127.0.0.1:__PORT__/;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_set_header Host $host;
|
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",
|
"id": "wireguard",
|
||||||
"packaging_format": 1,
|
"packaging_format": 1,
|
||||||
"description": {
|
"description": {
|
||||||
"en": "Virtual Private Networks (VPN) via WireGuard, with a web UI to ease configuration",
|
"en": "Web user interface to manage your WireGuard setup",
|
||||||
"fr": "Réseaux Privés Virtuels (VPN) via WireGuard, avec une web UI pour faciliter sa configuration"
|
"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",
|
"url": "https://github.com/ngoduykhanh/wireguard-ui",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
"email": "tituspijean@outlook.com"
|
"email": "tituspijean@outlook.com"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 4.2"
|
"yunohost": ">= 4.3.0"
|
||||||
},
|
},
|
||||||
"multi_instance": false,
|
"multi_instance": false,
|
||||||
"services": [
|
"services": [
|
||||||
|
@ -37,17 +37,11 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "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."
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "admin",
|
"name": "admin",
|
||||||
"type": "user",
|
"type": "user"
|
||||||
"example": "johndoe"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,16 @@
|
||||||
# COMMON VARIABLES
|
# COMMON VARIABLES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# dependencies used by the app
|
# WireGuard was integrated in Linux kernel 5.6
|
||||||
if grep "Raspberry Pi" /proc/device-tree/model; then
|
# Before that, we need Linux Headers
|
||||||
pkg_headers="raspberrypi-kernel-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
|
else
|
||||||
pkg_headers="linux-headers-$(uname -r)"
|
pkg_headers=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
|
@ -63,30 +68,6 @@ ynh_install_repo_gpg () {
|
||||||
# EXPERIMENTAL HELPERS
|
# 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
|
# Send an email to inform the administrator
|
||||||
#
|
#
|
||||||
# usage: ynh_send_readme_to_admin --app_message=app_message [--recipients=recipients] [--type=type]
|
# 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
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url="/"
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
|
architecture=$YNH_ARCH
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
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
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# 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
|
# NGINX CONFIGURATION
|
||||||
|
@ -198,7 +199,7 @@ ynh_permission_update --permission="main" --remove="all_users" --add="$admin"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# 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
|
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
|
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||||
|
|
||||||
test ! -d $final_path \
|
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD RESTORATION STEPS
|
# 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=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
port_wg=$(ynh_app_setting_get --app=$app --key=port_wg)
|
port_wg=$(ynh_app_setting_get --app=$app --key=port_wg)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
architecture=$YNH_ARCH
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -70,14 +71,13 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Downgrade linux-image-$arch if updated to the buster-backports version
|
# Downgrade linux-image-$arch if updated to the buster-backports version
|
||||||
arch=$(ynh_detect_arch)
|
linuximage_version=$(ynh_package_version --package=linux-image-$architecture)
|
||||||
linuximage_version=$(ynh_package_version --package=linux-image-$arch)
|
|
||||||
if [[ $linuximage_version == *"bpo10"* ]]
|
if [[ $linuximage_version == *"bpo10"* ]]
|
||||||
then
|
then
|
||||||
# Downgrading using ynh_package_install apt command without "--no-remove" and with "--allow-downgrades"
|
# 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
|
# 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 \
|
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
|
#Remove backports kernel if running on it and send a mail to the admin to ask him to reboot
|
||||||
linuxkernel_version=$(uname -r)
|
linuxkernel_version=$(uname -r)
|
||||||
|
@ -124,13 +124,13 @@ then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# 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
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# 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
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
Loading…
Add table
Reference in a new issue