Skip to content

Commit

Permalink
add env var for nebula db
Browse files Browse the repository at this point in the history
  • Loading branch information
kasteph committed Oct 24, 2024
1 parent 8f26a8c commit 27ac67b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/honeypot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ func main() {
logging.SetLogLevel("basichost", "info")

queenCmd := flag.NewFlagSet("queen", flag.ExitOnError)
nebulaPostgresStr := queenCmd.String("postgres", "", "Postgres connection string, postgres://user:password@host:port/dbname")
nebulaPostgresStr := *queenCmd.String("postgres", "", "Postgres connection string, postgres://user:password@host:port/dbname")
if len(nebulaPostgresStr) == 0 {
nebulaPostgresStr = os.Getenv("NEBULA_POSTGRES_CONNURL")
}

nPorts := queenCmd.Int("nPorts", 128, "Number of ports ants can listen on")
firstPort := queenCmd.Int("firstPort", 6000, "First port ants can listen on")
upnp := queenCmd.Bool("upnp", false, "Enable UPnP")
Expand Down Expand Up @@ -102,7 +106,7 @@ func main() {

errChan := make(chan error, 1)
go func() {
errChan <- runQueen(ctx, *nebulaPostgresStr, *nPorts, *firstPort, *upnp)
errChan <- runQueen(ctx, nebulaPostgresStr, *nPorts, *firstPort, *upnp)
}()

select {
Expand Down

0 comments on commit 27ac67b

Please sign in to comment.