Refactor/sdk init (#2947)

* fixes for main

* refactor package initialization

* fixes from testing

* more fixes

* beta.21

* do not use instanceof

* closes #2921

* beta22

* allow disabling kiosk

* migration

* fix /etc/shadow

* actionRequest -> task

* beta.23
This commit is contained in:
Aiden McClelland
2025-05-21 10:24:37 -06:00
committed by GitHub
parent 46fd01c264
commit 44560c8da8
237 changed files with 1827 additions and 98800 deletions

View File

@@ -89,6 +89,7 @@ use crate::context::{
use crate::disk::fsck::RequiresReboot;
use crate::net::net;
use crate::registry::context::{RegistryContext, RegistryUrlParams};
use crate::system::kiosk;
use crate::util::serde::{HandlerExtSerde, WithIoFormat};
#[derive(Deserialize, Serialize, Parser, TS)]
@@ -118,7 +119,7 @@ impl std::fmt::Display for ApiState {
}
pub fn main_api<C: Context>() -> ParentHandler<C> {
let api = ParentHandler::new()
let mut api = ParentHandler::new()
.subcommand(
"git-info",
from_fn(|_: C| version::git_info()).with_about("Display the githash of StartOS CLI"),
@@ -198,12 +199,18 @@ pub fn main_api<C: Context>() -> ParentHandler<C> {
"util",
util::rpc::util::<C>().with_about("Command for calculating the blake3 hash of a file"),
);
if &*PLATFORM != "raspberrypi" {
api = api.subcommand("kiosk", kiosk::<C>());
}
#[cfg(feature = "dev")]
let api = api.subcommand(
"lxc",
lxc::dev::lxc::<C>()
.with_about("Commands related to lxc containers i.e. create, list, remove, connect"),
);
{
api = api.subcommand(
"lxc",
lxc::dev::lxc::<C>().with_about(
"Commands related to lxc containers i.e. create, list, remove, connect",
),
);
}
api
}