Skip to content

Commit

Permalink
Move deploy folder to contrib/linode
Browse files Browse the repository at this point in the history
Much of these contriguration for specifically for running this on
linode.
  • Loading branch information
jeffreypicard committed Nov 17, 2021
1 parent 0d709d9 commit 7c24e72
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,35 @@ func loadConfig() (*config, []string, error) {
cfg.RPCListeners = normalizeAddresses(cfg.RPCListeners,
activeNetParams.rpcPort)

// Only allow TLS to be disabled if the RPC is bound to localhost
// addresses.
if !cfg.DisableRPC && cfg.DisableTLS {
allowedTLSListeners := map[string]struct{}{
"localhost": {},
"127.0.0.1": {},
"::1": {},
}
for _, addr := range cfg.RPCListeners {
host, _, err := net.SplitHostPort(addr)
if err != nil {
str := "%s: RPC listen interface '%s' is " +
"invalid: %v"
err := fmt.Errorf(str, funcName, addr, err)
fmt.Fprintln(os.Stderr, err)
fmt.Fprintln(os.Stderr, usageMessage)
return nil, nil, err
}
if _, ok := allowedTLSListeners[host]; !ok {
str := "%s: the --notls option may not be used " +
"when binding RPC to non localhost " +
"addresses: %s"
err := fmt.Errorf(str, funcName, addr)
fmt.Fprintln(os.Stderr, err)
fmt.Fprintln(os.Stderr, usageMessage)
return nil, nil, err
}
}
}

// Add default port to all added peer addresses if needed and remove
// duplicate addresses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN set -ex \
FROM debian:11-slim

COPY --from=build-container /app/lbcd /
COPY --from=build-container /app/deploy/run.sh /
COPY --from=build-container /app/contrib/linode/run.sh /

VOLUME ["/root/.lbcd"]

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7c24e72

Please sign in to comment.