mirror of
https://github.com/moghtech/komodo.git
synced 2026-05-02 09:34:38 -05:00
* add terminal (ssh) apis * add core terminal exec method * terminal typescript client method * terminals WIP * backend for pty * add ts responses * about wire everything * add new blog * credit Skyfay * working * regen lock * 1.17.4-dev-1 * pty history * replace the test terminal impl with websocket (pty) * create api and improve frontend * fix fe * terminals * disable terminal api on periphery * implement write level terminal perms * remove unneeded * fix clippy * delete unneeded * fix waste cpu cycles * set TERM and COLORTERM for shell environment * fix xterm scrolling behavior * starship promp in periphery container terminal * kill all terminals on periphery shutdown signal * improve starship config and enable ssl in compose * use same scrollTop setter * fix periphery container distribution link * support custom command / args to init terminal * allow fully configurable init command * docker exec into container * add permissioning for container exec * add starship to core container * add delete all terminals * dev-2 * finished gen client * core need curl * hide Terminal trigger if disabled * 1.17.4
125 lines
5.1 KiB
Plaintext
125 lines
5.1 KiB
Plaintext
# Connect More Servers
|
|
|
|
```mdx-code-block
|
|
import RemoteCodeFile from "@site/src/components/RemoteCodeFile";
|
|
```
|
|
|
|
Connecting a server to Komodo has 2 steps:
|
|
|
|
1. Install the Periphery agent on the server (either binary or container).
|
|
2. Add the server to Komodo via the Core API / UI.
|
|
|
|
## Install Periphery
|
|
|
|
You can install Periphery as a systemd managed process, run it as a [docker container](https://github.com/moghtech/komodo/pkgs/container/komodo-periphery), or do whatever you want with the binary.
|
|
|
|
:::warning
|
|
Allowing unintended access to the Periphery agent API is a security risk.
|
|
Ensure to take appropriate measures to block access to the Periphery API, such as firewall rules on port `8120`.
|
|
Additionally, you can whitelist your Komodo Core IP address in the [Periphery config](https://github.com/moghtech/komodo/blob/main/config/periphery.config.toml#L46),
|
|
and configure it to [only accept requests including your Core passkey](https://github.com/moghtech/komodo/blob/main/config/periphery.config.toml#L51).
|
|
:::
|
|
|
|
### Install the Periphery agent - systemd
|
|
|
|
As root user:
|
|
```bash
|
|
curl -sSL https://raw.githubusercontent.com/moghtech/komodo/main/scripts/setup-periphery.py | python3
|
|
```
|
|
|
|
Periphery can also be installed to run as the calling user, just note this comes with some additional configuration.
|
|
|
|
```bash
|
|
curl -sSL https://raw.githubusercontent.com/moghtech/komodo/main/scripts/setup-periphery.py | python3 - --user
|
|
```
|
|
|
|
You can find more information (and view the script) in the [readme](https://github.com/moghtech/komodo/tree/main/scripts).
|
|
|
|
:::info
|
|
This script can be run multiple times without issue, and it won't change existing config after the first run. Just run it again after a Komodo version release, and it will update the periphery version.
|
|
:::
|
|
|
|
### Install the Periphery agent - container
|
|
|
|
You can use a docker compose file:
|
|
|
|
```mdx-code-block
|
|
<RemoteCodeFile
|
|
title="https://github.com/moghtech/komodo/blob/main/compose/periphery.compose.yaml"
|
|
url="https://raw.githubusercontent.com/moghtech/komodo/main/compose/periphery.compose.yaml"
|
|
language="yaml"
|
|
/>
|
|
```
|
|
|
|
### Manual install steps - binaries
|
|
|
|
1. Download the periphery binary from the latest [release](https://github.com/moghtech/komodo/releases).
|
|
|
|
2. Create and edit your config files, following the [config example](https://github.com/moghtech/komodo/blob/main/config/periphery.config.toml).
|
|
|
|
:::note
|
|
See the [periphery config docs](https://docs.rs/komodo_client/latest/komodo_client/entities/config/periphery/index.html)
|
|
for more information on configuring periphery.
|
|
:::
|
|
|
|
3. Ensure that inbound connectivity is allowed on the port specified in periphery.config.toml (default 8120).
|
|
|
|
4. Install docker. See the [docker install docs](https://docs.docker.com/engine/install/).
|
|
|
|
:::note
|
|
Ensure that the user which periphery is run as has access to the docker group without sudo.
|
|
:::
|
|
|
|
5. Start the periphery binary with your preferred process manager, like systemd.
|
|
|
|
### Example periphery start command
|
|
|
|
```
|
|
periphery \
|
|
--config-path /path/to/periphery.config.base.toml \
|
|
--config-path /other_path/to/override-periphery-config-directory \
|
|
--config-keyword periphery \
|
|
--config-keyword config \
|
|
--merge-nested-config true
|
|
```
|
|
|
|
:::info
|
|
You can run `periphery --help` to see the manual.
|
|
:::
|
|
|
|
When running periphery in docker, use [command](https://docs.docker.com/reference/compose-file/services/#command) to pass in additional arguments.
|
|
```
|
|
command: periphery --config-path /path/in/container/to/periphery.config.base.toml
|
|
```
|
|
|
|
### Passing config files
|
|
|
|
Either file paths or directory paths can be passed to `--config-path`.
|
|
|
|
When using directories, the file entries can be filtered by name with the `--config-keyword` argument, which can be passed multiple times to add more keywords. If passed, then only config files with file names that contain all keywords will be merged.
|
|
|
|
When passing multiple config files, later --config-path given in the command will always override previous ones. Directory config files are merged in alphabetical order by name, so `config_b.toml` will override `config_a.toml`.
|
|
|
|
There are two ways to merge config files. The default behavior is to completely replace any base fields with whatever fields are present in the override config. So if you pass `allowed_ips = []` in your override config, the final allowed_ips will be an empty list as well.
|
|
|
|
`--merge-nested-config true` will merge config fields recursively and extend config array fields.
|
|
|
|
For example, with `--merge-nested-config true` you can specify an allowed ip in the base config, and another in the override config, they will both be present in the final config.
|
|
|
|
Similarly, you can specify a base docker / github account pair, and extend them with additional accounts in the override config.
|
|
|
|
## Configuration
|
|
|
|
Quick download to `./komodo/periphery.config.toml`:
|
|
```bash
|
|
wget -P komodo https://raw.githubusercontent.com/moghtech/komodo/main/config/periphery.config.toml
|
|
```
|
|
|
|
```mdx-code-block
|
|
<RemoteCodeFile
|
|
title="https://github.com/moghtech/komodo/blob/main/config/periphery.config.toml"
|
|
url="https://raw.githubusercontent.com/moghtech/komodo/main/config/periphery.config.toml"
|
|
language="toml"
|
|
/>
|
|
```
|