Skip to content

Make nginx optional modules gracefully skippable on build failure - #104

Merged
Stensel8 merged 4 commits into
mainfrom
claude/github-issues-srtmk3
Sep 2, 2026
Merged

Make nginx optional modules gracefully skippable on build failure#104
Stensel8 merged 4 commits into
mainfrom
claude/github-issues-srtmk3

Conversation

@Stensel8

@Stensel8 Stensel8 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Refactored the nginx installer to make optional dynamic modules (zstd, headers-more, ACME) gracefully skippable when downloads fail or builds fail, instead of aborting the entire installation. Also removed the PowerShell variant of the nginx installer and added a new standalone planned shutdown script for both Linux and Windows.

Key Changes

nginx/nginx_installer.sh

  • Optional module handling: Added --skip-acme, --skip-zstd, --skip-headers-more flags and environment variable equivalents (NGINX_SKIP_*) to allow users to disable modules upfront
  • Graceful failure: Created Get-OptionalFile() function that returns 1 on download/checksum failure instead of aborting, allowing the installer to skip failed modules with a warning
  • Improved rustup handling: Modified Install-Rustup() to return 1 on failure instead of stopping the script, enabling ACME module to be skipped if Rust toolchain installation fails
  • Dynamic configure args: Refactored nginx configure command to use an array of arguments that conditionally includes module flags based on skip settings
  • Conditional libzstd checks: Made libzstd availability checks non-fatal; zstd module is skipped with a warning if the library is missing
  • Conditional extraction: Only extract and build modules that aren't skipped
  • Cargo availability check: Made cargo check conditional on ACME not being skipped

Removed Files

  • nginx/nginx_installer.ps1: Entire PowerShell variant removed (892 lines). The bash version is the primary maintained installer.

New Files

  • system/planned_shutdown.sh: Standalone bash script for scheduling/canceling system shutdowns or reboots via systemd shutdown command. Supports --at HH:MM, --delay N[smh], --reboot, and --message options.
  • windows/Set-PlannedShutdown.ps1: PowerShell equivalent for Windows shutdown scheduling with similar command structure and options.

Documentation Updates

  • nginx/README.md: Added section documenting optional modules and how to skip them
  • CONTRIBUTING.md: Updated manual update instructions to reference only nginx_installer.sh
  • .github/workflows/update-nginx-checksums.yml: Removed reference to nginx_installer.ps1 from path triggers
  • .github/scripts/update-nginx-checksums.sh: Updated help text to remove PowerShell variant reference

Implementation Details

  • Optional modules now use a two-phase approach: skip flags can be set upfront via CLI or environment, and are also set automatically if downloads/builds fail
  • The ACME_MODULE_BUILT variable tracks whether ACME was actually built, used later to decide whether to load/require it
  • All module-specific operations (extraction, configure flags, installation) are now conditional on their skip status
  • Error handling preserves the ability to complete the nginx build even if optional modules fail

nginx_installer.ps1 was a PowerShell reimplementation of nginx_installer.sh
that only ran on Linux (it hard-checked $IsLinux), duplicating the bash
installer for no benefit and doubling the maintenance burden on every
version bump. Drop it and the tooling built around syncing it
(update-nginx-checksums.sh/.yml, CONTRIBUTING.md).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015JTpvkRWFpJNNhEdHMekLe
zstd, headers-more and ACME are now optional: --skip-acme, --skip-zstd,
--skip-headers-more and --skip-modules=a,b,c disable them up front, and
any of them is disabled automatically (with a warning) if its download
or build fails instead of aborting the whole install — the ACME module
in particular used to take the entire script down with it. The
generated nginx.conf, required-module checks and dependency install
step (cargo/rustup, only needed for ACME) all adapt accordingly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015JTpvkRWFpJNNhEdHMekLe
Adds system/planned_shutdown.sh (Linux, wraps the systemd shutdown
command) and windows/Set-PlannedShutdown.ps1 (Windows, wraps
shutdown.exe with its own state file since shutdown.exe has no query
verb). Both support schedule (--at HH:MM or --delay/-Delay, optional
reboot and broadcast message), cancel, and status.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015JTpvkRWFpJNNhEdHMekLe
Reflect the removed nginx PowerShell installer, the new nginx module
skip flags, and the new planned-shutdown scripts in README.md and
nginx/README.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015JTpvkRWFpJNNhEdHMekLe
Copilot AI lite review requested due to automatic review settings September 2, 2026 20:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Stensel8 Stensel8 self-assigned this Sep 2, 2026
@Stensel8 Stensel8 added the enhancement New feature or request label Sep 2, 2026
@Stensel8
Stensel8 merged commit de6dfd7 into main Sep 2, 2026
5 checks passed
@Stensel8
Stensel8 deleted the claude/github-issues-srtmk3 branch September 2, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

3 participants