aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/access.md7
-rw-r--r--src/config/mod.rs16
2 files changed, 16 insertions, 7 deletions
diff --git a/docs/access.md b/docs/access.md
index 75f8db2..29b4cb6 100644
--- a/docs/access.md
+++ b/docs/access.md
@@ -54,9 +54,10 @@ may do nothing until added (the genesis node warns of those of its `--htpasswd`)
log in by key and sign values from the start, and with
`--bootstrap-policy '{"version": 1, "values": "signed"}'` the policy (Values signed by
their users, below) in the same change: the swarm is strict from its start, and no
-change of it is from before the policy. Started from content (`--genesis --remake`),
-the content is a change of its own just before that one; a change built on it beside
-that one is refused as from the time before a strict policy (below).
+change of it is from before the policy. So it starts empty: content (`--genesis
+--remake`) would be a change of its own before that one, and is refused with a strict
+policy; a swarm started from content turns strict through a strict remake (Turning a
+swarm strict, below).
Without it, the swarm has no registry: its users are all alike (A swarm without a
registry, below), until someone gives it one. `--protocol-writers` counts in
both: without a registry, as who may write protocol data; with one, to set it right
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 1686792..4100764 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -923,10 +923,18 @@ impl Settings {
{
bail!("{why}");
}
- if let Err(why) =
- crate::access::policy::first(self.bootstrap_policy.as_deref(), &self.bootstrap_keys)
- {
- bail!("{why}");
+ match crate::access::policy::first(self.bootstrap_policy.as_deref(), &self.bootstrap_keys) {
+ Err(why) => bail!("{why}"),
+ // Its content would be a change of its own before the policy's: a swarm
+ // strict from its start has none, so it starts empty.
+ Ok(Some(policy))
+ if self.remake.is_some() && crate::access::policy::read(&policy).strict() =>
+ {
+ bail!(
+ "bootstrap-policy: a strict swarm starts empty, not from remake; one started from content turns strict through a strict remake"
+ )
+ }
+ Ok(_) => {}
}
if let Some(root) = &self.genesis_root
&& crate::swarm::roots::parse(root).is_none()