Generate random platform subdomains for apps without custom domains.

Assign unpredictable subdomains on create when no custom domain is set, and update deploy UI CNAME hints to reference the app Platform Domain after creation.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
keyhan
2026-05-26 19:55:44 +03:30
parent d7594df9a0
commit 20c4184cde
2 changed files with 35 additions and 17 deletions
+4 -16
View File
@@ -2086,7 +2086,7 @@ export default function DeployPage() {
Type: <strong>CNAME</strong>
</p>
<p className="text-xs font-mono bg-gray-50 rounded px-2 py-1">
Value: <strong>{form.name}-{(user?.id || '').split('-')[0]}.apps.cloudhost.ir</strong>
Value: <strong>your app Platform Domain (after creation)</strong>
</p>
</div>
<p>4. If using a root domain (without www), use a registrar that supports CNAME flattening (e.g. Cloudflare).</p>
@@ -2096,20 +2096,8 @@ export default function DeployPage() {
{/* CNAME target copy box */}
<div className="mt-3 bg-blue-50 rounded-lg p-3 border border-blue-100">
<p className="text-xs text-blue-700 font-medium mb-1">CNAME Target:</p>
<div className="flex items-center gap-2">
<code className="text-sm font-mono text-blue-900 bg-blue-100 px-2 py-1 rounded flex-1 truncate">
{form.name}-{(user?.id || '').split('-')[0]}.apps.cloudhost.ir
</code>
<button
type="button"
onClick={() => {
navigator.clipboard.writeText(`${form.name}-${(user?.id || '').split('-')[0]}.apps.cloudhost.ir`);
toast.success('Copied!');
}}
className="text-blue-600 hover:text-blue-800 p-1 shrink-0"
>
<Copy className="w-4 h-4" />
</button>
<div className="text-sm text-blue-900 bg-blue-100 px-2 py-1 rounded">
After the app is created, open its page and copy the Platform Domain value shown in the Domains/Settings section.
</div>
</div>
</div>
@@ -3055,7 +3043,7 @@ export default function DeployPage() {
<div className="mt-4 bg-gray-50 rounded-lg p-3 border border-gray-200">
<p className="text-xs font-medium text-gray-600 mb-1">Required CNAME record:</p>
<code className="text-xs font-mono text-gray-800">
{customDomainInput} {form.name}-{(user?.id || '').split('-')[0]}.apps.cloudhost.ir
{customDomainInput} your app Platform Domain (after creation)
</code>
</div>
</div>