diff --git a/apps/super-admin/src/pages/BusinessesPage.tsx b/apps/super-admin/src/pages/BusinessesPage.tsx index 9ebf11a..b4cf6f8 100644 --- a/apps/super-admin/src/pages/BusinessesPage.tsx +++ b/apps/super-admin/src/pages/BusinessesPage.tsx @@ -851,6 +851,7 @@ export function BusinessesPage() { deploySlug?: string | null gitRepoUrl?: string | null provisionError?: string | null + dnsError?: string | null } setData((prev) => { if (!prev) return prev @@ -875,12 +876,16 @@ export function BusinessesPage() { if (updated.provisionError) { showToast(`Domain updated to "${host}", but storefront setup failed.`, 'error') showToast(updated.provisionError, 'error') - } else if (gitRepoUrl && updated.deploySlug) { + } + if (updated.dnsError) { + showToast(`Domain updated to "${host}", but Arvan DNS failed.`, 'error') + showToast(updated.dnsError, 'error') + } else if (!updated.provisionError && gitRepoUrl && updated.deploySlug) { showToast( `Domain updated. Storefront deploy is ready on Websites.`, 'success', ) - } else { + } else if (!updated.provisionError) { showToast(`Domain updated to "${host}".`, 'success') } } else { @@ -895,6 +900,7 @@ export function BusinessesPage() { deploySlug?: string | null gitRepoUrl?: string | null provisionError?: string | null + dnsError?: string | null } setData((prev) => { if (!prev) return prev @@ -921,12 +927,16 @@ export function BusinessesPage() { if (created.provisionError) { showToast(`Domain "${host}" added, but storefront setup failed.`, 'error') showToast(created.provisionError, 'error') - } else if (gitRepoUrl && created.deploySlug) { + } + if (created.dnsError) { + showToast(`Domain "${host}" added, but Arvan DNS failed.`, 'error') + showToast(created.dnsError, 'error') + } else if (!created.provisionError && gitRepoUrl && created.deploySlug) { showToast( `Domain "${host}" added. Storefront deploy is ready on Websites.`, 'success', ) - } else { + } else if (!created.provisionError) { showToast(`Domain "${host}" added.`, 'success') } } diff --git a/docs/DEPLOY.md b/docs/DEPLOY.md index 76e6309..c3c4ec3 100644 --- a/docs/DEPLOY.md +++ b/docs/DEPLOY.md @@ -13,9 +13,8 @@ API: `https://api.meshkee.com/api/v1` (separate server). ## New tenant SSL (automatic) -1. Add business + domain in Super Admin (apex, e.g. `sanihome.ir`) -2. Add Arvan **A** records (DNS-only): `business` + `customer` → dashboards VPS IP -3. In Super Admin → **Websites** → **Sync SSL now** (or wait for cron ~2h) +1. Add business + domain in Super Admin (apex, e.g. `sanihome.ir`). The API writes Arvan records on that zone (`@` ANAME → `ns.meshkee.com`, `www` CNAME → the apex, plus `business` / `customer` / `api` CNAMEs to Meshkee hosts). The domain must already exist in Arvan. +2. In Super Admin → **Websites** → **Sync SSL now** (or wait for cron ~2h) Manual on the VPS: `sudo /opt/meshkee/dashboards/deploy/ssl-sync.sh` diff --git a/docs/PROJECT_CONTEXT.md b/docs/PROJECT_CONTEXT.md index d51cf46..460fdf1 100644 --- a/docs/PROJECT_CONTEXT.md +++ b/docs/PROJECT_CONTEXT.md @@ -3,7 +3,7 @@ > **For AI agents:** Read this file at the start of a new chat before making changes. > Update this document when a major feature is completed or architecture changes. -Last updated: August 13, 2026 +Last updated: August 14, 2026 --- @@ -138,7 +138,7 @@ Add to `/etc/hosts` (one line per tenant): |------|------| | `/login` | Login | | `/` | Home | -| `/businesses` | Businesses list (migrate-from-old + delete-data for portfolios/blogs(+news)/customers + categories; single-select). **Add domain** accepts optional Git repo URL → provisions storefront on websites VM and sets `deploy_slug` | +| `/businesses` | Businesses list (migrate-from-old + delete-data for portfolios/blogs(+news)/customers + categories; single-select). **Add domain** accepts optional Git repo URL → provisions storefront on websites VM and sets `deploy_slug`. Also upserts Arvan DNS (`@` ANAME → `ns.meshkee.com`, `www` CNAME → apex, `business`/`customer`/`api` CNAMEs). | | `/businesses/:businessId/invoices` | Business invoices list | | `/businesses/:businessId/invoices/new` | Issue invoice (full page) | | `/users` | Users (business filter: Customer vs Manager → Admin/Editor/Viewer; Admin assignable by super-admin only; owners locked) |