- common/crypto/crypto.util.ts: encrypt/decrypt (GCM, random 96-bit IV), format v1:base64(iv|tag|ct) - EncryptedTransformer applied to users.name + drivers.vehicle_plate (auto, no service change) - blindIndex (HMAC) helper for future searchable-field encryption (phone) - tolerant decrypt for legacy plaintext → no migration needed (varchar holds base64) - ENCRYPTION_KEY env + boot warning if unset; docs/16-encryption.md - fixes Siro's documented CBC+fixed-IV flaw Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
55 lines
1.9 KiB
Bash
55 lines
1.9 KiB
Bash
# ==== Tripz backend env (شغّل: cp .env.example .env) ====
|
|
# ملاحظة: السيرفر مشترك — كل شيء معزول ببادئة tripz و Redis DB غير الافتراضي (راجع docs/14)
|
|
|
|
NODE_ENV=development
|
|
API_PORT=4010 # منفذ غير شائع لتفادي التصادم على السيرفر المشترك
|
|
|
|
# ---- PostgreSQL (قاعدة مستقلة + بادئة جداول) ----
|
|
DB_HOST=postgres
|
|
DB_PORT=5432
|
|
DB_NAME=tripz
|
|
DB_USER=tripz
|
|
DB_PASSWORD=change_me_strong
|
|
DB_TABLE_PREFIX=tripz_
|
|
DB_SYNC=false # لا synchronize في الإنتاج — هجرات فقط
|
|
|
|
# ---- Redis (DB رقم 3 غير الافتراضي 0 + بادئة مفاتيح) ----
|
|
REDIS_HOST=redis
|
|
REDIS_PORT=6379
|
|
REDIS_DB=3
|
|
REDIS_KEY_PREFIX=tripz:
|
|
|
|
# ---- BullMQ ----
|
|
QUEUE_PREFIX=tripz_
|
|
|
|
# ---- Auth ----
|
|
JWT_SECRET=change_me_jwt_secret
|
|
|
|
# ---- تشفير الحقول الحساسة at-rest (AES-256-GCM) ----
|
|
# 32 بايت بصيغة hex (64 محرف). ولّده: openssl rand -hex 32
|
|
# إلزامي للإنتاج — بدونه يُستخدم مفتاح تطوير غير آمن
|
|
ENCRYPTION_KEY=
|
|
JWT_EXPIRES=15m
|
|
JWT_REFRESH_EXPIRES=30d
|
|
|
|
# ---- Maps (انطلق / map-saas) ----
|
|
MAPS_TILES_URL=http://martin:3000
|
|
MAPS_PROVIDER=antlaq
|
|
MAPS_BASE_URL=https://map-saas.intaleqapp.com
|
|
# مفاتيح انطلق لكل دولة (ضع القيم الحقيقية في .env على السيرفر — لا تُرفع لـ git)
|
|
MAPS_API_KEY_JO=
|
|
MAPS_API_KEY_SY=
|
|
MAPS_PLACES_API_KEY=
|
|
|
|
# ---- OTP via Nabeh (WhatsApp) ----
|
|
# اتركه dev لتفعيل الرمز الثابت 1234 بلا إرسال؛ اجعله false للإرسال الحقيقي عبر Nabeh
|
|
OTP_DEV_MODE=true
|
|
NABEH_BASE_URL=https://nabeh.intaleqapp.com
|
|
NABEH_EMAIL=
|
|
NABEH_PASSWORD=
|
|
NABEH_OTP_TYPE=text
|
|
|
|
# ---- FCM push (اتركه فارغاً لتعطيل الإرسال) ----
|
|
FCM_SERVER_KEY=
|
|
FCM_ENDPOINT=https://fcm.googleapis.com/fcm/send
|