Skip to content

Commit

Permalink
fix binds
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bonez committed Jan 15, 2025
1 parent 8b2dec8 commit defeccf
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions core/startos/src/version/v0_3_6_alpha_11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,42 @@ impl VersionT for Version {
json!({ "contact": &acme["contact"] });
}

for (_, package) in db["public"]["packageData"]
.as_object_mut()
.ok_or_else(|| {
Error::new(
eyre!("expected public.packageData to be an object"),
ErrorKind::Database,
)
})?
.iter_mut()
{
for (_, host) in package["hosts"]
.as_object_mut()
.ok_or_else(|| {
Error::new(
eyre!("expected public.packageData[id].hosts to be an object"),
ErrorKind::Database,
)
})?
.iter_mut()
{
for (_, bind) in host["bindings"]
.as_object_mut()
.ok_or_else(|| {
Error::new(
eyre!("expected public.packageData[id].hosts[hostId].bindings to be an object"),
ErrorKind::Database,
)
})?
.iter_mut()
{
bind["net"] = bind["lan"].clone();
bind["net"]["public"] = Value::Bool(false);
}
}
}

Ok(())
}
fn down(self, _db: &mut Value) -> Result<(), Error> {
Expand Down

0 comments on commit defeccf

Please sign in to comment.