-
Notifications
You must be signed in to change notification settings - Fork 16
/
.env.example
65 lines (54 loc) · 4 KB
/
.env.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
export KALEMAT_API_KEY="" # Token for Qur'an and Hadith search
export OPENAI_API_KEY="" # Token for GPT-4
# Optional. If not set, the app will not use these services.
export LANGFUSE_SECRET_KEY="" # Secret key for Langfuse
export LANGFUSE_PUBLIC_KEY="" # Public token for Langfuse
export SENDGRID_API_KEY="" # API key to send password reset options
# Database connection string
export DATABASE_URL="postgresql://user:password@localhost:5432/database_name"
export SECRET_KEY="secret" # Secret key for signing tokens
# Origins to be allowed by the backend
export ORIGINS="https://beta.ansari.chat,http://beta.ansari.chat,https://ansari.chat,http://ansari.chat,https://hajiansari.ai,http://hajiansari.ai,https://ansari.endeavorpal.com,https://web.whatsapp.com"
# Vectara search engine configuration
export PGPASSWORD="" # Password for PostgreSQL database
export VECTARA_API_KEY="" # Authentication token for Vectara API
# Related to our PostgreSQL database
export QURAN_DOT_COM_API_KEY=""
# Directory for storing templates
export template_dir="." # Directory path for templates
# Related to WhatsApp Business and Meta (leave empty if you're not planning to use WhatsApp)
# Source 1: https://www.youtube.com/watch?v=KP6_BUw3i0U
# Watch Until 32:25
# Source 2: https://glitch.com/edit/#!/insidious-tartan-alvarezsaurus
# Source 3: https://developers.facebook.com/blog/post/2022/10/24/sending-messages-with-whatsapp-in-your-python-applications/#u_0_39_8q
# Moreover, if want to test whatsapp's webhook locally, you can use zrok on a reserved URL with a zrok "share token"
# obtained by contacting its current holder: https://github.com/OdyAsh (source 1, 2 below)
# Alternatively, you can change the webhook url all together (source 3, 4 below)
# Check these sources for more details:
# Source 1: https://dev.to/odyash/quickly-share-your-app-with-zrok-4ihp
# Source 2: https://openziti.discourse.group/t/how-do-i-use-a-reserved-share-on-different-devices/2379/2
# Source 3: https://youtu.be/KP6_BUw3i0U?t=1294
# (@21:33 and 25:30, however they use glitch instead of zrok, so you'll just need to change the webhook url to your zrok url)
# Source 4 (where you can change callback url, given that your facebook account gets access by the app's admins):
# https://developers.facebook.com/apps/871020755148175/whatsapp-business/wa-settings/
# Note 1: Obviously, that `871...175` is the testing app's public id, so if this link still doesn't work even after you gain access,
# then the admins most probably created a new test app instance
# Note 2: If an unexpected 3rd party discovers the ZROK_SHARE_TOKEN,
# a new one will have to be generated, then added to Meta's callback URL of the *testing* app
# (Noting that the *production* app's callback URL will be different anyway, so the 3rd party won't be able to access that app)
# (but we still don't want random calls to be made to our testing app, so that's why we'll still have to change an exposed token :])
export WHATSAPP_RECIPIENT_WAID="<<YOUR-RECIPIENT-TEST-PHONE-NUMBER>>"
export WHATSAPP_API_VERSION="<<CURRENT-VERSION-AS-MENTIONED-IN-SOURCE-URL-ABOVE>>"
export WHATSAPP_BUSINESS_PHONE_NUMBER_ID="<<YOUR-WHATSAPP-BUSINESS-PHONE-NUMBER-ID>>"
export WHATSAPP_ACCESS_TOKEN_FROM_SYS_USER="<<YOUR-SYSTEM-USER-ACCESS-TOKEN>"
export WHATSAPP_VERIFY_TOKEN_FOR_WEBHOOK="<<The-VERIFIFY-TOKEN-CURRENTLY-USED-TO-VERIFY-META'S-CALLBACK-URL>>"
export ZROK_SHARE_TOKEN="<<THE-ZROK-SHARE-TOKEN-CURRENTLY-USED-IN-META'S-CALLBACK-URL>>"
# Related to internal code logic
# Leave the values below when locally debugging the application
# In production, don't add them to environment variables, or add them as "INFO"/"False" respectively
export LOGGING_LEVEL="DEBUG"
export DEBUG_MODE="True"
# To get rid of .py[cod] files (This should key should NOT be set in production!)
# This is only to de-clutter your local development environment
# Details: https://docs.python-guide.org/writing/gotchas/#disabling-bytecode-pyc-files
PYTHONDONTWRITEBYTECODE=1