Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ type ClientConfig struct {
// SwapServerNoTLS skips TLS for the swap server connection when set.
SwapServerNoTLS bool

// TLSPathServer is the path to the TLS certificate that is required to
// connect to the server.
TLSPathServer string
// TLSCertPathServer is the path to the TLS certificate that is
// required to connect to the server.
TLSCertPathServer string

// Lnd is an instance of the lnd proxy.
Lnd *lndclient.LndServices
Expand Down
17 changes: 14 additions & 3 deletions loopd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ var (
// LoopDirBase is the default main directory where loop stores its data.
LoopDirBase = btcutil.AppDataDir("loop", false)

// ApertureDirBase is the default main directory where aperture stores
// its data.
ApertureDirBase = btcutil.AppDataDir("aperture", false)

// DefaultApertureTLSCertPath is the default path to the TLS
// certificate that aperture creates for its proxy.
DefaultApertureTLSCertPath = filepath.Join(
ApertureDirBase, "tls.cert",
)

// DefaultNetwork is the default bitcoin network loop runs on.
DefaultNetwork = "mainnet"

Expand Down Expand Up @@ -139,8 +149,8 @@ type loopServerConfig struct {
Host string `long:"host" description:"Loop server address host:port"`
Proxy string `long:"proxy" description:"The host:port of a SOCKS proxy through which all connections to the loop server will be established over"`

NoTLS bool `long:"notls" description:"Disable tls for communication to the loop server [testing only]"`
TLSPath string `long:"tlspath" description:"Path to loop server tls certificate [testing only]"`
NoTLS bool `long:"notls" description:"Disable tls for communication to the loop server [testing only]"`
TLSCertPath string `long:"tlscertpath" description:"Path to the TLS certificate for the loop server's proxy. Defaults to the aperture tls.cert in the default aperture data directory."`
}

type viewParameters struct{}
Expand Down Expand Up @@ -218,7 +228,8 @@ func DefaultConfig() Config {
RPCListen: "localhost:11010",
RESTListen: "localhost:8081",
Server: &loopServerConfig{
NoTLS: false,
NoTLS: false,
TLSCertPath: DefaultApertureTLSCertPath,
},
Tapd: assets.DefaultTapdConfig(),
LoopDir: LoopDirBase,
Expand Down
2 changes: 1 addition & 1 deletion loopd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func getClient(cfg *Config, swapDb loopdb.SwapStore,
ServerAddress: cfg.Server.Host,
ProxyAddress: cfg.Server.Proxy,
SwapServerNoTLS: cfg.Server.NoTLS,
TLSPathServer: cfg.Server.TLSPath,
TLSCertPathServer: cfg.Server.TLSCertPath,
Lnd: lnd,
AssetClient: assets,
MaxL402Cost: btcutil.Amount(cfg.MaxL402Cost),
Expand Down
2 changes: 1 addition & 1 deletion regtest/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ services:
- "--network=regtest"
- "--debuglevel=debug"
- "--server.host=aperture:11018"
- "--server.tlspath=/root/.loop/aperture-tls.cert"
- "--server.tlscertpath=/root/.loop/aperture-tls.cert"
- "--lnd.host=lndclient:10009"
- "--lnd.macaroonpath=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon"
- "--lnd.tlspath=/root/.lnd/tls.cert"
Expand Down
5 changes: 3 additions & 2 deletions sample-loopd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,6 @@
; Disable tls for communication to the loop server [testing only]
; server.notls=false

; Path to loop server tls certificate [testing only]
; server.tlspath=
; Path to the TLS certificate for the loop server's proxy. Defaults to the
; aperture tls.cert in the default aperture data directory.
; server.tlscertpath=~/.aperture/tls.cert
2 changes: 1 addition & 1 deletion swap_server_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func newSwapServerClient(cfg *ClientConfig, l402Store l402.Store) (
)
serverConn, err := getSwapServerConn(
cfg.ServerAddress, cfg.ProxyAddress, cfg.SwapServerNoTLS,
cfg.TLSPathServer, clientInterceptor,
cfg.TLSCertPathServer, clientInterceptor,
)
if err != nil {
return nil, err
Expand Down
Loading