mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
rename frontend to web and update contributing guide (#2509)
* rename frontend to web and update contributing guide * rename this time * fix build * restructure rust code * update documentation * update descriptions * Update CONTRIBUTING.md Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com> --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com>
This commit is contained in:
159
core/startos/src/lib.rs
Normal file
159
core/startos/src/lib.rs
Normal file
@@ -0,0 +1,159 @@
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
pub const DEFAULT_MARKETPLACE: &str = "https://registry.start9.com";
|
||||
// pub const COMMUNITY_MARKETPLACE: &str = "https://community-registry.start9.com";
|
||||
pub const BUFFER_SIZE: usize = 1024;
|
||||
pub const HOST_IP: [u8; 4] = [172, 18, 0, 1];
|
||||
pub const TARGET: &str = current_platform::CURRENT_PLATFORM;
|
||||
lazy_static::lazy_static! {
|
||||
pub static ref ARCH: &'static str = {
|
||||
let (arch, _) = TARGET.split_once("-").unwrap();
|
||||
arch
|
||||
};
|
||||
pub static ref PLATFORM: String = {
|
||||
if let Ok(platform) = std::fs::read_to_string("/usr/lib/startos/PLATFORM.txt") {
|
||||
platform
|
||||
} else {
|
||||
ARCH.to_string()
|
||||
}
|
||||
};
|
||||
pub static ref SOURCE_DATE: SystemTime = {
|
||||
std::fs::metadata(std::env::current_exe().unwrap()).unwrap().modified().unwrap()
|
||||
};
|
||||
}
|
||||
|
||||
pub mod account;
|
||||
pub mod action;
|
||||
pub mod auth;
|
||||
pub mod backup;
|
||||
pub mod bins;
|
||||
pub mod config;
|
||||
pub mod context;
|
||||
pub mod control;
|
||||
pub mod core;
|
||||
pub mod db;
|
||||
pub mod dependencies;
|
||||
pub mod developer;
|
||||
pub mod diagnostic;
|
||||
pub mod disk;
|
||||
pub mod error;
|
||||
pub mod firmware;
|
||||
pub mod hostname;
|
||||
pub mod init;
|
||||
pub mod inspect;
|
||||
pub mod install;
|
||||
pub mod logs;
|
||||
pub mod manager;
|
||||
pub mod middleware;
|
||||
pub mod migration;
|
||||
pub mod net;
|
||||
pub mod notifications;
|
||||
pub mod os_install;
|
||||
pub mod prelude;
|
||||
pub mod procedure;
|
||||
pub mod properties;
|
||||
pub mod registry;
|
||||
pub mod s9pk;
|
||||
pub mod setup;
|
||||
pub mod shutdown;
|
||||
pub mod sound;
|
||||
pub mod ssh;
|
||||
pub mod status;
|
||||
pub mod system;
|
||||
pub mod update;
|
||||
pub mod util;
|
||||
pub mod version;
|
||||
pub mod volume;
|
||||
|
||||
use std::time::SystemTime;
|
||||
|
||||
pub use config::Config;
|
||||
pub use error::{Error, ErrorKind, ResultExt};
|
||||
use rpc_toolkit::command;
|
||||
use rpc_toolkit::yajrc::RpcError;
|
||||
|
||||
#[command(metadata(authenticated = false))]
|
||||
pub fn echo(#[arg] message: String) -> Result<String, RpcError> {
|
||||
Ok(message)
|
||||
}
|
||||
|
||||
#[command(subcommands(
|
||||
version::git_info,
|
||||
echo,
|
||||
inspect::inspect,
|
||||
server,
|
||||
package,
|
||||
net::net,
|
||||
auth::auth,
|
||||
db::db,
|
||||
ssh::ssh,
|
||||
net::wifi::wifi,
|
||||
disk::disk,
|
||||
notifications::notification,
|
||||
backup::backup,
|
||||
registry::marketplace::marketplace,
|
||||
))]
|
||||
pub fn main_api() -> Result<(), RpcError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command(subcommands(
|
||||
system::time,
|
||||
system::experimental,
|
||||
system::logs,
|
||||
system::kernel_logs,
|
||||
system::metrics,
|
||||
shutdown::shutdown,
|
||||
shutdown::restart,
|
||||
shutdown::rebuild,
|
||||
update::update_system,
|
||||
))]
|
||||
pub fn server() -> Result<(), RpcError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command(subcommands(
|
||||
action::action,
|
||||
install::install,
|
||||
install::sideload,
|
||||
install::uninstall,
|
||||
install::list,
|
||||
config::config,
|
||||
control::start,
|
||||
control::stop,
|
||||
control::restart,
|
||||
logs::logs,
|
||||
properties::properties,
|
||||
dependencies::dependency,
|
||||
backup::package_backup,
|
||||
))]
|
||||
pub fn package() -> Result<(), RpcError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command(subcommands(
|
||||
version::git_info,
|
||||
s9pk::pack,
|
||||
developer::verify,
|
||||
developer::init,
|
||||
inspect::inspect,
|
||||
registry::admin::publish,
|
||||
))]
|
||||
pub fn portable_api() -> Result<(), RpcError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command(subcommands(version::git_info, echo, diagnostic::diagnostic))]
|
||||
pub fn diagnostic_api() -> Result<(), RpcError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command(subcommands(version::git_info, echo, setup::setup))]
|
||||
pub fn setup_api() -> Result<(), RpcError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command(subcommands(version::git_info, echo, os_install::install))]
|
||||
pub fn install_api() -> Result<(), RpcError> {
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user