Skip to content

Commit 78bee1d

Browse files
florolfFiloSottile
andauthored
cmd/litebastion: allow comment lines in backend list (#68)
Skip over comment lines starting with "#". This is useful for keeping the file organized. Co-authored-by: Filippo Valsorda <hi@filippo.io>
1 parent 450da90 commit 78bee1d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

cmd/litebastion/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ requests over that connection. The bastion then proxies requests received at
1414
The only configuration file of litebastion is the backends file, which lists the
1515
acceptable client/witness key hashes.
1616

17+
Empty lines and lines starting with `#` are ignored.
18+
1719
-listen string
1820
host and port to listen at (default "localhost:8443")
1921
-cache string

cmd/litebastion/litebastion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func main() {
105105
}
106106
bs := strings.TrimSpace(string(backendsList))
107107
for _, line := range strings.Split(bs, "\n") {
108-
if line == "" {
108+
if strings.TrimSpace(line) == "" || line[0] == '#' {
109109
continue
110110
}
111111
l, err := hex.DecodeString(line)

0 commit comments

Comments
 (0)