Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ With dcflachs Docker Compose Manager being depreciated, if you want to go back t

## Requirements

- unRAID 6.9.0 or later
- unRAID 6.12.0 or later (PHP 8 is required; first included in Unraid 6.12.0)

> NOTE: This is untested on anything older than 7.2.3 currently. I will remove this note if I get a report that this IS compatible that far back. I am working on getting a machine setup for testing on the older versions. Any advice would be welcome, eg how to VM unraid easily.

Expand Down
50 changes: 1 addition & 49 deletions compose.manager.plg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
launch="&launch;"
pluginURL="&pluginURL;"
icon="cubes"
min="6.9.0"
min="6.12.0"
support="https://forums.unraid.net/topic/197334-plugin-compose-manager-plus/"
project="https://github.com/mstrhakr/compose_plugin"
readme="https://github.com/mstrhakr/compose_plugin#readme"
Expand Down Expand Up @@ -103,30 +103,6 @@ rm -f /tmp/ace-editor-install.sh
</INLINE>
</FILE>

<FILE Run="/bin/bash">
<INLINE>
echo ""
echo "----------------------------------------------------"
echo ""
echo " Patches are only installed for"
echo " pre-6.12 Unraid versions."
echo ""
echo " If on 6.12 or later, patches are not needed"
echo " and skips will be shown below."
echo ""
echo "----------------------------------------------------"
echo ""
</INLINE>
</FILE>

<!-- Patch utility installation for pre-6.12: install or remove patches -->
<FILE Name="/tmp/patch-util-install.sh" Run="/bin/bash" Max="6.11.99">
<INLINE>
&emhttpLOC;/scripts/install-patch.sh install &emhttpLOC; &pluginLOC;
rm -f /tmp/patch-util-install.sh
</INLINE>
</FILE>

<FILE Run="/bin/bash">
<INLINE>
echo ""
Expand All @@ -140,30 +116,6 @@ echo ""
</INLINE>
</FILE>

<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo ""
echo "----------------------------------------------------"
echo ""
echo " Patches are only modified for"
echo " pre-6.12 Unraid versions."
echo ""
echo " If on 6.12 or later, patches are not needed"
echo " and skips will be shown below."
echo ""
echo "----------------------------------------------------"
echo ""
</INLINE>
</FILE>

<!-- Patch utility removal for pre-6.12: remove patches -->
<FILE Name="/tmp/patch-util-remove.sh" Run="/bin/bash" Method="remove" Max="6.11.99">
<INLINE>
&emhttpLOC;/scripts/install-patch.sh remove &emhttpLOC; &pluginLOC;
rm -f /tmp/patch-util-remove.sh
</INLINE>
</FILE>

<!-- Uninstall script; plus cleanup old/unused packages -->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
Expand Down
21 changes: 1 addition & 20 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Access settings via **Settings → Compose** in the Unraid web UI.
| **Show in Header Menu** | No | Display Compose Manager as a separate page in the header navigation bar. |
| **Show Dashboard Tile** | Yes | Display a Compose Stacks tile on the Dashboard showing stack status at a glance. |
| **Hide Compose Containers (Dashboard Tile)** | No | Hide containers managed by Compose stacks from Unraid's Docker Containers dashboard tile. This avoids duplicate entries when both tiles are visible. Requires "Show Dashboard Tile". |
| **Hide Compose Containers (Docker Page)** | No | Patch the native Docker UI to hide or filter Compose-managed containers. See the Web UI Patches section for version limitations. |
| **Hide Compose Containers (Docker Page)** | No | Hide Compose-managed containers from the Docker Containers table to avoid duplicate entries when Compose stacks appear on the same page. Requires "Show in Header Menu" to be disabled (inline mode). |
| **Show Compose Above Docker Containers** | No | When the Docker page is displayed without tabs, move the Compose Stacks section above the built-in Docker Containers section. |
| **Expand Stacks by Default** | No | Automatically expand all stack detail rows when the page loads. |

Expand All @@ -39,7 +39,6 @@ Access settings via **Settings → Compose** in the Unraid web UI.

| Setting | Default | Description |
|---------|---------|-------------|
| **Legacy Patch Web UI** | No | Enable integration patches for the native Docker manager UI on Unraid ≤ 6.11. Not required on Unraid 6.12 and later. Use the Patch/Unpatch buttons to apply or remove the patch. |
| **Debug to Log** | No | Enable debug logging to syslog to troubleshoot Compose command output. |

### Backup Settings
Expand Down Expand Up @@ -90,24 +89,6 @@ The default location stores all compose configurations on the USB flash drive, e

Compose Manager supports all four standard Compose file names and preserves the filenames already present in each stack.

## Web UI Patches

This setting controls small compatibility patches that change how Compose-managed containers are presented in Unraid's native Docker UI. These patches only affect UI rendering and metadata — they do **not** stop containers or change how they run.

### Legacy UI Patch

- **Legacy behavior (Unraid < 6.12)** — On older Unraid releases the patch adds Compose-specific metadata (e.g. `net.unraid.docker.managed`) and tweaks the Docker manager so Compose-managed containers are recognized. Practical effects include skipping native update checks for those containers and preventing them from being treated like native Docker-managed containers in the UI. Use this when running an older Unraid release so Compose can interoperate cleanly with the Docker manager. This is enabled in the settings under "Patch UI"

### Hide Compose Containers from Docker UI via Patch

- **Hide patches (Unraid 6.12–7.2)** — For Unraid 6.12 through 7.2 we offer a different patch that **removes** Compose-managed containers from the Docker page and Dashboard tile entirely (they remain visible through the Compose Stacks tile). Use the hide patch to remove duplicate entries and declutter the Docker UI when you prefer to manage Compose stacks separately. This is enabled in the settings under "Hide Compose Containers from Docker UI via Patch"

Notes and version limitations:

- Unraid 6.12 and later integrate the basic "ignore" behavior natively; the legacy patch is not required for that functionality.
- The explicit "hide" patches are provided only for **6.12–7.2**. If you are on a version outside this range, check compatibility before enabling the hide option.
- Patch files are stored under `source/compose.manager/patches/` and are applied only when a matching Unraid version is detected.

## Debug Logging

Enable debug logging to troubleshoot issues. Logs are written to the Unraid syslog.
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements

- Unraid 6.9.0 or later
- Unraid 6.12.0 or later (PHP 8 is required; first included in Unraid 6.12.0)
- Docker service enabled

## Installation
Expand Down
6 changes: 1 addition & 5 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Compose Manager provides a Backup & Restore interface under **Settings → Compo

### Hiding and Filtering Compose Containers

You can optionally hide compose-managed containers from the native Docker manager and Dashboard. Use the setting to toggle patching of the Docker page and enable server-side filters so only the desired containers/stacks are shown.
Use **Hide Compose Containers from Docker Page** to hide Compose-managed containers from the native Docker Containers table when **Show Compose in Header Menu** is disabled (inline mode). Use **Hide Compose Containers from Docker Dashboard Tile** to hide them from the native Dashboard tile when **Show Dashboard Tile** is enabled. These display options avoid duplicate entries without changing how containers run; no legacy WebUI patch is required.

### Display Options

Expand Down Expand Up @@ -119,7 +119,3 @@ services:
```

The **Web UI** tab in the editor provides a visual interface for adding these labels.

### Patching the Native UI

Enable "Patch Web UI" in settings to show compose containers in the native Docker manager with stack grouping.
83 changes: 0 additions & 83 deletions source/compose.manager/compose.manager.settings.page
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ Lock="true"
include "/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php";
require_once("/usr/local/emhttp/plugins/compose.manager/include/Defines.php");
$cfg = parse_plugin_cfg($sName);
$ui_patch_button_type = (!$option_patch_ui && strcmp($cfg['PATCH_UI'], "true") == 0 && !isset($composemanDockerClientPatch)) ? "Button" : "Hidden";
$ui_unpatch_button_type = (!$option_patch_ui && strcmp($cfg['PATCH_UI'], "false") == 0 && isset($composemanDockerClientPatch)) ? "Button" : "Hidden";

$option_patch_ui = version_compare(parse_ini_file('/etc/unraid-version')['version'], '6.12.0-RC0', '>=');
$ui_patch_help_class = $option_patch_ui ? "hidden" : "inline_help"; // hide help on 6.12+ (integration built-in) //


$projects_exist = intval(shell_exec("ls -l " . $compose_root . " | grep ^d | wc -l")) != 0;

Expand Down Expand Up @@ -658,7 +652,6 @@ $acePath = file_exists('/usr/local/emhttp/plugins/dynamix/javascript/ace/ace.js'
<script src="<?php autov('/plugins/compose.manager/javascript/common.js'); ?>"></script>
<script>
var caURL = "/plugins/compose.manager/include/Exec.php";
var skipPatchUI = <?php echo json_encode($option_patch_ui); ?>; // true when Unraid >= 6.12
var logRefreshInterval = null;
var autoScroll = true;

Expand All @@ -670,30 +663,6 @@ $acePath = file_exists('/usr/local/emhttp/plugins/dynamix/javascript/ace/ace.js'
}
}

function patchWebui() {
if (skipPatchUI) {
swal('Not available', 'Patch Docker Page is not needed on Unraid 6.12+ (integration is built-in).', 'info');
return;
}
$.post(caURL, {
action: 'patchUI'
}, function(data) {
window.location.reload();
})
}

function unpatchWebui() {
if (skipPatchUI) {
swal('Not available', 'Unpatching the Docker page is not supported on Unraid 6.12+.', 'info');
return;
}
$.post(caURL, {
action: 'unPatchUI'
}, function(data) {
window.location.reload();
})
}

function clearAllIconCache() {
swal({
title: 'Clear Icon Cache',
Expand Down Expand Up @@ -865,7 +834,6 @@ $acePath = file_exists('/usr/local/emhttp/plugins/dynamix/javascript/ace/ace.js'
});
}

var _ignorePatchUIChange = true; // prevent change handler from firing during initialization
$('#PROJECTS_FOLDER').on("input change", null, null, checkProjectFolder);

// Helper to initialize toggles as switchButton (only once)
Expand Down Expand Up @@ -907,41 +875,6 @@ $acePath = file_exists('/usr/local/emhttp/plugins/dynamix/javascript/ace/ace.js'
}
}


// Patch UI toggle: confirm action and run patch.sh via server (uses existing ajax handlers)
if (!skipPatchUI) {
$('.compose-toggle[name="PATCH_UI"]').on('change', function(e) {
if (_ignorePatchUIChange) {
_ignorePatchUIChange = false;
return;
}
var $cb = $(this);
var checked = $cb.is(':checked');
swal({
title: checked ? 'Patch Docker Page' : 'Unpatch Docker Page',
text: checked ? 'This will patch the Docker page to better display compose-managed containers. Apply now?' : 'This will remove the Docker page patch and restore the original UI. Proceed?',
type: 'warning',
showCancelButton: true,
confirmButtonText: 'Yes, proceed'
}, function(confirmed) {
if (!confirmed) {
// revert UI to previous state
_ignorePatchUIChange = true;
$cb.prop('checked', !checked);
// reload to ensure switch UI reflects actual state
window.location.reload();
return;
}
// Call existing ajax helpers which execute patch.sh on the server and reload
if (checked) patchWebui();
else unpatchWebui();
});
});
} else {
// If Unraid >=6.12 then patch UI option is not applicable — keep checkbox disabled and show inline message
$('.compose-toggle[name="PATCH_UI"]').prop('disabled', true);
}

// Handle header menu toggle -> disable/enable compose-on-top and hide-from-docker
// Saves and restores the original checked state of dependent settings so toggling
// the header menu on then off preserves the user's previous selections.
Expand Down Expand Up @@ -1741,8 +1674,6 @@ $acePath = file_exists('/usr/local/emhttp/plugins/dynamix/javascript/ace/ace.js'
$('#AUTO_CHECK_UPDATES_DAYS_CUSTOM').on('input', onAutoCheckCustomDaysInput);
$('#AUTO_CHECK_UPDATES_DAYS_CUSTOM').on('change', onAutoCheckCustomDaysChanged);

// allow patch UI change handler to run now that switches are initialized
_ignorePatchUIChange = false;
var savedTab = localStorage.getItem('compose-settings-tab') || 'settings';
// Remove all active classes first
$('.compose-tab, .compose-tab-content').removeClass('active');
Expand Down Expand Up @@ -3024,20 +2955,6 @@ $acePath = file_exists('/usr/local/emhttp/plugins/dynamix/javascript/ace/ace.js'
</dd>
</dl>

<?php if (!$option_patch_ui): ?>
<dl>
<dt style="cursor: help;" onclick="toggleHelp(this)">_(Patch Docker Page)_:</dt>
<dd>
<input type="checkbox" name="PATCH_UI" class="compose-toggle" <?= $cfg['PATCH_UI'] == 'true' ? 'checked' : '' ?>>
<input type="button" value="_(Patch Now)_" onclick="patchWebui()" class="slim-button" style="margin-left:15px;">
<input type="button" value="_(Unpatch)_" onclick="unpatchWebui()" class="slim-button" style="margin-left:15px;">
<blockquote class="inline_help">
<strong>(Unraid 6.11 and earlier only)</strong> Patch the Docker page to better display compose-managed containers.
</blockquote>
</dd>
</dl>
<?php endif; ?>

<dl class="settings-actions settings-actions-hidden">
<dd>
<input type="submit" id="settings-submit-default" name="#default" value="_(Default)_">
Expand Down
1 change: 0 additions & 1 deletion source/compose.manager/default.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
PATCH_UI="false"
DEBUG_TO_LOG="false"
PROJECTS_FOLDER="/boot/config/plugins/compose.manager/projects"
AUTOSTART_FORCE_RECREATE="false"
Expand Down
21 changes: 0 additions & 21 deletions source/compose.manager/include/Exec.php
Original file line number Diff line number Diff line change
Expand Up @@ -895,27 +895,6 @@ function composeResolveContainerIcon(string $containerName, string $service, arr
echo json_encode(['result' => 'success']);
break;

case 'runPatch':
$cmd = isset($_POST['cmd']) ? $_POST['cmd'] : 'apply';
if (!in_array($cmd, ['apply', 'remove'])) {
echo json_encode(['result' => 'error', 'message' => 'Invalid command']);
break;
}
$script = "$plugin_root/scripts/patch.sh";
// Quote each argument to preserve spaces and special characters and avoid the fragility of escapeshellcmd()
$fullcmd = escapeshellarg($script) . ' ' . escapeshellarg($cmd) . ' ' . escapeshellarg('--verbose') . ' 2>&1';
exec($fullcmd, $output, $rc);
// Save a copy to plugin log file
$logfile = "/boot/config/plugins/compose.manager/patch_last_run.log";
$ts = date('c');
$entry = "[{$ts}] runPatch {$cmd} exit={$rc}\n" . implode("\n", $output) . "\n\n";
@file_put_contents($logfile, $entry, FILE_APPEND);
foreach ($output as $line) {
composeLogger(escapeshellarg($cmd) . ' ' . $line, null, 'user', 'debug', 'patch.sh');
}
echo json_encode(['result' => $rc === 0 ? 'success' : 'error', 'output' => implode("\n", $output), 'rc' => $rc]);
break;

case 'clearUpdateCache':
// Clear the compose manager update status cache
$composeUpdateStatusFile = COMPOSE_UPDATE_STATUS_FILE;
Expand Down
Loading
Loading