# Contributor: Alex Denes # Maintainer: Alex Denes . ../APKBUILD-config.template pkgver=2022.10.17.01 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=" # caskd adduser "12::2FRcncz/oSmqFQLrHqICi4fEkgxrCeS9P8TTv5gcfCw=" # cherry adduser "16::d459SqKVWko+wBhoFrU+yrFVM4BqI8FSmPtdrWepkw0=" # viggi adduser "18::Fb8sYfZghohEpznWpt46x1cmmkymt2ksQL7fEBI6qlc=" # MartijnTim adduser "20::QHx0BCbRDKXX3OvdZwX9jYN2BMJPcPj4r/gYekkBTXY=" \ "21::THwCjbASYrGxjOiw/gvmiiXoQJpQF1LzLXbaEW8FVU4=" # Nova adduser "24::zPg/v+EVJUhrSe1a3+ayzJuXakWUbgvcTgv3j4T11ks=" \ "25::ht/GLP/r7WWM2JP0Ya+vdA7+aigoy9tY8b4wOm2VAUg=" \ "26::PrGVHgZAM6vSK4I70QgYurIinKZE3b2Rrq5NQ8RDqS8=" # Shokara adduser "30::S/4jSds8CNsyk1SjI03AxWtB3E9lhtW49dia+x9hoVs=" \ "31::SFPtaY7fn632wJXIkVYFtaPop7fGoX6pEkTkqZklHXM=" \ "32::g9hn9jKFUwU7cijAuleeDUL2EqiAOD8shY/pTAk0qTA=" \ "33::JlvGHLrhbce2yQAQEgbnIduXNwswTW9VIkDwvtOEiVQ=" # deavmi adduser "34::X2kLcgAhs9bnHTNhBtt2awqXIZu0nJmYIZ6bmqQETCs=" # anewone adduser "36::nyP4szPjl0u1m6SgkAAClHO0M+vm7PiDBqNX4ehJ0Ts=" \ "37::qRGqVZ6nbIjkF2L/kzsyyY539J4L/bDPBmcjF9yUxk8=" # Ty3r0X adduser "38::ESBfwOJEbFRf1K2qk2cCtal8BlEghH7jWtMu1uKoE3Q=" # Schorsch adduser "40::1Kzfb15Y3kmub2Pdq0Eh3AwIbZd2kQTT4X2Uy1L+GHo=" \ "41::KbPB7gpE+4UwxKwm1WphbsXagBoKM1rIvlvTA5xBUR0=" # jole adduser "42::PYPaxtqy5zkRnv8RDM6oS4wcUGSEKRSR6xhw671yTRI=" \ "43::VmAZ+V5Go8nFla173LgUeUgfNgxmtECT3PRRVgZ+mRM=" # lagemeet adduser "45::4gaUgUFu3DpFdkb3AZ07e4J/zjZ+Uav+nG4B8ZOT9Sc=" # renken adduser "47::CXY/9aCbdx2v7+YvqBs77LwFppMbVt2cfw0XBcNETng=" # joe sha512sums=" 72d9999cd7a0be1f334cdf4690c56dac591f6149176a74e70dda7f239d3a82e4c62077efb487e4f59d10b50e24a9d18e3afe0735e7418bf2a4b41623dabdeb87 secret ac5074884463b3c8ac561a8355b67634d529b1c2c7f05c6200910a158443f9db35603556a2ccd607b841733384136eff21c6cae931ebe2464a8669a6d5a7a433 main.conf b79ffbc64f2e193dc9402f7506b56b66892aa5387d13ac209ae344f9ce0f17aec3fdc503bf6855650d413dba3b66ffa3f937dd803850028579f5f5ed747c56b0 sysctl.conf "