Skip to content
Prev Previous commit
Next Next commit
Small fixups
Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler committed Jul 8, 2024
commit 79b169134561d6eb4acf85f6863c7c8e35bb9eaf
5 changes: 3 additions & 2 deletions core/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ func (r *RunCMD) Run(ctx *cliContext.Context) error {
config.WithOpaqueErrors(r.OpaqueErrors),
}

token := ""
if r.Peer2Peer || r.Peer2PeerToken != "" {
log.Info().Msg("P2P mode enabled")
token := r.Peer2PeerToken
token = r.Peer2PeerToken
if token == "" {
// IF no token is provided, and p2p is enabled,
// we generate one and wait for the user to pick up the token (this is for interactive)
Expand Down Expand Up @@ -139,7 +140,7 @@ func (r *RunCMD) Run(ctx *cliContext.Context) error {
if err != nil {
return err
}
if err := p2p.ExposeService(context.Background(), "localhost", port, r.Peer2PeerToken, p2p.FederatedID); err != nil {
if err := p2p.ExposeService(context.Background(), "localhost", port, token, p2p.FederatedID); err != nil {
return err
}
}
Expand Down