diff options
author | David Harrigan | 2019-10-22 22:15:16 +0100 |
---|---|---|
committer | David Harrigan | 2019-10-22 22:15:16 +0100 |
commit | 9ca341f9b21ef6e998ec27b447a871e2a0990a25 (patch) | |
tree | 9824af43344f551e949329a127ad3a4d64af4047 | |
parent | 1e97882eee2b4178bb5ddc049e80e770f2395f48 (diff) | |
download | aur-9ca341f9b21ef6e998ec27b447a871e2a0990a25.tar.gz |
upgpkg: mkinitcpio-wireguard 0.3.0-1
upstream release
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 8 | ||||
-rw-r--r-- | README.adoc | 5 | ||||
-rw-r--r-- | wireguard_config | 4 | ||||
-rw-r--r-- | wireguard_hook | 12 | ||||
-rw-r--r-- | wireguard_install | 22 |
6 files changed, 39 insertions, 20 deletions
@@ -1,6 +1,6 @@ pkgbase = mkinitcpio-wireguard pkgdesc = mkinitcpio hook that initialises Wireguard to assist in the remote unlocking of encrypted partitions. - pkgver = 0.2.0 + pkgver = 0.3.0 pkgrel = 1 url = https://github.com/dharrigan/mkinitcpio-wireguard install = mkinitcpio-wireguard.install @@ -12,9 +12,9 @@ pkgbase = mkinitcpio-wireguard source = wireguard_hook source = wireguard_install source = wireguard_config - sha256sums = cf4027c5c88a521f76ecfe257ee0bbcaf24294f8dcc97b8128cf77a3cd547d09 - sha256sums = 5bbbe54b9bd0469537c74f892fd30fcb90e9b49143addc7a03f4366419d6bff6 - sha256sums = 7e6c925ba973a90f63100a1a56b2e57f017d1155c1d0514f38cf9eeca557bd99 + sha256sums = 0d173d068d440ab423386994c3bb3e7acef6a1380db3586adbded129d1e3975b + sha256sums = 563e42ce30179df55132c10b295604e0a5a68d925890db55153764b4c3f959fe + sha256sums = e7a034b4239610be33ccb1001a0df947fb14cbe758b8f2825d8b890f2bfc043e pkgname = mkinitcpio-wireguard @@ -1,7 +1,7 @@ # Maintainer: David Harrigan <dharrigan [@] gmail [dot] com> pkgname=mkinitcpio-wireguard -pkgver=0.2.0 +pkgver=0.3.0 pkgrel=1 pkgdesc='mkinitcpio hook that initialises Wireguard to assist in the remote unlocking of encrypted partitions.' url='https://github.com/dharrigan/mkinitcpio-wireguard' @@ -19,9 +19,9 @@ package() { } sha256sums=( -'cf4027c5c88a521f76ecfe257ee0bbcaf24294f8dcc97b8128cf77a3cd547d09' -'5bbbe54b9bd0469537c74f892fd30fcb90e9b49143addc7a03f4366419d6bff6' -'7e6c925ba973a90f63100a1a56b2e57f017d1155c1d0514f38cf9eeca557bd99' +'0d173d068d440ab423386994c3bb3e7acef6a1380db3586adbded129d1e3975b' +'563e42ce30179df55132c10b295604e0a5a68d925890db55153764b4c3f959fe' +'e7a034b4239610be33ccb1001a0df947fb14cbe758b8f2825d8b890f2bfc043e' ) # vim:set syntax=sh tw=78: diff --git a/README.adoc b/README.adoc index 3845d4e8c333..30d6305500b9 100644 --- a/README.adoc +++ b/README.adoc @@ -25,6 +25,11 @@ WARNING: Read the warning above. |=== |Version | Note +| *0.3.0* +a| +* Various tidy ups and script improvements +* Rename PRIVATE_KEY_FILE to PRIVATE_KEYFILE + | *0.2.0* a| * Don't include the entire `/etc/wireguard` directory, instead use a subdirectory, namely `/etc/wireguard/initcpio` to keep things separate. diff --git a/wireguard_config b/wireguard_config index 59e82c08da51..0498f27c1d83 100644 --- a/wireguard_config +++ b/wireguard_config @@ -39,7 +39,7 @@ INTERFACE=wg0 # Specifies the address that the Wireguard interface will use. # Please ensure you specify the address in CIDR format. -INTERFACE_ADDR=10.0.200.21/24 +INTERFACE_ADDR=10.0.200.21/32 # This is the public key of the peer. PEER_PUBLIC_KEY=abcdefg @@ -49,7 +49,7 @@ PEER_PUBLIC_KEY=abcdefg PEER_ENDPOINT=192.168.80.1:12912 # This is your private key previously setup to establish connection to the peer. -PRIVATE_KEY_FILE=/etc/wireguard/initcpio/privatekey +PRIVATE_KEYFILE=/etc/wireguard/initcpio/privatekey # If you're behind a NAT, a ping of 25 seconds is useful! PERSISTENT_KEEPALIVES=25 diff --git a/wireguard_hook b/wireguard_hook index 59d85985fc83..d82729134a6f 100644 --- a/wireguard_hook +++ b/wireguard_hook @@ -26,9 +26,9 @@ # For more information, please refer to <http://unlicense.org/> # -_fatal () { echo ":: wireguard [FATAL]: ${@}. Cannot initialise Wireguard\!"; break=y; } +_fatal () { echo ":: wireguard [FATAL]: ${@}. Cannot initialise Wireguard!"; break=y; } -if [ -f /etc/wireguard/initcpio/unlock ]; then +if [ -s /etc/wireguard/initcpio/unlock ]; then . /etc/wireguard/initcpio/unlock fi @@ -49,8 +49,8 @@ run_hook() return 1 fi - if [ -z $PRIVATE_KEY_FILE -a -f $PRIVATE_KEY_FILE ]; then - _fatal 'Private key file is not defined!' + if [ ! -s $PRIVATE_KEYFILE ]; then + _fatal 'Private keyfile is not defined!' return 1 fi @@ -69,11 +69,11 @@ run_hook() return 1 fi - echo "Starting Wireguard Remote Unlock." + echo "Starting Wireguard." ip link add dev $INTERFACE type wireguard wg set $INTERFACE \ - private-key $PRIVATE_KEY_FILE \ + private-key $PRIVATE_KEYFILE \ peer $PEER_PUBLIC_KEY \ endpoint $PEER_ENDPOINT \ persistent-keepalive $PERSISTENT_KEEPALIVES \ diff --git a/wireguard_install b/wireguard_install index 1ba2f65f774a..1e2e0d42984b 100644 --- a/wireguard_install +++ b/wireguard_install @@ -28,12 +28,26 @@ build() { - add_binary wg - add_module wireguard + if [ ! -s /etc/wireguard/initcpio/unlock ]; then + error "Missing Wireguard initcpio hook unlock configuration file! Exiting!" + return 1 + else + . /etc/wireguard/initcpio/unlock + if [ ! -s $PRIVATE_KEYFILE ]; then + error "Missing Wireguard initcpio hook Private Keyfile! Exiting!" + return 1 + fi + fi - add_full_dir /etc/wireguard/initcpio + add_binary wg + add_module wireguard - add_runscript + add_dir /etc/wireguard/initcpio + + add_file $PRIVATE_KEYFILE + add_file /etc/wireguard/initcpio/unlock + + add_runscript } help() { |