mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-27 02:41:53 +00:00
* wip * restructure backend for new ui structure * new patchdb bootstrap, single websocket api, local storage migration, more * update db websocket * init apis * update patch-db * setup progress * feat: implement state service, alert and routing Signed-off-by: waterplea <alexander@inkin.ru> * update setup wizard for new types * feat: add init page Signed-off-by: waterplea <alexander@inkin.ru> * chore: refactor message, patch-db source stream and connection service Signed-off-by: waterplea <alexander@inkin.ru> * fix method not found on state * fix backend bugs * fix compat assets * address comments * remove unneeded styling * cleaner progress * bugfixes * fix init logs * fix progress reporting * fix navigation by getting state after init * remove patch dependency from live api * fix caching * re-add patchDB to live api * fix metrics values * send close frame * add bootId and fix polling --------- Signed-off-by: waterplea <alexander@inkin.ru> Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: waterplea <alexander@inkin.ru>
43 lines
1.0 KiB
Rust
43 lines
1.0 KiB
Rust
use std::path::{Path, PathBuf};
|
|
|
|
pub use helpers::script_dir;
|
|
pub use models::VolumeId;
|
|
use models::{HostId, PackageId};
|
|
|
|
use crate::net::PACKAGE_CERT_PATH;
|
|
use crate::prelude::*;
|
|
use crate::util::VersionString;
|
|
|
|
pub const PKG_VOLUME_DIR: &str = "package-data/volumes";
|
|
pub const BACKUP_DIR: &str = "/media/startos/backups";
|
|
|
|
pub fn data_dir<P: AsRef<Path>>(datadir: P, pkg_id: &PackageId, volume_id: &VolumeId) -> PathBuf {
|
|
datadir
|
|
.as_ref()
|
|
.join(PKG_VOLUME_DIR)
|
|
.join(pkg_id)
|
|
.join("data")
|
|
.join(volume_id)
|
|
}
|
|
|
|
pub fn asset_dir<P: AsRef<Path>>(
|
|
datadir: P,
|
|
pkg_id: &PackageId,
|
|
version: &VersionString,
|
|
) -> PathBuf {
|
|
datadir
|
|
.as_ref()
|
|
.join(PKG_VOLUME_DIR)
|
|
.join(pkg_id)
|
|
.join("assets")
|
|
.join(version.as_str())
|
|
}
|
|
|
|
pub fn backup_dir(pkg_id: &PackageId) -> PathBuf {
|
|
Path::new(BACKUP_DIR).join(pkg_id).join("data")
|
|
}
|
|
|
|
pub fn cert_dir(pkg_id: &PackageId, host_id: &HostId) -> PathBuf {
|
|
Path::new(PACKAGE_CERT_PATH).join(pkg_id).join(host_id)
|
|
}
|