CoolFace
Apppublic

OinoVenv/sovereign-dialect-bridge-api

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
.env.example107 linesDownload Raw Back to root
1# =============================================================================2# Sovereign Dialect-Bridge — Backend Environment Variables3# Copy file ini ke `.env` dan isi nilai yang sesuai. JANGAN commit `.env`.4# =============================================================================5 6# Django secret key — generate via:7#   python -c "import secrets; print(secrets.token_urlsafe(50))"8SECRET_KEY=ganti-dengan-string-acak-minimal-50-karakter9 10# Set False di production. True hanya untuk development lokal.11DEBUG=True12 13# Comma-separated. Production: tambah domain HF Space.14#   ALLOWED_HOSTS=localhost,127.0.0.1,oinovenv-sovereign-dialect-bridge-api.hf.space15ALLOWED_HOSTS=localhost,127.0.0.116 17# Database URL — Supabase Postgres (Session Pooler), dipakai dev maupun production.18# Supabase: Project Settings → Database → Connection String → Session Pooler URI19DATABASE_URL=postgresql://postgres.PROJECT_REF:PASSWORD@aws-1-REGION.pooler.supabase.com:5432/postgres20 21# Persistent DB connection per worker (detik). 0 = re-open setiap request.22# 60 default — kurangi handshake overhead tanpa hold koneksi terlalu lama di pooler.23DB_CONN_MAX_AGE=6024 25# Cloudinary — OPSIONAL. Kosongkan ketiganya untuk skip image storage.26# Dapatkan dari https://cloudinary.com/ Dashboard.27CLOUDINARY_CLOUD_NAME=28CLOUDINARY_API_KEY=29CLOUDINARY_API_SECRET=30 31# CORS — daftar origin frontend, comma-separated.32# Production: tambahkan URL Vercel (tanpa trailing slash).33#   CORS_ALLOWED_ORIGINS=http://localhost:3000,https://sovereign-dialect-bridge.vercel.app34CORS_ALLOWED_ORIGINS=http://localhost:300035 36# Hugging Face token — opsional untuk download model dan wajib jika dashboard37# backend ingin proxy runtime/build logs HF Space via /dashboard/api/logs/.38# Buat token di https://huggingface.co/settings/tokens dengan permission Read.39HF_TOKEN=40 41# Pre-load model NLP berat (mT5 2.2 GB + IndoBERT NER) saat startup.42# DEFAULT false → `runserver` lokal cepat. Set true hanya jika packages NLP43# (torch, transformers, joblib, sumy, langdetect) terinstal dan model tersedia.44NLP_ENABLED=false45 46# Summarizer utama untuk hasil aduan production.47# Pilihan: mt5, indot5, textrank, ner, first_sentences.48SUMMARIZER_MODEL=mt549 50# Urutan fallback kalau summarizer utama belum loaded/gagal.51SUMMARIZER_FALLBACKS=ner,textrank,first_sentences52 53# Model abstractive yang di-warmup untuk dashboard comparison.54# Untuk hemat RAM production, bisa set hanya: mt5 atau indot5.55WARMUP_SUMMARIZERS=mt5,indot556 57# Checkpoint summarizer abstractive.58MT5_MODEL_PATH=OinoVenv/sovereign-mt5-nusasum59INDOT5_MODEL_PATH=OinoVenv/sovereign-indot5-nusasum60 61# Default true supaya bahasa unsupported NLLB (mis. Madura/Batak Toba) tetap62# punya jalur translasi fallback saat deploy.63ALLOW_EXTERNAL_TRANSLATION=true64 65# Google Sign-In — isi dengan OAuth Client ID dari Google Cloud Console.66# Nilai ini harus sama dengan NEXT_PUBLIC_GOOGLE_CLIENT_ID di frontend.67GOOGLE_CLIENT_ID=68 69# Reset password email-only.70# WAJIB False di production. True hanya untuk dev lokal — kode 6-digit71# ikut di-return di body response API supaya bisa di-copy tanpa email.72PASSWORD_RESET_CODE_TTL_MINUTES=1073PASSWORD_RESET_MAX_ATTEMPTS=574PASSWORD_RESET_DEBUG_CODE=False75 76# Email backend:77# - Lokal dev tanpa SMTP setup: pakai `console.EmailBackend` → kode reset78#   tampil di terminal Django, tidak benar-benar terkirim.79# - Production: WAJIB `smtp.EmailBackend` + isi EMAIL_HOST/USER/PASSWORD di bawah.80EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend81DEFAULT_FROM_EMAIL=Sovereign Dialect-Bridge <no-reply@localhost>82 83# Production SMTP — pilih salah satu provider.84# Setup guide lengkap (Gmail App Password / Resend / Brevo): docs/DEPLOYMENT.md §3.185#86# Gmail (5 menit setup, ~500/hari, gratis):87#   1. Aktifkan 2FA di https://myaccount.google.com/security88#   2. Buat App Password di https://myaccount.google.com/apppasswords89#   3. Paste 16-char password ke EMAIL_HOST_PASSWORD (hapus spasi)90# EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend91# EMAIL_HOST=smtp.gmail.com92# EMAIL_PORT=58793# EMAIL_HOST_USER=bot.dialectbridge@gmail.com94# EMAIL_HOST_PASSWORD=abcdefghijklmnop95# EMAIL_USE_TLS=True96# DEFAULT_FROM_EMAIL=Sovereign Dialect-Bridge <bot.dialectbridge@gmail.com>97#98# Resend (deliverability lebih baik, 3000/bulan free, butuh domain untuk From custom):99# EMAIL_HOST=smtp.resend.com100# EMAIL_HOST_USER=resend101# EMAIL_HOST_PASSWORD=re_xxxxxxxxxxxxxxxxxxxx102#103# Brevo (300/hari unlimited bulanan):104# EMAIL_HOST=smtp-relay.brevo.com105# EMAIL_HOST_USER=<login_smtp_brevo>106# EMAIL_HOST_PASSWORD=<smtp_key_brevo>107