From 60e22bf7e3272c1feafe73a383fddb404ced5b5d Mon Sep 17 00:00:00 2001 From: Hydra de lerne <162022179+Hydralerne@users.noreply.github.com> Date: Fri, 13 Nov 2026 19:39:32 +0200 Subject: [PATCH 01/19] fix(cloud): limit the update banner to verified workload security (#1748) * fix(cloud): suppress installation release notices in managed dashboards * fix(cloud): use only verified security in the update banner --- apps/dashboard/src/app/(dashboard)/layout.tsx | 7 ++- .../updates/useUpdates.requests.test.tsx | 46 ++++++++++++++++--- .../src/components/updates/useUpdates.ts | 8 ++-- docs/dashboard-design.md | 3 ++ 4 files changed, 48 insertions(+), 16 deletions(-) diff --git a/apps/dashboard/src/app/(dashboard)/layout.tsx b/apps/dashboard/src/app/(dashboard)/layout.tsx index abb88ac76..cc8c81f0c 100644 --- a/apps/dashboard/src/app/(dashboard)/layout.tsx +++ b/apps/dashboard/src/app/(dashboard)/layout.tsx @@ -173,10 +173,9 @@ export default async function DashboardLayout({ children }: { children: React.Re hostDomain={deploymentInfo.hostDomain} >
{emailParam - ? interpolate(t.auth.verifyEmail.pendingSentTo, { email: emailParam }) + ? interpolate( + fromSignup ? t.auth.verifyEmail.signupSentTo : t.auth.verifyEmail.pendingSentTo, + { email: emailParam }, + ) : t.auth.verifyEmail.pendingGeneric}
@@ -264,10 +269,17 @@ function VerifyEmailContent() {+ {t.auth.register.hasAccount}{" "} - {t.auth.verifyEmail.backToSignIn} + {t.auth.register.signIn}
+ + {t.auth.forgotPassword.title} + ); diff --git a/apps/dashboard/src/i18n/locales/ar/auth.json b/apps/dashboard/src/i18n/locales/ar/auth.json index a414e78af..3f552cd63 100644 --- a/apps/dashboard/src/i18n/locales/ar/auth.json +++ b/apps/dashboard/src/i18n/locales/ar/auth.json @@ -70,6 +70,8 @@ "errorDescription": "قد يكون الرمز غير صحيح أو منتهي الصلاحية.", "resendEmail": "إعادة إرسال الرمز", "signIn": "تسجيل الدخول", + "signupTitle": "تحقق من بريدك الإلكتروني", + "signupSentTo": "أرسلنا الخطوة التالية إلى {email}. أدخل الرمز أدناه إذا وصلك، أو اتبع تعليمات تسجيل الدخول في الرسالة.", "pendingTitle": "تحقق من بريدك الإلكتروني", "pendingSentTo": "أرسلنا رمزًا من ٦ أرقام إلى {email}. أدخله أدناه للتحقق من بريدك الإلكتروني.", "pendingGeneric": "أدخل رمز التحقق الذي أرسلناه إلى بريدك الإلكتروني.", diff --git a/apps/dashboard/src/i18n/locales/de/auth.json b/apps/dashboard/src/i18n/locales/de/auth.json index c09e5fb7b..10a58a691 100644 --- a/apps/dashboard/src/i18n/locales/de/auth.json +++ b/apps/dashboard/src/i18n/locales/de/auth.json @@ -70,6 +70,8 @@ "errorDescription": "Der Code ist möglicherweise falsch oder abgelaufen.", "resendEmail": "Code erneut senden", "signIn": "Anmelden", + "signupTitle": "Prüfe deine E-Mails", + "signupSentTo": "Wir haben den nächsten Schritt an {email} gesendet. Gib unten den erhaltenen Code ein oder folge den Anweisungen zur Anmeldung in der E-Mail.", "pendingTitle": "Verifizieren Sie Ihre E-Mail-Adresse", "pendingSentTo": "Wir haben einen 6-stelligen Code an {email} gesendet. Geben Sie ihn unten ein, um Ihre E-Mail-Adresse zu verifizieren.", "pendingGeneric": "Geben Sie den Verifizierungscode aus unserer E-Mail ein.", diff --git a/apps/dashboard/src/i18n/locales/en/auth.json b/apps/dashboard/src/i18n/locales/en/auth.json index 986626bc2..99cd7ac94 100644 --- a/apps/dashboard/src/i18n/locales/en/auth.json +++ b/apps/dashboard/src/i18n/locales/en/auth.json @@ -70,6 +70,8 @@ "errorDescription": "The code may be incorrect or expired.", "resendEmail": "Resend code", "signIn": "Sign in", + "signupTitle": "Check your email", + "signupSentTo": "We've emailed the next step to {email}. Enter a code below if you received one, or follow the sign-in instructions in the email.", "pendingTitle": "Verify your email", "pendingSentTo": "We emailed a 6-digit code to {email}. Enter it below to verify your email.", "pendingGeneric": "Enter the verification code we emailed you.", diff --git a/apps/dashboard/src/i18n/locales/es/auth.json b/apps/dashboard/src/i18n/locales/es/auth.json index fbdb9cc79..664897987 100644 --- a/apps/dashboard/src/i18n/locales/es/auth.json +++ b/apps/dashboard/src/i18n/locales/es/auth.json @@ -70,6 +70,8 @@ "errorDescription": "Puede que el código sea incorrecto o haya caducado.", "resendEmail": "Reenviar código", "signIn": "Iniciar sesión", + "signupTitle": "Revisa tu correo", + "signupSentTo": "Hemos enviado el siguiente paso a {email}. Introduce el código abajo si has recibido uno, o sigue las instrucciones para iniciar sesión del correo.", "pendingTitle": "Verifica tu correo electrónico", "pendingSentTo": "Enviamos un código de 6 dígitos a {email}. Introdúcelo a continuación para verificar tu correo electrónico.", "pendingGeneric": "Introduce el código de verificación que te enviamos por correo electrónico.", diff --git a/apps/dashboard/src/i18n/locales/fr/auth.json b/apps/dashboard/src/i18n/locales/fr/auth.json index d7c1c0c8c..79ef148e7 100644 --- a/apps/dashboard/src/i18n/locales/fr/auth.json +++ b/apps/dashboard/src/i18n/locales/fr/auth.json @@ -70,6 +70,8 @@ "errorDescription": "Le code est peut-être incorrect ou a expiré.", "resendEmail": "Renvoyer le code", "signIn": "Se connecter", + "signupTitle": "Consultez votre messagerie", + "signupSentTo": "Nous avons envoyé la prochaine étape à {email}. Saisissez le code ci-dessous si vous en avez reçu un, ou suivez les instructions de connexion dans le message.", "pendingTitle": "Vérifiez votre e-mail", "pendingSentTo": "Nous avons envoyé un code à 6 chiffres à {email}. Saisissez-le ci-dessous pour vérifier votre e-mail.", "pendingGeneric": "Saisissez le code de vérification que nous vous avons envoyé par e-mail.", diff --git a/apps/dashboard/src/i18n/locales/ja/auth.json b/apps/dashboard/src/i18n/locales/ja/auth.json index adee5359f..923dda1b1 100644 --- a/apps/dashboard/src/i18n/locales/ja/auth.json +++ b/apps/dashboard/src/i18n/locales/ja/auth.json @@ -70,6 +70,8 @@ "errorDescription": "コードが正しくないか、有効期限が切れている可能性があります。", "resendEmail": "コードを再送信", "signIn": "サインイン", + "signupTitle": "メールを確認してください", + "signupSentTo": "次の手順を {email} に送信しました。コードを受け取った場合は下に入力し、それ以外の場合はメールのログイン手順に従ってください。", "pendingTitle": "メールアドレスを確認", "pendingSentTo": "{email} に6桁のコードを送信しました。メールアドレスを確認するには、以下に入力してください。", "pendingGeneric": "メールでお送りした確認コードを入力してください。", diff --git a/apps/dashboard/src/i18n/locales/pt/auth.json b/apps/dashboard/src/i18n/locales/pt/auth.json index 733f24529..ec7e52fe1 100644 --- a/apps/dashboard/src/i18n/locales/pt/auth.json +++ b/apps/dashboard/src/i18n/locales/pt/auth.json @@ -70,6 +70,8 @@ "errorDescription": "O código pode estar incorreto ou expirado.", "resendEmail": "Reenviar código", "signIn": "Entrar", + "signupTitle": "Verifique seu e-mail", + "signupSentTo": "Enviamos o próximo passo para {email}. Insira o código abaixo se recebeu um, ou siga as instruções de acesso no e-mail.", "pendingTitle": "Verifique seu email", "pendingSentTo": "Enviamos um código de 6 dígitos para {email}. Digite-o abaixo para verificar seu email.", "pendingGeneric": "Digite o código de verificação que enviamos por email.", diff --git a/apps/dashboard/src/i18n/locales/ru/auth.json b/apps/dashboard/src/i18n/locales/ru/auth.json index d823d4c10..ebc8bd0b0 100644 --- a/apps/dashboard/src/i18n/locales/ru/auth.json +++ b/apps/dashboard/src/i18n/locales/ru/auth.json @@ -70,6 +70,8 @@ "errorDescription": "Код неверен или срок его действия истёк.", "resendEmail": "Отправить код повторно", "signIn": "Войти", + "signupTitle": "Проверьте почту", + "signupSentTo": "Мы отправили дальнейшие инструкции на {email}. Если вы получили код, введите его ниже. В противном случае следуйте инструкциям для входа в письме.", "pendingTitle": "Подтвердите вашу эл. почту", "pendingSentTo": "Мы отправили 6-значный код на {email}. Введите его ниже для подтверждения эл. почты.", "pendingGeneric": "Введите код подтверждения, отправленный вам по эл. почте.", diff --git a/apps/dashboard/src/i18n/locales/tr/auth.json b/apps/dashboard/src/i18n/locales/tr/auth.json index d99c7b079..299fd24a7 100644 --- a/apps/dashboard/src/i18n/locales/tr/auth.json +++ b/apps/dashboard/src/i18n/locales/tr/auth.json @@ -70,6 +70,8 @@ "errorDescription": "Kod hatalı veya süresi dolmuş olabilir.", "resendEmail": "Kodu tekrar gönder", "signIn": "Giriş yap", + "signupTitle": "E-postanızı kontrol edin", + "signupSentTo": "Sonraki adımı {email} adresine gönderdik. Bir kod aldıysanız aşağıya girin veya e-postadaki giriş talimatlarını izleyin.", "pendingTitle": "E-postanızı doğrulayın", "pendingSentTo": "{email} adresine 6 haneli bir kod gönderdik. E-postanızı doğrulamak için aşağıya girin.", "pendingGeneric": "Size e-posta ile gönderdiğimiz doğrulama kodunu girin.", diff --git a/apps/dashboard/src/i18n/locales/zh/auth.json b/apps/dashboard/src/i18n/locales/zh/auth.json index d5b6eaf90..3cb32f509 100644 --- a/apps/dashboard/src/i18n/locales/zh/auth.json +++ b/apps/dashboard/src/i18n/locales/zh/auth.json @@ -70,6 +70,8 @@ "errorDescription": "该验证码可能不正确或已过期。", "resendEmail": "重新发送验证码", "signIn": "登录", + "signupTitle": "请查收邮件", + "signupSentTo": "我们已将后续步骤发送至 {email}。如果您收到了验证码,请在下方输入;否则,请按照邮件中的登录说明操作。", "pendingTitle": "验证你的邮箱", "pendingSentTo": "我们已将 6 位验证码发送至 {email}。请在下方输入验证码以验证你的邮箱。", "pendingGeneric": "请输入我们通过邮件发送的验证码。", diff --git a/packages/platform/src/engine/lib/auth.ts b/packages/platform/src/engine/lib/auth.ts index dd1d25a48..0528fa7fb 100644 --- a/packages/platform/src/engine/lib/auth.ts +++ b/packages/platform/src/engine/lib/auth.ts @@ -17,6 +17,7 @@ import { resetPasswordOtpEmail, verifyEmailTemplate, verifyOtpEmailTemplate, + existingAccountEmail, } from "./email-templates"; import { provisionUser } from "./provision-user"; import { oidcOAuthPlugin } from "./oidc"; @@ -176,6 +177,23 @@ export const auth = betterAuth({ configured, so a platform-mailbox instance isn't locked out by a transient mail-server fault mid-signup. */ requireEmailVerification: isSaasDeployment ? true : requireEmailVerificationStrict, + // Better Auth deliberately returns the same response for existing addresses. + // Continue privately by email without adding a credential or replacing a + // password on an account whose ownership has not been proved. + onExistingUserSignUp: async ({ user }): PromiseYou already have an OpenShip account. This signup attempt did not create another account or change your password.
+Sign in with your existing password, or use Google or GitHub if that is how you registered.
+ ${ctaButton(htmlEscape(login), "Sign in")} +To set or reset a password, request a password reset code.
+If you did not request this email, you can ignore it. Your account has not changed.
+ `), + text: `Hi ${user.name || "there"},\n\nYou already have an OpenShip account. This signup attempt did not create another account or change your password.\n\nSign in with your existing password, or use Google or GitHub if that is how you registered: ${login}\n\nTo set or reset a password, request a reset code: ${reset}\n\nIf you did not request this email, you can ignore it. Your account has not changed.`, + }; +} + /* ------------------------------------------------------------------ */ /* OTP codes (no links, for deliverability): verification + reset */ /* ------------------------------------------------------------------ */ From fef57589ef7fd40d03173ad6defa79e2e770dcf0 Mon Sep 17 00:00:00 2001 From: Hydra de lerne <162022179+Hydralerne@users.noreply.github.com> Date: Sat, 14 Nov 2026 00:59:37 +0200 Subject: [PATCH 03/19] Explain duplicate-container deployment recovery (#1751) --- .../compose-host-channel-notice.test.ts | 16 +++- .../deployments/resource-guidance.test.ts | 18 ++++ ...DeploymentContainerConflictNotice.test.tsx | 89 +++++++++++++++++++ .../DeploymentContainerConflictNotice.tsx | 61 +++++++++++++ .../compose/ComposeDeploymentProcessing.tsx | 3 +- .../src/i18n/locales/ar/deployments.json | 7 ++ .../src/i18n/locales/de/deployments.json | 7 ++ .../src/i18n/locales/en/deployments.json | 7 ++ .../src/i18n/locales/es/deployments.json | 7 ++ .../src/i18n/locales/fr/deployments.json | 7 ++ .../src/i18n/locales/ja/deployments.json | 7 ++ .../src/i18n/locales/pt/deployments.json | 7 ++ .../src/i18n/locales/ru/deployments.json | 7 ++ .../src/i18n/locales/tr/deployments.json | 7 ++ .../src/i18n/locales/zh/deployments.json | 7 ++ packages/core/src/errors.ts | 1 + .../modules/deployments/build-pipeline.ts | 15 +++- .../deployments/compose/deploy.service.ts | 14 ++- 18 files changed, 277 insertions(+), 10 deletions(-) create mode 100644 apps/dashboard/src/components/import-project/DeploymentContainerConflictNotice.test.tsx create mode 100644 apps/dashboard/src/components/import-project/DeploymentContainerConflictNotice.tsx diff --git a/apps/api/test/modules/deployments/compose-host-channel-notice.test.ts b/apps/api/test/modules/deployments/compose-host-channel-notice.test.ts index 58861d410..7ef67833d 100644 --- a/apps/api/test/modules/deployments/compose-host-channel-notice.test.ts +++ b/apps/api/test/modules/deployments/compose-host-channel-notice.test.ts @@ -1599,7 +1599,8 @@ describe("compose deploy — host channel unavailable", () => { expect(base.deployServiceWorkload).not.toHaveBeenCalled(); }); - it("refuses ambiguous duplicate containers before repairing or activating anything", async () => { + it.each([null, "server-original"])("refuses ambiguous duplicate containers on %s before repairing or activating anything", async (serverId) => { + h.previousDeployment.meta = { serverId }; const base = startingRuntime(); const liveContainer = (id: string, name: string) => ({ id, @@ -1665,11 +1666,18 @@ describe("compose deploy — host channel unavailable", () => { { executor: {} as CommandExecutor, hostPortTarget: localHostPortTarget, + serverId: serverId ?? undefined, }, ), - ).rejects.toThrow( - /more than one container matching active service "api".*no service activation/i, - ); + ).rejects.toMatchObject({ + code: "SERVICE_CONTAINER_CONFLICT", + message: expect.stringMatching(/more than one container matching active service "api".*no service activation/i), + details: { + projectId: "p1", serviceId: "svc-api", serviceName: "api", + containerNames: ["openship-app-api-a", "openship-app-api-b"], + serverId, workspaceId: null, + }, + }); expect(h.updateServiceDeployment).not.toHaveBeenCalled(); expect(h.allocateAndReservePinnedHostPort).not.toHaveBeenCalled(); diff --git a/apps/api/test/modules/deployments/resource-guidance.test.ts b/apps/api/test/modules/deployments/resource-guidance.test.ts index 3e0533151..68b7f89ee 100644 --- a/apps/api/test/modules/deployments/resource-guidance.test.ts +++ b/apps/api/test/modules/deployments/resource-guidance.test.ts @@ -237,3 +237,21 @@ it("retains resource guidance for a published partial rollout without turning it errorDetails: { resourceIssue: "storage-full" }, }); }); + + +it.each([true, false])("restores a container conflict on a Cloud=%s attempt without relabeling it as capacity", async (cloud) => { + const ctx = await attempt(cloud); + const details = { + projectId: ctx.project.id, + serviceId: "app-service", + containerNames: ["app-current", "app-duplicate"], + serverId: ctx.project.serverId ?? "ssh-original", + workspaceId: ctx.project.workspaceId, + }; + await onFailure(ctx, "More than one container matches the active service", undefined, { + errorCode: "SERVICE_CONTAINER_CONFLICT", errorDetails: details, + }); + expect(await getBuildSessionStatus(ctx.dep.id)).toMatchObject({ + status: "failed", errorCode: "SERVICE_CONTAINER_CONFLICT", errorDetails: details, + }); +}); diff --git a/apps/dashboard/src/components/import-project/DeploymentContainerConflictNotice.test.tsx b/apps/dashboard/src/components/import-project/DeploymentContainerConflictNotice.test.tsx new file mode 100644 index 000000000..838edb9f4 --- /dev/null +++ b/apps/dashboard/src/components/import-project/DeploymentContainerConflictNotice.test.tsx @@ -0,0 +1,89 @@ +// @vitest-environment happy-dom +import { act } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { afterEach, beforeEach, expect, it, vi } from "vitest"; +import { baseDictionary } from "@/i18n"; +import { + DEFAULT_CONFIG, + INITIAL_STATE, + type DeploymentContextType, +} from "@/context/deployment/types"; +import { DeploymentContainerConflictNotice } from "./DeploymentContainerConflictNotice"; + +let deployment: Pick{copy.description}
+ {names.length > 0 && ( +{name}
+
+ {copy.reference}: {state.deploymentId}
+
{t.billing.deployGate.checkoutOpened}
- - {t.billing.deployGate.continueCheckout} - +{t.billing.deployGate.checkoutOpened}
+{copy.catalogNoResults}
)} diff --git a/apps/dashboard/src/app/(dashboard)/deployments/components/DeploymentCard.tsx b/apps/dashboard/src/app/(dashboard)/deployments/components/DeploymentCard.tsx index 105bd759e..92eaf168a 100644 --- a/apps/dashboard/src/app/(dashboard)/deployments/components/DeploymentCard.tsx +++ b/apps/dashboard/src/app/(dashboard)/deployments/components/DeploymentCard.tsx @@ -8,10 +8,8 @@ import { DeploymentMenu } from "./DeploymentMenu"; import { CommitDetailsModal } from "./CommitDetailsModal"; import type { Deployment } from "../types"; import { formatDistanceToNow, formatBuildTime, getStatusConfig } from "../utils"; -import { ProjectStackIcon } from "@/components/shared/ProjectStackIcon"; -import { AppLogo } from "@/components/AppLogo"; +import { ProjectIcon } from "@/components/shared/ProjectIcon"; import { useI18n, interpolate } from "@/components/i18n-provider"; -import { useImageFallback } from "@/hooks/useImageFallback"; type ServiceStatusLabels = { deployed: string; @@ -122,7 +120,6 @@ export const DeploymentCard: React.FC{displayName} @@ -612,9 +614,7 @@ export function Sidebar({ mobileOpen = false, onCloseMobile }: { mobileOpen?: bo collapsed ? "justify-center" : "gap-3" }`} > -