mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
appmgr: split bins update cargo.toml and .gitignore context appmgr: refactor error module appmgr: context begin new s9pk format appmgr: add fields to manifest appmgr: start action abstraction appmgr: volume abstraction appmgr: improved volumes appmgr: install wip appmgr: health daemon appmgr: health checks appmgr: wip config get appmgr: secret store wip appmgr: config rewritten appmgr: delete non-reusable code appmgr: wip appmgr: please the borrow-checker appmgr: technically runs now appmgr: cli appmgr: clean up cli appmgr: rpc-toolkit in action appmgr: wrap up config appmgr: account for updates during install appmgr: fix: #308 appmgr: impl Display for Version appmgr: cleanup appmgr: set dependents on install appmgr: dependency health checks
25 lines
708 B
Rust
25 lines
708 B
Rust
use std::ffi::{OsStr, OsString};
|
|
use std::net::Ipv4Addr;
|
|
|
|
use indexmap::IndexMap;
|
|
use patch_db::DbHandle;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::s9pk::manifest::PackageId;
|
|
use crate::{Error, HOST_IP};
|
|
|
|
pub const TLD: &'static str = "embassy";
|
|
|
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
|
pub struct Hosts(pub IndexMap<PackageId, Ipv4Addr>);
|
|
impl Hosts {
|
|
pub fn docker_args(&self) -> Vec<OsString> {
|
|
let mut res = Vec::with_capacity(self.0.len() + 1);
|
|
res.push(format!("--add-host={}:{}", TLD, Ipv4Addr::from(HOST_IP)).into());
|
|
for (id, ip) in &self.0 {
|
|
res.push(format!("--add-host={}.{}:{}", id, TLD, ip).into());
|
|
}
|
|
res
|
|
}
|
|
}
|