diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 850f7de..85aee89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -115,7 +115,6 @@ jobs: -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro \ -e TZ="America/New_York" \ -e COMPOSE_VERSION="$COMPOSE_VERSION" \ - -e ACE_VERSION="$ACE_VERSION" \ -e OUTPUT_FOLDER="/mnt/output" \ -e PKG_VERSION="${VERSION}" \ -e PKG_BUILD="${BUILD}" \ diff --git a/build.ps1 b/build.ps1 index 80087dc..757f07a 100644 --- a/build.ps1 +++ b/build.ps1 @@ -5,7 +5,7 @@ .DESCRIPTION This script runs a Slackware Docker container to build the .txz package. - It downloads Docker Compose, Compose Switch, and Ace Editor, then packages + It downloads Docker Compose and Compose Switch, then packages everything together. .PARAMETER Version @@ -18,10 +18,7 @@ Skip running tests before building. Not recommended. .PARAMETER ComposeVersion - Docker Compose version to include. Default: 2.40.3 - -.PARAMETER AceVersion - Ace Editor version to include. Default: 1.4.14 + Docker Compose version to include. Default: 5.0.2 .EXAMPLE ./build.ps1 @@ -34,8 +31,7 @@ param( [string]$Version, [switch]$Dev, [switch]$SkipTests, - [string]$ComposeVersion, - [string]$AceVersion + [string]$ComposeVersion ) $ErrorActionPreference = "Stop" @@ -60,11 +56,9 @@ $versionsFile = Join-Path $ScriptDir "versions.env" if (Test-Path $versionsFile) { Get-Content $versionsFile | ForEach-Object { if ($_ -match '^COMPOSE_VERSION=(.+)$' -and -not $ComposeVersion) { $ComposeVersion = $Matches[1].Trim() } - if ($_ -match '^ACE_VERSION=(.+)$' -and -not $AceVersion) { $AceVersion = $Matches[1].Trim() } } } if (-not $ComposeVersion) { $ComposeVersion = "5.0.2" } -if (-not $AceVersion) { $AceVersion = "1.43.5" } # Generate dev version with timestamp if -Dev flag is used if ($Dev) { @@ -126,7 +120,6 @@ Write-Host "Generated temporary plugin manifest for build: $TempPluginPath" -For Write-Host "Building compose.manager package v$Version (build $BuildNum)" -ForegroundColor Green Write-Host " Docker Compose: v$ComposeVersion" -ForegroundColor Gray -Write-Host " Ace Editor: v$AceVersion" -ForegroundColor Gray Write-Host "" # Convert Windows paths to Docker-compatible paths @@ -161,7 +154,6 @@ $dockerArgs = @( "-v", "${HostCACert}:${ContainerCACert}:ro" "-e", "TZ=America/New_York" "-e", "COMPOSE_VERSION=$ComposeVersion" - "-e", "ACE_VERSION=$AceVersion" "-e", "OUTPUT_FOLDER=/mnt/output" "-e", "PKG_VERSION=$Version" "-e", "PKG_BUILD=$BuildNum" diff --git a/build_in_docker.sh b/build_in_docker.sh index 33626bd..e3b3fd7 100755 --- a/build_in_docker.sh +++ b/build_in_docker.sh @@ -3,14 +3,12 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" [ -f "${SCRIPT_DIR}/versions.env" ] && source "${SCRIPT_DIR}/versions.env" [ -z "$COMPOSE_VERSION" ] && COMPOSE_VERSION=5.0.2 -[ -z "$ACE_VERSION" ] && ACE_VERSION=1.43.5 [ -z "$PKG_VERSION" ] && PKG_VERSION="$(date +%Y.%m.%d)" [ -z "$PKG_BUILD" ] && PKG_BUILD="$(date +%H%M)" docker run --rm --tmpfs /tmp \ -v "$PWD/archive:/mnt/output:rw" \ -e TZ="America/New_York" \ -e COMPOSE_VERSION="$COMPOSE_VERSION" \ - -e ACE_VERSION="$ACE_VERSION" \ -e PKG_VERSION="$PKG_VERSION" \ -e PKG_BUILD="$PKG_BUILD" \ -e OUTPUT_FOLDER="/mnt/output" \ diff --git a/compose.manager.plg b/compose.manager.plg index 7690e40..59be214 100644 --- a/compose.manager.plg +++ b/compose.manager.plg @@ -14,6 +14,8 @@ + + ]> &packageMD5; + + +# Download Ace editor if not already provided by Unraid (Unraid 7.0.0+ includes it via Dynamix) +ACE_DYNAMIX_PATH="/usr/local/emhttp/plugins/dynamix/javascript/ace/ace.js" +ACE_PLUGIN_DIR="&emhttpLOC;/javascript/ace" + +if [ -f "$ACE_DYNAMIX_PATH" ]; then + echo "Ace editor found at $ACE_DYNAMIX_PATH (Unraid 7.0.0+), skipping download." +else + echo "Ace editor not found in Dynamix (pre-7.0.0 Unraid), downloading v&aceVER;..." + mkdir -p "$ACE_PLUGIN_DIR" + TMPDIR_ACE="/tmp/ace-install-$$" + mkdir -p "$TMPDIR_ACE" + WGET_CERT_OPTS="" + if [ ! -f /etc/ssl/certs/ca-certificates.crt ] && [ ! -d /etc/ssl/certs ]; then + echo "WARNING: No system CA bundle found; downloading Ace with TLS verification disabled." + WGET_CERT_OPTS="--no-check-certificate" + fi + if wget $WGET_CERT_OPTS -q -O "$TMPDIR_ACE/ace.zip" "&aceURL;"; then + if unzip -q "$TMPDIR_ACE/ace.zip" \ + "ace-builds-&aceVER;/src-min-noconflict/ace.js" \ + "ace-builds-&aceVER;/src-min-noconflict/mode-yaml.js" \ + "ace-builds-&aceVER;/src-min-noconflict/mode-sh.js" \ + "ace-builds-&aceVER;/src-min-noconflict/theme-tomorrow.js" \ + "ace-builds-&aceVER;/src-min-noconflict/theme-tomorrow_night.js" \ + -d "$TMPDIR_ACE/extracted"; then + if cp "$TMPDIR_ACE/extracted/ace-builds-&aceVER;/src-min-noconflict/"*.js "$ACE_PLUGIN_DIR/"; then + if [ -f "$ACE_PLUGIN_DIR/ace.js" ]; then + echo "Ace editor v&aceVER; installed to $ACE_PLUGIN_DIR" + else + echo "WARNING: Ace editor files not found in $ACE_PLUGIN_DIR after install. Editor will lack syntax highlighting." + fi + else + echo "WARNING: Failed to copy Ace editor files. Editor will lack syntax highlighting." + fi + else + echo "WARNING: Failed to extract Ace editor archive. Editor will lack syntax highlighting." + fi + else + echo "WARNING: Failed to download Ace editor. The YAML/env editor will not have syntax highlighting." + fi + rm -rf "$TMPDIR_ACE" +fi + + + # Use the new patch utility during install to cleanup and optionally apply patches diff --git a/source/compose.manager/compose.manager.settings.page b/source/compose.manager/compose.manager.settings.page index 70f2394..b59f192 100755 --- a/source/compose.manager/compose.manager.settings.page +++ b/source/compose.manager/compose.manager.settings.page @@ -16,6 +16,10 @@ $ui_patch_help_class = $option_patch_ui ? "hidden" : "inline_help"; // hide help $projects_exist = intval(shell_exec("ls -l " . $compose_root . " | grep ^d | wc -l")) != 0; + +$acePath = file_exists('/usr/local/emhttp/plugins/dynamix/javascript/ace/ace.js') + ? '/webGui/javascript/ace' + : '/plugins/compose.manager/javascript/ace'; ?> @@ -2496,7 +2500,7 @@ $projects_exist = intval(shell_exec("ls -l " . $compose_root . " | grep ^d | wc

Build & Packaging

  • `pkg_build.sh` — packaging helper used when assembling plugin releases.
  • -
  • ace-builds — source for the bundled Ace editor files.
  • +
  • ace-builds — Ace editor (provided by Unraid 7.0.0+ via Dynamix; downloaded during install on older versions).

If you maintain packaging scripts or upstream libraries we reference and would like a more explicit mention, let me know and I'll add it.

@@ -2532,8 +2536,9 @@ $projects_exist = intval(shell_exec("ls -l " . $compose_root . " | grep ^d | wc } } catch (e) {} - // Fallback: fetch the bundled ace.js and attempt to extract a version string - $.get('/plugins/compose.manager/javascript/ace/ace.js', function(data) { + // Fallback: fetch ace.js from wherever it lives (Dynamix on 7.0.0+, plugin-local on older) + var aceJsPath = + '/ace.js'; + $.get(aceJsPath, function(data) { var m = null; // common patterns: ace.version = '1.4.12' or "version: '1.4.12'" or ace-builds-1.4.12 m = data.match(/ace\.version\s*=\s*['\"]([\w\.\-]+)['\"]/i) || data.match(/version\s*[:=]\s*['\"]([\w\.\-]+)['\"]/i) || data.match(/ace-builds[-_]?([\d\.\-]+)/i); diff --git a/source/compose.manager/php/compose_manager_main.php b/source/compose.manager/php/compose_manager_main.php index 273609b..330a80a 100755 --- a/source/compose.manager/php/compose_manager_main.php +++ b/source/compose.manager/php/compose_manager_main.php @@ -178,7 +178,14 @@ - + +