Skip to content

Commit f4332cd

Browse files
committed
fix qr, datadir handling
1 parent 7b20c4b commit f4332cd

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

.goreleaser.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ builds:
1616
- linux
1717
goarch:
1818
- amd64
19+
env:
20+
- CGO_ENABLED=0
21+
ldflags:
22+
- -extldflags=-static
1923

2024
binary: lantern-server-manager
2125

cloud/lantern-server-manager.service

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=Lantern Server Manager
3+
Documentation=https://github.com/getlantern/lantern-server-manager
4+
After=syslog.target network.target remote-fs.target nss-lookup.target
5+
6+
[Service]
7+
User=root
8+
ExecStart=/opt/lantern/lantern-server-manager serve
9+
ExecStop=/bin/kill -s QUIT $MAINPID
10+
PrivateTmp=true
11+
StandardOutput=journal+console
12+
StandardError=journal+console
13+
[Install]
14+
WantedBy=multi-user.target

cmd/main.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,17 @@ func main() {
5555
func ensureDataDirectoryExists() {
5656
if fi, err := os.Stat(args.DataDir); err != nil {
5757
if os.IsNotExist(err) {
58+
log.Debug("data directory does not exist, creating", "path", args.DataDir)
5859
err = os.MkdirAll(args.DataDir, 0755)
5960
if err != nil {
60-
log.Fatal(err)
61+
log.Fatalf("Unable to create data folder %v", err)
6162
}
6263
} else if !fi.IsDir() {
6364
log.Fatal("data directory is not a directory")
6465
}
6566
} else {
66-
log.Fatal(err)
67+
if !fi.IsDir() {
68+
log.Fatal("data directory is not a directory")
69+
}
6770
}
6871
}

common/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (c *ServerConfig) GetNewServerURL() string {
2929
}
3030
func (c *ServerConfig) GetQR() string {
3131
qrCode := bytes.NewBufferString("")
32-
qrterminal.Generate(c.GetNewServerURL(), qrterminal.L, qrCode)
32+
qrterminal.GenerateHalfBlock(c.GetNewServerURL(), qrterminal.L, qrCode)
3333

3434
return qrCode.String()
3535
}

0 commit comments

Comments
 (0)