better-ccflare 2.0.11 → 2.0.12

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 CHANGED
@@ -179,18 +179,76 @@ RETRY_BACKOFF=2 # Retry backoff multiplier
179
179
  - Never commit `.env` files containing sensitive values to version control
180
180
  - Use environment-specific configuration for production deployments
181
181
 
182
+ ### Using .env Files
183
+
184
+ better-ccflare automatically supports `.env` files for easy configuration management. You can create a `.env` file in your project directory:
185
+
186
+ ```bash
187
+ # Copy the example .env file
188
+ cp .env.example .env
189
+ # Edit with your configuration
190
+ nano .env
191
+ ```
192
+
193
+ **Supported across all deployment methods**:
194
+ - **CLI Binary**: Automatically loads `.env` from current working directory
195
+ - **Docker Compose**: Automatically loads `.env` from the same directory as `docker-compose.yml`
196
+ - **Docker**: Mount your `.env` file or pass variables directly
197
+
198
+ **Example `.env` file**:
199
+ ```bash
200
+ # Server Configuration
201
+ PORT=8080
202
+
203
+ # SSL/TLS Configuration (optional)
204
+ SSL_KEY_PATH=/path/to/ssl/key.pem
205
+ SSL_CERT_PATH=/path/to/ssl/cert.pem
206
+
207
+ # Load Balancing
208
+ LB_STRATEGY=session
209
+
210
+ # Logging and Debugging
211
+ LOG_LEVEL=INFO
212
+ LOG_FORMAT=pretty
213
+
214
+ # Database configuration
215
+ DATA_RETENTION_DAYS=7
216
+ REQUEST_RETENTION_DAYS=365
217
+ ```
218
+
219
+ **Usage with different deployment methods**:
220
+ ```bash
221
+ # CLI (binary or local development)
222
+ better-ccflare --serve
223
+
224
+ # Docker Compose (place .env alongside docker-compose.yml)
225
+ docker-compose up
226
+
227
+ # Docker (mount .env file)
228
+ docker run -v $(pwd)/.env:/app/.env:ro -p 8080:8080 ghcr.io/tombii/better-ccflare:latest
229
+ ```
230
+
182
231
  ### Docker (Multi-Platform: linux/amd64, linux/arm64)
183
232
 
184
233
  ```bash
185
234
  # Quick start with docker-compose
186
235
  curl -O https://raw.githubusercontent.com/tombii/better-ccflare/main/docker-compose.yml
236
+
237
+ # Optional: Create and configure .env file
238
+ cp .env.example .env
239
+ # Edit .env with your settings (SSL, port, etc.)
240
+ nano .env
241
+
242
+ # Start with docker-compose (automatically loads .env file)
187
243
  docker-compose up -d
188
244
 
189
- # Or use docker run
245
+ # Or use docker run with environment variables
190
246
  docker run -d \
191
247
  --name better-ccflare \
192
248
  -p 8080:8080 \
193
249
  -v better-ccflare-data:/data \
250
+ -e SSL_KEY_PATH=/path/to/ssl/key.pem \
251
+ -e SSL_CERT_PATH=/path/to/ssl/cert.pem \
194
252
  ghcr.io/tombii/better-ccflare:latest
195
253
 
196
254
  # View logs
@@ -201,6 +259,8 @@ docker exec -it better-ccflare better-ccflare --add-account myaccount
201
259
  docker exec -it better-ccflare better-ccflare --list
202
260
  ```
203
261
 
262
+ **🆕 Environment Variable Support**: Docker Compose now automatically loads `.env` files from the same directory as `docker-compose.yml`. Simply create a `.env` file alongside your `docker-compose.yml` file and the container will use those settings.
263
+
204
264
  **Available Docker tags:**
205
265
  - `latest` - Latest stable release
206
266
  - `main` - Latest build from main branch
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-ccflare",
3
- "version": "2.0.11",
3
+ "version": "2.0.12",
4
4
  "description": "Load balancer proxy for Claude API with intelligent distribution across multiple OAuth accounts to avoid rate limiting",
5
5
  "author": "snipeship",
6
6
  "license": "MIT",
@@ -34,7 +34,9 @@
34
34
  "devDependencies": {
35
35
  "@types/node": "^20.0.0"
36
36
  },
37
- "dependencies": {},
37
+ "dependencies": {
38
+ "dotenv": "^17.2.3"
39
+ },
38
40
  "files": [
39
41
  "dist/better-ccflare",
40
42
  "README.md"