feat(proxy): enhance Traefik version notifications to show patch and minor upgrades

- Store both patch update and newer minor version information simultaneously
- Display patch update availability alongside minor version upgrades in notifications
- Add newer_branch_target and newer_branch_latest fields to traefik_outdated_info
- Update all notification channels (Discord, Telegram, Slack, Pushover, Email, Webhook)
- Show minor version in format (e.g., v3.6) for upgrade targets instead of patch version
- Enhance UI callouts with clearer messaging about available upgrades
- Remove verbose logging in favor of cleaner code structure
- Handle edge case where SSH command returns empty response

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2025-11-17 09:59:17 +01:00
parent cc6a538fca
commit 6593b2a553
15 changed files with 618 additions and 241 deletions

View File

@@ -1,8 +1,6 @@
<x-emails.layout>
{{ $count }} server(s) are running outdated Traefik proxy. Update recommended for security and features.
**Note:** This check is based on the actual running container version, not the configuration file.
## Affected Servers
@foreach ($servers as $server)
@@ -10,16 +8,37 @@
$info = $server->outdatedInfo ?? [];
$current = $info['current'] ?? 'unknown';
$latest = $info['latest'] ?? 'unknown';
$type = ($info['type'] ?? 'patch_update') === 'patch_update' ? '(patch)' : '(upgrade)';
$isPatch = ($info['type'] ?? 'patch_update') === 'patch_update';
$hasNewerBranch = isset($info['newer_branch_target']);
$hasUpgrades = $hasUpgrades ?? false;
if ($type === 'upgrade') {
if (!$isPatch || $hasNewerBranch) {
$hasUpgrades = true;
}
// Add 'v' prefix for display
$current = str_starts_with($current, 'v') ? $current : "v{$current}";
$latest = str_starts_with($latest, 'v') ? $latest : "v{$latest}";
// For minor upgrades, use the upgrade_target (e.g., "v3.6")
if (!$isPatch && isset($info['upgrade_target'])) {
$upgradeTarget = str_starts_with($info['upgrade_target'], 'v') ? $info['upgrade_target'] : "v{$info['upgrade_target']}";
} else {
// For patch updates, show the full version
$upgradeTarget = $latest;
}
// Get newer branch info if available
if ($hasNewerBranch) {
$newerBranchTarget = $info['newer_branch_target'];
$newerBranchLatest = str_starts_with($info['newer_branch_latest'], 'v') ? $info['newer_branch_latest'] : "v{$info['newer_branch_latest']}";
}
@endphp
- **{{ $server->name }}**: {{ $current }} {{ $latest }} {{ $type }}
@if ($isPatch && $hasNewerBranch)
- **{{ $server->name }}**: {{ $current }} {{ $upgradeTarget }} (patch update available) | Also available: {{ $newerBranchTarget }} (latest patch: {{ $newerBranchLatest }}) - new minor version
@elseif ($isPatch)
- **{{ $server->name }}**: {{ $current }} {{ $upgradeTarget }} (patch update available)
@else
- **{{ $server->name }}**: {{ $current }} (latest patch: {{ $latest }}) {{ $upgradeTarget }} (new minor version available)
@endif
@endforeach
## Recommendation
@@ -27,7 +46,7 @@
It is recommended to test the new Traefik version before switching it in production environments. You can update your proxy configuration through your [Coolify Dashboard]({{ config('app.url') }}).
@if ($hasUpgrades ?? false)
**Important for major/minor upgrades:** Before upgrading to a new major or minor version, please read the [Traefik changelog](https://github.com/traefik/traefik/releases) to understand breaking changes and new features.
**Important for minor version upgrades:** Before upgrading to a new minor version, please read the [Traefik changelog](https://github.com/traefik/traefik/releases) to understand breaking changes and new features.
@endif
## Next Steps

View File

@@ -115,12 +115,14 @@
</x-callout>
@endif
@if ($this->newerTraefikBranchAvailable)
<x-callout dismissible onDismiss="traefikWarningsDismissed = true; localStorage.setItem('callout-dismissed-traefik-warnings-{{ $server->id }}', 'true')" type="info" title="Newer Traefik Version Available" class="my-4">
A newer version of Traefik is available: <span
<x-callout dismissible onDismiss="traefikWarningsDismissed = true; localStorage.setItem('callout-dismissed-traefik-warnings-{{ $server->id }}', 'true')" type="info" title="New Minor Traefik Version Available" class="my-4">
A new minor version of Traefik is available: <span
class="font-mono">{{ $this->newerTraefikBranchAvailable }}</span>
<br><br>
<strong>Important:</strong> Before upgrading to a new major or minor version, please
read
You are currently running <span class="font-mono">v{{ $server->detected_traefik_version }}</span>.
Upgrading to <span class="font-mono">{{ $this->newerTraefikBranchAvailable }}</span> will give you access to new features and improvements.
<br><br>
<strong>Important:</strong> Before upgrading to a new minor version, please read
the <a href="https://github.com/traefik/traefik/releases" target="_blank"
class="underline text-white">Traefik changelog</a> to understand breaking changes
and new features.