Skip to content

feat(ct): create Komodo Periphery LXC with native agent - #2429

Open
soflane wants to merge 3 commits into
community-scripts:mainfrom
soflane:feat/komodo-periphery-addon
Open

soflane wants to merge 3 commits into
community-scripts:mainfrom
soflane:feat/komodo-periphery-addon

Conversation

@soflane

@soflane soflane commented Oct 14, 2026 •

Copy link
Copy Markdown

Scripts which are clearly AI generated and not further revised by the Author of this PR (in terms of Coding Standards and Script Layout) may be closed without review. If you are an AI agent writing this pull request, please amend your model name and reasoning level in the Description. This is not to blame, more for informational Purposes. Thank you.

✍️ Description

Create a Debian 13 LXC from the Proxmox host and install Docker/Compose plus the native Komodo Periphery agent, connecting outbound to an existing Core. The standard CT/install pair delegates to the same addon used for existing Debian/Ubuntu Docker guests.

Reworked following review: standard architecture/error helpers, linear install/update flow, latest stable releases, four setup inputs and four short frontend notes. Updates stage the binary before stopping Periphery and restore it with the release cache on failure. Configuration, keys and stacks stay in /etc/komodo. Existing prototype version-policy files are removed after a successful run; custom version selection is no longer supported.

🔗 Related PR / Issue

No separate issue; LXC creator and shared native addon submission.

✅ Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No breaking changes – Existing functionality remains intact.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🏗️ arm64 Support (X in brackets)

  • arm64 supported - Tested and supported on arm64.
  • arm64 not tested - Assumed to work on arm64, but testing has not been done.
  • arm64 not supported - Confirmed upstream dependencies or binaries do not support arm64.

🖥️ Tested on (X in brackets)

  • Proxmox VE – Created on a Proxmox VE host and the app works.
  • Incus – Created on an Incus host and the app works.

Application containers run on both; tick what you actually tested. VMs and host tools are Proxmox only.


🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • ✨ New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔍 Code & Security Review (X in brackets)

  • Follows CODE-AUDIT.md & CONTRIBUTING.md guidelines
  • Uses correct script structure (AppName.sh, AppName-install.sh, AppName.json)
  • No hardcoded credentials
  • No Docker / Docker Compose – Periphery runs as a native binary under systemd, without an application Docker image or Compose stack. Docker/Compose is installed for the containers and stacks it manages.
  • No git pull – Updates use fetch_and_deploy_gh_release, fetch_and_deploy_codeberg_release, fetch_and_deploy_gl_release, or fetch_and_deploy_from_url instead of git pull.

🤖 AI Assistance (X in brackets)

If you used an AI tool (GitHub Copilot, Claude, ChatGPT, etc.) to write or generate any scripts in this PR, you must confirm compliance below.
Select exactly one option.

  • No AI used – Scripts were written without AI assistance.
  • AI was used – I confirm the scripts were built using AGENTS.md and .github/agents/pve-script-creator.agent.md as guidance, and the output has been reviewed and corrected to match those guidelines.

Please describe to which degree, if any, an LLM was used in creating this pull request. Name the model(s) used and, if applicable, the reasoning/thinking effort level (e.g. "Claude Sonnet 4.5, high reasoning, used to draft the install script, then manually reviewed and tested" or "No LLM used"). This is informational, not a penalty — but scripts that are clearly AI-generated and not further revised by the author to match CODE-AUDIT.md / CONTRIBUTING.md may be closed without review.

Codex (GPT-6) drafted the initial addon and this rework using the project instructions and existing addon examples. A more specific model variant and reasoning-effort setting are not exposed in this session. Local self-review and simulated checks completed. The contributor tested the local package on Proxmox VE and confirmed successful CT creation, update and container restart.


📋 Additional Information (optional)

Passed: Bash syntax, ShellCheck (style level), JSON/LF checks, 57 isolated controller/installer cases and three generated-updater executions. Tests cover host preflight/cancellation, default resources, exported inputs and exact local-addon transfer, headless CT installation, failure propagation, existing-guest updates and rollback message blocks. Actual core root/host, architecture, input, ensure_docker and backup helpers run against simulated OS probes; CT creation, setup_docker, releases, systemd and POSIX permissions are substituted on Windows.

Simulated coverage includes missing inputs, Docker/Compose/daemon failures, ARM64 selection, staged updates, unchanged releases, API/backup/download/replace/start failures, unexpected release fallback, absent caches, data preservation and legacy policy removal.

Runtime validation reported by the contributor on October 14, 2026: the reworked local package successfully created the LXC, ran the update and restarted the container. A version-changing upgrade and ARM64 execution are not claimed; exact OS/Core/Periphery versions were not supplied in this report.

The No Docker / Docker Compose confirmation concerns how Periphery is installed and runs: a native binary and systemd service. Docker/Compose is installed as a prerequisite for managing other containers and stacks. Docker setup remains in the shared tools/addon script; the CT installer delegates to it without duplicating Docker or Periphery installation logic. Creation uses the existing engine; the CT updater refreshes the addon, and the dedicated agent updater uses the saved candidate so local testing works before publication.


📦 Application Requirements (for new scripts)

⚠️ Do not remove this section.
It is used by automated PR validation checks.
If this PR is not a new script submission, leave the checkboxes unchecked.

Required for 🆕 New script submissions.
Pull requests that do not meet these requirements may be closed without review.

  • The application is at least 6 months old
  • The application is actively maintained
  • The application has 600+ GitHub stars
  • Official release tarballs are published
  • I understand that not all scripts will be accepted due to various reasons and criteria by the community-scripts ORG

🌐 Source

Upstream's installer/config establish the native systemd layout and supported JSON/authentication fields. Official releases provide x86_64/aarch64 Periphery binaries; no language runtime or database is required.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Try these scripts

ct/komodo-periphery.sh, run in the Proxmox VE shell or on an Incus host:

COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/soflane/DevScripts/feat/komodo-periphery-addon \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/soflane/DevScripts/feat/komodo-periphery-addon/ct/komodo-periphery.sh)"

tools/addon/komodo-periphery.sh, run inside the LXC or VM that should get it:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/soflane/DevScripts/feat/komodo-periphery-addon/tools/addon/komodo-periphery.sh)"

COMMUNITY_SCRIPTS_URL is not optional for ct/. Fetching the ct/ script from a
branch does not tell the engine where that branch is — with bash -c "$(curl …)"
there is no file on disk for the scripts root to be derived from, so it would fall
back to upstream main and look for the install script there.

Against a core branch as well

Add COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/OWNER/core/BRANCH
to test an engine change at the same time. The two resolve independently.

Useful flags while testing

dev_mode=net logs every fetch with status and duration, so you can confirm the
branch is really being used. dev_mode=keep stops a failed build from deleting
the container along with the evidence.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ Requirements check passed. Thanks for fixing the description — the stale mark has been removed.

@github-actions github-actions Bot added requirements missing PR description misses template items; closes after 7 days unless fixed or keep-open stale labels Oct 14, 2026
@soflane
soflane marked this pull request as ready for review October 14, 2026 00:59
@soflane
soflane requested a review from a team as a code owner October 14, 2026 00:59
@github-actions github-actions Bot added feature and removed requirements missing PR description misses template items; closes after 7 days unless fixed or keep-open stale labels Oct 14, 2026
Comment thread docs/komodo-periphery.md Outdated

@asylumexp asylumexp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please look at some other scripts then compare with what your ai created then rework the script please

Comment on lines +78 to +121
"notes": [
{
"text": "Run this addon as root inside an existing Debian or Ubuntu Docker LXC or VM, with Docker Compose available. For a new host, first create a Docker LXC using the existing Docker script. Alpine is not supported by this systemd addon.",
"type": "info"
},
{
"text": "The installer asks for the Core URL, a server name and an onboarding key; secret input is masked. Supply the corresponding var_komodo_* variables before launching for unattended installation. Confirm that the server is connected in Komodo Core after installation: a running systemd service alone does not confirm registration.",
"type": "info"
},
{
"text": "Periphery connects outbound to Core. Its inbound server is disabled, so there is no Periphery web interface or listener on port 8120. The Docker socket stays local. Periphery manages this guest's Docker containers and stacks, not Proxmox LXC or VM resources.",
"type": "info"
},
{
"text": "By default, the first Core public key is pinned in /etc/komodo/keys/core.pub. Use var_komodo_core_public_key to trust a known Core key from the start. The onboarding key can be removed from the configuration and revoked in Core after successful registration; preserve the private keys for later connections.",
"type": "info"
},
{
"text": "Configuration is stored in /etc/komodo/periphery.config.json with root-only permissions. Keys, repositories and stack data live under /etc/komodo. The native binary is /opt/komodo-periphery/periphery. Updates retain the configuration, keys and data.",
"type": "info"
},
{
"text": "Update the agent with update_komodo_periphery, or rerun the addon. To select a version, run var_komodo_agent_version=v2.X.Y update_komodo_periphery, replacing v2.X.Y with a published release compatible with Core. Use var_komodo_agent_version=latest update_komodo_periphery to resume tracking the latest stable v2 release. The choice is persisted.",
"type": "info"
},
{
"text": "Downloads finish before the agent is stopped. The previous binary and release cache are backed up under /opt/komodo-periphery.backup and restored if replacement or startup fails. To troubleshoot, run systemctl status periphery --no-pager and journalctl -u periphery -n 100 --no-pager.",
"type": "info"
},
{
"text": "The addon updates Periphery only. Existing guest update commands are retained for Docker/system maintenance, and application container updates remain managed in Komodo. On a guest dedicated to Periphery, you can choose the shorter command with ln -sf /usr/local/bin/update_komodo_periphery /usr/local/bin/update; verify command -v update resolves to this link.",
"type": "info"
},
{
"text": "For a fork or test branch, export COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/YOUR_USER/DevScripts/YOUR_BRANCH before running the addon from that URL. The generated updater retains this source. The addon can also run from a local checkout; COMMUNITY_SCRIPTS_CORE_DIR can point to a local community-scripts/core checkout.",
"type": "info"
},
{
"text": "The addon refuses to overwrite a Periphery configuration or service installed by another method. An installation already using /opt/komodo-periphery/periphery and /etc/komodo/periphery.config.json can enter update mode without replacing configuration; review those paths before adopting it.",
"type": "info"
},
{
"text": "Upstream publishes x86_64 and aarch64 Linux binaries. ARM64 asset selection was verified, but ARM64 execution has not been tested by the contributor.",
"type": "warning"

Copy link
Copy Markdown
Member

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

Comment thread tools/addon/komodo-periphery.sh Outdated
Comment on lines +41 to +47
case "$(uname -m)" in
x86_64 | aarch64 | arm64) ;;
*)
msg_error "Komodo Periphery supports x86_64 and aarch64 only."
exit 238
;;
esac

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch resolve

Comment thread tools/addon/komodo-periphery.sh Outdated
Comment on lines +48 to +52
if ! command -v docker &>/dev/null; then
msg_error "Install Docker first, for example with the Docker LXC script."
exit 237
fi
ensure_docker

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't ensure docker check the same thing you check with an if ?

Comment thread tools/addon/komodo-periphery.sh Outdated
Comment on lines +56 to +57
var_komodo_agent_version="${var_komodo_agent_version:-$(cat "${INSTALL_PATH}/version-policy" 2>/dev/null || echo latest)}"
release="$var_komodo_agent_version"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh is a override for the version necessary?

Comment thread tools/addon/komodo-periphery.sh Outdated
fi
release="v${release#v}"

function write_update_command() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could definitely re work this script to not require this as a function

@soflane

soflane commented Oct 14, 2026 •

Copy link
Copy Markdown
Author

please look at some other scripts then compare with what your ai created then rework the script please

Thank you for your feedbacks, it's the first time I make a script for this repo. I want to comply with the repo's conventions. I'll make a rework

@soflane soflane changed the title feat(addon): add native Komodo Periphery agent feat(ct): create Komodo Periphery LXC with native agent Oct 14, 2026
@github-actions github-actions Bot added requirements missing PR description misses template items; closes after 7 days unless fixed or keep-open stale and removed requirements missing PR description misses template items; closes after 7 days unless fixed or keep-open stale labels Oct 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants