@opencode-cloud/core 1.0.8 → 3.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +9 -2
- package/README.md +56 -30
- package/package.json +1 -1
- package/src/config/mod.rs +8 -3
- package/src/config/paths.rs +14 -0
- package/src/config/schema.rs +561 -0
- package/src/config/validation.rs +271 -0
- package/src/docker/Dockerfile +353 -207
- package/src/docker/README.dockerhub.md +39 -0
- package/src/docker/client.rs +132 -3
- package/src/docker/container.rs +204 -36
- package/src/docker/dockerfile.rs +15 -12
- package/src/docker/exec.rs +278 -0
- package/src/docker/health.rs +165 -0
- package/src/docker/image.rs +2 -4
- package/src/docker/mod.rs +72 -8
- package/src/docker/mount.rs +330 -0
- package/src/docker/progress.rs +4 -4
- package/src/docker/state.rs +120 -0
- package/src/docker/update.rs +156 -0
- package/src/docker/users.rs +357 -0
- package/src/docker/version.rs +95 -0
- package/src/host/error.rs +61 -0
- package/src/host/mod.rs +29 -0
- package/src/host/provision.rs +394 -0
- package/src/host/schema.rs +308 -0
- package/src/host/ssh_config.rs +282 -0
- package/src/host/storage.rs +118 -0
- package/src/host/tunnel.rs +268 -0
- package/src/lib.rs +10 -1
- package/src/platform/launchd.rs +1 -1
- package/src/platform/systemd.rs +6 -6
- package/src/singleton/mod.rs +1 -1
- package/src/version.rs +1 -6
package/src/platform/systemd.rs
CHANGED
|
@@ -53,15 +53,15 @@ impl SystemdManager {
|
|
|
53
53
|
|
|
54
54
|
// Quote path if it contains spaces
|
|
55
55
|
let exec_start = if executable_path.contains(' ') {
|
|
56
|
-
format!("\"{}\" start --no-daemon"
|
|
56
|
+
format!("\"{executable_path}\" start --no-daemon")
|
|
57
57
|
} else {
|
|
58
|
-
format!("{} start --no-daemon"
|
|
58
|
+
format!("{executable_path} start --no-daemon")
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
let exec_stop = if executable_path.contains(' ') {
|
|
62
|
-
format!("\"{}\" stop"
|
|
62
|
+
format!("\"{executable_path}\" stop")
|
|
63
63
|
} else {
|
|
64
|
-
format!("{} stop"
|
|
64
|
+
format!("{executable_path} stop")
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
// Calculate StartLimitIntervalSec: restart_delay * restart_retries * 2
|
|
@@ -103,7 +103,7 @@ WantedBy=default.target
|
|
|
103
103
|
}
|
|
104
104
|
cmd.args(args)
|
|
105
105
|
.output()
|
|
106
|
-
.map_err(|e| anyhow!("Failed to run systemctl: {}"
|
|
106
|
+
.map_err(|e| anyhow!("Failed to run systemctl: {e}"))
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/// Run systemctl and check for success
|
|
@@ -214,7 +214,7 @@ impl ServiceManager for SystemdManager {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
fn service_file_path(&self) -> PathBuf {
|
|
217
|
-
self.service_dir().join(format!("{}.service"
|
|
217
|
+
self.service_dir().join(format!("{SERVICE_NAME}.service"))
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
fn service_name(&self) -> &str {
|
package/src/singleton/mod.rs
CHANGED
|
@@ -131,7 +131,7 @@ fn is_process_running(pid: u32) -> bool {
|
|
|
131
131
|
// Fallback: check /proc on Linux
|
|
132
132
|
#[cfg(target_os = "linux")]
|
|
133
133
|
{
|
|
134
|
-
std::path::Path::new(&format!("/proc/{}"
|
|
134
|
+
std::path::Path::new(&format!("/proc/{pid}")).exists()
|
|
135
135
|
}
|
|
136
136
|
#[cfg(not(target_os = "linux"))]
|
|
137
137
|
{
|
package/src/version.rs
CHANGED
|
@@ -17,12 +17,7 @@ pub fn get_version_long() -> String {
|
|
|
17
17
|
let git_hash = option_env!("OCC_GIT_HASH").unwrap_or("unknown");
|
|
18
18
|
let build_date = option_env!("OCC_BUILD_DATE").unwrap_or("unknown");
|
|
19
19
|
|
|
20
|
-
format!(
|
|
21
|
-
"{version} (git: {git_hash}, built: {build_date})",
|
|
22
|
-
version = version,
|
|
23
|
-
git_hash = git_hash,
|
|
24
|
-
build_date = build_date
|
|
25
|
-
)
|
|
20
|
+
format!("{version} (git: {git_hash}, built: {build_date})")
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
#[cfg(test)]
|