Replace the landing with the artifact design and rebuild the admin in Ant Design.
Adds consultation leads, section editors, and the one-time content reset for this release. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -104,11 +104,63 @@ curl -sI http://127.0.0.1:3051/
|
||||
### ۷) Nginx
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /etc/nginx/snippets /var/www/certbot
|
||||
sudo cp /var/www/montech/deploy/nginx-montech-locations.conf /etc/nginx/snippets/montech-locations.conf
|
||||
# First time (before cert exists): use HTTP-only — see step 7b
|
||||
sudo cp /var/www/montech/deploy/nginx-montech.ir.conf /etc/nginx/sites-available/montech.ir
|
||||
sudo ln -sf /etc/nginx/sites-available/montech.ir /etc/nginx/sites-enabled/
|
||||
sudo nginx -t && sudo systemctl reload nginx
|
||||
```
|
||||
|
||||
### ۷b) SSL مستقیم روی سرور (certbot + :443)
|
||||
|
||||
**نکته WCDN:** اگر DNS دامنه روی CDN است، Let's Encrypt ممکن است به origin نرسد. یکی از اینها:
|
||||
|
||||
- موقتاً رکورد A را مستقیم روی `185.50.38.53` بگذار، گواهی بگیر، بعد دوباره CDN را وصل کن و Origin را HTTPS کن؛ یا
|
||||
- مطمئن شو WCDN درخواستهای `/.well-known/acme-challenge/` را به origin روی HTTP:80 پاس میدهد.
|
||||
|
||||
```bash
|
||||
# 1) پکیجها
|
||||
sudo apt update
|
||||
sudo apt install -y certbot python3-certbot-nginx
|
||||
|
||||
# 2) تا قبل از وجود گواهی، بلاک :443 را موقتاً از سایت بردار
|
||||
# (یا فقط server :80 را نگه دار) و nginx را reload کن
|
||||
sudo nano /etc/nginx/sites-available/montech.ir
|
||||
# کل بلوک server { listen 443 ... } را کامنت کن
|
||||
sudo nginx -t && sudo systemctl reload nginx
|
||||
|
||||
# 3) گرفتن گواهی (وبروت — با مسیر ACME در snippet)
|
||||
sudo mkdir -p /var/www/certbot
|
||||
sudo certbot certonly --webroot -w /var/www/certbot \
|
||||
-d montech.ir -d www.montech.ir \
|
||||
--email admin@montech.ir --agree-tos --no-eff-email
|
||||
|
||||
# یا با پلاگین nginx (اگر بلاک 443 کامنت است و :80 فعال):
|
||||
# sudo certbot --nginx -d montech.ir -d www.montech.ir
|
||||
|
||||
# 4) فعال کردن :443
|
||||
sudo cp /var/www/montech/deploy/nginx-montech-locations.conf /etc/nginx/snippets/montech-locations.conf
|
||||
sudo cp /var/www/montech/deploy/nginx-montech.ir.conf /etc/nginx/sites-available/montech.ir
|
||||
sudo nginx -t && sudo systemctl reload nginx
|
||||
|
||||
# 5) تست لوکال
|
||||
curl -skI https://127.0.0.1/ -H 'Host: montech.ir'
|
||||
ss -tlnp | grep ':443'
|
||||
|
||||
# 6) تمدید خودکار
|
||||
sudo certbot renew --dry-run
|
||||
```
|
||||
|
||||
بعد در پنل WCDN:
|
||||
|
||||
- Origin protocol = **HTTPS**
|
||||
- Origin port = **443**
|
||||
- حالت SSL = **Full** (اگر گواهی معتبر Let's Encrypt داری میتوانی Full Strict هم بزنی)
|
||||
- کش را Purge کن
|
||||
|
||||
اگر فقط میخواهی 502 برطرف شود و SSL روی CDN کافی است، Origin را **HTTP:80** بگذار و این مرحله را لازم نداری.
|
||||
|
||||
### ۸) تست
|
||||
|
||||
1. `https://montech.ir` → لندینگ
|
||||
@@ -117,3 +169,41 @@ sudo nginx -t && sudo systemctl reload nginx
|
||||
4. `https://montech.ir/api/health` → `{ ok: true }`
|
||||
|
||||
پاک نکنید: `uploads/` و `apps/api/.env`
|
||||
|
||||
---
|
||||
|
||||
## One-time release: artifact landing + Ant Design admin (2026-10)
|
||||
|
||||
This release replaces the landing content model, adds the `Lead` table and new dependencies on all apps.
|
||||
Run it once instead of the quick update above.
|
||||
|
||||
```bash
|
||||
ssh -p 3031 montime@185.50.38.53
|
||||
cd /var/www/montech
|
||||
|
||||
# 1) Back up the database first (the migration deletes legacy landing sections)
|
||||
pg_dump -h 127.0.0.1 -p 15432 -U montech -Fc montech > ~/montech-$(date +%F).dump
|
||||
|
||||
git pull
|
||||
npm ci # new deps: gsap, lenis, tailwindcss@3, ant-design-vue, …
|
||||
|
||||
npm run build -w @montech/shared
|
||||
cd apps/api
|
||||
npx prisma migrate deploy # creates "Lead", removes marquee/manifesto/services/work/process/stats/team
|
||||
npx prisma generate
|
||||
SEED_RESET_CONTENT=1 npx prisma db seed # overwrites settings, page SEO and sections with the artifact content
|
||||
cd ../..
|
||||
|
||||
npm run build -w @montech/api
|
||||
npm run build -w @montech/adm
|
||||
npm run build -w @montech/landing
|
||||
pm2 restart montech-api montech-landing
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- Without `SEED_RESET_CONTENT=1` the seed only creates missing rows and never overwrites admin edits. Use the flag only for this release.
|
||||
- Contact phone/email/address and socials are edited in **Admin → تنظیمات سایت** and feed the landing footer.
|
||||
- Consultation requests from the landing are listed in **Admin → درخواستهای مشاوره** (`POST /api/public/leads`, rate limited to 5 per IP per 10 minutes).
|
||||
- The landing caches pages with stale-while-revalidate (`/` 30s, blog/gallery 120s), so admin edits appear within that window.
|
||||
- Verify after deploy: `curl -s https://montech.ir/robots.txt`, `curl -s https://montech.ir/sitemap.xml`, submit a test consultation and check it in the admin.
|
||||
|
||||
Reference in New Issue
Block a user