35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
# Contributor: Alex Denes <caskd@redxen.eu>
|
|
# Maintainer: Alex Denes <caskd@redxen.eu>
|
|
|
|
. ../APKBUILD-config.template
|
|
|
|
pkgver=2021.06.06.01
|
|
pkgrel=0
|
|
source="
|
|
secret
|
|
settings.json
|
|
"
|
|
|
|
build() {
|
|
. secret
|
|
: "${TRANSMISSION_USERNAME:?'Transmission username is missing'}"
|
|
: "${TRANSMISSION_PASSWORD:?'Transmission password is missing'}"
|
|
|
|
cp "settings.json" "settings.json.private"
|
|
TRANSMISSION_PASS_SALT="$(cat /dev/urandom | tr -dc '[:alnum:]./' | head -c 8)"
|
|
TRANSMISSION_PASS_HASH="$(printf '%s%s' "$TRANSMISSION_PASSWORD" "$TRANSMISSION_PASS_SALT" | sha1sum)"
|
|
TRANSMISSION_PASS_SALTED="{${TRANSMISSION_PASS_HASH%% *}$TRANSMISSION_PASS_SALT"
|
|
rx_replace "TRANSMISSION_USERNAME" "$TRANSMISSION_USERNAME" settings.json.private
|
|
rx_replace "TRANSMISSION_PASSWORD" "$TRANSMISSION_PASS_SALTED" settings.json.private
|
|
}
|
|
|
|
package() {
|
|
rx_install "settings.json.private" "settings.json"
|
|
install -dm700 "$(rx_cpkgdir)"/"$_rx_installdir"/resume "$(rx_cpkgdir)"/seedbox
|
|
}
|
|
|
|
sha512sums="
|
|
7435cdea2f9a63d09164c6c7cf6105e24a27316150bbebb7c2abda0a72c9ffcbd36632be1f9d77bccdc616fa8b84a9bfeaa4b5b32349d11a3d4f9c12ee884963 secret
|
|
bd60b90cc7cb89faa97b37ba76f66212b4f01e2a5bcc0a072a43078b433f64374c5acb542ec93590724a0a74d0f779dfc73288b1c04dc292363b33a274cb05c8 settings.json
|
|
"
|