2020-11-20 16:31:49 +00:00
|
|
|
# Contributor: Alex Denes <caskd@redxen.eu>
|
|
|
|
# Maintainer: Alex Denes <caskd@redxen.eu>
|
2021-02-07 21:36:32 +00:00
|
|
|
|
2021-06-01 23:17:41 +00:00
|
|
|
. ../APKBUILD-config.template
|
2021-02-07 21:36:32 +00:00
|
|
|
|
2022-03-18 18:43:17 +00:00
|
|
|
pkgver=2022.03.18.01
|
2021-06-01 23:17:41 +00:00
|
|
|
pkgrel=0
|
2021-02-07 21:36:32 +00:00
|
|
|
subpackages="$pkgname-sysctl"
|
2020-11-20 16:31:49 +00:00
|
|
|
source="
|
2021-06-01 23:17:41 +00:00
|
|
|
secret
|
2020-11-20 16:31:49 +00:00
|
|
|
main.conf
|
2020-12-13 01:33:40 +00:00
|
|
|
sysctl.conf
|
2020-11-20 16:31:49 +00:00
|
|
|
"
|
2021-06-01 23:17:41 +00:00
|
|
|
_users=""
|
|
|
|
|
|
|
|
build() {
|
|
|
|
. secret
|
|
|
|
: "${WIREGUARD_PRIVATEKEY:?'Private key missing'}"
|
|
|
|
|
|
|
|
cp main.conf main.conf.private
|
|
|
|
rx_replace "WIREGUARD_PRIVATEKEY" "$WIREGUARD_PRIVATEKEY" main.conf.private
|
|
|
|
for i in $_users; do
|
2022-03-18 18:43:17 +00:00
|
|
|
local peer="${i#*::}"
|
|
|
|
local v4="${i%::*}"
|
|
|
|
local v6="$(printf '%X' "$v4")"
|
|
|
|
msg "Added $peer as v4:$v4 v6:$v6"
|
|
|
|
printf "[Peer]\nPublicKey = %s\nAllowedIPs = 172.22.12.%s/32, fd42:42:42::2:%s/128\n" "$peer" "$v4" "$v6" >> main.conf.private
|
2021-06-01 23:17:41 +00:00
|
|
|
done
|
|
|
|
}
|
2020-11-20 16:31:49 +00:00
|
|
|
|
|
|
|
package() {
|
2021-06-01 23:17:41 +00:00
|
|
|
rx_install main.conf.private rxmain.conf
|
2021-02-07 21:36:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sysctl() {
|
|
|
|
install_if="redxen-config-wireguard"
|
2021-06-01 23:17:41 +00:00
|
|
|
_rx_installdir="/etc/sysctl.d" rx_install sysctl.conf 90-wireguard.conf
|
2020-11-20 16:31:49 +00:00
|
|
|
}
|
|
|
|
|
2021-06-01 23:17:41 +00:00
|
|
|
adduser() {
|
|
|
|
for i in $@; do
|
|
|
|
_users="$_users $i"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
adduser "2::Xb+ASR5NdnIB+dXWEA4H0V3d0LC0KocKeFeQDyqDqjk=" \
|
|
|
|
"3::kz9vLMnPtfka11n1EJpzHb4966ieJSo4BU1P2joHLXo=" # caskd <caskd@redxen.eu>
|
|
|
|
adduser "12::2FRcncz/oSmqFQLrHqICi4fEkgxrCeS9P8TTv5gcfCw=" # cherry <cherry@redxen.eu>
|
|
|
|
adduser "16::d459SqKVWko+wBhoFrU+yrFVM4BqI8FSmPtdrWepkw0=" # viggi <viggi@redxen.eu>
|
|
|
|
adduser "18::Fb8sYfZghohEpznWpt46x1cmmkymt2ksQL7fEBI6qlc=" # MartijnTim <martijntim@redxen.eu>
|
|
|
|
adduser "20::QHx0BCbRDKXX3OvdZwX9jYN2BMJPcPj4r/gYekkBTXY=" \
|
|
|
|
"21::THwCjbASYrGxjOiw/gvmiiXoQJpQF1LzLXbaEW8FVU4=" # Nova <novaburst@kalli.st>
|
|
|
|
adduser "24::zPg/v+EVJUhrSe1a3+ayzJuXakWUbgvcTgv3j4T11ks=" \
|
|
|
|
"25::ht/GLP/r7WWM2JP0Ya+vdA7+aigoy9tY8b4wOm2VAUg=" \
|
|
|
|
"26::PrGVHgZAM6vSK4I70QgYurIinKZE3b2Rrq5NQ8RDqS8=" # Shokara <shokara@snopyta.org>
|
|
|
|
adduser "30::S/4jSds8CNsyk1SjI03AxWtB3E9lhtW49dia+x9hoVs=" \
|
|
|
|
"31::SFPtaY7fn632wJXIkVYFtaPop7fGoX6pEkTkqZklHXM=" \
|
|
|
|
"32::g9hn9jKFUwU7cijAuleeDUL2EqiAOD8shY/pTAk0qTA=" \
|
|
|
|
"33::JlvGHLrhbce2yQAQEgbnIduXNwswTW9VIkDwvtOEiVQ=" # deavmi <deavmi@redxen.eu>
|
2021-09-18 16:01:01 +00:00
|
|
|
adduser "34::X2kLcgAhs9bnHTNhBtt2awqXIZu0nJmYIZ6bmqQETCs=" # anewone <anewone@posteo.de>
|
2021-06-01 23:17:41 +00:00
|
|
|
|
|
|
|
sha512sums="
|
|
|
|
72d9999cd7a0be1f334cdf4690c56dac591f6149176a74e70dda7f239d3a82e4c62077efb487e4f59d10b50e24a9d18e3afe0735e7418bf2a4b41623dabdeb87 secret
|
2021-09-18 16:01:01 +00:00
|
|
|
ac5074884463b3c8ac561a8355b67634d529b1c2c7f05c6200910a158443f9db35603556a2ccd607b841733384136eff21c6cae931ebe2464a8669a6d5a7a433 main.conf
|
2021-06-01 23:17:41 +00:00
|
|
|
b79ffbc64f2e193dc9402f7506b56b66892aa5387d13ac209ae344f9ce0f17aec3fdc503bf6855650d413dba3b66ffa3f937dd803850028579f5f5ed747c56b0 sysctl.conf
|
|
|
|
"
|