Skip to content

Commit 00ace75

Browse files
fix[frontend](integrations): added https certificates load before enabling integrations where need
1 parent 2bc8106 commit 00ace75

10 files changed

Lines changed: 54 additions & 5 deletions

File tree

frontend/src/features/integrations/components/setup/CustomSetup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ export function CustomSetup({ integration }: { integration: Integration }) {
117117
/>
118118
</label>
119119

120-
{/* TLS needs certificates loaded first. */}
121-
{proto === 'tls' && (
120+
{/* TLS and HTTPS need certificates loaded first. */}
121+
{(proto === 'tls' || proto === 'https') && (
122122
<div className="mb-3">
123123
<p className="mb-1.5 text-[11px] font-medium text-muted-foreground">{t(`${ROOT}.choose.tlsFirst`)}</p>
124124
<CodeBlock code={tlsCertsCmd} />

frontend/src/features/integrations/components/setup/collector/ForwarderGuide.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,25 @@ function TLSSection({ sourceType, port }: { sourceType: string; port: string })
146146
)
147147
}
148148

149+
// ── HTTPS certificates step ───────────────────────────────────────────────────
150+
151+
// Required (not collapsible) cert-loading step for collectors whose listener is
152+
// natively HTTPS — same command CustomSetup shows for the tls protocol.
153+
export function HttpsCertsSection({ step, port }: { step: number; port: string }) {
154+
const { t } = useTranslation()
155+
const loadCmd = `/opt/utmstack-forwarder/utmstack_forwarder load-tls-certs /path/to/cert.crt /path/to/key.key`
156+
157+
return (
158+
<Section title={t(`${SHARED}.httpsCerts.title`)} step={step}>
159+
<p className="mb-2 text-sm text-foreground/90">{t(`${SHARED}.httpsCerts.body`, { port })}</p>
160+
<CodeBlock code={loadCmd} />
161+
<p className="mt-2 rounded-md bg-muted/40 px-3 py-2 text-[11px] text-muted-foreground">
162+
{t(`${SHARED}.tls.step1Note`)}
163+
</p>
164+
</Section>
165+
)
166+
}
167+
149168
// ── Forwarder install section ─────────────────────────────────────────────────
150169

151170
export function ForwarderInstall({ source }: { source: string }) {

frontend/src/features/integrations/components/setup/collector/collectors/github.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useTranslation, Trans } from 'react-i18next'
22
import { registerCollector } from '../registry'
3-
import { ForwarderGuide, forwarderHost } from '../ForwarderGuide'
3+
import { ForwarderGuide, HttpsCertsSection, forwarderHost } from '../ForwarderGuide'
44
import { Section } from '@/features/integrations/components/ui/Section'
55
import { CodeBlock } from '@/features/integrations/components/ui/CodeBlock'
66
import type { Integration } from '@/features/integrations/types'
@@ -16,7 +16,9 @@ function GithubGuide({ module: _module }: { module: Integration }) {
1616

1717
return (
1818
<ForwarderGuide source={t(`${ROOT}.source`)} port={PORT} sourceType="github" hideTLS>
19-
<Section title={t(`${ROOT}.step1.title`)} step={2}>
19+
<HttpsCertsSection step={2} port={PORT} />
20+
21+
<Section title={t(`${ROOT}.step1.title`)} step={3}>
2022
<p className="mb-2 text-sm text-foreground/90">{t(`${ROOT}.step1.body`)}</p>
2123
<CodeBlock code="sudo /opt/utmstack-forwarder/utmstack_forwarder enable-integration github https" />
2224
<p className="mt-2 rounded-md bg-amber-500/10 border border-amber-500/30 px-3 py-2 text-[11px] text-amber-700 dark:text-amber-400">
@@ -28,7 +30,7 @@ function GithubGuide({ module: _module }: { module: Integration }) {
2830
<p className="text-sm text-foreground/90">{t(`${ROOT}.certWarning.body`)}</p>
2931
</Section>
3032

31-
<Section title={t(`${ROOT}.step2.title`)} step={3}>
33+
<Section title={t(`${ROOT}.step2.title`)} step={4}>
3234
<p className="mb-3 text-sm text-foreground/90">{t(`${ROOT}.step2.body`)}</p>
3335
<img
3436
src={`${IMG}/webhook.png`}

frontend/src/shared/i18n/locales/de.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,6 +2705,10 @@
27052705
"step1Note": "Ein optionales CA-Zertifikat kann als drittes Argument hinzugefügt werden. Lassen Sie es weg, um das Blattzertifikat als CA zu verwenden.",
27062706
"step2": "2 · Listener mit TLS erneut aktivieren"
27072707
},
2708+
"httpsCerts": {
2709+
"title": "TLS-Zertifikat auf den Forwarder laden",
2710+
"body": "Diese Integration verwendet einen HTTPS-Listener auf Port {{port}}, daher müssen vor der Aktivierung ein Zertifikat und ein Schlüssel auf dem Forwarder geladen werden:"
2711+
},
27082712
"uninstall": {
27092713
"title": "Optional – Forwarder deinstallieren",
27102714
"body": "Führen Sie diesen Befehl auf dem Host aus, auf dem der Forwarder installiert ist, um den Dienst zu beenden und alle zugehörigen Dateien zu entfernen."

frontend/src/shared/i18n/locales/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,6 +2740,10 @@
27402740
"step1Note": "An optional CA certificate can be added as a third argument. Omit it to use the leaf certificate as CA.",
27412741
"step2": "2 · Re-enable the listener using TLS"
27422742
},
2743+
"httpsCerts": {
2744+
"title": "Load the TLS certificate on the Forwarder",
2745+
"body": "This integration uses an HTTPS listener on port {{port}}, so the Forwarder needs a certificate and key loaded before enabling it:"
2746+
},
27432747
"uninstall": {
27442748
"title": "Optional — Uninstall the Forwarder",
27452749
"body": "Run this command on the host where the Forwarder is installed to stop the service and remove all its files."

frontend/src/shared/i18n/locales/es.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,10 @@
18071807
"step1Note": "Puedes agregar un certificado CA como tercer argumento. Si se omite, se usa el certificado hoja como CA.",
18081808
"step2": "2 · Rehabilitar el listener con TLS"
18091809
},
1810+
"httpsCerts": {
1811+
"title": "Carga el certificado TLS en el Forwarder",
1812+
"body": "Esta integración usa un listener HTTPS en el puerto {{port}}, por lo que el Forwarder necesita un certificado y una clave cargados antes de habilitarla:"
1813+
},
18101814
"uninstall": {
18111815
"title": "Opcional — Desinstalar el Forwarder",
18121816
"body": "Ejecuta este comando en el host donde está instalado el Forwarder para detener el servicio y eliminar todos sus archivos."

frontend/src/shared/i18n/locales/fr.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,6 +2705,10 @@
27052705
"step1Note": "Un certificat CA facultatif peut être ajouté comme troisième argument. Omettez-le pour utiliser le certificat feuille comme CA.",
27062706
"step2": "2 · Réactiver le listener avec TLS"
27072707
},
2708+
"httpsCerts": {
2709+
"title": "Chargez le certificat TLS sur le Forwarder",
2710+
"body": "Cette intégration utilise un listener HTTPS sur le port {{port}}, le Forwarder a donc besoin d'un certificat et d'une clé chargés avant de l'activer :"
2711+
},
27082712
"uninstall": {
27092713
"title": "Optionnel — Désinstaller le Forwarder",
27102714
"body": "Exécutez cette commande sur l'hôte où le Forwarder est installé pour arrêter le service et supprimer tous ses fichiers."

frontend/src/shared/i18n/locales/it.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,6 +2705,10 @@
27052705
"step1Note": "È possibile aggiungere un certificato CA facoltativo come terzo argomento. Omettilo per utilizzare il certificato foglia come CA.",
27062706
"step2": "2 · Riabilita il listener usando TLS"
27072707
},
2708+
"httpsCerts": {
2709+
"title": "Carica il certificato TLS sul Forwarder",
2710+
"body": "Questa integrazione usa un listener HTTPS sulla porta {{port}}, quindi il Forwarder richiede un certificato e una chiave caricati prima di abilitarla:"
2711+
},
27082712
"uninstall": {
27092713
"title": "Facoltativo — Disinstalla il Forwarder",
27102714
"body": "Esegui questo comando sull'host in cui è installato il Forwarder per interrompere il servizio e rimuovere tutti i suoi file."

frontend/src/shared/i18n/locales/pt.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,10 @@
18071807
"step1Note": "Um certificado CA opcional pode ser adicionado como terceiro argumento. Se omitido, o certificado folha é usado como CA.",
18081808
"step2": "2 · Reativar o listener com TLS"
18091809
},
1810+
"httpsCerts": {
1811+
"title": "Carregue o certificado TLS no Forwarder",
1812+
"body": "Esta integração usa um listener HTTPS na porta {{port}}, então o Forwarder precisa de um certificado e uma chave carregados antes de habilitá-la:"
1813+
},
18101814
"uninstall": {
18111815
"title": "Opcional — Desinstalar o Forwarder",
18121816
"body": "Execute este comando no host onde o Forwarder está instalado para parar o serviço e remover todos os seus arquivos."

frontend/src/shared/i18n/locales/ru.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2605,6 +2605,10 @@
26052605
"step1Note": "Дополнительный сертификат CA можно передать третьим аргументом. Если его опустить, в роли CA будет использован конечный сертификат.",
26062606
"step2": "2 · Повторно включить прослушиватель с TLS"
26072607
},
2608+
"httpsCerts": {
2609+
"title": "Загрузите TLS-сертификат на Forwarder",
2610+
"body": "Эта интеграция использует HTTPS-прослушиватель на порту {{port}}, поэтому перед её включением на Forwarder необходимо загрузить сертификат и ключ:"
2611+
},
26082612
"uninstall": {
26092613
"title": "Дополнительно — Удалить Forwarder",
26102614
"body": "Выполните эту команду на хосте, где установлен Forwarder, чтобы остановить службу и удалить все её файлы."

0 commit comments

Comments
 (0)