File size: 6,893 Bytes
83d6851
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aaec145
 
 
 
 
 
83d6851
 
 
 
 
 
 
 
 
 
 
 
 
cd6f706
 
d0736f4
 
cd6f706
 
 
 
 
 
83d6851
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6cd5bf4
83d6851
 
6cd5bf4
83d6851
 
 
6cd5bf4
83d6851
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# ------------------------------------------------------------------
# AgentDeck Backend - example environment
# Copy to `.env` (or set these in your deployment) and fill in real values.
#   cp .env.example .env
# In production the app REFUSES TO START unless these are set to strong,
# non-default values:
#   API_KEY, JWT_SECRET_KEY
# ------------------------------------------------------------------

# --- App ---
APP_NAME=All API Collection
ENVIRONMENT=production        # production | development
HOST=0.0.0.0
PORT=7860
WORKERS=1
LOG_LEVEL=INFO

# --- Auth (required) ---
# Master bearer key for the whole API; must be long & random in production.
API_KEY=change-me-to-a-long-random-value
# Secret used to sign JWTs. Must be long & random (>=32 chars) in production.
JWT_SECRET_KEY=change-me-to-a-long-random-value
JWT_ALGORITHM=HS256
JWT_ISSUER=all-api-collection
ADMIN_PASSWORD=

# Per-client-IP global rate limit (requests / minute). 0 disables.
RATE_LIMIT_PER_MINUTE=60

# --- Service enablement ---
# Which API groups are mounted is controlled by services.yaml at the project
# root (set enabled: true/false per service, e.g. google:sheets_api). Point
# this at a different file to override.
# SERVICES_CONFIG_PATH=./services.yaml

# --- URL shortener ---
URL_SHORTENER_SECRET=change-me
URL_SHORTENER_BASE=http://localhost:7860/api/v1

# --- Limits ---
MAX_UPLOAD_BYTES=15728640

# --- Embeddings / vector store ---
EMBEDDING_MODEL=ibm-granite/granite-embedding-small-english-r2
EMBEDDING_DIMENSION=384
DEFAULT_TOP_K=10
DATA_DIR=./data

# --- Local on-device extraction (/json/feature-extract) ---
# All keys are optional; unset values fall back to the defaults shown.
# GLINER_MODEL=lion-ai/gliner2-base-v1-onnx
# DEPRECATED: PyTorch model (torch backend) -- restore to roll back:
# GLINER_MODEL=fastino/gliner2-base-v1
# GLINER_ENABLED=true
# GLINER_DEVICE=cpu
# GLINER_MAX_CONCURRENT=2
# GLINER_MAX_CONTENT_LENGTH=100000

# --- Supabase ---
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
SUPABASE_SCHEMA=public

# --- Redis (optional; scheduler / caching) ---
REDIS_URL=
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=
REDIS_SSL=false

# --- Google Maps / GCP ---
GCP_API_KEY=
GOOGLE_MAPS_BASE_URL=https://maps.googleapis.com/maps/api

# --- Google Cloud Storage ---
GCS_BUCKET_NAME=
GCS_SERVICE_ACCOUNT_KEY_PATH=

# --- Google OAuth / Gmail (optional) ---
GOOGLE_OAUTH_CLIENT_ID=
GOOGLE_OAUTH_CLIENT_SECRET=

# --- Web search (SearXNG) ---
SEARXNG_BASE_URL=http://localhost:8888

# --- Startup self-ping ---
SELF_PING_URL=

# ------------------------------------------------------------------
# --- WhatsApp service (single source of truth) ---------------------
# This `.env` is the ONLY configuration file. It is read by the main FastAPI
# app (pydantic-settings) AND, via start.sh / the Docker image, forwarded to
# the internal AgentDeck WhatsApp service (Go) as its process environment.
# The Go service never reads a `.env` of its own — it consumes injected env
# vars only. In a container deployment these values are set on the platform
# (Hugging Face Spaces secrets) and start.sh passes them straight through.
# ------------------------------------------------------------------

# --- Gateway settings (read by the FastAPI app) ---
# The main app reverse-proxies /api/whatsapp/* to the WhatsApp service.
# When the image embeds the binary (start.sh) the gateway is auto-enabled;
# set explicitly to control it. WHATSAPP_SERVICE_URL may be a service name
# (http://whatsapp-service:8231) when the WhatsApp service runs as a separate
# container, or loopback when co-hosted in this image.
WHATSAPP_SERVICE_ENABLED=false
WHATSAPP_SERVICE_URL=http://127.0.0.1:8231
WHATSAPP_SERVICE_TIMEOUT=30
WHATSAPP_SERVICE_CONNECT_TIMEOUT=5
# Port start.sh launches the embedded Go binary on (its SERVER_PORT).
WHATSAPP_SERVICE_PORT=8231

# --- Settings forwarded to the Go service (start.sh / Docker) ---
# Global API key of the WhatsApp service. Used by the gateway as the default
# `apikey` header AND injected into the Go process as GLOBAL_API_KEY.
WHATSAPP_SERVICE_GLOBAL_API_KEY=

# The Go service requires: SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY (injected
# as SUPABASE_SERVICE_KEY), SUPABASE_DB_URL, REDIS_URL, GLOBAL_API_KEY (see
# WHATSAPP_SERVICE_GLOBAL_API_KEY) and DATABASE_SAVE_MESSAGES. SUPABASE_URL
# and REDIS_URL are the shared values defined above; SUPABASE_SERVICE_ROLE_KEY
# is mapped to the Go service's expected name (SUPABASE_SERVICE_KEY) for you.
# SUPABASE_DB_URL is a direct native-Postgres connection string (used by the
# whatsmeow session store — NOT the PostgREST URL):
SUPABASE_DB_URL=postgresql://postgres:postgres@db.your-project.supabase.co:5432/postgres
DATABASE_SAVE_MESSAGES=false
CLIENT_NAME=agentdeck
CONNECT_ON_STARTUP=false

# Optional WhatsApp service behaviour (documented defaults = Go service defaults).
DEBUG_ENABLED=INFO       # whatsmeow debug level (mapped from legacy WADEBUG)
LOG_TYPE=console         # console | file
WEBHOOK_FILES=true
OS_NAME=AgentDeck
WHATSAPP_VERSION_MAJOR=2
WHATSAPP_VERSION_MINOR=3000
WHATSAPP_VERSION_PATCH=1
# EVENT_IGNORE_GROUP=false
# EVENT_IGNORE_STATUS=false
# QRCODE_MAX_COUNT=5
# CHECK_USER_EXISTS=true

# MinIO media storage (only if MINIO_ENABLED=true).
MINIO_ENABLED=false
# MINIO_ENDPOINT=localhost:9000
# MINIO_ACCESS_KEY=minioadmin
# MINIO_SECRET_KEY=minioadmin
# MINIO_BUCKET=agentdeck-media
# MINIO_USE_SSL=false
# MINIO_REGION=

# RabbitMQ / NATS event producers (optional).
# AMQP_URL=amqp://admin:admin@localhost:5672/default
# AMQP_GLOBAL_ENABLED=false
# AMQP_GLOBAL_EVENTS=
# AMQP_SPECIFIC_EVENTS=
# NATS_URL=
# NATS_GLOBAL_ENABLED=false
# NATS_GLOBAL_EVENTS=
# WEBHOOK_URL=

# Outbound proxy for the WhatsApp service (optional).
# PROXY_PROTOCOL=http       # http | https | socks5
# PROXY_HOST=
# PROXY_PORT=
# PROXY_USERNAME=
# PROXY_PASSWORD=

# Audio converter (optional).
# API_AUDIO_CONVERTER=
# API_AUDIO_CONVERTER_KEY=

# Logger rotation (optional).
# LOG_MAX_SIZE=100          # MB
# LOG_MAX_BACKUPS=5
# LOG_MAX_AGE=30            # days
# LOG_DIRECTORY=./logs
# LOG_COMPRESS=true

# --- Concurrency ---
# Shared thread pool worker count. Unset => auto-calc min(32, cpu_count+4).
CORE_CONCURRENCY=

# --- PaddleOCR PP-OCRv6 (ONNX Runtime) ---
# OCR_ENGINE=onnxruntime        # paddle | paddle_static | paddle_dynamic | onnxruntime | transformers
# OCR_DEVICE=cpu
# OCR_LANG=                    # e.g. en; empty uses model defaults
# OCR_DET_MODEL_NAME=PP-OCRv6_small_det
# OCR_REC_MODEL_NAME=PP-OCRv6_small_rec
# OCR_USE_DOC_ORIENTATION_CLASSIFY=false
# OCR_USE_DOC_UNWARPING=false
# OCR_USE_TEXTLINE_ORIENTATION=true
# OCR_MAX_CONCURRENT=1         # max parallel predict calls on shared engine
# Enrich raw/OCR content into labeled Markdown before LLM extraction (default true).
CONTENT_STRUCTURE_ENRICHMENT=true