better-ccflare 2.0.6 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/better-ccflare +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ https://github.com/user-attachments/assets/c859872f-ca5e-4f8b-b6a0-7cc7461fe62a
|
|
|
22
22
|
- **⚡ Auto-Refresh** - Automatically start new usage windows when rate limits reset
|
|
23
23
|
- **📊 Request-Level Analytics** - Track latency, token usage, and costs in real-time with optimized batch processing
|
|
24
24
|
- **🔍 Deep Debugging** - Full request/response logging and error traces
|
|
25
|
+
- **🔐 API Authentication** - Optional API key authentication with secure key management
|
|
25
26
|
- **⚡ <10ms Overhead** - Minimal performance impact with lazy loading and request deduplication
|
|
26
27
|
- **💸 Free & Open Source** - Run it yourself, modify it, own your infrastructure
|
|
27
28
|
|
|
@@ -137,6 +138,47 @@ bun run better-ccflare
|
|
|
137
138
|
|
|
138
139
|
**Note**: You must run `bun run build` at least once to build the dashboard files before starting the server. This can also be done by running `bun run better-ccflare` which includes the build step.
|
|
139
140
|
|
|
141
|
+
### Environment Variables
|
|
142
|
+
|
|
143
|
+
better-ccflare supports several environment variables for configuration:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Server Configuration
|
|
147
|
+
PORT=8080 # Server port (default: 8080)
|
|
148
|
+
BETTER_CCFLARE_HOST=0.0.0.0 # Server binding host (default: 0.0.0.0, use 127.0.0.1 for localhost-only)
|
|
149
|
+
CLIENT_ID=your-client-id # OAuth client ID
|
|
150
|
+
BETTER_CCFLARE_CONFIG_PATH=/path/to/config.json # Custom config location
|
|
151
|
+
BETTER_CCFLARE_DB_PATH=/path/to/database.db # Custom database path (default: config dir/better-ccflare.db)
|
|
152
|
+
|
|
153
|
+
# Development Environment
|
|
154
|
+
NODE_ENV=development # Set to 'development' to use separate dev database
|
|
155
|
+
DEV=true # Alternative way to enable development mode
|
|
156
|
+
# When in development, uses 'better-ccflare-dev.db' instead of production
|
|
157
|
+
|
|
158
|
+
# Logging and Debugging
|
|
159
|
+
LOG_LEVEL=INFO # Log level (ERROR, WARN, INFO, DEBUG)
|
|
160
|
+
LOG_FORMAT=json # Log format (json or text)
|
|
161
|
+
better-ccflare_DEBUG=0 # Enable debug mode (1 for enabled)
|
|
162
|
+
|
|
163
|
+
# SSL/TLS Configuration
|
|
164
|
+
SSL_KEY_PATH=/path/to/key.pem # SSL private key path (for HTTPS)
|
|
165
|
+
SSL_CERT_PATH=/path/to/cert.pem # SSL certificate path (for HTTPS)
|
|
166
|
+
|
|
167
|
+
# Load Balancing
|
|
168
|
+
LB_STRATEGY=session # Load balancing strategy (default: session)
|
|
169
|
+
SESSION_DURATION_MS=18000000 # Session duration in milliseconds (5 hours)
|
|
170
|
+
|
|
171
|
+
# Retry Configuration
|
|
172
|
+
RETRY_ATTEMPTS=3 # Number of retry attempts
|
|
173
|
+
RETRY_DELAY_MS=1000 # Initial retry delay in milliseconds
|
|
174
|
+
RETRY_BACKOFF=2 # Retry backoff multiplier
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Security Notes**:
|
|
178
|
+
- Use `BETTER_CCFLARE_HOST=127.0.0.1` to bind only to localhost for better security
|
|
179
|
+
- Never commit `.env` files containing sensitive values to version control
|
|
180
|
+
- Use environment-specific configuration for production deployments
|
|
181
|
+
|
|
140
182
|
### Docker (Multi-Platform: linux/amd64, linux/arm64)
|
|
141
183
|
|
|
142
184
|
```bash
|
package/dist/better-ccflare
CHANGED
|
Binary file
|
package/package.json
CHANGED