Skip to content

core: support optional POST_INSTALL_SCRIPT (var_post_install_script) hook #14160

Draft
MickLesk wants to merge 4 commits intomainfrom
feat/post-install-script-hook
Draft

core: support optional POST_INSTALL_SCRIPT (var_post_install_script) hook #14160
MickLesk wants to merge 4 commits intomainfrom
feat/post-install-script-hook

Conversation

@MickLesk
Copy link
Copy Markdown
Member

@MickLesk MickLesk commented May 1, 2026

✍️ Description

work in progress

🔗 Related Issue

Fixes #14112

✅ Prerequisites (X in brackets)

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

🛠️ 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 script metadata (PocketBase/website data).
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

@github-actions github-actions Bot added the core label May 1, 2026
@MickLesk MickLesk force-pushed the feat/post-install-script-hook branch from f8a8ad8 to 3a1c02d Compare May 1, 2026 20:22
…figurable via default.vars/app.vars or new advanced-settings step (path on Proxmox host); runs in description() with APP/CTID/IP env vars.
@MickLesk MickLesk force-pushed the feat/post-install-script-hook branch from 3a1c02d to 53fcf17 Compare May 1, 2026 20:28
MickLesk added 2 commits May 3, 2026 21:06
…, logging & whiptail error feedback

- New step 28 in advanced_settings(): inputbox for the optional host-side
  post-install script path. Validates: must be absolute, no shell
  metacharacters; warns (yes/no) if file does not yet exist on host.
- Verbose+Confirm becomes step 29; confirm summary now includes a
  warning that the hook runs as root on the Proxmox HOST, not in the LXC.
- Execution block:
  * Captures hook stdout/stderr to /var/log/community-scripts/post-install-<CTID>.log
  * Uses explicit $? capture (was relying on $? after if-test).
  * On failure or missing file: shows whiptail msgbox so the user
    cannot miss it scrolling past the post-create output.
  * Tails the last 15 log lines into the failure popup.
…ipts

Adds tools/pve/post-install-hook-examples.sh — a single, well-commented
file that demonstrates how to use the new var_post_install hook.

It is NOT meant to be executed directly. Each example sits between clear
BEGIN/END markers; users copy the block they want into their own .sh on
the Proxmox host and point var_post_install at it.

Examples:
  1. minimal-logger.sh           — append every new LXC to a CSV log
  2. discord-gotify-notify.sh    — Discord embed + Gotify push
  3. auto-pool-tags-backup.sh    — pool, tags, pi-hole DNS, vzdump
  4. inject-ssh-and-monitoring.sh— admin SSH key, Beszel agent, Uptime-Kuma
  5. per-app-router.sh           — dispatcher with per-NSAPP behavior
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.

Post install script

1 participant