-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
207 lines (159 loc) · 7.12 KB
/
Copy path.env.example
File metadata and controls
207 lines (159 loc) · 7.12 KB
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
198
199
200
201
202
203
204
205
206
207
# AutoVoice Environment Configuration Template
# Copy to .env and customize for your deployment
# ============================================================================
# Server Configuration
# ============================================================================
# Port mapping (avoid 8000-8004, use 10000+ range)
HOST_PORT=10001
PROMETHEUS_PORT=10002
GRAFANA_PORT=10003
# Log level: debug, info, warning, error, critical
LOG_LEVEL=info
# ============================================================================
# Flask Secret Key Configuration (CRITICAL SECURITY SETTING)
# ============================================================================
# WARNING: The SECRET_KEY is used for session signing and CSRF protection.
# A weak or predictable key allows attackers to forge session cookies and
# bypass security measures. NEVER use the default value in production!
# Option 1 (RECOMMENDED): Use SecretsManager
# Create a secrets file at config/secrets.yaml with:
# secret_keys:
# flask_secret_key: "your-64-character-random-hex-string-here"
# The app will automatically load from AUTOVOICE_SECRET_FLASK_SECRET_KEY
# Option 2: Set via environment variable
# Generate a secure random key using one of these methods:
#
# Python (recommended - 64 hex characters):
# python -c "import secrets; print(secrets.token_hex(32))"
#
# OpenSSL (64 hex characters):
# openssl rand -hex 32
#
# Python urlsafe (43 alphanumeric characters):
# python -c "import secrets; print(secrets.token_urlsafe(32))"
#
# Then set it in your environment or .env file:
SECRET_KEY=your-generated-secret-key-here
# IMPORTANT: Your secret key should be:
# - At least 32 bytes (64 hex characters or 43 urlsafe characters)
# - Cryptographically random (use secrets module, not random module)
# - Unique per deployment (don't reuse across dev/staging/production)
# - Kept secret (never commit to version control or share publicly)
#
# The application will:
# - In PRODUCTION: Require AUTOVOICE_SECRET_FLASK_SECRET_KEY (fails if not set)
# - In TESTING: Auto-generate a secure random key for each test run
# - NEVER fall back to a hardcoded default value
# ============================================================================
# GPU Configuration
# ============================================================================
# CUDA device selection (0 for single GPU)
CUDA_VISIBLE_DEVICES=0
# GPU memory fraction (0.0-1.0)
MAX_MEMORY_FRACTION=0.9
# CUDA architecture for Jetson Thor
TORCH_CUDA_ARCH_LIST=11.0
CUDA_HOME=/usr/local/cuda-13.0
# ============================================================================
# Job Manager Configuration
# ============================================================================
# Maximum concurrent workers
MAX_WORKERS=4
# Job TTL in seconds (1 hour)
TTL_SECONDS=3600
# In-progress job TTL in seconds (2 hours)
IN_PROGRESS_TTL_SECONDS=7200
# ============================================================================
# Model Configuration
# ============================================================================
# Path to pretrained models (mounted in container)
PRETRAINED_DIR=/app/models/pretrained
# Model checkpoints
SOVITS_CHECKPOINT=sovits5.0_main_1500.pth
HIFIGAN_CHECKPOINT=hifigan_ljspeech.ckpt
HUBERT_CHECKPOINT=hubert-soft-0d54a1f4.pt
# ============================================================================
# Feature Flags
# ============================================================================
# Enable/disable components
SINGING_CONVERSION_ENABLED=true
VOICE_CLONING_ENABLED=true
KARAOKE_ENABLED=true
# Optional release evidence lane. Set only to operator-owned media before
# running scripts/run_completion_matrix.py --live-youtube.
AUTOVOICE_LIVE_YOUTUBE_URL=
# ============================================================================
# Monitoring Configuration
# ============================================================================
# Grafana admin credentials (CHANGE IN PRODUCTION)
GRAFANA_USER=admin
GRAFANA_PASSWORD=admin-CHANGE-ME
# Prometheus retention (default: 15 days)
PROMETHEUS_RETENTION=15d
# ============================================================================
# Audio Configuration
# ============================================================================
# Sample rate for audio processing
SAMPLE_RATE=22050
# FFT parameters
HOP_LENGTH=512
N_FFT=2048
WIN_LENGTH=2048
N_MELS=80
# ============================================================================
# Storage Configuration
# ============================================================================
# Maximum upload file size (bytes)
MAX_CONTENT_LENGTH=104857600
# Allowed audio extensions
ALLOWED_AUDIO_EXTENSIONS=wav,mp3,flac,ogg,m4a
# ============================================================================
# Database Configuration (if using external DB)
# ============================================================================
# PostgreSQL connection (optional)
# DATABASE_URL=postgresql://user:password@localhost:5432/autovoice
# Redis connection (optional, for caching)
# REDIS_URL=redis://localhost:6379/0
# ============================================================================
# Security Configuration
# ============================================================================
# CORS allowed origins (comma-separated)
CORS_ORIGINS=http://localhost:3000,http://localhost:10001
# Set true for hosted/public deployments. Public mode rejects wildcard CORS,
# requires API auth, enables strict server-path sandboxing, and requires media
# rights/consent attestations for risky ingestion paths.
AUTOVOICE_PUBLIC_DEPLOYMENT=false
# API token auth for operator/destructive endpoints. Frontend deployments should
# terminate auth at a trusted reverse proxy or inject this token server-side.
AUTOVOICE_REQUIRE_API_AUTH=false
AUTOVOICE_API_TOKEN=
# Do not set this in production unless another perimeter enforces origin/auth.
AUTOVOICE_ALLOW_INSECURE_CORS=false
# Restrict server-side audio_path ingestion to managed AutoVoice data/uploads.
AUTOVOICE_STRICT_PATH_SANDBOX=true
# Require consent/source-media attestation fields for clone/download/import APIs.
AUTOVOICE_REQUIRE_MEDIA_CONSENT=false
# Public/commercial launch gate. These are intentionally unset until the linked
# evidence exists; see docs/public-commercial-launch-gate.md.
AUTOVOICE_ACCOUNT_AUTH_PROVIDER=
AUTOVOICE_TENANT_ISOLATION_ENABLED=false
AUTOVOICE_QUOTA_BACKEND=
AUTOVOICE_ABUSE_REVIEW_ENABLED=false
AUTOVOICE_HOSTED_PUBLIC_EVIDENCE_PATH=
AUTOVOICE_LEGAL_APPROVAL_PATH=
AUTOVOICE_PUBLIC_INGRESS_REVIEW_PATH=
# API rate limiting (requests per minute)
RATE_LIMIT=60
# ============================================================================
# Deployment Configuration
# ============================================================================
# Environment: development, staging, production
ENVIRONMENT=production
# Application version
VERSION=0.1.0
# ============================================================================
# Secrets Management (DO NOT COMMIT)
# ============================================================================
# API keys for external services (if needed)
# YOUTUBE_API_KEY=your-key-here
# OPENAI_API_KEY=your-key-here