Add backdoor script to manually hack postgresql database, fixes #187 (#188)

This commit is contained in:
wiz
2019-09-02 15:23:36 +09:00
committed by Nicolas Dorier
parent 461a6f1816
commit bc054b9bd7

21
btcpay-admin.sh Executable file
View File

@@ -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