github moghtech/komodo v1.17.5
Komodo v1.17.5

latest releases: v1.19.3, v1.19.2, v1.19.1...
4 months ago

Changelog

🚨 This release removes support for the ServerTemplate resource. It was an interesting experiment, but ultimately I feel cloud server creation is outside of the scope of Komodo, it wasn't a very refined flow, and is better accomplished using other IAC tools such as OpenTofu.

🚨 Container exec is now enabled even if disable_terminals = true. This allows users to still use container exec while disabling general terminals. If you don't want to allow container exec, you now have to use disable_container_exec in periphery.config.toml (Env: PERIPHERY_DISABLE_CONTAINER_EXEC=true)

🚨 ssl_enabled in periphery.config.toml (Env: PERIPHERY_SSL_ENABLED) now defaults to true. You should update your server address to use https if you haven't yet.

  • Websocket: Add disable_websocket_reconnect = true to core.config.toml (Env: KOMODO_DISABLE_WEBSOCKET_RECONNECT=true) if your websocket is causing issues. You can still click the connected indicator in the topbar to manually trigger reconnect. The reconnect logic has also improved to make sure reconnect attempts only happen every 5s, so you might want to try it out before disabling reconnect. Re #368.

  • UI: Improve renaming visibility / intuitiveness

    • Now you rename by clicking on the name in the header
    • Lots of people didn't see the previous rename function until it was pointed out, hopefully this makes it easier to figure out.
  • Stack: Add the BatchPullStack execution for use in Actions / Procedures.

  • Server: Terminals can now be started using your shell of choice (before it was always bash)

  • Server: Implemented the execute_terminal api to send command to your Terminals over HTTP call. See below for details.

Execute Terminal

One use case I had in mind for terminals is to have an easy way to handle a simple system update task, say running sudo apt upgrade -y, on a schedule. To do this, I needed a way to interact with terminals from an Action. Now you can do this using komodo.execute_terminal. For example, a simple Action to update all your servers and consolidate / save the logs:

const servers = await komodo.read("ListServers", {
  query: { tags: ["auto-update"] },
});

for (const server of servers) {
  console.log();
  console.log("------------------");
  console.log("Updating", server.name);
  await komodo.write("CreateTerminal", {
    server: server.name,
    name: "apt-upgrade",
    command: "bash",
    recreate: Types.TerminalRecreateMode.DifferentCommand,
  });
  await komodo.execute_terminal(
    {
      server: server.name,
      terminal: "apt-upgrade",
      command:
        "sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y",
    },
    {
      onLine: console.log,
      onFinish: (code) => console.log("Finished:", code),
    },
  );
}

Note. It is necessary to CreateTerminal before you can execute on it, as shown above. Setting recreate: Types.TerminalRecreateMode.DifferentCommand will make it so it does not fail if the terminal already exists, and only recreates the terminal if it was started with a different root command. This allows you to reuse the same terminal and collect the output for later viewing. You can also use Types.TerminalRecreateMode.Always to always run on a fresh terminal.

Other

  • The API now supports the Path calling convention, allowing for the request type to be specified in the URL path, which is a bit more concise. For example calling DeployStack:
---------------------------------
## Path calling convention (New)
---------------------------------
curl --header (unchanged) \
    --data '{ "stack": "my-stack", "services": ["server"] }' \ # <- data just matches the rust struct
    https://komodo.example.com/execute/DeployStack # <- request type in path

-----------------------------------
## Type-params calling convention (Old, but still supported)
-----------------------------------
curl --header (unchanged) \
    --data '{ "type": "DeployStack", "params": { "stack": "my-stack", "services": ["server"] } }' \
    https://komodo.example.com/execute
  • This is not breaking, the previous way of calling the API continues to be supported.
  • The Frontend interface now uses the path based calling convention, as it is much easier to see what calls are happening from the browser devtools during development. That was the main motivation for this feature.
  • There isn't any change to the rust or typescript clients.

Don't miss a new komodo release

NewReleases is sending notifications on new releases.