|
| 1 | +# Configuration Guide |
| 2 | + |
| 3 | +## Environment Variables |
| 4 | + |
| 5 | +### Auto Source Configuration |
| 6 | + |
| 7 | +| Variable | Description | Default | Example | |
| 8 | +| ----------------------------- | -------------------------------------- | ----------------- | ----------------------------------------------------- | |
| 9 | +| `AUTO_SOURCE_ENABLED` | Enable auto source feature | `false` | `true` | |
| 10 | +| `AUTO_SOURCE_USERNAME` | Basic auth username | Required | `admin` | |
| 11 | +| `AUTO_SOURCE_PASSWORD` | Basic auth password | Required | `changeme` | |
| 12 | +| `AUTO_SOURCE_ALLOWED_ORIGINS` | Allowed request origins | Required | `localhost:3000,example.com` | |
| 13 | +| `AUTO_SOURCE_ALLOWED_URLS` | **URL whitelist for public instances** | `""` (allows all) | `https://github.com/*,https://news.ycombinator.com/*` | |
| 14 | + |
| 15 | +### Health Check Configuration |
| 16 | + |
| 17 | +| Variable | Description | Default | Example | |
| 18 | +| ----------------------- | --------------------- | -------------- | ---------- | |
| 19 | +| `HEALTH_CHECK_USERNAME` | Health check username | Auto-generated | `health` | |
| 20 | +| `HEALTH_CHECK_PASSWORD` | Health check password | Auto-generated | `changeme` | |
| 21 | + |
| 22 | +### Ruby Integration |
| 23 | + |
| 24 | +| Variable | Description | Default | Example | |
| 25 | +| ----------- | -------------------------- | ------- | --------------- | |
| 26 | +| `RUBY_PATH` | Path to Ruby executable | `ruby` | `/usr/bin/ruby` | |
| 27 | +| `APP_ROOT` | Application root directory | `.` | `/app` | |
| 28 | + |
| 29 | +## URL Restriction Patterns |
| 30 | + |
| 31 | +The `AUTO_SOURCE_ALLOWED_URLS` variable supports: |
| 32 | + |
| 33 | +- **Exact URLs**: `https://example.com/news` |
| 34 | +- **Wildcard patterns**: `https://example.com/*` (matches any path) |
| 35 | +- **Domain patterns**: `https://*.example.com` (matches subdomains) |
| 36 | +- **Multiple patterns**: Comma-separated list |
| 37 | + |
| 38 | +### Examples |
| 39 | + |
| 40 | +```bash |
| 41 | +# Allow only specific sites |
| 42 | +AUTO_SOURCE_ALLOWED_URLS=https://github.com/*,https://news.ycombinator.com/*,https://example.com/news |
| 43 | + |
| 44 | +# Allow all subdomains of a domain |
| 45 | +AUTO_SOURCE_ALLOWED_URLS=https://*.example.com/* |
| 46 | + |
| 47 | +# Allow everything (for private instances) |
| 48 | +AUTO_SOURCE_ALLOWED_URLS= |
| 49 | + |
| 50 | +# Block everything (disable auto source) |
| 51 | +AUTO_SOURCE_ENABLED=false |
| 52 | +``` |
| 53 | + |
| 54 | +## Security Considerations |
| 55 | + |
| 56 | +### Public Instances |
| 57 | +- **Always set** `AUTO_SOURCE_ALLOWED_URLS` to restrict URLs |
| 58 | +- Use strong authentication credentials |
| 59 | +- Monitor usage and set up rate limiting |
| 60 | +- Consider IP whitelisting for additional security |
| 61 | + |
| 62 | +### Private Instances |
| 63 | +- Leave `AUTO_SOURCE_ALLOWED_URLS` empty to allow all URLs |
| 64 | +- Still use authentication to prevent unauthorized access |
| 65 | +- Consider network-level restrictions |
| 66 | + |
| 67 | +## Deployment Examples |
| 68 | + |
| 69 | +### Public Demo Instance |
| 70 | +```bash |
| 71 | +AUTO_SOURCE_ENABLED=true |
| 72 | +AUTO_SOURCE_USERNAME=demo |
| 73 | +AUTO_SOURCE_PASSWORD=secure_password |
| 74 | +AUTO_SOURCE_ALLOWED_URLS=https://github.com/*,https://news.ycombinator.com/*,https://example.com/* |
| 75 | +``` |
| 76 | + |
| 77 | +### Private Instance |
| 78 | +```bash |
| 79 | +AUTO_SOURCE_ENABLED=true |
| 80 | +AUTO_SOURCE_USERNAME=admin |
| 81 | +AUTO_SOURCE_PASSWORD=very_secure_password |
| 82 | +AUTO_SOURCE_ALLOWED_URLS= |
| 83 | +``` |
| 84 | + |
| 85 | +### Disabled Auto Source |
| 86 | +```bash |
| 87 | +AUTO_SOURCE_ENABLED=false |
| 88 | +``` |
0 commit comments