mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-25 01:50:54 -05:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b3bb9b8bb | ||
|
|
79831f29af | ||
|
|
b68f5abd25 | ||
|
|
2325899ebf | ||
|
|
23fd208f0f | ||
|
|
19904e00b9 | ||
|
|
8880b1c948 | ||
|
|
e47c8d2b62 | ||
|
|
1addb8fccd |
@@ -2,7 +2,7 @@ use anyhow::{Context, anyhow};
|
||||
use colored::Colorize;
|
||||
use komodo_client::{
|
||||
api::{
|
||||
read::{ListAllDockerContainers, ListServers},
|
||||
read::{GetServer, ListAllDockerContainers, ListServers},
|
||||
terminal::InitTerminal,
|
||||
},
|
||||
entities::{
|
||||
@@ -138,11 +138,14 @@ async fn get_server(
|
||||
}
|
||||
|
||||
if containers.len() == 1 {
|
||||
return containers
|
||||
let server_id = containers
|
||||
.pop()
|
||||
.context("Shouldn't happen")?
|
||||
.server_id
|
||||
.context("Container doesn't have server_id");
|
||||
.context("Container doesn't have server_id")?;
|
||||
let server_name =
|
||||
client.read(GetServer { server: server_id }).await?.name;
|
||||
return Ok(server_name);
|
||||
}
|
||||
|
||||
let servers = containers
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
The Komodo CLI, `km`, can be used to:
|
||||
- Quickly **run executions** and update **resources** and **variables**.
|
||||
- **Reset user passwords** and elevate users to **Super Admin**.
|
||||
- **Reset user passwords** and elevate users to **Super Admin**.
|
||||
- Perform Database **backup**, **restore**, and **copy**.
|
||||
- **Connect to server / container shell** via Komodo Terminals.
|
||||
|
||||
The Komodo Core image comes packaged with the Komodo CLI,
|
||||
and is available for usage inside running container with `docker exec -it komodo-core km ...`.
|
||||
@@ -21,6 +22,61 @@ This way, it inherits the Core database config in order to easily perform backup
|
||||
- `km x commit my-sync`
|
||||
- `km set user mbecks super-admin true`
|
||||
- `km set user mbecks password "temp-password"`
|
||||
- `km ssh my-server`
|
||||
- `km connect my-server bash -n my-session`
|
||||
- `km exec my-container bash`
|
||||
- `km attach my-container -s my-server`
|
||||
|
||||
### Terminals
|
||||
|
||||
All terminal commands share the same disconnect shortcut: press **Alt+Q** to end the session.
|
||||
The session itself stays running and will keep the history if you connect again, or connect from a
|
||||
different device.
|
||||
|
||||
#### SSH / Connect
|
||||
|
||||
The `km ssh` command (alias for `km connect`) opens an interactive shell on a server managed by Komodo Periphery. Analogous to `ssh`.
|
||||
|
||||
```
|
||||
km ssh <server> [command] [options]
|
||||
km connect <server> [command] [options]
|
||||
```
|
||||
|
||||
| Argument | Description |
|
||||
|---|---|
|
||||
| `server` | Server name (required) |
|
||||
| `command` | Shell command to start, e.g. `bash` (optional, defaults to Periphery default) |
|
||||
| `-n`, `--name` | Terminal session name (default: `ssh`) |
|
||||
| `-r`, `--recreate` | Force a fresh terminal, replacing any existing session with the same name |
|
||||
|
||||
#### Exec
|
||||
|
||||
The `km exec` command opens an interactive shell inside a running container. Analogous to `docker exec`.
|
||||
|
||||
```
|
||||
km exec <container> <shell> [options]
|
||||
```
|
||||
|
||||
| Argument | Description |
|
||||
|---|---|
|
||||
| `container` | Container name (required) |
|
||||
| `shell` | Shell to use, e.g. `bash` or `sh` (required) |
|
||||
| `-s`, `--server` | Server name — required if multiple servers have a container with the same name |
|
||||
| `-r`, `--recreate` | Force a fresh terminal, replacing any existing session |
|
||||
|
||||
#### Attach
|
||||
|
||||
The `km attach` command attaches to a running container's main process stdio. Analogous to `docker attach`.
|
||||
|
||||
```
|
||||
km attach <container> [options]
|
||||
```
|
||||
|
||||
| Argument | Description |
|
||||
|---|---|
|
||||
| `container` | Container name (required) |
|
||||
| `-s`, `--server` | Server name — required if multiple servers have a container with the same name |
|
||||
| `-r`, `--recreate` | Force a fresh terminal, replacing any existing session |
|
||||
|
||||
### Install
|
||||
|
||||
@@ -53,7 +109,7 @@ brew tap moghtech/komodo && \
|
||||
|
||||
You can alias a docker run command:
|
||||
```bash
|
||||
alias km='docker run --rm -v $HOME/.config/komodo:/config ghcr.io/moghtech/komodo-cli km'
|
||||
alias km='docker run --rm -v $HOME/.config/komodo:/config ghcr.io/moghtech/komodo-cli:2 km'
|
||||
km config
|
||||
```
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ Komodo v2 is a major release with significant architectural changes and new feat
|
||||
- **PKI authentication**: Core and Periphery now authenticate with auto-generated key pairs and automatic rotation. Passkeys are deprecated.
|
||||
- **Onboarding keys**: streamlined server onboarding with reusable keys.
|
||||
- **Improved terminals**: Terminals dashboard, `km ssh`, and improved Action scripting.
|
||||
- **Improved auto updates**: Uses a better system to handle auto updates based on image digest.
|
||||
- **New UI**: Improved look with higher contrast and better UI primitives.
|
||||
- **Passkey / TOTP 2FA**: Built in two factor authentication for username / password login.
|
||||
- **Multi-login Linking**: Users can now link multiple login providers (Local, OIDC, Github, etc) to their account.
|
||||
@@ -22,7 +23,8 @@ It is largely backward compatible with Komodo v1 configuration, and users can up
|
||||
|
||||
:::note
|
||||
Starting with v2, Komodo will not publish images with the `latest` tag in favor of Semver (`2`, `2.0`, `2.0.0`).
|
||||
This prevents unintented major version upgrades when using auto updaters.
|
||||
This prevents unintented major version upgrades when using auto updaters. Use `:2` to stay up to date
|
||||
with all future Komodo v2 releases.
|
||||
:::
|
||||
|
||||
### 1. Upgrade Core and Periphery to v2
|
||||
@@ -63,8 +65,6 @@ Systemd Periphery users just need to update their Periphery binary version. The
|
||||
|
||||
After getting both Core and Periphery running, everything should already work correctly at this point.
|
||||
|
||||
|
||||
|
||||
### 2a. Move to public key authentication
|
||||
|
||||
If you want to **reverse the agent connection, [skip this step and go to 2b](#2b-reversing-the-agent-connection)**.
|
||||
@@ -119,7 +119,7 @@ onboarding_key = "<YOUR_ONBOARDING_KEY>"
|
||||
|
||||
Upon connecting, the privileged onboarding key will allow the existing server's expected public key
|
||||
to be updated, allowing the Periphery agent to connect.
|
||||
**In general when onboarding _new_ servers, privilidged mode is not needed.**
|
||||
**In general when onboarding _new_ servers, privileged mode is not needed.**
|
||||
|
||||
### 3. Fix any `komodo.execute_terminal` in Actions
|
||||
|
||||
|
||||
@@ -28,6 +28,16 @@ You can create multiple named terminal sessions on the same resource. Each sessi
|
||||
|
||||
Each terminal maintains a rolling 1 MiB output buffer. When you reconnect to an existing session, the history is replayed so you can see previous output.
|
||||
|
||||
## CLI
|
||||
|
||||
Terminal sessions can also be accessed from the command line using the [Komodo CLI](./ecosystem/cli.mdx#terminals).
|
||||
|
||||
- `km ssh <server>` — open a shell on a server
|
||||
- `km exec <container> <shell>` — exec into a container
|
||||
- `km attach <container>` — attach to a container's main process
|
||||
|
||||
Press **Alt+Q** to disconnect from any CLI terminal session while the session itself stays running.
|
||||
|
||||
## Execute Terminal
|
||||
|
||||
The `execute_terminal` API method allows you to run a command on a terminal and stream the output back over HTTP. This is useful for:
|
||||
|
||||
@@ -13,7 +13,7 @@ If you have an idea for Komodo, feel free to open an issue beginning with the `[
|
||||
- **v1.16**: "Action" resource: Run requests on the Komodo API using snippets of typescript. ✅
|
||||
- **v1.17**: Procedure Schedules: Run procedures / Actions at scheduled times, like CRON job. Connect to host terminals and exec into containers ✅
|
||||
- **v1.18**: Upgrade granular role based access control system ✅
|
||||
- **Undecided**: Support "Swarm" resource - Manage docker swarms, attach Deployments / Stacks to "Swarm".
|
||||
- **v2.0**: Support "Swarm" resource - Manage docker swarms, attach Deployments / Stacks to "Swarm".
|
||||
- **Undecided**: Support "Cluster" resource - Manage Kubernetes cluster, can attach deployments to "Cluster"
|
||||
|
||||
**Note. The specific versions associated with these features are not final.**
|
||||
@@ -55,7 +55,9 @@ export default function HashCompare({
|
||||
<Badge color="accent.9">message</Badge>
|
||||
<Text c="dimmed">{lastHash}</Text>
|
||||
</Group>
|
||||
<Code>{lastMessage || latestMessage}</Code>
|
||||
<Code maw="calc(100vh - 150px)" style={{ overflow: "auto" }}>
|
||||
{lastMessage || latestMessage}
|
||||
</Code>
|
||||
</Stack>
|
||||
{outOfDate && (
|
||||
<Stack gap="xs">
|
||||
@@ -65,7 +67,9 @@ export default function HashCompare({
|
||||
</Badge>
|
||||
<Text c="dimmed">{latestHash}</Text>
|
||||
</Group>
|
||||
<Code>{latestMessage}</Code>
|
||||
<Code maw="calc(100vh - 150px)" style={{ overflow: "auto" }}>
|
||||
{latestMessage}
|
||||
</Code>
|
||||
</Stack>
|
||||
)}
|
||||
</Stack>
|
||||
|
||||
@@ -58,8 +58,9 @@ export default function SwarmConfig({
|
||||
<Group
|
||||
key={index}
|
||||
gap="xs"
|
||||
w={{ base: "85%", lg: 400 }}
|
||||
w={{ base: "100%", lg: 400 }}
|
||||
justify="space-between"
|
||||
wrap="nowrap"
|
||||
>
|
||||
<ResourceSelector
|
||||
type="Server"
|
||||
@@ -105,7 +106,7 @@ export default function SwarmConfig({
|
||||
})
|
||||
}
|
||||
leftSection={<ICONS.Add size="1rem" />}
|
||||
w={{ base: "85%", lg: 400 }}
|
||||
w={{ base: "100%", lg: 400 }}
|
||||
>
|
||||
Add Server
|
||||
</Button>
|
||||
@@ -118,7 +119,6 @@ export default function SwarmConfig({
|
||||
{
|
||||
label: "Alerts",
|
||||
labelHidden: true,
|
||||
contentHidden: ((update.links ?? config.links)?.length ?? 0) === 0,
|
||||
fields: {
|
||||
send_unhealthy_alerts: {
|
||||
description: "Send alerts when the Swarm is unhealthy",
|
||||
@@ -151,7 +151,6 @@ export default function SwarmConfig({
|
||||
{
|
||||
label: "Links",
|
||||
description: "Add quick links in the resource header",
|
||||
contentHidden: ((update.links ?? config.links)?.length ?? 0) === 0,
|
||||
fields: {
|
||||
links: (values, set) => (
|
||||
<ConfigList
|
||||
|
||||
Reference in New Issue
Block a user