mirror of
https://github.com/fiatjaf/nak.git
synced 2025-12-09 00:58:50 +00:00
print bunker restart command without schemes in relay urls when possible.
This commit is contained in:
11
bunker.go
11
bunker.go
@@ -115,10 +115,19 @@ var bunker = &cli.Command{
|
|||||||
secretKeyFlag = "--sec " + sec
|
secretKeyFlag = "--sec " + sec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
relayURLsPossiblyWithoutSchema := make([]string, len(relayURLs))
|
||||||
|
for i, url := range relayURLs {
|
||||||
|
if strings.HasPrefix(url, "wss://") {
|
||||||
|
relayURLsPossiblyWithoutSchema[i] = url[6:]
|
||||||
|
} else {
|
||||||
|
relayURLsPossiblyWithoutSchema[i] = url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
restartCommand := fmt.Sprintf("nak bunker %s%s %s",
|
restartCommand := fmt.Sprintf("nak bunker %s%s %s",
|
||||||
secretKeyFlag,
|
secretKeyFlag,
|
||||||
preauthorizedFlags,
|
preauthorizedFlags,
|
||||||
strings.Join(relayURLs, " "),
|
strings.Join(relayURLsPossiblyWithoutSchema, " "),
|
||||||
)
|
)
|
||||||
|
|
||||||
log("listening at %v:\n pubkey: %s \n npub: %s%s%s\n to restart: %s\n bunker: %s\n\n",
|
log("listening at %v:\n pubkey: %s \n npub: %s%s%s\n to restart: %s\n bunker: %s\n\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user