Feature/remove postgres (#2570)

* wip: move postgres data to patchdb

* wip

* wip

* wip

* complete notifications and clean up warnings

* fill in user agent

* move os tor bindings to single call
This commit is contained in:
Aiden McClelland
2024-03-07 14:40:22 -07:00
committed by GitHub
parent a17ec4221b
commit e0c9f8a5aa
70 changed files with 2429 additions and 2383 deletions

View File

@@ -1,4 +1,5 @@
use std::collections::BTreeSet;
use std::net::Ipv4Addr;
use std::ops::Deref;
use std::path::Path;
use std::sync::{Arc, Weak};
@@ -109,6 +110,7 @@ impl LxcManager {
pub struct LxcContainer {
manager: Weak<LxcManager>,
rootfs: OverlayGuard,
ip: Ipv4Addr,
guid: Arc<InternedString>,
rpc_bind: TmpMountGuard,
config: LxcConfig,
@@ -169,9 +171,20 @@ impl LxcContainer {
.arg(&*guid)
.invoke(ErrorKind::Lxc)
.await?;
let ip = String::from_utf8(
Command::new("lxc-info")
.arg("--name")
.arg(&*guid)
.arg("-iH")
.invoke(ErrorKind::Docker)
.await?,
)?
.trim()
.parse()?;
Ok(Self {
manager: Arc::downgrade(manager),
rootfs,
ip,
guid: Arc::new(guid),
rpc_bind,
config,
@@ -183,6 +196,10 @@ impl LxcContainer {
self.rootfs.path()
}
pub fn ip(&self) -> Ipv4Addr {
self.ip
}
pub fn rpc_dir(&self) -> &Path {
self.rpc_bind.path()
}