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
Open
soflane
wants to merge
3
commits into
community-scripts:main
Choose a base branch
from
soflane:feat/komodo-periphery-addon
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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 | ||
| type=update bash /usr/local/lib/komodo-periphery/addon.sh | ||
| exit | ||
| } | ||
|
|
||
| if on_pve_host; then | ||
| root_check | ||
| 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. | ||
| 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 | ||
| 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." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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 | ||
|
|
||
| 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. | ||
| var_komodo_setup_docker=yes bash /usr/local/lib/komodo-periphery/addon.sh | ||
| unset var_komodo_addon_script var_komodo_onboarding_key | ||
|
|
||
| motd_ssh | ||
| customize | ||
| cleanup_lxc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.", | ||
| "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.", | ||
| "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.", | ||
| "type": "info" | ||
| }, | ||
| { | ||
| "text": "ARM64 has not been tested. The installer asks for confirmation before attempting it.", | ||
| "type": "warning" | ||
| } | ||
| ] | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
oh my lord an essay in here