BlockchainCommons / GordianServer-macOS

Tor-protected full-node GordianServer for macOS
Other
63 stars 8 forks source link

rpcauth #169

Closed Fonta1n3 closed 1 year ago

Fonta1n3 commented 2 years ago
ChristopherA commented 2 years ago

Why closed?

Fonta1n3 commented 2 years ago

Why closed?

Seems there was no interest and I wanted to make more commits and not have them show up here. Can add back again.

Fonta1n3 commented 1 year ago

Hey this fixes the update issue #180

shannona commented 1 year ago

incorporating into dev branch for testing.

shannona commented 1 year ago

Unfortunately, the PR doesn't work.

Trying it out on a M1 machine where I cleaned out the files with KILLALL:

error: 
2023-06-27 12:19:43.023308-1000 GordianServer-macOS[11743:577452] [connection] nw_socket_handle_socket_event [C1.1.1.1.1:4] Socket SO_ERROR [61: Connection refused]
2023-06-27 12:19:43.024568-1000 GordianServer-macOS[11743:577452] [connection] nw_socket_handle_socket_event [C1.1.1.1.2:4] Socket SO_ERROR [61: Connection refused]
2023-06-27 12:19:43.029390-1000 GordianServer-macOS[11743:577452] Connection 1: received failure notification
2023-06-27 12:19:43.029455-1000 GordianServer-macOS[11743:577452] Connection 1: failed to connect 1:61, reason -1
2023-06-27 12:19:43.029478-1000 GordianServer-macOS[11743:577452] Connection 1: encountered error(1:61)
2023-06-27 12:19:43.029961-1000 GordianServer-macOS[11743:577452] Task <AC22A867-941A-47ED-B4C3-99131536F174>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
2023-06-27 12:19:43.033138-1000 GordianServer-macOS[11743:577378] Task <AC22A867-941A-47ED-B4C3-99131536F174>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600002619fb0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), viable, interface: lo0, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <AC22A867-941A-47ED-B4C3-99131536F174>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <AC22A867-941A-47ED-B4C3-99131536F174>.<1>"
), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://blockchain.info/ticker, NSErrorFailingURLKey=https://blockchain.info/ticker, _kCFStreamErrorDomainKey=1}
2023-06-27 12:19:43.965752-1000 GordianServer-macOS[11743:577378] [Window] Warning: Window NSWindow 0x125ef5800 ordered front from a non-active application and may order beneath the active application's windows.
2023-06-27 12:20:09.659669-1000 GordianServer-macOS[11743:577378] Metal API Validation Enabled

No buttons at all are illuminated. (So not only can you not START or STOP, but VERIFY is gray too, as is the network choice.) rpc host is listed as unauthenticated.

Bitcoin 25 update was also not allowed to minimize variables.

==

Trying it out on an older (non-M1) machine where the directory was still in place:

2023-06-27 12:25:15.844346-1000 GordianServer-macOS[93699:1301986] [Nib Loading] Failed to connect (newWindowClicked) outlet from (GordianServer_macOS.AppDelegate) to (NSMenuItem): missing setter or instance variable
2023-06-27 12:25:15.931763-1000 GordianServer-macOS[93699:1301986] [Nib Loading] Failed to connect (perrDetailsButton) outlet from (GordianServer_macOS.ViewController) to (NSButton): missing setter or instance variable
env = ["VERSION": "bitcoin-25.0", "DATADIR": "/Users/shannona/Library/Application Support/Bitcoin", "CHAIN": "main", "BINARY_NAME": "bitcoin-25.0-x86_64-apple-darwin.tar.gz", "PREFIX": "bitcoin-25.0"]
libraryPath: /Users/shannona/Library/Developer/Xcode/DerivedData/GordianServer-macOS-bbduasnibbaxrzehsuwymrtjouxg/Build/Products/Debug/GordianServer-macOS.app/Contents/Resources/Python/Versions/3.10/Python
python version: 3.10.0 (v3.10.0:b494f5935c, Oct  4 2021, 14:59:20) [Clang 12.0.5 (clang-1205.0.22.11)]
env = ["BINARY_NAME": "bitcoin-25.0-x86_64-apple-darwin.tar.gz", "VERSION": "bitcoin-25.0", "PREFIX": "bitcoin-25.0", "CHAIN": "main", "DATADIR": "/Users/shannona/Library/Application Support/Bitcoin"]
Jun 27 12:25:18.012 [notice] Tor 0.4.4.6 (git-b7e5e4bdcaf0086e) running on Darwin with Libevent 2.1.11-stable, OpenSSL 3.0.0-alpha11-dev, Zlib 1.2.11, Liblzma 5.2.4, and Libzstd N/A.
Jun 27 12:25:18.012 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Jun 27 12:25:18.012 [notice] Read configuration file "/Users/shannona/.torrc".
Jun 27 12:25:18.015 [notice] Opening Socks listener on 127.0.0.1:19150
Jun 27 12:25:18.015 [notice] Opened Socks listener on 127.0.0.1:19150
Jun 27 12:25:18.015 [notice] Opening DNS listener on 127.0.0.1:12346
Jun 27 12:25:18.015 [notice] Opened DNS listener on 127.0.0.1:12346
Jun 27 12:25:18.015 [notice] Opening Control listener on /Users/shannona/.gordian/.tor/cp
Jun 27 12:25:18.015 [notice] Opened Control listener on /Users/shannona/.gordian/.tor/cp
2023-06-27 12:25:20.700978-1000 GordianServer-macOS[93699:1301986] Metal API Validation Enabled
2023-06-27 12:25:20.777206-1000 GordianServer-macOS[93699:1301986] [default] CGSWindowShmemCreateWithPort failed on port 0
2023-06-27 12:25:20.790366-1000 GordianServer-macOS[93699:1301986] [default] CGSWindowShmemCreateWithPort failed on port 0
2023-06-27 12:25:20.793884-1000 GordianServer-macOS[93699:1301986] [Window] Warning: Window _NSAlertPanel 0x7fbabebaab30 ordered front from a non-active application and may order beneath the active application's windows.
2023-06-27 12:25:20.829323-1000 GordianServer-macOS[93699:1302559] [connection] nw_socket_handle_socket_event [C1.1.1.1:4] Socket SO_ERROR [61: Connection refused]
2023-06-27 12:25:20.831081-1000 GordianServer-macOS[93699:1302559] [connection] nw_socket_handle_socket_event [C1.1.1.2:4] Socket SO_ERROR [61: Connection refused]
2023-06-27 12:25:20.831959-1000 GordianServer-macOS[93699:1302559] Connection 1: received failure notification
2023-06-27 12:25:20.832017-1000 GordianServer-macOS[93699:1302559] Connection 1: failed to connect 1:61, reason -1
2023-06-27 12:25:20.832041-1000 GordianServer-macOS[93699:1302559] Connection 1: encountered error(1:61)
2023-06-27 12:25:20.832434-1000 GordianServer-macOS[93699:1302559] Task <E75920D3-575B-4C3C-912E-6EEAE0A0FC97>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
python version: 3.10.0 (v3.10.0:b494f5935c, Oct  4 2021, 14:59:20) [Clang 12.0.5 (clang-1205.0.22.11)]
2023-06-27 12:25:28.581145-1000 GordianServer-macOS[93699:1301986] Task <E75920D3-575B-4C3C-912E-6EEAE0A0FC97>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600003b77420 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), viable, interface: lo0, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <E75920D3-575B-4C3C-912E-6EEAE0A0FC97>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <E75920D3-575B-4C3C-912E-6EEAE0A0FC97>.<1>"
), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://blockchain.info/ticker, NSErrorFailingURLKey=https://blockchain.info/ticker, _kCFStreamErrorDomainKey=1}
script: CheckForBitcoinCore
output: Bitcoin Core version v25.0.0
Copyright (C) 2009-2023 The Bitcoin Core developers

Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.

This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>

error: 
script: IsProcessRunning
output: 93026
Running

error: 
2023-06-27 12:25:29.076388-1000 GordianServer-macOS[93699:1301986] [default] CGSWindowShmemCreateWithPort failed on port 0
2023-06-27 12:25:29.084795-1000 GordianServer-macOS[93699:1301986] [default] CGSWindowShmemCreateWithPort failed on port 0
2023-06-27 12:25:31.244141-1000 GordianServer-macOS[93699:1301986] [default] CGSWindowShmemCreateWithPort failed on port 0
2023-06-27 12:25:31.252642-1000 GordianServer-macOS[93699:1301986] [default] CGSWindowShmemCreateWithPort failed on port 0

The START and STOP buttons are not available, though I think Bitcoin is running, as Server later asked if it should be left running when I killed Server.

rpc host is unauthenticated.

This was AFTER allowing the Bitcoin 25 update, which also didn't work right (I had to close out the install window after installation, and then restart the Server.)

==

If I was going to dig into this more my process would be:

  1. Set Bitcoin 25 as the default download to minimize that variable.
  2. Make sure Bitcoin 25 is downloaded correctly.
  3. Then dig back into the failed setup.
  4. Then merge in the newer updates on Master
  5. Then debug further
Fonta1n3 commented 1 year ago

I have not tested this on a fresh install (recently)... it's a 2 year old PR. I've been using this for 2 years without any issues, will try and delete Gordian directory and see if I can replicate your issue.

Keep in mind this has nothing do with with the RPC authentication for the tor hidden service. It just replaces the need for storing rpc creds in plain text in your bitcoin.conf

Fonta1n3 commented 1 year ago

fwiw I deleted the .gordian directory and it installed for me without any issues.