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

Install backports repo gpg key and linux-headers (#18)

* Install backports repo gpg key

* Add linux-headers dependency

* Fix repo key

* Remove linux-headers dependency
It is handled by the wireguard dependencies
This commit is contained in:
tituspijean 2021-03-20 18:36:54 +01:00 committed by GitHub
parent 0cbc000b24
commit e9525eb25c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 0 deletions

View file

@ -11,6 +11,47 @@ pkg_dependencies="wireguard-dkms 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

@ -73,6 +73,9 @@ 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"

View file

@ -136,6 +136,9 @@ 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"