Skip to content

Commit 4f1dde8

Browse files
sputn1ckguggero
authored andcommitted
multi: add support for building without UI
This commit adds support for building without UI. If the build tag "litd no_ui" is set the UI will be disabled.
1 parent b4f1178 commit 4f1dde8

File tree

5 files changed

+66
-10
lines changed

5 files changed

+66
-10
lines changed

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,22 @@ go-build:
130130
$(GOBUILD) -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" -o litd-debug $(PKG)/cmd/litd
131131
$(GOBUILD) -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" -o litcli-debug $(PKG)/cmd/litcli
132132

133+
134+
go-build-noui:
135+
@$(call print, "Building lightning-terminal without UI.")
136+
$(GOBUILD) -tags="litd_no_ui $(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" -o litd-debug $(PKG)/cmd/litd
137+
$(GOBUILD) -tags="litd_no_ui $(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" -o litcli-debug $(PKG)/cmd/litcli
138+
133139
go-install:
134140
@$(call print, "Installing lightning-terminal.")
135141
$(GOINSTALL) -trimpath -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litd
136142
$(GOINSTALL) -trimpath -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litcli
137143

144+
go-install-noui:
145+
@$(call print, "Installing lightning-terminal without UI.")
146+
$(GOINSTALL) -tags="litd_no_ui $(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litd
147+
$(GOINSTALL) -tags="litd_no_ui $(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litcli
148+
138149
go-install-cli:
139150
@$(call print, "Installing all CLI binaries.")
140151
$(GOINSTALL) -trimpath -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" github.com/lightningnetwork/lnd/cmd/lncli

app.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//go:build !litd_no_ui
2+
// +build !litd_no_ui
3+
4+
package terminal
5+
6+
import (
7+
"embed"
8+
)
9+
10+
var (
11+
// appBuildFS is an in-memory file system that contains all the static
12+
// HTML/CSS/JS files of the UI. It is compiled into the binary with the
13+
// go 1.16 embed directive below. Because the path is relative to the
14+
// root package, all assets will have a path prefix of /app/build/ which
15+
// we'll strip by giving a sub directory to the HTTP server.
16+
//
17+
//go:embed app/build/*
18+
appBuildFS embed.FS
19+
)

app_noui.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build litd_no_ui
2+
// +build litd_no_ui
3+
4+
package terminal
5+
6+
import "embed"
7+
8+
var (
9+
appBuildFS embed.FS
10+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Release Notes
2+
3+
# Integrated Binary Updates
4+
5+
### Lightning Terminal
6+
7+
- [Fixed a bug where REST calls for the `WalletUnlocker` service weren't allowed
8+
on startup](https://github.com/lightninglabs/lightning-terminal/pull/806).
9+
- [Added build flag 'litd_no_ui' for building litd without the ui, accessible
10+
with 'make go-build-noui' and 'make go-install-noui'](https://github.com/lightninglabs/lightning-terminal/pull/500).
11+
12+
### LND
13+
14+
### Loop
15+
16+
### Pool
17+
18+
### Faraday
19+
20+
### Taproot Assets
21+
22+
# Autopilot
23+
24+
# Contributors (Alphabetical Order)
25+
26+
* Oliver Gugger

terminal.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package terminal
33
import (
44
"context"
55
"crypto/tls"
6-
"embed"
76
"encoding/binary"
87
"encoding/hex"
98
"errors"
@@ -99,15 +98,6 @@ var (
9998
// the macaroon database before we give up with an error.
10099
macDatabaseOpenTimeout = time.Second * 5
101100

102-
// appBuildFS is an in-memory file system that contains all the static
103-
// HTML/CSS/JS files of the UI. It is compiled into the binary with the
104-
// go 1.16 embed directive below. Because the path is relative to the
105-
// root package, all assets will have a path prefix of /app/build/ which
106-
// we'll strip by giving a sub directory to the HTTP server.
107-
//
108-
//go:embed app/build/*
109-
appBuildFS embed.FS
110-
111101
// appFilesDir is the sub directory of the above build directory which
112102
// we pass to the HTTP server.
113103
appFilesDir = "app/build"

0 commit comments

Comments
 (0)