Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

feat(dashboard): show admins a link to a newer release

Yudhi Armyndharisf592ef83f781
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7000c5b0d..f2c73644b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Webhook and automation filters accept a `chatId` condition, so a webhook can be scoped to specific groups or chats instead of only to a sender ([#1634](https://github.com/rmyndharis/OpenWA/issues/1634)). Thanks @krishshah9944 and @bhavyachopra99.
- The dashboard Templates list has a delete button on each row, so a template can be deleted without opening it in the editor first. Like the editor's delete button, it shows only for keys that can write templates. Thanks @C24212.
- On the dashboard Chats page, Escape closes the open chat, channel or status viewer and returns to the list. It leaves the key alone while a dialog, a menu or the media viewer is open, since those handle Escape themselves. Thanks @C24212.
+- The dashboard sidebar tells admins when a newer OpenWA release exists, as a link to its release notes next to the version. `GET /api/infra/update-check` (ADMIN) reads the latest published GitHub release through the SSRF-guarded fetch and caches it for six hours, and a failed check never surfaces as an error; `UPDATE_CHECK_ENABLED=false` turns the request off ([#988](https://github.com/rmyndharis/OpenWA/issues/988), [#1678](https://github.com/rmyndharis/OpenWA/issues/1678)). Thanks @voosam and @OneArmArmy for the request.
### Changed
@@ -103,6 +104,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- WebSocket command replies are pushed on the `message` event as well as returned through the ack callback. A client that passes an ack AND listens on `message` therefore sees each reply twice from this release; handle it in one place.
- A caller-supplied URL leaves through the session proxy from this release. Set `SESSION_PROXY_URL_FETCH=false` when a session proxy is a WhatsApp-only route that cannot reach arbitrary media hosts.
- whatsapp-web.js: `POST /api/sessions/{sessionId}/calls/{callId}/reject` answers `501` instead of a `200` that did not stop the call from ringing.
+- The gateway makes an outbound request to `api.github.com` when an admin opens the dashboard, to find the latest release. The answer is cached for six hours, or fifteen minutes after a failure. Set `UPDATE_CHECK_ENABLED=false` where that egress is not wanted.
### Security
diff --git a/dashboard/src/components/Layout.css b/dashboard/src/components/Layout.css
index d15b91fb0..f4e19d4a1 100644
--- a/dashboard/src/components/Layout.css
+++ b/dashboard/src/components/Layout.css
@@ -71,6 +71,22 @@
margin-top: 1px;
}
+.brand-update {
+ align-self: flex-start;
+ margin-top: 2px;
+ padding: 1px 6px;
+ border-radius: var(--radius);
+ font-size: 0.625rem;
+ font-weight: 600;
+ color: var(--primary-text);
+ background: var(--primary-soft);
+ text-decoration: none;
+}
+
+.brand-update:hover {
+ text-decoration: underline;
+}
+
/* Collapse Toggle Button - Circular design at edge */
.collapse-toggle {
position: absolute;
diff --git a/dashboard/src/components/Layout.tsx b/dashboard/src/components/Layout.tsx
index 4e9c1b551..495e66cd6 100644
--- a/dashboard/src/components/Layout.tsx
+++ b/dashboard/src/components/Layout.tsx
@@ -25,7 +25,7 @@ import {
import { useTheme } from '../hooks/useTheme';
import { type UserRole } from '../hooks/useRole';
import { languageOptions, resolveSupportedLanguage, rtlLanguages, type SupportedLanguage } from '../i18n';
-import { healthApi } from '../services/api';
+import { healthApi, infraApi } from '../services/api';
import './Layout.css';
interface LayoutProps {
@@ -64,6 +64,9 @@ export function Layout({ onLogout, userRole }: LayoutProps) {
// Show the build-time version immediately, then replace it with the live running version from the
// backend so a stale-built bundle can't display the wrong number. Falls back silently on error.
const [version, setVersion] = useState(__APP_VERSION__);
+ // A newer published release, shown to admins as a link to its notes. The route is ADMIN-only and
+ // the backend answers quietly when GitHub is unreachable or the check is turned off.
+ const [update, setUpdate] = useState<{ latest: string; url: string } | null>(null);
const [isLanguageMenuOpen, setIsLanguageMenuOpen] = useState(false);
const languageMenuRef = useRef<HTMLDivElement>(null);
@@ -92,6 +95,24 @@ export function Layout({ onLogout, userRole }: LayoutProps) {
};
}, []);
+ useEffect(() => {
+ if (userRole !== 'admin') return;
+ let active = true;
+ infraApi
+ .getUpdateCheck()
+ .then(check => {
+ if (active && check.updateAvailable && check.latest && check.releaseUrl) {
+ setUpdate({ latest: check.latest, url: check.releaseUrl });
+ }
+ })
+ .catch(() => {
+ /* no notice */
+ });
+ return () => {
+ active = false;
+ };
+ }, [userRole]);
+
const handleNavClick = () => {
if (isMobile) setIsMobileOpen(false);
};
@@ -160,6 +181,11 @@ export function Layout({ onLogout, userRole }: LayoutProps) {
<div className="sidebar-brand">
<span className="brand-name">{t('common.appName')}</span>
<span className="brand-version">v{version}</span>
+ {update && (
+ <a className="brand-update" href={update.url} target="_blank" rel="noopener noreferrer">
+ {t('common.updateAvailable', { version: update.latest })}
+ </a>
+ )}
</div>
)}
</div>
diff --git a/dashboard/src/i18n/locales/ar.json b/dashboard/src/i18n/locales/ar.json
index 227f5a848..504a00905 100644
--- a/dashboard/src/i18n/locales/ar.json
+++ b/dashboard/src/i18n/locales/ar.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "الإصدار v{{version}} متاح",
"loading": "جارٍ التحميل...",
"cancel": "إلغاء",
"delete": "حذف",
diff --git a/dashboard/src/i18n/locales/de.json b/dashboard/src/i18n/locales/de.json
index b6f13b729..6b85a1e4f 100644
--- a/dashboard/src/i18n/locales/de.json
+++ b/dashboard/src/i18n/locales/de.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} verfügbar",
"loading": "Wird geladen...",
"cancel": "Abbrechen",
"delete": "Löschen",
diff --git a/dashboard/src/i18n/locales/en.json b/dashboard/src/i18n/locales/en.json
index e9b160269..9f13b4c2a 100644
--- a/dashboard/src/i18n/locales/en.json
+++ b/dashboard/src/i18n/locales/en.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} available",
"loading": "Loading...",
"cancel": "Cancel",
"delete": "Delete",
diff --git a/dashboard/src/i18n/locales/es.json b/dashboard/src/i18n/locales/es.json
index 958e6f191..262bb6e1d 100644
--- a/dashboard/src/i18n/locales/es.json
+++ b/dashboard/src/i18n/locales/es.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} disponible",
"loading": "Cargando...",
"cancel": "Cancelar",
"delete": "Eliminar",
diff --git a/dashboard/src/i18n/locales/fr.json b/dashboard/src/i18n/locales/fr.json
index c962d183d..ef1d607c7 100644
--- a/dashboard/src/i18n/locales/fr.json
+++ b/dashboard/src/i18n/locales/fr.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} disponible",
"loading": "Chargement...",
"cancel": "Annuler",
"delete": "Supprimer",
diff --git a/dashboard/src/i18n/locales/he.json b/dashboard/src/i18n/locales/he.json
index 5ecc9093f..e2c2595fa 100644
--- a/dashboard/src/i18n/locales/he.json
+++ b/dashboard/src/i18n/locales/he.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "גרסה v{{version}} זמינה",
"loading": "טוען...",
"cancel": "ביטול",
"delete": "מחיקה",
diff --git a/dashboard/src/i18n/locales/it.json b/dashboard/src/i18n/locales/it.json
index 43047e1a6..ddc3cac2b 100644
--- a/dashboard/src/i18n/locales/it.json
+++ b/dashboard/src/i18n/locales/it.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} disponibile",
"loading": "Caricamento...",
"cancel": "Annulla",
"delete": "Elimina",
diff --git a/dashboard/src/i18n/locales/ko.json b/dashboard/src/i18n/locales/ko.json
index e4c417b29..dc78d736e 100644
--- a/dashboard/src/i18n/locales/ko.json
+++ b/dashboard/src/i18n/locales/ko.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} 사용 가능",
"loading": "로딩 중...",
"cancel": "취소",
"delete": "삭제",
diff --git a/dashboard/src/i18n/locales/pt-BR.json b/dashboard/src/i18n/locales/pt-BR.json
index 0be002035..8b184d113 100644
--- a/dashboard/src/i18n/locales/pt-BR.json
+++ b/dashboard/src/i18n/locales/pt-BR.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} disponível",
"loading": "Carregando...",
"cancel": "Cancelar",
"delete": "Excluir",
diff --git a/dashboard/src/i18n/locales/te.json b/dashboard/src/i18n/locales/te.json
index e9b488c97..63afa6109 100644
--- a/dashboard/src/i18n/locales/te.json
+++ b/dashboard/src/i18n/locales/te.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} అందుబాటులో ఉంది",
"loading": "లోడ్ అవుతోంది...",
"cancel": "రద్దు చేయి",
"delete": "తొలగించు",
diff --git a/dashboard/src/i18n/locales/tr.json b/dashboard/src/i18n/locales/tr.json
index b4360b8bd..8460d7606 100644
--- a/dashboard/src/i18n/locales/tr.json
+++ b/dashboard/src/i18n/locales/tr.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} mevcut",
"loading": "Yükleniyor...",
"cancel": "İptal",
"delete": "Sil",
diff --git a/dashboard/src/i18n/locales/zh-CN.json b/dashboard/src/i18n/locales/zh-CN.json
index 76270d56a..0ece74c8e 100644
--- a/dashboard/src/i18n/locales/zh-CN.json
+++ b/dashboard/src/i18n/locales/zh-CN.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} 已发布",
"loading": "正在加载...",
"cancel": "取消",
"delete": "删除",
diff --git a/dashboard/src/i18n/locales/zh-HK.json b/dashboard/src/i18n/locales/zh-HK.json
index f522fa7d5..98328d681 100644
--- a/dashboard/src/i18n/locales/zh-HK.json
+++ b/dashboard/src/i18n/locales/zh-HK.json
@@ -7,6 +7,7 @@
},
"common": {
"appName": "OpenWA",
+ "updateAvailable": "v{{version}} 已發佈",
"loading": "正在載入...",
"cancel": "取消",
"delete": "刪除",
diff --git a/dashboard/src/services/api.ts b/dashboard/src/services/api.ts
index cf1d330dd..c8907fccb 100644
--- a/dashboard/src/services/api.ts
+++ b/dashboard/src/services/api.ts
@@ -536,6 +536,14 @@ export interface HealthStatus {
};
}
+/** GET /infra/update-check: the running version against the latest published release. */
+export interface UpdateCheck {
+ current: string;
+ latest: string | null;
+ updateAvailable: boolean;
+ releaseUrl: string | null;
+}
+
export interface InfraStatus {
// `builtIn` = OpenWA's own bundled container is actually running and backing this service (live),
// not just the saved intent — falls back to the saved flag when Docker is unavailable. (#488)
@@ -1123,6 +1131,7 @@ export const healthApi = {
export const infraApi = {
getStatus: () => request<InfraStatus>('/infra/status'),
+ getUpdateCheck: () => request<UpdateCheck>('/infra/update-check'),
getConfig: () => request<SavedConfig>('/infra/config'),
saveConfig: (config: SaveConfigPayload) =>
request<{ message: string; saved: boolean; envPath: string; profiles: string[] }>('/infra/config', {