mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
create skeleton
This commit is contained in:
@@ -113,6 +113,8 @@ pub struct ServerConfig {
|
||||
pub datadir: Option<PathBuf>,
|
||||
#[arg(long = "disable-encryption")]
|
||||
pub disable_encryption: Option<bool>,
|
||||
#[arg(short = 'a', long = "analytics-url")]
|
||||
pub analytics_url: Option<Url>,
|
||||
}
|
||||
impl ContextConfig for ServerConfig {
|
||||
fn next(&mut self) -> Option<PathBuf> {
|
||||
@@ -131,6 +133,7 @@ impl ContextConfig for ServerConfig {
|
||||
.or(other.revision_cache_size);
|
||||
self.datadir = self.datadir.take().or(other.datadir);
|
||||
self.disable_encryption = self.disable_encryption.take().or(other.disable_encryption);
|
||||
self.analytics_url = self.analytics_url.take().or(other.analytics_url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ use rpc_toolkit::{CallRemote, Context, Empty};
|
||||
use tokio::sync::{broadcast, oneshot, Mutex, RwLock};
|
||||
use tokio::time::Instant;
|
||||
use tracing::instrument;
|
||||
use url::Url;
|
||||
|
||||
use super::setup::CURRENT_SECRET;
|
||||
use crate::account::AccountInfo;
|
||||
@@ -55,7 +56,9 @@ pub struct RpcContextSeed {
|
||||
pub client: Client,
|
||||
pub hardware: Hardware,
|
||||
pub start_time: Instant,
|
||||
#[cfg(feature = "dev")]
|
||||
pub dev: Dev,
|
||||
pub analytics_url: Option<Url>,
|
||||
}
|
||||
|
||||
pub struct Dev {
|
||||
@@ -184,9 +187,11 @@ impl RpcContext {
|
||||
.with_kind(crate::ErrorKind::ParseUrl)?,
|
||||
hardware: Hardware { devices, ram },
|
||||
start_time: Instant::now(),
|
||||
#[cfg(feature = "dev")]
|
||||
dev: Dev {
|
||||
lxc: Mutex::new(BTreeMap::new()),
|
||||
},
|
||||
analytics_url: config.analytics_url.clone(),
|
||||
});
|
||||
|
||||
let res = Self(seed.clone());
|
||||
|
||||
Reference in New Issue
Block a user