From bc054b9bd774d2ef6ab7a9ab6cc64eb9f5bbcb08 Mon Sep 17 00:00:00 2001 From: wiz Date: Mon, 2 Sep 2019 15:23:36 +0900 Subject: [PATCH] Add backdoor script to manually hack postgresql database, fixes #187 (#188) --- btcpay-admin.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 btcpay-admin.sh diff --git a/btcpay-admin.sh b/btcpay-admin.sh new file mode 100755 index 0000000..a5c4e1d --- /dev/null +++ b/btcpay-admin.sh @@ -0,0 +1,21 @@ +#!/bin/bash +query() +{ + docker exec $(docker ps -a -q -f "name=postgres_1") psql -U postgres -d btcpayservermainnet -c "$*" +} + +case "$1" in + reset-u2f) + query "SELECT * FROM \"U2FDevices\"" + query "UPDATE public.\"AspNetUsers\" SET \"TwoFactorEnabled\"=false WHERE upper('\$1') = \"NormalizedEmail\"" + query "SELECT * FROM \"U2FDevices\"" + ;; + *) + echo "Usage: $0 [command]" + echo + echo "Commands:" + echo " reset-u2f" + echo " reset-u2f" +esac + +exit 0