@@ -3,7 +3,6 @@ package terminal
33import (
44 "context"
55 "crypto/tls"
6- "embed"
76 "encoding/hex"
87 "errors"
98 "fmt"
8382 // set this to 200MiB atm.
8483 maxMsgRecvSize = grpc .MaxCallRecvMsgSize (1 * 1024 * 1024 * 200 )
8584
86- // appBuildFS is an in-memory file system that contains all the static
87- // HTML/CSS/JS files of the UI. It is compiled into the binary with the
88- // go 1.16 embed directive below. Because the path is relative to the
89- // root package, all assets will have a path prefix of /app/build/ which
90- // we'll strip by giving a sub directory to the HTTP server.
91- //
92- //go:embed app/build/*
93- appBuildFS embed.FS
94-
9585 // appFilesDir is the sub directory of the above build directory which
9686 // we pass to the HTTP server.
9787 appFilesDir = "app/build"
@@ -1159,44 +1149,43 @@ func (g *LightningTerminal) shutdown() error {
11591149// between the embedded HTTP server and the RPC proxy. An incoming request will
11601150// go through the following chain of components:
11611151//
1162- // Request on port 8443 <------------------------------------+
1163- // | converted gRPC request |
1164- // v |
1165- // +---+----------------------+ other +----------------+ |
1166- // | Main web HTTP server +------->+ Embedded HTTP | |
1167- // +---+----------------------+____+ +----------------+ |
1168- // | | |
1169- // v any RPC or grpc-web call | any REST call |
1170- // +---+----------------------+ |->+----------------+ |
1171- // | grpc-web proxy | + grpc-gateway +-----------+
1172- // +---+----------------------+ +----------------+
1173- // |
1174- // v native gRPC call with basic auth
1175- // +---+----------------------+
1176- // | interceptors |
1177- // +---+----------------------+
1178- // |
1179- // v native gRPC call with macaroon
1180- // +---+----------------------+
1181- // | gRPC server |
1182- // +---+----------------------+
1183- // |
1184- // v unknown authenticated call, gRPC server is just a wrapper
1185- // +---+----------------------+
1186- // | director |
1187- // +---+----------------------+
1188- // |
1189- // v authenticated call
1190- // +---+----------------------+ call to lnd or integrated daemon
1191- // | lnd (remote or local) +---------------+
1192- // | faraday remote | |
1193- // | loop remote | +----------v----------+
1194- // | pool remote | | lnd local subserver |
1195- // +--------------------------+ | - faraday |
1196- // | - loop |
1197- // | - pool |
1198- // +---------------------+
1199- //
1152+ // Request on port 8443 <------------------------------------+
1153+ // | converted gRPC request |
1154+ // v |
1155+ // +---+----------------------+ other +----------------+ |
1156+ // | Main web HTTP server +------->+ Embedded HTTP | |
1157+ // +---+----------------------+____+ +----------------+ |
1158+ // | | |
1159+ // v any RPC or grpc-web call | any REST call |
1160+ // +---+----------------------+ |->+----------------+ |
1161+ // | grpc-web proxy | + grpc-gateway +-----------+
1162+ // +---+----------------------+ +----------------+
1163+ // |
1164+ // v native gRPC call with basic auth
1165+ // +---+----------------------+
1166+ // | interceptors |
1167+ // +---+----------------------+
1168+ // |
1169+ // v native gRPC call with macaroon
1170+ // +---+----------------------+
1171+ // | gRPC server |
1172+ // +---+----------------------+
1173+ // |
1174+ // v unknown authenticated call, gRPC server is just a wrapper
1175+ // +---+----------------------+
1176+ // | director |
1177+ // +---+----------------------+
1178+ // |
1179+ // v authenticated call
1180+ // +---+----------------------+ call to lnd or integrated daemon
1181+ // | lnd (remote or local) +---------------+
1182+ // | faraday remote | |
1183+ // | loop remote | +----------v----------+
1184+ // | pool remote | | lnd local subserver |
1185+ // +--------------------------+ | - faraday |
1186+ // | - loop |
1187+ // | - pool |
1188+ // +---------------------+
12001189func (g * LightningTerminal ) startMainWebServer () error {
12011190 // Initialize the in-memory file server from the content compiled by
12021191 // the go:embed directive. Since everything's relative to the root dir,
0 commit comments