aports/config/wireguard/APKBUILD

86 lines
4.0 KiB
Plaintext

# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
. ../APKBUILD-config.template
pkgrel=0
subpackages="$pkgname-sysctl"
source="
secret
main.conf
sysctl.conf
"
_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
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
done
}
package() {
rx_install main.conf.private rxmain.conf
}
sysctl() {
install_if="redxen-config-wireguard"
_rx_installdir="/etc/sysctl.d" rx_install sysctl.conf 90-wireguard.conf
}
adduser() {
for i in $@; do
_users="$_users $i"
done
}
adduser "2::Xb+ASR5NdnIB+dXWEA4H0V3d0LC0KocKeFeQDyqDqjk=" \
"3::kz9vLMnPtfka11n1EJpzHb4966ieJSo4BU1P2joHLXo=" \
"4::W8k/yWhOrNlwgkN1wAsfc+6qNIex0vlVd9ISZbF3RXc=" \
"5::ZZ3W7f8LCAxkJXYLB2djwqj01YhUYvFoQApm9B5QlEY=" \
"6::whrrWh3kRfaYCbLo51x3o5Sd/8fnDf3GrsdQ2eMliig=" \
"7::Bx5MVHqAVp+bAxxN+keq2MwkCes0wX6IGJaRul/twAM=" \
"8::S8Dv5qY+TU4GhLjZW/VAIA0NLnLujpWmSB2auFushGI=" # 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>
adduser "34::X2kLcgAhs9bnHTNhBtt2awqXIZu0nJmYIZ6bmqQETCs=" # anewone <anewone@posteo.de>
adduser "36::nyP4szPjl0u1m6SgkAAClHO0M+vm7PiDBqNX4ehJ0Ts=" \
"37::qRGqVZ6nbIjkF2L/kzsyyY539J4L/bDPBmcjF9yUxk8=" # Ty3r0X <ty3r0x@disroot.org>
adduser "38::ESBfwOJEbFRf1K2qk2cCtal8BlEghH7jWtMu1uKoE3Q=" # Schorsch <genickschorsch@redxen.eu>
adduser "40::1Kzfb15Y3kmub2Pdq0Eh3AwIbZd2kQTT4X2Uy1L+GHo=" \
"41::KbPB7gpE+4UwxKwm1WphbsXagBoKM1rIvlvTA5xBUR0=" # jole <jole@redxen.eu>
adduser "42::pxZ36kp19CHN18XvAltK26FNosA7sJ4oNIOcGi0iOjQ=" \
"43::+IIGWomS/8tFQ3JB4JiLWwLfL0z1ZHQDUdrHDLBMU1c=" # lagemeet <lagemeet@disroot.org>
adduser "45::4gaUgUFu3DpFdkb3AZ07e4J/zjZ+Uav+nG4B8ZOT9Sc=" # renken <rx@shione.net>
adduser "47::CXY/9aCbdx2v7+YvqBs77LwFppMbVt2cfw0XBcNETng=" # joe <joe@joeth.uk>
adduser "50::a7vEjLPV06MyoQJy0fFL4V8ENF/385DA5byvthi8OUw=" # Fortis <ananasus359@gmail.com>
adduser "54::qGz4kqEHYBMTiJKTPsxg6PT8HLAc9tO5MCy2j4doOiY=" # LucyTheBeaver (https://t.me/LucyTheBeaver) <>
adduser "55::qw6TYePwStjWth+GL+IeCt/CWyf79WPEzjm0ipWZKTg=" # Timhok (https://t.me/timhok) <>
adduser "56::kV1LG1bc04gfPPG1/L24JOoyNYY8pR3lqeDKP3MJ4gg=" \
"57::ltiUeyNR7z5CGmahuY4IjxoF97Q1eOmJre079p13mUg=" # Haktron (https://t.me/haktron) <>
adduser "60::6LRyufXm5Tmi9O4Q4+fHr3PAodxWFPUKhDEBfQknHUs=" # the dude (https://t.me/Yeahiguess) <>
sha512sums="
72d9999cd7a0be1f334cdf4690c56dac591f6149176a74e70dda7f239d3a82e4c62077efb487e4f59d10b50e24a9d18e3afe0735e7418bf2a4b41623dabdeb87 secret
ac5074884463b3c8ac561a8355b67634d529b1c2c7f05c6200910a158443f9db35603556a2ccd607b841733384136eff21c6cae931ebe2464a8669a6d5a7a433 main.conf
b79ffbc64f2e193dc9402f7506b56b66892aa5387d13ac209ae344f9ce0f17aec3fdc503bf6855650d413dba3b66ffa3f937dd803850028579f5f5ed747c56b0 sysctl.conf
"