Skip to content

feat: add advanced settings application hook - #8

Open
lukdz wants to merge 1 commit into
community-scripts:mainfrom
lukdz:feat/advanced-settings-hook
Open

feat: add advanced settings application hook#8
lukdz wants to merge 1 commit into
community-scripts:mainfrom
lukdz:feat/advanced-settings-hook

Conversation

@lukdz

@lukdz lukdz commented Aug 22, 2026

Copy link
Copy Markdown

✍️ Description

Adds an optional, generic extension point to the shared Advanced LXC wizard. Application scripts may define:

  • advanced_settings_app_configure to collect application-specific settings before confirmation.
  • advanced_settings_app_summary to append those settings to the confirmation summary.

Both callbacks are optional and preserve existing behavior for scripts that do not define them. They are called only from the Advanced wizard, never from default or silent install flows.

Why this is needed

T3 Code needs custom Advanced-mode menus for optional tools such as Git, Codex, Claude, Grok, OpenCode, GitHub CLI, GitLab CLI, and Azure CLI. The normal Advanced wizard is implemented in community-scripts/core, not in ProxmoxVED.

Without an extension point, an application script would have to duplicate the entire core wizard, modify the core function using fragile eval/sed logic, or show its configuration prompts later inside the container installer outside the Advanced workflow.

This hook keeps the shared wizard in control while allowing an application to provide its own settings UI. T3 Code defines the callbacks in its standard ct/t3-code.sh script, and the core wizard invokes them only when present. Other scripts remain unchanged.

After this core PR is merged, T3 Code can restore its Advanced-mode menus using the normal test command without requiring a special core branch.

Related consumer PR: community-scripts/ProxmoxVED#2203

Test commands:

export COMMUNITY_SCRIPTS_URL='https://raw.githubusercontent.com/lukdz/ProxmoxVED/feat/t3-code'
export COMMUNITY_SCRIPTS_CORE_URL='https://raw.githubusercontent.com/lukdz/core/feat/advanced-settings-hook'
bash -c "$(curl -fsSL "$COMMUNITY_SCRIPTS_URL/ct/t3-code.sh")"
Zrzut ekranu 2026-08-22 o 23 48 59 Zrzut ekranu 2026-08-22 o 23 48 53 Zrzut ekranu 2026-08-22 o 23 48 46

AI assistance disclosure: implemented and reviewed with OpenCode, model gpt-5.6-luna, reasoning level high.

🔗 Related Issue

Fixes #

✅ Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes were validated with the shared engine syntax and split-file checks. The T3 consumer was tested against the hook branch.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.
  • API.txt regenerated – The ui/API.txt snapshot was checked and remains unchanged because the public loader API did not change.

🤖 AI Assistance (X in brackets)

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

  • No AI used – Code was written without AI assistance.
  • AI was used – The output has been reviewed and corrected, and I take responsibility for it matching this repo's conventions.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds a new, non-breaking extension point for application scripts.
  • 💥 Breaking change – Alters existing behavior in a way that may require updates in every downstream script.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Documents the new optional hook in docs/ui.md.

Testing Details

  • bash -n passed for all 35 engine .func files.
  • Prefetch coverage passes for all engine files.
  • ui/API.txt matches the loader function snapshot.
  • git diff --check passed.
  • Existing scripts that do not define the callbacks retain their current behavior.

@github-actions

Copy link
Copy Markdown

Try this branch

The engine and the scripts resolve independently, so a production script can
be run against the engine from this PR by setting one variable:

COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/lukdz/core/feat/advanced-settings-hook \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/debian.sh)"

Swap ct/debian.sh for whatever exercises the change.

Run a script from a fork as well
curl -fsSL https://raw.githubusercontent.com/lukdz/core/feat/advanced-settings-hook/tools/run.sh |
  bash -s -- https://raw.githubusercontent.com/YOU/ProxmoxVED/your-branch ct/debian.sh \
             https://raw.githubusercontent.com/lukdz/core/feat/advanced-settings-hook

Note that run.sh is reached through a pipe, so the script it starts inherits
an exhausted stdin. Whiptail is fine — it opens /dev/tty — but a plain read
would see EOF. The single-variable form above does not have that problem.

Useful flags while testing

dev_mode=net logs every engine fetch with status and duration, which is the
quickest way to confirm the branch is really being used. dev_mode=keep stops a
failed build from deleting the container along with the evidence.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant