# Project justice Git สำหรับเก็บ 1. **Nginx** ของ `https://srv1361159.hstgr.cloud` 2. **เว็บทั้งหมด** ใต้ `/var/www/html/` (mirror ใน `www/html/`) — **ไม่รวม** `node_modules` (ติดตั้งบนเซิร์ฟเวอร์ด้วย `npm ci` ตาม `package-lock.json`) ## Layout | พาธใน repo | ความหมาย | |------------|-----------| | `nginx/srv1361159.hstgr.cloud` | vhost → `/etc/nginx/sites-available/srv1361159.hstgr.cloud` | | `www/html/` | mirror → `/var/www/html/` | ## Nginx ```bash sudo /root/repos/justice/scripts/deploy-nginx.sh ``` ดึงจาก `/etc` เข้า repo แล้ว push: ```bash /root/repos/justice/scripts/save-from-etc.sh "ข้อความ commit" ``` ## เว็บ (`/var/www/html`) หลังแก้ใน repo แล้วไป production (**ทุกครั้ง** ที่ต้องการให้ `/var/www/html` ตรงกับ `www/html/` ใน repo — path คนละตัว ไม่ sync เอง): ```bash sudo /root/repos/justice/scripts/deploy-www.sh ``` **ฉากแมป (`Game/data/maps/*.json`):** สคริปต์ deploy **ไม่ทับ** ไฟล์ที่มีอยู่บนเซิร์ฟแล้ว (กันหายหลังบันทึกจาก Editor) — คัดลอกจาก repo เฉพาะรหัสที่ยังไม่มีบนเซิร์ฟ · ถ้าต้องการอัปเดตฉากจาก repo ให้ลบไฟล์นั้นบนเซิร์ฟก่อน หรือรัน `save-www-from-etc.sh` เพื่อดึงจากเซิร์ฟเข้า repo แล้วค่อย deploy กฎ Cursor: `.cursor/rules/sync-var-www-html.mdc` (และที่ workspace `/root`: `~/.cursor/rules/justice-sync-var-www-html.mdc`) ให้ช่วยเตือน/รันหลังแก้ `www/html`. ดึงจากเซิร์ฟเวอร์เข้า repo + commit + push: ```bash /root/repos/justice/scripts/save-www-from-etc.sh "ข้อความ commit" ``` บนเซิร์ฟเวอร์ หลัง clone หรือ pull ถ้าไม่มี `node_modules`: ```bash cd /var/www/html/Game && npm ci cd /var/www/html/realtimechat && npm ci ``` ## Remote - https://git.srv1361159.hstgr.cloud/giteaadmin/justice.git ## ความปลอดภัย โฟลเดอร์ `Admin/private/` อาจมีข้อมูลอ่อนไหว — อย่าเปิด repo เป็นสาธารณะถ้าไม่ต้องการให้เห็นข้อมูลนั้น