Repository navigation
feat(ct): create Komodo Periphery LXC with native agent #2429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| #!/usr/bin/env bash | ||
| _CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" | ||
| _cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" | ||
| # shellcheck source=/dev/null | ||
| source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") | ||
|
|
||
| # Copyright (c) 2026 community-scripts ORG | ||
| # Author: Sofiane A. (soflane) | ||
| # License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE | ||
| # Source: https://komo.do/ | https://github.com/moghtech/komodo | ||
|
|
||
| APP="Komodo-Periphery" | ||
| var_tags="${var_tags:-docker;komodo}" | ||
| var_cpu="${var_cpu:-2}" | ||
| var_ram="${var_ram:-2048}" | ||
| var_disk="${var_disk:-8}" | ||
| var_os="${var_os:-debian}" | ||
| var_version="${var_version:-13}" | ||
| var_unprivileged="${var_unprivileged:-1}" | ||
| #var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified | ||
|
|
||
| export var_komodo_core_address="${var_komodo_core_address:-}" | ||
| export var_komodo_server_name="${var_komodo_server_name:-}" | ||
| export var_komodo_onboarding_key="${var_komodo_onboarding_key:-}" | ||
| export var_komodo_core_public_key="${var_komodo_core_public_key:-}" | ||
|
|
||
| header_info "$APP" | ||
| variables | ||
| color | ||
| catch_errors | ||
|
|
||
| function update_script() { | ||
| header_info | ||
| check_container_storage | ||
| check_container_resources | ||
| if [[ ! -x /opt/komodo-periphery/periphery || ! -f /etc/komodo/periphery.config.json ]]; then | ||
| msg_error "No Komodo Periphery installation found!" | ||
| exit 233 | ||
| fi | ||
|
|
||
| if ! var_komodo_addon_script="$(_cs_fetch_text "tools/addon/komodo-periphery.sh")" || | ||
| [[ -z "$var_komodo_addon_script" ]]; then | ||
| msg_error "Could not load the Komodo Periphery addon." | ||
| exit 115 | ||
| fi | ||
|
Comment on lines
+42
to
+45
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
| mkdir -p /usr/local/lib/komodo-periphery | ||
| addon_file=$(mktemp /usr/local/lib/komodo-periphery/.addon.XXXXXX) | ||
| cat <<EOF >"$addon_file" | ||
| $var_komodo_addon_script | ||
| EOF | ||
| chmod 755 "$addon_file" | ||
| mv -f "$addon_file" /usr/local/lib/komodo-periphery/addon.sh | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. write directly |
||
| type=update bash /usr/local/lib/komodo-periphery/addon.sh | ||
| exit | ||
| } | ||
|
|
||
| if on_pve_host; then | ||
| root_check | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
| if is_unattended && [[ -z "$var_komodo_core_address" || -z "$var_komodo_onboarding_key" ]]; then | ||
| msg_error "Supply var_komodo_core_address and var_komodo_onboarding_key before creating the Komodo Periphery LXC." | ||
| exit 1 | ||
| fi | ||
| var_komodo_core_address=$(prompt_input_required "Komodo Core URL:" "" 120 "var_komodo_core_address") | ||
| if [[ ! "$var_komodo_core_address" =~ ^https?://[^[:space:]/]+(/[^[:space:]]*)?$ ]]; then | ||
| msg_error "Komodo Periphery requires an HTTP or HTTPS Core URL without whitespace." | ||
| exit 1 | ||
| fi | ||
| if [[ -z "$var_komodo_onboarding_key" ]] && ! is_unattended; then | ||
| read -r -s -p "${TAB3}Komodo Server Onboarding Key: " var_komodo_onboarding_key </dev/tty || true | ||
| echo | ||
| fi | ||
| if [[ -z "$var_komodo_onboarding_key" ]]; then | ||
| msg_error "A Komodo Server Onboarding Key is required before creating the LXC." | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| start | ||
| # Forward the local candidate to the guest, including before the PR is published. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
| if ! var_komodo_addon_script="$(_cs_fetch_text "tools/addon/komodo-periphery.sh")" || | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fetching this file twice in this script? |
||
| [[ -z "$var_komodo_addon_script" ]]; then | ||
| msg_error "Could not load the Komodo Periphery addon." | ||
| exit 115 | ||
| fi | ||
| export var_komodo_addon_script | ||
| build_container | ||
| description | ||
|
|
||
| msg_ok "Komodo Periphery LXC created successfully!" | ||
| echo -e "${INFO}Confirm the new server connection in Komodo Core." | ||
| echo -e "${INFO}Update the agent inside the LXC with update_komodo_periphery." | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright (c) 2026 community-scripts ORG | ||
| # Author: Sofiane A. (soflane) | ||
| # License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE | ||
| # Source: https://komo.do/ | https://github.com/moghtech/komodo | ||
|
|
||
| # shellcheck source=/dev/null | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
| source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" | ||
| color | ||
| verb_ip6 | ||
| catch_errors | ||
| setting_up_container | ||
| network_check | ||
| update_os | ||
|
|
||
| if [[ -z "${var_komodo_addon_script:-}" ]]; then | ||
| msg_error "The Komodo Periphery addon was not supplied by the LXC creator." | ||
| exit 115 | ||
| fi | ||
|
Comment on lines
+17
to
+20
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should always be supplied remove |
||
|
|
||
| msg_info "Preparing Komodo Periphery installer" | ||
| mkdir -p /usr/local/lib/komodo-periphery | ||
| cat <<EOF >/usr/local/lib/komodo-periphery/addon.sh | ||
| $var_komodo_addon_script | ||
| EOF | ||
| chmod 755 /usr/local/lib/komodo-periphery/addon.sh | ||
| msg_ok "Prepared Komodo Periphery installer" | ||
|
|
||
| # The CT creation wizard authorizes Docker installation in this new guest. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
| var_komodo_setup_docker=yes bash /usr/local/lib/komodo-periphery/addon.sh | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a world where this would be no? |
||
| unset var_komodo_addon_script var_komodo_onboarding_key | ||
|
|
||
| motd_ssh | ||
| customize | ||
| cleanup_lxc | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,85 @@ | ||||||
| { | ||||||
| "name": "Komodo Periphery", | ||||||
| "slug": "komodo-periphery", | ||||||
| "categories": [ | ||||||
| 3 | ||||||
| ], | ||||||
| "date_created": "2026-10-14", | ||||||
| "type": "ct", | ||||||
| "updateable": true, | ||||||
| "privileged": false, | ||||||
| "platforms": [ | ||||||
| "pve" | ||||||
| ], | ||||||
| "interface_port": null, | ||||||
| "documentation": "https://komo.do/docs/setup/connect-servers", | ||||||
| "website": "https://komo.do/", | ||||||
| "repository": "https://github.com/moghtech/komodo", | ||||||
| "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/komodo.webp", | ||||||
| "description": "A Docker LXC with the native Komodo Periphery agent, connecting to an existing Core for centralized container and Compose stack management.", | ||||||
| "install_methods": [ | ||||||
| { | ||||||
| "type": "default", | ||||||
| "script": "ct/komodo-periphery.sh", | ||||||
| "config_path": "/etc/komodo/periphery.config.json", | ||||||
| "resources": { | ||||||
| "cpu": 2, | ||||||
| "ram": 2048, | ||||||
| "hdd": 8, | ||||||
| "os": "Debian", | ||||||
| "version": "13" | ||||||
| } | ||||||
| } | ||||||
| ], | ||||||
| "default_credentials": { | ||||||
| "username": null, | ||||||
| "password": null | ||||||
| }, | ||||||
| "app_vars": [ | ||||||
| { | ||||||
| "name": "var_komodo_core_address", | ||||||
| "label": "Komodo Core URL", | ||||||
| "type": "text", | ||||||
| "required": true, | ||||||
| "help": "Reachable HTTP or HTTPS Core URL, such as https://komodo.example.com." | ||||||
| }, | ||||||
| { | ||||||
| "name": "var_komodo_server_name", | ||||||
| "label": "Komodo Server Name", | ||||||
| "type": "text", | ||||||
| "help": "Server name in Core; defaults to the guest hostname." | ||||||
| }, | ||||||
| { | ||||||
| "name": "var_komodo_onboarding_key", | ||||||
| "label": "Server Onboarding Key", | ||||||
| "type": "password", | ||||||
| "secret": true, | ||||||
| "required": true, | ||||||
| "help": "Create a Server Onboarding Key in Komodo Core before installation." | ||||||
| }, | ||||||
| { | ||||||
| "name": "var_komodo_core_public_key", | ||||||
| "label": "Core Public Key", | ||||||
| "type": "text", | ||||||
| "help": "Optional Core public key; defaults to trusting and pinning the first Core in /etc/komodo/keys/core.pub." | ||||||
| } | ||||||
| ], | ||||||
| "notes": [ | ||||||
| { | ||||||
| "text": "Run the CT creator on Proxmox VE. It creates a Debian LXC, installs Docker/Compose and runs Periphery natively under systemd.", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||||||
| "type": "info" | ||||||
| }, | ||||||
| { | ||||||
| "text": "Create an onboarding key in Core before installation, then confirm the server is connected. See the linked documentation for onboarding and authentication.", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| "type": "info" | ||||||
| }, | ||||||
| { | ||||||
| "text": "Run update_komodo_periphery for the latest stable agent. Configuration, keys and stack data are retained under /etc/komodo; the guest's existing update command is preserved.", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||||||
| "type": "info" | ||||||
| }, | ||||||
| { | ||||||
| "text": "ARM64 has not been tested. The installer asks for confirmation before attempting it.", | ||||||
| "type": "warning" | ||||||
|
soflane marked this conversation as resolved.
|
||||||
| } | ||||||
| ] | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you add this?