File size: 3,543 Bytes
3060aa0
5ef3828
 
 
 
 
 
 
 
 
 
3060aa0
 
5ef3828
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3060aa0
5ef3828
 
3060aa0
5ef3828
 
3060aa0
5ef3828
 
4cfc59a
3060aa0
5ef3828
 
 
 
 
3060aa0
 
4cfc59a
3060aa0
 
5ef3828
3060aa0
 
 
 
 
 
 
 
 
5ef3828
3060aa0
 
5ef3828
3060aa0
 
 
 
 
 
 
 
5ef3828
 
 
3060aa0
 
5ef3828
 
3060aa0
5ef3828
3060aa0
 
5ef3828
 
 
 
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
# ===========================================
# .env.example β€” Multi-LLM-API-Gateway
# Copy this file to .env and fill in the values.
# IMPORTANT: Never commit the .env file to version control.
# ===========================================
# ARCHITECTURE NOTE:
#   The Guardian (main.py) is the ONLY process that reads this file.
#   app/* modules NEVER touch .env β€” they get ENV-VAR NAMES via app/.pyfun
#   and the values are read with os.getenv() inside the sandbox boundary.
#
#   No key set = provider skipped = tool not registered = NO CRASH.
# ===========================================

# --- LLM Provider Keys ---
# Which providers activate is defined in app/.pyfun [LLM_PROVIDERS].
# A provider only registers when its ENV key here is set.

# Anthropic (api.anthropic.com)
ANTHROPIC_API_KEY=""

# Google Gemini (generativelanguage.googleapis.com)
GEMINI_API_KEY=""

# OpenRouter (openrouter.ai) β€” free models available
OPENROUTER_API_KEY=""

# HuggingFace Inference API (api-inference.huggingface.co)
HF_TOKEN=""

# SmolLM2 custom Space (your own deployment)
SMOLLM_API_KEY=""

# --- Search Provider Keys ---
# Activate search by setting at least one of these.

# Brave Search (api.search.brave.com)
BRAVE_API_KEY=""

# Tavily (api.tavily.com) β€” AI-optimized search
TAVILY_API_KEY=""

# --- App Identity (optional) ---
# Used by OpenRouter HTTP-Referer header (rate limit attribution)
APP_URL="https://huggingface.co/spaces/codey-lab/Universal-MCP-Hub"

# --- Optional hub gate for /api, /crypto and /mcp (see app/auth.py) ---
# Leave empty = hub is open (as before). Set a long random string to require it.
# Clients send:  X-Hub-Token: <token>   or   Authorization: Bearer <token>
# (the ENV var NAME is configured in app/.pyfun [HUB] HUB_AUTH_ENV)
HUB_API_TOKEN=""

# ===========================================
# PyFundaments CORE CONFIGURATION
# ===========================================

# --- Database Connection (PostgreSQL) ---
# The complete Data Source Name (DSN) for your PostgreSQL database.
# This works for both local instances and cloud providers like Neon.tech.
# Example for Neon: postgresql://user:password@host.eu-central-1.aws.neon.tech/neondb?sslmode=require
# Example for local: postgresql://user:password@localhost:5432/mydb
# Leave empty or comment out if your app doesn't need database
DATABASE_URL="your_database_dsn_here"

# --- Application-Level Encryption Keys ---
# These keys are used by the application itself to encrypt sensitive data
# before it is written to the database.
# The master key must be a 256-bit key (32 bytes).
MASTER_ENCRYPTION_KEY="your_256_bit_key_here"

# The salt is a unique, persistent value used with the master key.
# It should also be a secure, random string.
PERSISTENT_ENCRYPTION_SALT="your_unique_salt_here"

# ===========================================
# LOGGING CONFIGURATION (Optional)
# ===========================================

# PyFundaments Debug Mode (true = startup diagnostics: Python version,
# sys.path, file checks). Only needed while developing β€” false for normal use.
PYFUNDAMENTS_DEBUG="false"

# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
# INFO is enough for daily operation; DEBUG only while hunting a bug.
LOG_LEVEL="INFO"

# Store logs in /tmp directory (cleared on restart, host-local only)
LOG_TO_TMP="false"

# Public logging β€” CAREFUL: stdout logs are PUBLICLY VISIBLE on HF Spaces
# (Space -> Logs tab). Set to "false" for production. Only keep "true"
# while actively debugging a deployment.
ENABLE_PUBLIC_LOGS="false"