Merged
Conversation
… Ace is missing When Ace fails to load, initEditorModal() returns early leaving editorModal.editors[type] undefined. loadEditorFiles(), saveTab(), and the post-save validation callback all accessed these without guards, causing TypeError crashes. Add null checks on every unguarded editorModal.editors[type] access in loadEditorFiles, saveTab, and the save-success validation callback.
Remove stale AceVersion parameter declaration, documentation, and print statement that were missed during the Ace removal.
The settings page doesn't include compose_manager_main.php, so the JS aceBasePath variable was undefined. The typeof fallback defaulted to /webGui/javascript/ace which is correct on 7.0.0+ but wrong on 6.x where ace lives in the plugin directory. Use the same PHP file_exists() detection to resolve the correct path server-side and emit it directly into the JS.
There was a problem hiding this comment.
Pull request overview
This PR stops bundling the Ace editor in the package build and instead uses Unraid’s Dynamix-provided Ace (Unraid 7.0.0+) with a plugin-side install-time download fallback for older Unraid versions, plus runtime path detection in PHP/JS to ensure Ace modules resolve correctly.
Changes:
- Remove
ACE_VERSIONand all Ace download/bundling steps from the build pipeline (scripts, env, CI workflow). - Add plugin install-time logic to download Ace files only when Dynamix Ace is unavailable (pre-7.0.0).
- Add runtime Ace path detection and configure
ace.config.basePath, plus guards to avoid JS crashes when Ace is missing.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
versions.env |
Removes ACE_VERSION from version inputs. |
source/pkg_build.sh |
Removes Ace download/unpack/copy steps from package build output. |
source/compose.manager/php/compose_manager_main.php |
Dynamically selects Ace base URL, sets Ace basePath, and adds guards when editors may be absent. |
source/compose.manager/compose.manager.settings.page |
Detects Ace path for version detection fallback. |
compose.manager.plg |
Adds install-time Ace download fallback for older Unraid versions. |
build_in_docker.sh |
Stops passing ACE_VERSION into the container build. |
build.ps1 |
Removes AceVersion parameter/env wiring and updates build output messaging. |
.github/workflows/build.yml |
Stops passing ACE_VERSION in CI Docker build step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ace modes try to load worker scripts (worker-yaml.js, worker-sh.js) via the module loader. Since we only bundle a minimal subset of Ace files, these would 404 and throw loader errors. Disable workers via session.setUseWorker(false) — we already validate YAML client-side via js-yaml so workers are redundant.
Only disable certificate checking when no system CA bundle exists. Previously wget --no-check-certificate was used unconditionally, which could allow MITM substitution of the downloaded JS assets.
Check unzip and cp exit codes and verify ace.js exists after install. Previously a failed extraction would silently print success, leaving users with missing editor files and no diagnostic output.
Help text said Default: 2.40.3 but actual default is 5.0.2.
When Ace fails to load, opening the editor modal would show an empty non-functional UI. Instead, prevent the modal from opening entirely and show a swal error prompting the user to reload or check the plugin installation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use Dynamix Ace Editor, Stop Bundling
Problem
Users reported stacks not rendering and "Add Stack" breaking the page. Root cause: the Slackware package naming transition (
compose.manager-package-*→compose.manager-*-noarch-*) could leaveupgradepkgwith a partial install, resulting in missing Ace module files (e.g.mode-sh.js). Ace's async module loader throws uncaught errors on 404, which poison the page's JS context and break all downstream functionality.Solution
Stop bundling Ace editor entirely. Unraid 7.0.0+ already ships Ace v1.15.2 via Dynamix at
/webGui/javascript/ace/. For pre-7.0.0 Unraid, the PLG post-install script downloads the required Ace files from GitHub on install.Changes
Build pipeline — Remove Ace from the build entirely:
source/pkg_build.sh— Remove Ace download/unzip/copy block andACE_VERSIONvalidationversions.env— RemoveACE_VERSION=1.43.5build.ps1— RemoveAceVersionparameter, docs, and print statementbuild_in_docker.sh— RemoveACE_VERSIONdefault and Docker arg.github/workflows/build.yml— Remove-e ACE_VERSIONDocker argRuntime Ace resolution — Detect and use whichever Ace is available:
compose.manager.plg— AddaceVER/aceURLentities; add post-install script that checks for Dynamix Ace and downloads v1.43.5 only if missing (6.x)compose_manager_main.php— PHPfile_exists()selects Dynamix or plugin-local Ace path; emitaceBasePathJS var; callace.config.set('basePath', ...)so mode/theme files resolve correctly; guardinitEditorModal()when Ace is unavailableEditor robustness — Prevent crashes when Ace is missing:
compose_manager_main.php— Guard alleditorModal.editors[type]accesses inloadEditorFiles(),saveTab(), and the post-save validation callbackSettings page — Fix version detection on all Unraid versions:
compose.manager.settings.page— Add PHP$acePathdetection so the credits version-check fetches from the correct path on both 6.x and 7.0.0+Testing
https://github.com/ajaxorg/ace-builds/archive/refs/tags/v1.43.5.zipreturns 200 with all 5 required files at expected pathsdeploy.ps1 -Dev -RemoteHost saturnCommits
99f2b09cd55a89editorModal.editorsaccesses when Ace is missing6ac2f7dbuild.ps149934ed$acePathon settings page for version detection fallback