With this PR we might call the stop method even when the start
method of a subsystem did not successfully finish therefore we
need to make sure we guard the stop methods for potential panics
if some variables are not initialized in the contructors of the
subsystems.
Bump all build go versions to v1.21.0
Bump the minimum build package version to v1.19.0
Debian "buster" is not longer supported. Security updates have been
discontinued since June 30th 2022. We will build using the latest
version, "bookworm".
With this commit we avoid calling LookupHost if we already have an IPv4
or IPv6 address, as we can return that directly.
This avoids asking Tor to resolve an IPv6 address, which it cannot do.
This commit lays the groundwork for enabling the option of encrypting a Tor private key on disk, and removes the onion type parameters from the OnionStore interface methods, since they are unused.
Replies may contain quoted values that include spaces, newlines and/or
escaped characters (including doublequote itself). Not accounting for
that leads to errors when e. g. `COOKIEFILE` path contains spaces.
Fixes#6013.
This commit fixes the Tor healthcheck that would previously fail if
there were multiple hidden service registered.
In the controller, we only need to know that our service is contained in
the list of active services. But we can't do a string equality check
since there might be multiple services, comma separated.
A new method, Reconnect, is added to tor controller which can be used to
reset the current connection. This will be later used in healthcheck to
help us reset the connection to Tor Daemon.
This commit adds a new response reader which replaces the old
textproto.Reader.ReadResponse. The older reader cannot handle the case
when the reply from Tor server contains a data reply line, which uses
the symbol "+" to signal such a case.
This commit adds a new method to call DEL_ONION when lnd is shutting
down. Tor controller will now be aware of the active serviceID and
removes the service upon shutdown.
If we use a chain backend that only understands IP addresses (like
Neutrino for example), we need to turn any Onion v2 host addresses into
a fake IPv6 representation, otherwise it would be resolved incorrectly.
To do this, we use the same fake IPv6 address format that bitcoind and
btcd use internally to represent Onion v2 hidden service addresses.
This provides users an alternative over the SAFECOOKIE authentication
method, which may not be as useful if users are connecting to a remote
Tor sevrer due to lnd not being able to retrieve the cookie file.
In this commit, we modify the AddOnionConfig struct to include an
abstract OnionStore, which will be responsible for storing all relevant
information of an onion service. We also add a file-based implementation
of the interface to maintain the same behavior of storing an onion
service's private key in a file.
In this commit, we extend our Tor controller to also support creating v3
onion services, as they are now supported by the Tor daemon. We also
refactor our existing AddOnion method to take in a config struct that
houses all of the required options to create/restore an onion service.