1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//! Shared constants and utilities for the microsandbox project.
//--------------------------------------------------------------------------------------------------
// Constants: Directory Layout
//--------------------------------------------------------------------------------------------------
/// Name of the microsandbox home directory (relative to user's home).
pub const BASE_DIR_NAME: &str = ".microsandbox";
/// Subdirectory for shared libraries (libkrunfw).
pub const LIB_SUBDIR: &str = "lib";
/// Subdirectory for helper binaries.
pub const BIN_SUBDIR: &str = "bin";
/// Subdirectory for the database.
pub const DB_SUBDIR: &str = "db";
/// Subdirectory for OCI layer cache.
pub const CACHE_SUBDIR: &str = "cache";
/// Subdirectory for per-sandbox state.
pub const SANDBOXES_SUBDIR: &str = "sandboxes";
/// Subdirectory for named volumes.
pub const VOLUMES_SUBDIR: &str = "volumes";
/// Subdirectory for logs.
pub const LOGS_SUBDIR: &str = "logs";
/// Subdirectory for secrets.
pub const SECRETS_SUBDIR: &str = "secrets";
/// Subdirectory for TLS certificates.
pub const TLS_SUBDIR: &str = "tls";
/// Subdirectory for SSH keys.
pub const SSH_SUBDIR: &str = "ssh";
//--------------------------------------------------------------------------------------------------
// Constants: Binary Names
//--------------------------------------------------------------------------------------------------
/// Guest agent binary name.
pub const AGENTD_BINARY: &str = "agentd";
/// CLI binary name.
pub const MSB_BINARY: &str = "msb";
//--------------------------------------------------------------------------------------------------
// Constants: Versions
//--------------------------------------------------------------------------------------------------
/// Version for downloading prebuilt release artifacts.
///
/// This tracks the published crate/package version so the SDK and the
/// downloaded runtime bundle stay aligned.
pub const PREBUILT_VERSION: &str = env!;
/// libkrunfw release version. Keep in sync with justfile.
pub const LIBKRUNFW_VERSION: &str = "5.2.1";
/// libkrunfw ABI version (soname major). Keep in sync with justfile.
pub const LIBKRUNFW_ABI: &str = "5";
//--------------------------------------------------------------------------------------------------
// Constants: Filenames
//--------------------------------------------------------------------------------------------------
/// Database filename.
pub const DB_FILENAME: &str = "msb.db";
/// Global configuration filename.
pub const CONFIG_FILENAME: &str = "config.json";
/// Project-local sandbox configuration filename.
pub const SANDBOXFILE_NAME: &str = "Sandboxfile";
//--------------------------------------------------------------------------------------------------
// Constants: GitHub
//--------------------------------------------------------------------------------------------------
/// GitHub organization.
pub const GITHUB_ORG: &str = "superradcompany";
/// Main repository name.
pub const MICROSANDBOX_REPO: &str = "microsandbox";
//--------------------------------------------------------------------------------------------------
// Functions
//--------------------------------------------------------------------------------------------------
/// Returns the platform-specific libkrunfw filename.
/// Returns the GitHub release download URL for libkrunfw.
/// Returns the GitHub release download URL for the agentd binary.
/// Returns the GitHub release download URL for the microsandbox bundle tarball.