build: rename server runtime binaries
This commit is contained in:
parent
699290ccb1
commit
fb285b17e4
|
|
@ -7,7 +7,7 @@ license.workspace = true
|
|||
autobins = false
|
||||
|
||||
[[bin]]
|
||||
name = "worker-runtime-rest-server"
|
||||
name = "yoi-runtime"
|
||||
path = "src/main.rs"
|
||||
required-features = ["ws-server", "fs-store"]
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ From the repository root:
|
|||
```bash
|
||||
cargo run -p worker-runtime \
|
||||
--features ws-server,fs-store \
|
||||
--bin worker-runtime-rest-server \
|
||||
--bin yoi-runtime \
|
||||
-- --bind 127.0.0.1:38800
|
||||
```
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ To bind another address explicitly:
|
|||
```bash
|
||||
cargo run -p worker-runtime \
|
||||
--features ws-server,fs-store \
|
||||
--bin worker-runtime-rest-server \
|
||||
--bin yoi-runtime \
|
||||
-- --bind 0.0.0.0:38800
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ fn main() -> ExitCode {
|
|||
match run() {
|
||||
Ok(()) => ExitCode::SUCCESS,
|
||||
Err(error) => {
|
||||
eprintln!("worker-runtime-rest-server: {error}");
|
||||
eprintln!("yoi-runtime: {error}");
|
||||
if let ProcessError::Usage(_) = error {
|
||||
eprintln!();
|
||||
eprintln!("{}", usage());
|
||||
|
|
@ -64,7 +64,7 @@ fn run() -> Result<(), ProcessError> {
|
|||
let local_addr = listener.local_addr()?;
|
||||
let worker_runtime = build_runtime(&config)?;
|
||||
eprintln!(
|
||||
"worker-runtime REST server listening on {local_addr}; intended client is a trusted backend/proxy, not a browser"
|
||||
"yoi-runtime listening on {local_addr}; intended client is a trusted backend/proxy, not a browser"
|
||||
);
|
||||
worker_runtime::http_server::serve_runtime_http_with_auth(
|
||||
worker_runtime,
|
||||
|
|
@ -796,7 +796,7 @@ fn run_trust_server_command(mut args: VecDeque<String>) -> Result<(), ProcessErr
|
|||
}
|
||||
|
||||
fn usage() -> &'static str {
|
||||
r#"Usage: worker-runtime-rest-server [OPTIONS]
|
||||
r#"Usage: yoi-runtime [OPTIONS]
|
||||
|
||||
Starts a worker-backed Runtime REST command API for a trusted backend/proxy.
|
||||
Browsers must not connect to this Runtime process directly.
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ version = "0.1.0"
|
|||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish = false
|
||||
autobins = false
|
||||
|
||||
[[bin]]
|
||||
name = "yoi-server"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ impl WorkspaceBackendConfigFile {
|
|||
match fs::read_to_string(&path) {
|
||||
Ok(local) => Ok(ConfigDiff::new(WORKSPACE_BACKEND_CONFIG_TEMPLATE, &local)),
|
||||
Err(error) if error.kind() == io::ErrorKind::NotFound => Err(Error::Config(format!(
|
||||
"workspace backend local config `{}` does not exist; run `yoi-workspace-server init --workspace {}` first",
|
||||
"workspace backend local config `{}` does not exist; run `yoi-server init --workspace {}` first",
|
||||
path.display(),
|
||||
workspace_root.display()
|
||||
))),
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ impl WorkspaceIdentity {
|
|||
Ok(raw) => Self::parse_str(&raw, &path),
|
||||
Err(error) if error.kind() == ErrorKind::NotFound => {
|
||||
Err(Error::WorkspaceIdentity(format!(
|
||||
"workspace is not initialized at {}; run `yoi-workspace-server init --workspace {}` first",
|
||||
"workspace is not initialized at {}; run `yoi-server init --workspace {}` first",
|
||||
workspace_root.as_ref().display(),
|
||||
workspace_root.as_ref().display()
|
||||
)))
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ async fn main() -> ExitCode {
|
|||
match run().await {
|
||||
Ok(()) => ExitCode::SUCCESS,
|
||||
Err(error) => {
|
||||
eprintln!("yoi-workspace-server: {error}");
|
||||
eprintln!("yoi-server: {error}");
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
}
|
||||
|
|
@ -160,7 +160,7 @@ async fn run_init_with_database_path(
|
|||
})?;
|
||||
|
||||
eprintln!(
|
||||
"yoi-workspace-server: initialized workspace `{}` ({}) in server DB `{}`",
|
||||
"yoi-server: initialized workspace `{}` ({}) in server DB `{}`",
|
||||
options.workspace.display(),
|
||||
identity.workspace_id,
|
||||
database_path.display()
|
||||
|
|
@ -572,7 +572,7 @@ async fn run_serve(options: ServeOptions) -> Result<(), Box<dyn std::error::Erro
|
|||
|
||||
let listener = TcpListener::bind(resolved.listen).await?;
|
||||
eprintln!(
|
||||
"yoi-workspace-server: serving workspace `{}` from server DB `{}` on http://{}",
|
||||
"yoi-server: serving workspace `{}` from server DB `{}` on http://{}",
|
||||
workspace.workspace_id,
|
||||
database_path.display(),
|
||||
listener.local_addr()?
|
||||
|
|
@ -588,7 +588,7 @@ fn append_trusted_runtime_sources(
|
|||
let Some(server_identity) = read_server_identity_file(&server_identity_path())? else {
|
||||
if !store.list_trusted_runtimes(false)?.is_empty() {
|
||||
return Err(Box::new(CliError(
|
||||
"trusted runtimes are registered but server identity is not initialized; run `yoi-workspace-server identity init`".to_string(),
|
||||
"trusted runtimes are registered but server identity is not initialized; run `yoi-server identity init`".to_string(),
|
||||
)));
|
||||
}
|
||||
return Ok(());
|
||||
|
|
@ -617,7 +617,8 @@ fn select_serve_workspace(store: &SqliteWorkspaceStore) -> Result<WorkspaceRecor
|
|||
.map_err(|error| CliError(format!("failed to list workspaces from server DB: {error}")))?;
|
||||
match workspaces.as_slice() {
|
||||
[] => Err(CliError(
|
||||
"server DB has no workspace records; run `yoi-workspace-server init --workspace <PATH>`".to_string(),
|
||||
"server DB has no workspace records; run `yoi-server init --workspace <PATH>`"
|
||||
.to_string(),
|
||||
)),
|
||||
[workspace] => Ok(workspace.clone()),
|
||||
_ => Err(CliError(format!(
|
||||
|
|
@ -825,31 +826,31 @@ fn parse_listen(value: &str) -> Result<SocketAddr, CliError> {
|
|||
|
||||
fn print_help() {
|
||||
println!(
|
||||
"yoi-workspace-server\n\nUsage:\n yoi-workspace-server init [OPTIONS]\n yoi-workspace-server config <COMMAND> [OPTIONS]\n yoi-workspace-server identity init --server-id <SERVER_ID> [--replace]\n yoi-workspace-server identity show [--json]\n yoi-workspace-server trust-runtime add --runtime-id <RUNTIME_ID> --base-url <URL> --public-key <KEY> [--display-name <NAME>] [--replace]\n yoi-workspace-server trust-runtime list [--json] [--include-revoked]\n yoi-workspace-server trust-runtime revoke --runtime-id <RUNTIME_ID>\n yoi-workspace-server skills <COMMAND> [OPTIONS]\n yoi-workspace-server serve [OPTIONS]\n\nOptions:\n -h, --help Print help"
|
||||
"yoi-server\n\nUsage:\n yoi-server init [OPTIONS]\n yoi-server config <COMMAND> [OPTIONS]\n yoi-server identity init --server-id <SERVER_ID> [--replace]\n yoi-server identity show [--json]\n yoi-server trust-runtime add --runtime-id <RUNTIME_ID> --base-url <URL> --public-key <KEY> [--display-name <NAME>] [--replace]\n yoi-server trust-runtime list [--json] [--include-revoked]\n yoi-server trust-runtime revoke --runtime-id <RUNTIME_ID>\n yoi-server skills <COMMAND> [OPTIONS]\n yoi-server serve [OPTIONS]\n\nOptions:\n -h, --help Print help"
|
||||
);
|
||||
}
|
||||
|
||||
fn print_init_help() {
|
||||
println!(
|
||||
"yoi-workspace-server init\n\nUsage:\n yoi-workspace-server init [OPTIONS]\n\nDescription:\n Initializes a Workspace identity, copies the packaged Backend config template to .yoi/workspace-backend.local.toml, and registers the Workspace in the Yoi server DB.\n\nOptions:\n --workspace <PATH> Workspace root to initialize (defaults to cwd)\n -h, --help Print help"
|
||||
"yoi-server init\n\nUsage:\n yoi-server init [OPTIONS]\n\nDescription:\n Initializes a Workspace identity, copies the packaged Backend config template to .yoi/workspace-backend.local.toml, and registers the Workspace in the Yoi server DB.\n\nOptions:\n --workspace <PATH> Workspace root to initialize (defaults to cwd)\n -h, --help Print help"
|
||||
);
|
||||
}
|
||||
|
||||
fn print_config_help() {
|
||||
println!(
|
||||
"yoi-workspace-server config\n\nUsage:\n yoi-workspace-server config default\n yoi-workspace-server config diff [OPTIONS]\n\nDescription:\n Prints the packaged Workspace Backend config template or compares it with the workspace-local config.\n\nOptions for diff:\n --workspace <PATH> Workspace root (defaults to cwd)\n -h, --help Print help"
|
||||
"yoi-server config\n\nUsage:\n yoi-server config default\n yoi-server config diff [OPTIONS]\n\nDescription:\n Prints the packaged Workspace Backend config template or compares it with the workspace-local config.\n\nOptions for diff:\n --workspace <PATH> Workspace root (defaults to cwd)\n -h, --help Print help"
|
||||
);
|
||||
}
|
||||
|
||||
fn print_skills_help() {
|
||||
println!(
|
||||
"yoi-workspace-server skills\n\nUsage:\n yoi-workspace-server skills list [OPTIONS]\n yoi-workspace-server skills lint [OPTIONS]\n yoi-workspace-server skills show <NAME> [OPTIONS]\n\nDescription:\n Uses the Workspace backend Skill catalog/lint/detail authority. Catalog output is lightweight and omits full SKILL.md bodies; detail output includes the body. allowed-tools and scripts are diagnostics only.\n\nOptions:\n --workspace <PATH> Workspace root (defaults to cwd)\n -h, --help Print help"
|
||||
"yoi-server skills\n\nUsage:\n yoi-server skills list [OPTIONS]\n yoi-server skills lint [OPTIONS]\n yoi-server skills show <NAME> [OPTIONS]\n\nDescription:\n Uses the Workspace backend Skill catalog/lint/detail authority. Catalog output is lightweight and omits full SKILL.md bodies; detail output includes the body. allowed-tools and scripts are diagnostics only.\n\nOptions:\n --workspace <PATH> Workspace root (defaults to cwd)\n -h, --help Print help"
|
||||
);
|
||||
}
|
||||
|
||||
fn print_serve_help() {
|
||||
println!(
|
||||
"yoi-workspace-server serve\n\nUsage:\n yoi-workspace-server serve [OPTIONS]\n\nDescription:\n Serves the Workspace recorded in the Yoi server DB. Workspace records are stored in the XDG/Yoi data directory, and runtime sources are loaded from XDG runtimes.toml.\n\nOptions:\n --listen <ADDR> Listen address (default 127.0.0.1:8787)\n -h, --help Print help"
|
||||
"yoi-server serve\n\nUsage:\n yoi-server serve [OPTIONS]\n\nDescription:\n Serves the Workspace recorded in the Yoi server DB. Workspace records are stored in the XDG/Yoi data directory, and runtime sources are loaded from XDG runtimes.toml.\n\nOptions:\n --listen <ADDR> Listen address (default 127.0.0.1:8787)\n -h, --help Print help"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1671,8 +1671,8 @@ Backend-only commands:
|
|||
login Run Backend device login and save the API token
|
||||
|
||||
Standalone binaries:
|
||||
yoi-workspace-server Workspace Backend server/admin CLI
|
||||
worker-runtime-rest-server Worker Runtime REST server
|
||||
yoi-server Workspace Backend server/admin CLI
|
||||
yoi-runtime Worker Runtime REST server
|
||||
|
||||
Options:
|
||||
-h, --help Print help
|
||||
|
|
@ -1826,8 +1826,8 @@ backend = "shared"
|
|||
assert!(TOP_LEVEL_HELP.contains("--backend <URL>"));
|
||||
assert!(TOP_LEVEL_HELP.contains("<data_dir>/client/config.toml"));
|
||||
assert!(TOP_LEVEL_HELP.contains("<cwd>/.yoi/client.config.toml"));
|
||||
assert!(TOP_LEVEL_HELP.contains("yoi-workspace-server"));
|
||||
assert!(TOP_LEVEL_HELP.contains("worker-runtime-rest-server"));
|
||||
assert!(TOP_LEVEL_HELP.contains("yoi-server"));
|
||||
assert!(TOP_LEVEL_HELP.contains("yoi-runtime"));
|
||||
assert!(!TOP_LEVEL_HELP.contains("yoi workspace"));
|
||||
assert!(!TOP_LEVEL_HELP.contains("yoi server"));
|
||||
assert!(!TOP_LEVEL_HELP.contains("TARGET_OPTIONS"));
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ in
|
|||
tag = imageTag;
|
||||
copyToRoot = runtimeRoot;
|
||||
config = {
|
||||
Entrypoint = [ "/bin/worker-runtime-rest-server" ];
|
||||
Entrypoint = [ "/bin/yoi-runtime" ];
|
||||
Cmd = [
|
||||
"--bind"
|
||||
"0.0.0.0:38800"
|
||||
|
|
@ -259,7 +259,7 @@ in
|
|||
tag = imageTag;
|
||||
copyToRoot = serverRoot;
|
||||
config = {
|
||||
Entrypoint = [ "/bin/yoi-workspace-server" ];
|
||||
Entrypoint = [ "/bin/yoi-server" ];
|
||||
Cmd = [
|
||||
"serve"
|
||||
"--listen"
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ Current image roles:
|
|||
|
||||
```text
|
||||
yoi-runtime:latest
|
||||
worker-runtime-rest-server
|
||||
yoi-runtime
|
||||
|
||||
yoi-server:latest
|
||||
yoi-workspace-server
|
||||
yoi-server
|
||||
|
||||
yoi-webui:latest
|
||||
nginx serving built WebUI assets and proxying API requests
|
||||
|
|
@ -62,7 +62,7 @@ docker/workspace/.yoi/workspace.toml
|
|||
docker/workspace/.yoi/workspace-backend.local.toml
|
||||
```
|
||||
|
||||
The WebUI container serves static assets and proxies `/api` to the Backend Server. The Backend Server registers the Runtime container as a remote Runtime such as `docker-runtime`. The Runtime container runs `worker-runtime-rest-server` and owns Worker spawning/materialization for that runtime.
|
||||
The WebUI container serves static assets and proxies `/api` to the Backend Server. The Backend Server registers the Runtime container as a remote Runtime such as `docker-runtime`. The Runtime container runs `yoi-runtime` and owns Worker spawning/materialization for that runtime.
|
||||
|
||||
Container user and writable data directories matter: runtime/server images must be able to write their configured data directories and named volumes. The current local-image Compose setup avoids an image-level `User` override and sets data-directory permissions accordingly.
|
||||
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@ RUNTIME_BASE_URL=http://127.0.0.1:38800
|
|||
From the Workspace Server host:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server identity init --server-id server-main
|
||||
yoi-server identity init --server-id server-main
|
||||
```
|
||||
|
||||
Show the public identity and copy the `public_key` value:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server identity show --json
|
||||
yoi-server identity show --json
|
||||
```
|
||||
|
||||
The Server private identity is stored in the Yoi data directory under the Server data root, currently:
|
||||
|
|
@ -50,13 +50,13 @@ On Unix this file is written with `0600` permissions. Do not copy the private ke
|
|||
From the Runtime host, using the same Runtime storage flags that the Runtime server process will use:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server identity init --runtime-id runtime-main
|
||||
yoi-runtime identity init --runtime-id runtime-main
|
||||
```
|
||||
|
||||
Show the public identity and copy the `public_key` value:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server identity show --json
|
||||
yoi-runtime identity show --json
|
||||
```
|
||||
|
||||
By default, Runtime auth state is stored at:
|
||||
|
|
@ -70,21 +70,21 @@ If the Runtime process is launched with `--fs-root` or `--fs-runtime-dir`, pass
|
|||
Example with explicit Runtime storage:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server identity init \
|
||||
yoi-runtime identity init \
|
||||
--runtime-id runtime-main \
|
||||
--fs-root /var/lib/yoi-runtime
|
||||
|
||||
worker-runtime-rest-server identity show \
|
||||
yoi-runtime identity show \
|
||||
--json \
|
||||
--fs-root /var/lib/yoi-runtime
|
||||
```
|
||||
|
||||
## 3. Register the Server public key on Runtime
|
||||
|
||||
On the Runtime host, register the Server public key copied from `yoi-workspace-server identity show --json`:
|
||||
On the Runtime host, register the Server public key copied from `yoi-server identity show --json`:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server trust-server add \
|
||||
yoi-runtime trust-server add \
|
||||
--server-id server-main \
|
||||
--public-key '<SERVER_PUBLIC_KEY>'
|
||||
```
|
||||
|
|
@ -92,7 +92,7 @@ worker-runtime-rest-server trust-server add \
|
|||
With explicit Runtime storage, keep using the same storage flags:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server trust-server add \
|
||||
yoi-runtime trust-server add \
|
||||
--server-id server-main \
|
||||
--public-key '<SERVER_PUBLIC_KEY>' \
|
||||
--fs-root /var/lib/yoi-runtime
|
||||
|
|
@ -101,27 +101,27 @@ worker-runtime-rest-server trust-server add \
|
|||
Verify:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server trust-server list --json
|
||||
yoi-runtime trust-server list --json
|
||||
```
|
||||
|
||||
## 4. Register the Runtime public key and endpoint on Server
|
||||
|
||||
On the Workspace Server host, register the Runtime public key copied from `worker-runtime-rest-server identity show --json`:
|
||||
On the Workspace Server host, register the Runtime public key copied from `yoi-runtime identity show --json`:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server trust-runtime add \
|
||||
yoi-server trust-runtime add \
|
||||
--runtime-id runtime-main \
|
||||
--base-url http://127.0.0.1:38800 \
|
||||
--public-key '<RUNTIME_PUBLIC_KEY>' \
|
||||
--display-name 'Runtime main'
|
||||
```
|
||||
|
||||
This writes a trusted Runtime record to the Server DB. During `yoi-workspace-server serve`, active trusted Runtime records are loaded as remote Runtime sources and receive signed capability tokens. You do not need to duplicate the same Runtime in `runtimes.toml` for this trust-backed path.
|
||||
This writes a trusted Runtime record to the Server DB. During `yoi-server serve`, active trusted Runtime records are loaded as remote Runtime sources and receive signed capability tokens. You do not need to duplicate the same Runtime in `runtimes.toml` for this trust-backed path.
|
||||
|
||||
Verify:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server trust-runtime list --json
|
||||
yoi-server trust-runtime list --json
|
||||
```
|
||||
|
||||
## 5. Start Runtime and Workspace Server
|
||||
|
|
@ -129,7 +129,7 @@ yoi-workspace-server trust-runtime list --json
|
|||
Start Runtime with the same storage flags used during Runtime identity/trust setup:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server \
|
||||
yoi-runtime \
|
||||
--bind 127.0.0.1:38800
|
||||
```
|
||||
|
||||
|
|
@ -138,26 +138,26 @@ For repository builds, the equivalent cargo command is:
|
|||
```bash
|
||||
cargo run -p worker-runtime \
|
||||
--features ws-server,fs-store \
|
||||
--bin worker-runtime-rest-server \
|
||||
--bin yoi-runtime \
|
||||
-- --bind 127.0.0.1:38800
|
||||
```
|
||||
|
||||
Start Workspace Server:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server serve --listen 127.0.0.1:8787
|
||||
yoi-server serve --listen 127.0.0.1:8787
|
||||
```
|
||||
|
||||
For repository builds:
|
||||
|
||||
```bash
|
||||
cargo run -p yoi-workspace-server -- serve --listen 127.0.0.1:8787
|
||||
cargo run -p yoi-workspace-server --bin yoi-server -- serve --listen 127.0.0.1:8787
|
||||
```
|
||||
|
||||
If the Server DB has no workspace record yet, initialize it first:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server init --workspace <WORKSPACE_ROOT>
|
||||
yoi-server init --workspace <WORKSPACE_ROOT>
|
||||
```
|
||||
|
||||
## Smoke checks
|
||||
|
|
@ -165,8 +165,8 @@ yoi-workspace-server init --workspace <WORKSPACE_ROOT>
|
|||
Check both trust stores:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server trust-runtime list --json
|
||||
worker-runtime-rest-server trust-server list --json
|
||||
yoi-server trust-runtime list --json
|
||||
yoi-runtime trust-server list --json
|
||||
```
|
||||
|
||||
Check that Workspace Server can see Runtime workers through the authenticated path. From the CLI:
|
||||
|
|
@ -186,13 +186,13 @@ Identity and trust records are intentionally not overwritten by default.
|
|||
Rotate Server identity:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server identity init --server-id server-main --replace
|
||||
yoi-server identity init --server-id server-main --replace
|
||||
```
|
||||
|
||||
After Server identity rotation, every Runtime that trusts that Server must be updated with the new Server public key:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server trust-server add \
|
||||
yoi-runtime trust-server add \
|
||||
--server-id server-main \
|
||||
--public-key '<NEW_SERVER_PUBLIC_KEY>' \
|
||||
--replace
|
||||
|
|
@ -201,13 +201,13 @@ worker-runtime-rest-server trust-server add \
|
|||
Rotate Runtime identity:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server identity init --runtime-id runtime-main --replace
|
||||
yoi-runtime identity init --runtime-id runtime-main --replace
|
||||
```
|
||||
|
||||
After Runtime identity rotation, Server must be updated with the new Runtime public key:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server trust-runtime add \
|
||||
yoi-server trust-runtime add \
|
||||
--runtime-id runtime-main \
|
||||
--base-url http://127.0.0.1:38800 \
|
||||
--public-key '<NEW_RUNTIME_PUBLIC_KEY>' \
|
||||
|
|
@ -219,13 +219,13 @@ yoi-workspace-server trust-runtime add \
|
|||
Revoke a trusted Runtime on Server:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server trust-runtime revoke --runtime-id runtime-main
|
||||
yoi-server trust-runtime revoke --runtime-id runtime-main
|
||||
```
|
||||
|
||||
Remove a trusted Server from Runtime:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server trust-server revoke --server-id server-main
|
||||
yoi-runtime trust-server revoke --server-id server-main
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
|
@ -235,7 +235,7 @@ worker-runtime-rest-server trust-server revoke --server-id server-main
|
|||
The Server DB contains trusted Runtime records, but the Server signing identity file does not exist. Run:
|
||||
|
||||
```bash
|
||||
yoi-workspace-server identity init --server-id server-main
|
||||
yoi-server identity init --server-id server-main
|
||||
```
|
||||
|
||||
If the identity was created in another environment, ensure the Server process is using the same Yoi data directory.
|
||||
|
|
@ -245,8 +245,8 @@ If the identity was created in another environment, ensure the Server process is
|
|||
Runtime only enables signed capability-token auth when both a Runtime identity and at least one trusted Server are present in its auth file. Check:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server identity show --json
|
||||
worker-runtime-rest-server trust-server list --json
|
||||
yoi-runtime identity show --json
|
||||
yoi-runtime trust-server list --json
|
||||
```
|
||||
|
||||
Also confirm the Runtime process was started with the same `--fs-root` / `--fs-runtime-dir` used for setup.
|
||||
|
|
@ -256,8 +256,8 @@ Also confirm the Runtime process was started with the same `--fs-root` / `--fs-r
|
|||
Confirm the `--runtime-id` registered on Server exactly matches the Runtime identity id:
|
||||
|
||||
```bash
|
||||
worker-runtime-rest-server identity show --json
|
||||
yoi-workspace-server trust-runtime list --json
|
||||
yoi-runtime identity show --json
|
||||
yoi-server trust-runtime list --json
|
||||
```
|
||||
|
||||
`RUNTIME_ID` is the token audience; mismatches are rejected by Runtime.
|
||||
|
|
|
|||
24
package.nix
24
package.nix
|
|
@ -43,7 +43,7 @@ rustPlatform.buildRustPackage rec {
|
|||
filter = sourceFilter;
|
||||
};
|
||||
|
||||
cargoHash = "sha256-iZaTREhL/aLixn67A1+Gi9opqh2j/yyFuGMyBBvuATM=";
|
||||
cargoHash = "sha256-R33Ty4414wGkqnwCt08zbDQbVu9ggMC5I3ZawgloNT0=";
|
||||
|
||||
depsExtraArgs = {
|
||||
# Older fetchCargoVendor utilities used crates.io's API download endpoint,
|
||||
|
|
@ -92,8 +92,8 @@ rustPlatform.buildRustPackage rec {
|
|||
];
|
||||
|
||||
postBuild = ''
|
||||
cargo build --offline --profile release -p yoi-workspace-server --bin yoi-workspace-server
|
||||
cargo build --offline --profile release -p worker-runtime --bin worker-runtime-rest-server --features ws-server,fs-store
|
||||
cargo build --offline --profile release -p yoi-workspace-server --bin yoi-server
|
||||
cargo build --offline --profile release -p worker-runtime --bin yoi-runtime --features ws-server,fs-store
|
||||
'';
|
||||
|
||||
# The package check is a credential-free install smoke check below. Running the
|
||||
|
|
@ -105,16 +105,16 @@ rustPlatform.buildRustPackage rec {
|
|||
runHook preInstall
|
||||
|
||||
yoi_bin=$(find . -type f -name yoi | head -n 1)
|
||||
workspace_server_bin=$(find . -type f -name yoi-workspace-server | head -n 1)
|
||||
worker_runtime_bin=$(find . -type f -name worker-runtime-rest-server | head -n 1)
|
||||
workspace_server_bin=$(find . -type f -name yoi-server | head -n 1)
|
||||
worker_runtime_bin=$(find . -type f -name yoi-runtime | head -n 1)
|
||||
if [ -z "$yoi_bin" ] || [ -z "$workspace_server_bin" ] || [ -z "$worker_runtime_bin" ]; then
|
||||
echo "built binaries not found" >&2
|
||||
find . -maxdepth 6 -type f \( -name yoi -o -name yoi-workspace-server -o -name worker-runtime-rest-server \) -print >&2
|
||||
find . -maxdepth 6 -type f \( -name yoi -o -name yoi-server -o -name yoi-runtime \) -print >&2
|
||||
exit 1
|
||||
fi
|
||||
install -Dm755 "$yoi_bin" "$out/bin/yoi"
|
||||
install -Dm755 "$workspace_server_bin" "$out/bin/yoi-workspace-server"
|
||||
install -Dm755 "$worker_runtime_bin" "$out/bin/worker-runtime-rest-server"
|
||||
install -Dm755 "$workspace_server_bin" "$out/bin/yoi-server"
|
||||
install -Dm755 "$worker_runtime_bin" "$out/bin/yoi-runtime"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
|
@ -125,10 +125,10 @@ rustPlatform.buildRustPackage rec {
|
|||
|
||||
"$out/bin/yoi" worker --help >/dev/null
|
||||
test -x "$out/bin/yoi"
|
||||
test -x "$out/bin/yoi-workspace-server"
|
||||
test -x "$out/bin/worker-runtime-rest-server"
|
||||
"$out/bin/yoi-workspace-server" --help >/dev/null
|
||||
"$out/bin/worker-runtime-rest-server" --help >/dev/null
|
||||
test -x "$out/bin/yoi-server"
|
||||
test -x "$out/bin/yoi-runtime"
|
||||
"$out/bin/yoi-server" --help >/dev/null
|
||||
"$out/bin/yoi-runtime" --help >/dev/null
|
||||
test ! -e "$out/bin/yoi-pod"
|
||||
test ! -e "$out/share/yoi/resources"
|
||||
if "$out/bin/yoi" --session not-a-uuid 2>yoi.err; then
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
# Workspace Backend local config template.
|
||||
#
|
||||
# `yoi-workspace-server init` copies this packaged template to
|
||||
# `yoi-server init` copies this packaged template to
|
||||
# `.yoi/workspace-backend.local.toml` without overwriting an existing file.
|
||||
# The `.local` file is intentionally git-ignored.
|
||||
#
|
||||
# Print the latest packaged template with:
|
||||
# yoi-workspace-server config default
|
||||
# yoi-server config default
|
||||
#
|
||||
# Compare the local config with the latest packaged template with:
|
||||
# yoi-workspace-server config diff
|
||||
# yoi-server config diff
|
||||
#
|
||||
# Omit a key to use the built-in fallback. TOML has no `null`, so optional
|
||||
# settings are represented by leaving the key commented out.
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ usage() {
|
|||
Usage: $(basename "$0") <start|stop|restart|status>
|
||||
|
||||
Manage the local Yoi development stack for this checkout:
|
||||
runtime target/debug/worker-runtime-rest-server --bind $RUNTIME_BIND
|
||||
backend target/debug/yoi-workspace-server serve --listen $BACKEND_LISTEN
|
||||
runtime target/debug/yoi-runtime --bind $RUNTIME_BIND
|
||||
backend target/debug/yoi-server serve --listen $BACKEND_LISTEN
|
||||
frontend deno run -A npm:vite@7.2.7 dev --host $FRONTEND_HOST --port $FRONTEND_PORT (cwd: web/workspace)
|
||||
|
||||
Actions:
|
||||
|
|
@ -307,7 +307,7 @@ build_runtime_backend() {
|
|||
log "building runtime binary"
|
||||
(
|
||||
cd "$ROOT_DIR"
|
||||
run_cargo build -p worker-runtime --features ws-server,fs-store --bin worker-runtime-rest-server
|
||||
run_cargo build -p worker-runtime --features ws-server,fs-store --bin yoi-runtime
|
||||
)
|
||||
else
|
||||
log "runtime disabled by YOI_DEV_RUNTIME_ENABLED=0; skipping runtime build"
|
||||
|
|
@ -316,7 +316,7 @@ build_runtime_backend() {
|
|||
log "building backend binary"
|
||||
(
|
||||
cd "$ROOT_DIR"
|
||||
run_cargo build -p yoi-workspace-server --bin yoi-workspace-server
|
||||
run_cargo build -p yoi-workspace-server --bin yoi-server
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -327,7 +327,7 @@ start_runtime() {
|
|||
fi
|
||||
local port runtime_bin
|
||||
port="$(port_for_addr "$RUNTIME_BIND")"
|
||||
runtime_bin="$ROOT_DIR/target/debug/worker-runtime-rest-server"
|
||||
runtime_bin="$ROOT_DIR/target/debug/yoi-runtime"
|
||||
if [[ ! -x "$runtime_bin" ]]; then
|
||||
printf 'runtime binary not found or not executable: %s\n' "$runtime_bin" >&2
|
||||
return 1
|
||||
|
|
@ -339,7 +339,7 @@ start_runtime() {
|
|||
start_backend() {
|
||||
local port backend_bin
|
||||
port="$(port_for_addr "$BACKEND_LISTEN")"
|
||||
backend_bin="$ROOT_DIR/target/debug/yoi-workspace-server"
|
||||
backend_bin="$ROOT_DIR/target/debug/yoi-server"
|
||||
if [[ ! -x "$backend_bin" ]]; then
|
||||
printf 'backend binary not found or not executable: %s\n' "$backend_bin" >&2
|
||||
return 1
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
SvelteKit static SPA for the Yoi workspace control plane.
|
||||
|
||||
The frontend is intentionally static. Workspace authority, validation, and API
|
||||
behavior live in the Rust `yoi-workspace-server` backend.
|
||||
behavior live in the Rust `yoi-server` backend.
|
||||
|
||||
## Development
|
||||
|
||||
|
|
@ -30,12 +30,12 @@ printed by `deno task dev`.
|
|||
If you want to run the backend from the repository root instead:
|
||||
|
||||
```bash
|
||||
cargo run -p yoi-workspace-server -- serve --listen 127.0.0.1:8787
|
||||
cargo run -p yoi-workspace-server --bin yoi-server -- serve --listen 127.0.0.1:8787
|
||||
```
|
||||
|
||||
The backend reads Workspace records from the Yoi server DB at
|
||||
`<data_dir>/server/server.db`. Run
|
||||
`cargo run -p yoi-workspace-server -- init --workspace .` first when the server
|
||||
`cargo run -p yoi-workspace-server --bin yoi-server -- init --workspace .` first when the server
|
||||
DB has not been initialized.
|
||||
|
||||
## Static build
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"tasks": {
|
||||
"install": "deno install",
|
||||
"dev": "deno run -A npm:vite@7.2.7 dev",
|
||||
"dev:backend": "cd ../.. && cargo run -p yoi-workspace-server -- serve --listen 127.0.0.1:8787",
|
||||
"dev:backend": "cd ../.. && cargo run -p yoi-workspace-server --bin yoi-server -- serve --listen 127.0.0.1:8787",
|
||||
"check": "deno run -A npm:@sveltejs/kit@2.49.4 sync && deno run -A npm:svelte-check@4.3.4 --tsconfig ./tsconfig.json",
|
||||
"test": "deno test --allow-read=src --allow-env=VSCODE_TEXTMATE_DEBUG src/lib/workspace/auth/model.test.ts src/lib/workspace/api/http.test.ts src/lib/workspace/console/chat-submit.test.ts src/lib/workspace/console/composer-command.test.ts src/lib/workspace/console/composer-completion.test.ts src/lib/workspace/console/markdown.test.ts src/lib/workspace/console/model.test.ts src/lib/workspace/console/worker-console.ui.test.ts src/lib/workspace/settings/model.test.ts src/lib/workspace/sidebar/workers.test.ts src/lib/workspace/sidebar/worker-launch.test.ts src/lib/workspace/sidebar/repository-nav.test.ts",
|
||||
"build": "deno run -A npm:vite@7.2.7 build",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user