Choose even the first region in the browser; update Docker and Nix
A node now starts without any region (it only helps others connect, and prints a hint). The owner's sign-in link leads straight to the Regions page when none is followed, visitors get a notice instead of an empty search, and status always lists regions as an array. The Docker image no longer pins Bonn, the NixOS module no longer requires regions, and the VM test now starts without any, chooses the first region over the API and checks it survives a restart. README and the init hint follow. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
@@ -59,7 +59,7 @@ func cmdInit(args []string) error {
|
||||
|
||||
fmt.Printf("\nDone. This machine is set up as a device of identity %s…\n", dev.Cert.Author[:12])
|
||||
fmt.Printf("Your device certificate is valid until %s.\n\n", time.Unix(dev.Cert.ExpiresAt, 0).Format("2006-01-02"))
|
||||
fmt.Printf("Next: allmende run --region <region> --data %s\n", *data)
|
||||
fmt.Printf("Next: allmende run --data %s\nThen open the sign-in link it prints and choose your region (or add --region <region> to start with one).\n", *data)
|
||||
fmt.Printf("The admin token for publishing is in %s\n", filepath.Join(*data, tokenFile))
|
||||
return nil
|
||||
}
|
||||
|
||||
+7
-4
@@ -66,10 +66,8 @@ func cmdRun(args []string) error {
|
||||
}
|
||||
regions = saved
|
||||
}
|
||||
// A bootstrap node may follow no region: it then only helps others connect.
|
||||
if len(regions) == 0 && !*public {
|
||||
return errors.New("choose at least one region to replicate, e.g. --region u1x (a region is a 3-character geohash, about 150 km wide)")
|
||||
}
|
||||
// Without a region the node only helps others connect, until the owner
|
||||
// chooses one in the browser (see the sign-in hint printed below).
|
||||
if !*noDefaultBootstrap {
|
||||
bootstrap = append(bootstrap, p2p.DefaultBootstrap)
|
||||
}
|
||||
@@ -186,6 +184,11 @@ func cmdRun(args []string) error {
|
||||
// log file. It sits in the URL fragment, which a browser never sends to
|
||||
// a server; the page moves it into sessionStorage and removes it.
|
||||
fmt.Fprintf(os.Stderr, "\nOwner login (answer your inbox in the browser):\n %s\n\n", loginURL(ln.Addr().String(), token))
|
||||
if len(regions) == 0 && !*public {
|
||||
fmt.Fprint(os.Stderr, "This node follows no region yet. Open the link above and choose where you want\nlistings from (and to publish) under \"My listings\" > \"Regions\".\n\n")
|
||||
}
|
||||
} else if len(regions) == 0 && !*public {
|
||||
log.Warn("this node follows no region and has no admin token, so nobody can choose one: pass --region")
|
||||
}
|
||||
|
||||
go announce(ctx, log, node, st, dev.Cert.Author)
|
||||
|
||||
Reference in New Issue
Block a user