Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): say what a pinned built-in flag does

Yudhi Armyndharisa263a5eac7b4
diff --git a/dashboard/src/i18n/locales/ar.json b/dashboard/src/i18n/locales/ar.json
index d9c1cbf73..0229d2d05 100644
--- a/dashboard/src/i18n/locales/ar.json
+++ b/dashboard/src/i18n/locales/ar.json
@@ -1263,6 +1263,7 @@
"saveFailed": "فشل الحفظ"
},
"envPinNote": "مُثبَّت عبر متغيّر البيئة {{name}} — هذه هي القيمة قيد التشغيل؛ لن تُطبَّق تغييرات لوحة التحكّم حتى يُلغى هذا المتغيّر.",
+ "envPinFlagNote": "مُثبَّت عبر متغيّر البيئة {{name}}: ما دامت قيمته true، تبدأ الحاوية المدمجة مع كل تشغيل للخادم، حتى لو كان هذا المفتاح مُعطّلًا.",
"pendingRestartNote": "تم الحفظ ولكن لم يُطبَّق بعد — أعد تشغيل الخادم ليصبح هذا التغيير ساريًا.",
"pendingBuiltInNote": "تم الحفظ ولكن لم يُطبَّق بعد: يعمل الخادم الآن مع خدمة خارجية، وستحوّله إعادة التشغيل إلى الحاوية المدمجة.",
"pendingExternalNote": "تم الحفظ ولكن لم يُطبَّق بعد: يعمل الخادم الآن مع الحاوية المدمجة، وستحوّله إعادة التشغيل إلى خدمة خارجية.",
diff --git a/dashboard/src/i18n/locales/de.json b/dashboard/src/i18n/locales/de.json
index 22f92c84c..c051beb92 100644
--- a/dashboard/src/i18n/locales/de.json
+++ b/dashboard/src/i18n/locales/de.json
@@ -1205,6 +1205,7 @@
"disabled": "Deaktiviert"
},
"envPinNote": "Durch die Umgebungsvariable {{name}} festgelegt — dies ist der aktuell verwendete Wert. Änderungen im Dashboard werden erst wirksam, wenn diese Variable entfernt wird.",
+ "envPinFlagNote": "Durch die Umgebungsvariable {{name}} festgelegt: Solange sie auf true steht, startet der integrierte Container bei jedem Serverstart, auch wenn dieser Schalter aus ist.",
"pendingRestartNote": "Gespeichert, aber noch nicht übernommen — starten Sie den Server neu, damit diese Änderung wirksam wird.",
"pendingBuiltInNote": "Gespeichert, aber noch nicht übernommen: Der Server läuft derzeit mit einem externen Dienst, ein Neustart wechselt zum integrierten Container.",
"pendingExternalNote": "Gespeichert, aber noch nicht übernommen: Der Server läuft derzeit mit dem integrierten Container, ein Neustart wechselt zu einem externen Dienst.",
diff --git a/dashboard/src/i18n/locales/en.json b/dashboard/src/i18n/locales/en.json
index a3ffc45dc..82fc4d70e 100644
--- a/dashboard/src/i18n/locales/en.json
+++ b/dashboard/src/i18n/locales/en.json
@@ -1205,6 +1205,7 @@
"disabled": "Disabled"
},
"envPinNote": "Pinned by the environment variable {{name}} — this is the running value; dashboard changes won't apply until that variable is unset.",
+ "envPinFlagNote": "Pinned by the environment variable {{name}}: the built-in container still starts at every boot while it is set to true, even with this toggle off.",
"pendingRestartNote": "Saved, but not applied yet — restart the server for this change to take effect.",
"pendingBuiltInNote": "Saved, but not applied yet: the server runs with an external service now, and a restart switches it to the built-in container.",
"pendingExternalNote": "Saved, but not applied yet: the server runs with the built-in container now, and a restart switches it to an external service.",
diff --git a/dashboard/src/i18n/locales/es.json b/dashboard/src/i18n/locales/es.json
index f0000acf3..24797cbaa 100644
--- a/dashboard/src/i18n/locales/es.json
+++ b/dashboard/src/i18n/locales/es.json
@@ -1235,6 +1235,7 @@
"saveFailed": "Error al guardar"
},
"envPinNote": "Fijado por la variable de entorno {{name}}: este es el valor en ejecución; los cambios del panel no se aplicarán hasta que esa variable se elimine.",
+ "envPinFlagNote": "Fijado por la variable de entorno {{name}}: mientras valga true, el contenedor integrado se inicia en cada arranque del servidor, aunque este interruptor esté desactivado.",
"pendingRestartNote": "Guardado, pero aún no aplicado: reinicia el servidor para que este cambio surta efecto.",
"pendingBuiltInNote": "Guardado, pero aún no aplicado: el servidor usa ahora un servicio externo y un reinicio lo cambiará al contenedor integrado.",
"pendingExternalNote": "Guardado, pero aún no aplicado: el servidor usa ahora el contenedor integrado y un reinicio lo cambiará a un servicio externo.",
diff --git a/dashboard/src/i18n/locales/fr.json b/dashboard/src/i18n/locales/fr.json
index 6d393f5d1..f638c9eb5 100644
--- a/dashboard/src/i18n/locales/fr.json
+++ b/dashboard/src/i18n/locales/fr.json
@@ -1235,6 +1235,7 @@
"saveFailed": "Échec de l'enregistrement"
},
"envPinNote": "Défini par la variable d'environnement {{name}} — c'est la valeur en cours d'exécution ; les modifications du tableau de bord ne s'appliqueront pas tant que cette variable n'est pas supprimée.",
+ "envPinFlagNote": "Défini par la variable d'environnement {{name}} : tant qu'elle vaut true, le conteneur intégré est lancé à chaque démarrage du serveur, même si cet interrupteur est désactivé.",
"pendingRestartNote": "Enregistré, mais pas encore appliqué — redémarrez le serveur pour que cette modification prenne effet.",
"pendingBuiltInNote": "Enregistré, mais pas encore appliqué : le serveur utilise actuellement un service externe, et un redémarrage le basculera vers le conteneur intégré.",
"pendingExternalNote": "Enregistré, mais pas encore appliqué : le serveur utilise actuellement le conteneur intégré, et un redémarrage le basculera vers un service externe.",
diff --git a/dashboard/src/i18n/locales/he.json b/dashboard/src/i18n/locales/he.json
index a78adee59..0a8eacaa4 100644
--- a/dashboard/src/i18n/locales/he.json
+++ b/dashboard/src/i18n/locales/he.json
@@ -1245,6 +1245,7 @@
"saveFailed": "השמירה נכשלה"
},
"envPinNote": "מקובע על ידי משתנה הסביבה {{name}} — זהו הערך הפעיל; שינויים בלוח הבקרה לא ייכנסו לתוקף עד שמשתנה זה יבוטל.",
+ "envPinFlagNote": "מקובע על ידי משתנה הסביבה {{name}}: כל עוד ערכו true, הקונטיינר המובנה מופעל בכל הפעלה של השרת, גם כשמתג זה כבוי.",
"pendingRestartNote": "נשמר, אך טרם הוחל — הפעילו מחדש את השרת כדי שהשינוי ייכנס לתוקף.",
"pendingBuiltInNote": "נשמר, אך טרם הוחל: השרת פועל כעת עם שירות חיצוני, והפעלה מחדש תעביר אותו לקונטיינר המובנה.",
"pendingExternalNote": "נשמר, אך טרם הוחל: השרת פועל כעת עם הקונטיינר המובנה, והפעלה מחדש תעביר אותו לשירות חיצוני.",
diff --git a/dashboard/src/i18n/locales/hi.json b/dashboard/src/i18n/locales/hi.json
index b672b9f5d..f5b4b517c 100644
--- a/dashboard/src/i18n/locales/hi.json
+++ b/dashboard/src/i18n/locales/hi.json
@@ -1205,6 +1205,7 @@
"disabled": "अक्षम"
},
"envPinNote": "पर्यावरण चर {{name}} द्वारा पिन किया गया — यह चल रहा मान है; डैशबोर्ड परिवर्तन तब तक लागू नहीं होंगे जब तक कि वह चर अनसेट नहीं हो जाता।",
+ "envPinFlagNote": "पर्यावरण चर {{name}} द्वारा पिन किया गया: जब तक इसका मान true है, अंतर्निहित कंटेनर हर बार सर्वर शुरू होने पर चालू होता है, भले ही यह टॉगल बंद हो।",
"pendingRestartNote": "सहेजा गया, लेकिन अभी लागू नहीं हुआ — इस बदलाव को प्रभावी करने के लिए सर्वर को पुनरारंभ करें।",
"pendingBuiltInNote": "सहेजा गया, लेकिन अभी लागू नहीं हुआ: सर्वर अभी बाहरी सेवा के साथ चल रहा है, और पुनरारंभ करने पर वह अंतर्निहित कंटेनर पर स्विच हो जाएगा।",
"pendingExternalNote": "सहेजा गया, लेकिन अभी लागू नहीं हुआ: सर्वर अभी अंतर्निहित कंटेनर के साथ चल रहा है, और पुनरारंभ करने पर वह बाहरी सेवा पर स्विच हो जाएगा।",
diff --git a/dashboard/src/i18n/locales/id.json b/dashboard/src/i18n/locales/id.json
index 4979e3c53..8866d2681 100644
--- a/dashboard/src/i18n/locales/id.json
+++ b/dashboard/src/i18n/locales/id.json
@@ -1205,6 +1205,7 @@
"disabled": "Dinonaktifkan"
},
"envPinNote": "Disematkan oleh variabel lingkungan {{name}} — ini adalah nilai yang berjalan; perubahan dasbor tidak akan berlaku sampai variabel tersebut dihapus.",
+ "envPinFlagNote": "Disematkan oleh variabel lingkungan {{name}}: selama bernilai true, container bawaan tetap dijalankan setiap kali server mulai, meskipun sakelar ini mati.",
"pendingRestartNote": "Tersimpan, tetapi belum diterapkan — restart server agar perubahan berlaku.",
"pendingBuiltInNote": "Tersimpan, tetapi belum diterapkan: server saat ini berjalan dengan layanan eksternal, dan restart akan mengalihkannya ke container bawaan.",
"pendingExternalNote": "Tersimpan, tetapi belum diterapkan: server saat ini berjalan dengan container bawaan, dan restart akan mengalihkannya ke layanan eksternal.",
diff --git a/dashboard/src/i18n/locales/it.json b/dashboard/src/i18n/locales/it.json
index cfe77e1fd..47185671f 100644
--- a/dashboard/src/i18n/locales/it.json
+++ b/dashboard/src/i18n/locales/it.json
@@ -1235,6 +1235,7 @@
"saveFailed": "Salvataggio Fallito"
},
"envPinNote": "Fissato dalla variabile d'ambiente {{name}}: questo è il valore in esecuzione; le modifiche dalla dashboard non verranno applicate finché quella variabile non viene rimossa.",
+ "envPinFlagNote": "Fissato dalla variabile d'ambiente {{name}}: finché vale true, il container integrato viene avviato a ogni avvio del server, anche con questo interruttore disattivato.",
"pendingRestartNote": "Salvato, ma non ancora applicato: riavvia il server perché questa modifica abbia effetto.",
"pendingBuiltInNote": "Salvato, ma non ancora applicato: il server usa ora un servizio esterno e un riavvio lo passerà al container integrato.",
"pendingExternalNote": "Salvato, ma non ancora applicato: il server usa ora il container integrato e un riavvio lo passerà a un servizio esterno.",
diff --git a/dashboard/src/i18n/locales/ko.json b/dashboard/src/i18n/locales/ko.json
index d5911a3d0..2114a7254 100644
--- a/dashboard/src/i18n/locales/ko.json
+++ b/dashboard/src/i18n/locales/ko.json
@@ -1205,6 +1205,7 @@
"disabled": "사용 안 함"
},
"envPinNote": "환경 변수 {{name}}(으)로 고정됨 — 현재 실행 중인 값이며, 해당 변수를 해제해야 대시보드 변경 사항이 적용됩니다.",
+ "envPinFlagNote": "환경 변수 {{name}}(으)로 고정됨: 값이 true인 동안에는 이 토글이 꺼져 있어도 서버가 시작될 때마다 내장 컨테이너가 시작됩니다.",
"pendingRestartNote": "저장되었지만 아직 적용되지 않았습니다 — 이 변경 사항을 적용하려면 서버를 다시 시작하세요.",
"pendingBuiltInNote": "저장되었지만 아직 적용되지 않았습니다. 서버는 현재 외부 서비스로 실행 중이며, 다시 시작하면 내장 컨테이너로 전환됩니다.",
"pendingExternalNote": "저장되었지만 아직 적용되지 않았습니다. 서버는 현재 내장 컨테이너로 실행 중이며, 다시 시작하면 외부 서비스로 전환됩니다.",
diff --git a/dashboard/src/i18n/locales/pt-BR.json b/dashboard/src/i18n/locales/pt-BR.json
index 03c82af21..e12d6df03 100644
--- a/dashboard/src/i18n/locales/pt-BR.json
+++ b/dashboard/src/i18n/locales/pt-BR.json
@@ -1235,6 +1235,7 @@
"saveFailed": "Erro ao salvar"
},
"envPinNote": "Fixado pela variável de ambiente {{name}}: este é o valor em execução; as alterações do painel não serão aplicadas até que essa variável seja removida.",
+ "envPinFlagNote": "Fixado pela variável de ambiente {{name}}: enquanto valer true, o contêiner integrado é iniciado a cada inicialização do servidor, mesmo com esta opção desativada.",
"pendingRestartNote": "Salvo, mas ainda não aplicado: reinicie o servidor para que esta alteração tenha efeito.",
"pendingBuiltInNote": "Salvo, mas ainda não aplicado: o servidor está usando um serviço externo agora, e uma reinicialização o trocará para o contêiner integrado.",
"pendingExternalNote": "Salvo, mas ainda não aplicado: o servidor está usando o contêiner integrado agora, e uma reinicialização o trocará para um serviço externo.",
diff --git a/dashboard/src/i18n/locales/te.json b/dashboard/src/i18n/locales/te.json
index 9574c8c84..fd63a216d 100644
--- a/dashboard/src/i18n/locales/te.json
+++ b/dashboard/src/i18n/locales/te.json
@@ -1226,6 +1226,7 @@
"saveFailed": "సేవ్ చేయడం విఫలమైంది"
},
"envPinNote": "{{name}} ఎన్విరాన్‌మెంట్ వేరియబుల్ ద్వారా పిన్ చేయబడింది — ఇది ప్రస్తుతం అమలులో ఉన్న విలువ; ఆ వేరియబుల్‌ను తొలగించే వరకు డాష్‌బోర్డ్ మార్పులు వర్తించవు.",
+ "envPinFlagNote": "{{name}} ఎన్విరాన్‌మెంట్ వేరియబుల్ ద్వారా పిన్ చేయబడింది: దాని విలువ true గా ఉన్నంత వరకు, ఈ టోగుల్ ఆఫ్‌లో ఉన్నా సర్వర్ ప్రారంభమైన ప్రతిసారీ ఇన్-బిల్ట్ కంటైనర్ ప్రారంభమవుతుంది.",
"pendingRestartNote": "సేవ్ చేయబడింది, కానీ ఇంకా వర్తించలేదు — ఈ మార్పు అమలులోకి రావడానికి సర్వర్‌ను పునఃప్రారంభించండి.",
"pendingBuiltInNote": "సేవ్ చేయబడింది, కానీ ఇంకా వర్తించలేదు: సర్వర్ ప్రస్తుతం బాహ్య సేవతో నడుస్తోంది, పునఃప్రారంభిస్తే అది ఇన్-బిల్ట్ కంటైనర్‌కు మారుతుంది.",
"pendingExternalNote": "సేవ్ చేయబడింది, కానీ ఇంకా వర్తించలేదు: సర్వర్ ప్రస్తుతం ఇన్-బిల్ట్ కంటైనర్‌తో నడుస్తోంది, పునఃప్రారంభిస్తే అది బాహ్య సేవకు మారుతుంది.",
diff --git a/dashboard/src/i18n/locales/tr.json b/dashboard/src/i18n/locales/tr.json
index 3dea7c908..5bb80df70 100644
--- a/dashboard/src/i18n/locales/tr.json
+++ b/dashboard/src/i18n/locales/tr.json
@@ -1205,6 +1205,7 @@
"disabled": "Devre Dışı"
},
"envPinNote": "{{name}} ortam değişkeni tarafından sabitlendi — bu çalışan değerdir; ortam değişkeni kaldırılana kadar kontrol panelindeki değişiklikler uygulanmayacaktır.",
+ "envPinFlagNote": "{{name}} ortam değişkeni tarafından sabitlendi: değeri true olduğu sürece, bu anahtar kapalı olsa bile dahili konteyner sunucunun her başlatılışında başlatılır.",
"pendingRestartNote": "Kaydedildi, ancak henüz uygulanmadı — bu değişikliğin yürürlüğe girmesi için sunucuyu yeniden başlatın.",
"pendingBuiltInNote": "Kaydedildi, ancak henüz uygulanmadı: sunucu şu anda harici bir hizmetle çalışıyor, yeniden başlatma onu dahili konteynere geçirir.",
"pendingExternalNote": "Kaydedildi, ancak henüz uygulanmadı: sunucu şu anda dahili konteynerle çalışıyor, yeniden başlatma onu harici bir hizmete geçirir.",
diff --git a/dashboard/src/i18n/locales/zh-CN.json b/dashboard/src/i18n/locales/zh-CN.json
index b3719d796..57aa57168 100644
--- a/dashboard/src/i18n/locales/zh-CN.json
+++ b/dashboard/src/i18n/locales/zh-CN.json
@@ -1226,6 +1226,7 @@
"saveFailed": "保存失败"
},
"envPinNote": "已由环境变量 {{name}} 锁定 —— 此为当前运行值;在取消该变量之前,仪表盘的更改不会生效。",
+ "envPinFlagNote": "已由环境变量 {{name}} 锁定:只要其值为 true,即使此开关已关闭,内置容器仍会在每次服务器启动时启动。",
"pendingRestartNote": "已保存,但尚未生效 —— 请重启服务器以应用此更改。",
"pendingBuiltInNote": "已保存,但尚未生效:服务器当前使用外部服务,重启后将切换为内置容器。",
"pendingExternalNote": "已保存,但尚未生效:服务器当前使用内置容器,重启后将切换为外部服务。",
diff --git a/dashboard/src/i18n/locales/zh-HK.json b/dashboard/src/i18n/locales/zh-HK.json
index 219a389cd..237d3b326 100644
--- a/dashboard/src/i18n/locales/zh-HK.json
+++ b/dashboard/src/i18n/locales/zh-HK.json
@@ -1226,6 +1226,7 @@
"saveFailed": "儲存失敗"
},
"envPinNote": "已由環境變數 {{name}} 鎖定 — 這是正在運行的值;在取消設定該變數之前,儀表板的變更不會生效。",
+ "envPinFlagNote": "已由環境變數 {{name}} 鎖定:只要其值為 true,即使此開關已關閉,內置容器仍會在每次伺服器啟動時啟動。",
"pendingRestartNote": "已儲存,但尚未生效 — 請重新啟動伺服器以套用此變更。",
"pendingBuiltInNote": "已儲存,但尚未生效:伺服器目前使用外部服務,重新啟動後將切換為內置容器。",
"pendingExternalNote": "已儲存,但尚未生效:伺服器目前使用內置容器,重新啟動後將切換為外部服務。",
diff --git a/dashboard/src/pages/Infrastructure.test.ts b/dashboard/src/pages/Infrastructure.test.ts
index aa52aeeb6..cb3a556a5 100644
--- a/dashboard/src/pages/Infrastructure.test.ts
+++ b/dashboard/src/pages/Infrastructure.test.ts
@@ -1427,7 +1427,7 @@ function notesUnderToggle(container: HTMLElement, labelText: string): string[] {
return notes;
}
-const ENV_PIN_NOTE = /^Pinned by the environment variable (\S+)/;
+const ENV_PIN_NOTE = /^Pinned by the environment variable ([A-Z][A-Z0-9_]*)/;
function builtInNoteOf(container: HTMLElement, labelText: string): string | null {
return notesUnderToggle(container, labelText).find(note => !ENV_PIN_NOTE.test(note)) ?? null;
@@ -1821,6 +1821,75 @@ test('without a reported pin the settings a save writes show no pin note', async
assert.deepEqual(notes, []);
});
+// The three *_BUILTIN flags pinned true, after the page switched every service to an external server and the restart
+// applied it: GET /config reads the saved external choice (the host decides), the containers run because the pinned
+// flags start them at every boot. The note under each toggle says so, and an unrelated save keeps the switch.
+const FLAG_PIN_NOTE = (name: string) =>
+ `Pinned by the environment variable ${name}: the built-in container still starts at every boot while it is set to true, even with this toggle off.`;
+const RUNNING_EXTERNAL_FLAGS_PINNED: InfraStatus = {
+ ...RUNNING_EXTERNAL_ALL,
+ database: { ...RUNNING_EXTERNAL_ALL.database, running: true },
+ redis: { ...RUNNING_EXTERNAL_ALL.redis, running: true },
+ storage: { ...RUNNING_EXTERNAL_ALL.storage, running: true },
+ envPinned: ['POSTGRES_BUILTIN', 'REDIS_BUILTIN', 'MINIO_BUILTIN'],
+};
+const SAVED_EXTERNAL_SET: SavedConfig = {
+ ...SAVED_EXTERNAL_ALL,
+ database: { ...SAVED_EXTERNAL_ALL.database, builtIn: false, builtInSet: true },
+ storage: { ...SAVED_EXTERNAL_ALL.storage, builtIn: false, builtInSet: true },
+};
+
+test('a flag the environment pins says the bundled container still starts at every boot', async () => {
+ const { screen, fireEvent } = rtl;
+ resetFetchCalls();
+ overrides = { status: RUNNING_EXTERNAL_FLAGS_PINNED, saved: SAVED_EXTERNAL_SET };
+ const { container } = renderInfrastructure();
+
+ await screen.findByText('Database Configuration');
+ await awaitSeeded(container);
+ const toggles = [
+ ['Use Built-in PostgreSQL Container', 'POSTGRES_BUILTIN'],
+ ['Use Built-in Redis Container', 'REDIS_BUILTIN'],
+ ['Use Built-in MinIO Container', 'MINIO_BUILTIN'],
+ ];
+ assert.deepEqual(
+ toggles.map(([label]) => [toggleInput(container, label).checked, notesUnderToggle(container, label)]),
+ toggles.map(([, flag]) => [false, [FLAG_PIN_NOTE(flag)]]),
+ );
+
+ fireEvent.click(toggleInput(container, 'Headless Mode'));
+ fireEvent.click(screen.getByRole('button', { name: 'Save Configuration' }));
+ const dialog = await screen.findByRole('dialog');
+ const body = findFetchCall('PUT', '/api/infra/config')!.body as Record<string, { builtIn?: boolean; host?: string }>;
+ assert.deepEqual(
+ [body.database.builtIn, body.database.host, body.redis.builtIn, body.redis.host, body.storage.builtIn],
+ [false, 'db.ext.example', false, 'cache.ext.example', false],
+ );
+ assert.doesNotMatch(dialog.textContent ?? '', /The new database starts empty|not moved to the new storage/);
+});
+
+// A host pinned elsewhere starts nothing whatever the flag says, so the flag is one more pinned value there.
+test('beside a host pinned elsewhere a pinned flag gets the plain pin note', async () => {
+ const { screen } = rtl;
+ resetFetchCalls();
+ overrides = {
+ status: { ...RUNNING_EXTERNAL_FLAGS_PINNED, envPinned: ['DATABASE_HOST', 'POSTGRES_BUILTIN'] },
+ saved: { ...SAVED_EXTERNAL_SET, database: { ...SAVED_EXTERNAL_SET.database, builtInSet: false } },
+ };
+ const { container } = renderInfrastructure();
+
+ await screen.findByText('Database Configuration');
+ await awaitSeeded(container);
+ const notes = notesUnderToggle(container, 'Use Built-in PostgreSQL Container');
+ assert.deepEqual(
+ notes.map(note => [ENV_PIN_NOTE.exec(note)?.[1], /this is the running value/.test(note)]),
+ [
+ ['DATABASE_HOST', true],
+ ['POSTGRES_BUILTIN', true],
+ ],
+ );
+});
+
// The next boot reads a pinned bucket, port or database name whatever the form holds, so an edit there moves nothing;
// a field beside it the pin does not cover still does.
for (const { pin, label, value, warns } of [
diff --git a/dashboard/src/pages/Infrastructure.tsx b/dashboard/src/pages/Infrastructure.tsx
index 799dea1dd..191a37e6f 100644
--- a/dashboard/src/pages/Infrastructure.tsx
+++ b/dashboard/src/pages/Infrastructure.tsx
@@ -263,12 +263,22 @@ export function Infrastructure() {
// flag and the two paths do have a running and a saved value, but show only a reported pin as well, and so
// do the three datastore hosts, under the Use Built-in toggle a pinned host overrides, and every other setting a
// save writes, after the row that holds its field (a note inside a narrow port field would not fit).
- const pinNote = (envKey: string) =>
+ const pinNote = (envKey: string, note = 'infrastructure.envPinNote') =>
infraStatus?.envPinned?.includes(envKey) ? (
<p className="env-pin-note">
- <AlertTriangle size={14} /> {t('infrastructure.envPinNote', { name: envKey })}
+ <AlertTriangle size={14} /> {t(note, { name: envKey })}
</p>
) : null;
+ // A pinned *_BUILTIN flag decides only whether the boot starts the bundled container, at every boot while it is
+ // true; whether the service uses it follows its host. Beside a host pinned elsewhere the boot starts nothing.
+ const flagPinNote = (flagKey: string, profile: string) =>
+ pinNote(
+ flagKey,
+ infraStatus.envPinned?.includes(HOST_KEY[profile]) &&
+ !namesBundledContainer(profile, nextBootHost(profile, savedConfig))
+ ? 'infrastructure.envPinNote'
+ : 'infrastructure.envPinFlagNote',
+ );
const settingNote = (envKey: string, running: unknown, saved: unknown) => {
if (infraStatus?.envPinned?.includes(envKey)) return pinNote(envKey);
// Hidden only while the save request is in flight (`configSave.saving`).
@@ -374,7 +384,7 @@ export function Infrastructure() {
namesBundledContainer('postgres', infraStatus.database.host),
)}
{pinNote('DATABASE_HOST')}
- {pinNote('POSTGRES_BUILTIN')}
+ {flagPinNote('POSTGRES_BUILTIN', 'postgres')}
{!configForm.dbConfig.builtIn && (
<div className="config-form">
@@ -688,7 +698,7 @@ export function Infrastructure() {
namesBundledContainer('redis', infraStatus.redis.host),
)}
{pinNote('REDIS_HOST')}
- {pinNote('REDIS_BUILTIN')}
+ {flagPinNote('REDIS_BUILTIN', 'redis')}
{!configForm.redisConfig.builtIn && (
<div className="config-form">
@@ -892,7 +902,7 @@ export function Infrastructure() {
namesBundledContainer('minio', infraStatus.storage.endpoint),
)}
{pinNote('S3_ENDPOINT')}
- {pinNote('MINIO_BUILTIN')}
+ {flagPinNote('MINIO_BUILTIN', 'minio')}
{!configForm.storageConfig.builtIn && (
<>