Repository navigation
Conversation
Try these scripts
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)"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/soflane/DevScripts/feat/komodo-periphery-addon/tools/addon/komodo-periphery.sh)"
Against a core branch as wellAdd Useful flags while testing
|
|
✅ Requirements check passed. Thanks for fixing the description — the |
asylumexp
left a comment
There was a problem hiding this comment.
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 |
|
@asylumexp @CrazyWolf13 Can you please proceed a review ? |
| #!/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 |
| [[ -z "$var_komodo_addon_script" ]]; then | ||
| msg_error "Could not load the Komodo Periphery addon." | ||
| exit 115 | ||
| fi |
| $var_komodo_addon_script | ||
| EOF | ||
| chmod 755 "$addon_file" | ||
| mv -f "$addon_file" /usr/local/lib/komodo-periphery/addon.sh |
| } | ||
|
|
||
| if on_pve_host; then | ||
| root_check |
|
|
||
| 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")" || |
There was a problem hiding this comment.
fetching this file twice in this script?
| if FORCE_UPDATE=1 var_appversion="$CHECK_UPDATE_RELEASE" fetch_and_deploy_gh_release \ | ||
| "periphery" "moghtech/komodo" "singlefile" "$CHECK_UPDATE_RELEASE" "$staging_dir" \ | ||
| "periphery-$(arch_resolve "x86_64" "aarch64")" && | ||
| [[ -s "$staging_dir/periphery" && -x "$staging_dir/periphery" && -f "$HOME/.periphery" ]] && | ||
| [[ "$(<"$HOME/.periphery")" == "${CHECK_UPDATE_RELEASE#v}" ]] && chmod 755 "$staging_dir/periphery"; then | ||
| msg_info "Replacing Komodo Periphery binary" | ||
| if systemctl stop periphery; then | ||
| service_stopped=yes | ||
| if ! mv -f "$staging_dir/periphery" "${INSTALL_PATH}/periphery" || | ||
| ! systemctl start periphery || ! sleep 2 || ! systemctl is-active --quiet periphery; then | ||
| msg_error "Could not replace or start Komodo Periphery." | ||
| update_failed=1 | ||
| else | ||
| msg_ok "Replaced Komodo Periphery binary" | ||
| fi | ||
| else | ||
| msg_error "Could not stop Komodo Periphery." | ||
| update_failed=1 | ||
| fi | ||
| else | ||
| update_failed=1 | ||
| fi | ||
| rm -rf "$staging_dir" | ||
| if [[ "$update_failed" == "1" ]]; then | ||
| if [[ "$service_stopped" == "yes" ]]; then | ||
| systemctl stop periphery || true | ||
| fi | ||
| restore_backup | ||
| [[ "$version_file_existed" == "yes" ]] || rm -f "$HOME/.periphery" | ||
| if [[ "$service_stopped" == "yes" ]]; then | ||
| systemctl start periphery || msg_warn "Could not restart the previous Komodo Periphery agent." | ||
| fi | ||
| msg_error "Komodo Periphery update failed; restored the previous agent. Check journalctl -u periphery." | ||
| exit 1 | ||
| fi | ||
| rm -rf "$BACKUP_DIR" | ||
| else |
There was a problem hiding this comment.
gotta be honest on this one this is a very complicated function that just handles updates, try simplify it a bit
| msg_info "Configuring Komodo Periphery" | ||
| command install -d -m 700 /etc/komodo /etc/komodo/keys | ||
| config_file=$(mktemp /etc/komodo/.periphery.config.XXXXXX) | ||
| # JSON is supported upstream; jq escapes names and credentials safely. |
|
|
||
| msg_info "Configuring Komodo Periphery" | ||
| command install -d -m 700 /etc/komodo /etc/komodo/keys | ||
| config_file=$(mktemp /etc/komodo/.periphery.config.XXXXXX) |
There was a problem hiding this comment.
remove your usage of staging files/folders in all script files
| fi | ||
|
|
||
| msg_info "Creating Komodo Periphery update command" | ||
| printf -v scripts_url '%q' "$COMMUNITY_SCRIPTS_URL" |
There was a problem hiding this comment.
does this hide when verbose mode is off?
| export COMMUNITY_SCRIPTS_CORE_URL=${core_url} | ||
| if [[ -f /usr/local/lib/komodo-periphery/addon.sh ]]; then | ||
| type=update bash /usr/local/lib/komodo-periphery/addon.sh | ||
| else |
There was a problem hiding this comment.
remove if check it should always fetch from the repo
|
Komodo Periphery is an agent designed to manage resources on an existing host, not a standalone application. |
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 with the native Komodo Periphery agent, or install the same addon inside an existing Debian/Ubuntu guest. Periphery runs under systemd and connects outbound to an existing Komodo Core. Docker/Compose is installed by the addon for the containers and stacks it manages.
The CT installer and both update entry points fetch the addon from the configured scripts repository. There is no saved addon copy or script-managed staging. Updates use the standard release and backup helpers: save the current binary and release cache under
/opt/komodo-periphery.backup, stop Periphery, replace the binary, and restart and check the service. Failures stop the script and retain the backup for manual recovery; there is no automatic rollback. Configuration, keys and stacks under/etc/komodoare preserved. The frontend keeps the four setup inputs and one onboarding note.🔗 Related PR / Issue
No separate issue; native Periphery LXC creator and shared addon submission.
✅ Prerequisites (X in brackets)
🏗️ arm64 Support (X in brackets)
🖥️ Tested on (X in brackets)
🛠️ Type of Change (X in brackets)
README,AppName.md,CONTRIBUTING.md, or other docs.🔍 Code & Security Review (X in brackets)
CODE-AUDIT.md&CONTRIBUTING.mdguidelinesAppName.sh,AppName-install.sh,AppName.json)fetch_and_deploy_gh_release.🤖 AI Assistance (X in brackets)
AGENTS.mdand.github/agents/pve-script-creator.agent.mdas 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. This is informational, not a penalty.
Codex (GPT-6) drafted the initial addon and revised the scripts against the project instructions, existing helpers and contributor feedback. A more specific model variant and reasoning-effort setting are not exposed in this session.
📋 Additional Information (optional)
Local validation: Bash syntax for all three scripts; JSON, LF and CT/metadata input/resource consistency checks; ShellCheck 0.11.0 at style severity. Dynamic-source diagnostics SC1090/SC1091 are excluded; SC2034 is excluded only for the addon's APP_TYPE global, which is read by the sourced header helper.
All 39 isolated Git Bash checks passed. They exercise the real core input/architecture, release check/deploy/download and backup/restore helpers with simulated OS probes, HTTP, Docker and systemd. Cases cover installation and delegated entry points, escaped configuration, fresh fork downloads, unchanged releases, missing caches, API/backup/download/stop/start/health failures, retained backups, inactive-service retries and separate manual recovery. Configuration, keys, stacks and the existing guest update command are preserved. POSIX permissions and executable-file checks are substituted on Windows, and the interactive secret branch uses a fixture rather than a real terminal.
Proxmox VE creation, real Docker/systemd operation, POSIX permissions, Core registration and a version-changing upgrade remain for the contributor to verify. The October 14 runtime report covered an earlier local package and is not counted as runtime validation of this change.
setup_dockeris confined to the addon's installation branch. Periphery updates do not upgrade Docker or managed workloads. The four exported CT inputs remain necessary to reach the guest;APP_TYPEis no longer exported. Both scripts and core source URLs are retained for fork/branch testing.printf -v ... %qserializes these URLs without printing them.📦 Application Requirements (for new scripts)
🌐 Source
Upstream documents systemd operation, JSON configuration and outbound onboarding. Its Dockerfile copies prebuilt binaries; its dependency script supplies Git and Docker/Compose clients, and the Compose example confirms the configuration and key paths. Official releases provide
periphery-x86_64andperiphery-aarch64; no language runtime or database is needed for the native agent.