|
| 1 | +# Configuration |
| 2 | + |
| 3 | +## API Server |
| 4 | + |
| 5 | +The following are the detailed configurations for the API server. You can inject these environment variables into the `refly_api` container. |
| 6 | + |
| 7 | +### General Config |
| 8 | + |
| 9 | +| Env | Description | Default Value | |
| 10 | +| --- | --- | --- | |
| 11 | +| NODE_ENV | Node environment | `development` | |
| 12 | +| PORT | HTTP API service port, used for regular API requests | `5800` | |
| 13 | +| WS_PORT | WebSocket server port, used for real-time synchronization for canvases and documents | `5801` | |
| 14 | +| ORIGIN | Client origin (where you are accessing the Refly application from), used for CORS check | `http://localhost:5700` | |
| 15 | +| STATIC_ENDPOINT | Static file endpoint, used for serving static files | `http://localhost:5800/v1/misc/` | |
| 16 | + |
| 17 | +### Credentials |
| 18 | + |
| 19 | +| Env | Description | Default Value | |
| 20 | +| --- | --- | --- | |
| 21 | +| OPENAI_API_KEY | [OpenAI](https://openai.com/) API key, used for LLM inference and embeddings | (not set) | |
| 22 | +| OPENROUTER_API_KEY | [OpenRouter](https://openrouter.ai/) API key, used for LLM inference | (not set) | |
| 23 | +| JINA_API_KEY | [Jina](https://jina.ai/) API key, used for embeddings | (not set) | |
| 24 | +| FIREWORKS_API_KEY | [Fireworks](https://fireworks.ai/) API key, used for embedding | (not set) | |
| 25 | +| SERPER_API_KEY | [Serper](https://serper.dev/) API key, used for online search | (not set) | |
| 26 | + |
| 27 | +### Middlewares |
| 28 | + |
| 29 | +Refly depends on following middlewares to function properly: |
| 30 | + |
| 31 | +- **Postgres**: used for basic data persistence |
| 32 | +- **Redis**: used for cache, asynchronous task queue and coordination within distributed environment |
| 33 | +- **Qdrant**: used for semantic searching via embeddings |
| 34 | +- **Elasticsearch**: used for full-text searching within workspace |
| 35 | +- **MinIO**: used for object storage for canvas, document and resource data |
| 36 | + |
| 37 | +#### Postgres |
| 38 | + |
| 39 | +| Env | Description | Default Value | |
| 40 | +| --- | --- | --- | |
| 41 | +| DATABASE_URL | PostgreSQL connection URL | `postgresql://refly:test@localhost:5432/refly?schema=refly` | |
| 42 | + |
| 43 | +::: info |
| 44 | +Refer to [Prisma doc](https://www.prisma.io/docs/orm/overview/databases/postgresql#connection-details) for detailed definition of connection URL. |
| 45 | +::: |
| 46 | + |
| 47 | +#### Redis |
| 48 | + |
| 49 | +| Env | Description | Default Value | |
| 50 | +| --- | --- | --- | |
| 51 | +| REDIS_HOST | Redis host | `localhost` | |
| 52 | +| REDIS_PORT | Redis port | `6379` | |
| 53 | +| REDIS_PASSWORD | Redis password | `test` | |
| 54 | + |
| 55 | +#### Qdrant (Vector Store) |
| 56 | + |
| 57 | +| Env | Description | Default Value | |
| 58 | +| --- | --- | --- | |
| 59 | +| QDRANT_HOST | Qdrant host | `localhost` | |
| 60 | +| QDRANT_PORT | Qdrant port | `6333` | |
| 61 | +| QDRANT_API_KEY | Qdrant API key | (not set) | |
| 62 | +| REFLY_VEC_DIM | Vector dimension size | `768` | |
| 63 | + |
| 64 | +#### Elasticsearch |
| 65 | + |
| 66 | +| Env | Description | Default Value | |
| 67 | +| --- | --- | --- | |
| 68 | +| ELASTICSEARCH_URL | Elasticsearch URL | `http://localhost:9200` | |
| 69 | +| ELASTICSEARCH_USERNAME | Elasticsearch username | (not set) | |
| 70 | +| ELASTICSEARCH_PASSWORD | Elasticsearch username | (not set) | |
| 71 | + |
| 72 | +#### MinIO |
| 73 | + |
| 74 | +Refly requires two MinIO instances: |
| 75 | + |
| 76 | +- **Internal**: used for storing canvas, resource, and document data, typically with visibility set to *private*. |
| 77 | +- **External**: used for storing uploaded files, typically with visibility set to *public*. |
| 78 | + |
| 79 | +| Env | Description | Default Value | |
| 80 | +| --- | --- | --- | |
| 81 | +| MINIO_INTERNAL_ENDPOINT | MinIO host used for internal data | `localhost` | |
| 82 | +| MINIO_INTERNAL_PORT | MinIO port used for internal data | `9000` | |
| 83 | +| MINIO_INTERNAL_USE_SSL | Whether to use HTTPS for transport | `false` | |
| 84 | +| MINIO_INTERNAL_ACCESS_KEY | Access key for internal MinIO | `minioadmin` | |
| 85 | +| MINIO_INTERNAL_SECRET_KEY | Secret key for MinIO | `minioadmin` | |
| 86 | +| MINIO_INTERNAL_BUCKET | Bucket name for internal | `refly-weblink` | |
| 87 | +| MINIO_EXTERNAL_ENDPOINT | MinIO host used for internal data | `localhost` | |
| 88 | +| MINIO_EXTERNAL_PORT | MinIO port used for internal data | `9000` | |
| 89 | +| MINIO_EXTERNAL_USE_SSL | Whether to use HTTPS for transport | `false` | |
| 90 | +| MINIO_EXTERNAL_ACCESS_KEY | Access key for internal MinIO | `minioadmin` | |
| 91 | +| MINIO_EXTERNAL_SECRET_KEY | Secret key for MinIO | `minioadmin` | |
| 92 | +| MINIO_EXTERNAL_BUCKET | Bucket name for internal | `refly-weblink` | |
| 93 | + |
| 94 | +### Authentication Configuration |
| 95 | + |
| 96 | +| Env | Description | Default Value | |
| 97 | +| --- | --- | --- | |
| 98 | +| AUTH_SKIP_VERIFICATION | Whether to skip email verification | `false` | |
| 99 | +| REFLY_COOKIE_DOMAIN | Cookie domain used for signing authentication tokens | `localhost` | |
| 100 | +| LOGIN_REDIRECT_URL | URL to redirect after OAuth login | (not set) | |
| 101 | +| JWT_SECRET | JWT signing secret | `test` | |
| 102 | +| JWT_EXPIRATION_TIME | JWT access token expiration time | `1h` | |
| 103 | +| JWT_REFRESH_EXPIRATION_TIME | JWT refresh token expiration time | `7d` | |
| 104 | +| COLLAB_TOKEN_EXPIRY | Collaboration token expiration time | `1h` | |
| 105 | + |
| 106 | +::: info |
| 107 | +The time format is compatible with [Vercel MS](https://github.com/vercel/ms). |
| 108 | +::: |
| 109 | + |
| 110 | +#### Email Authentication |
| 111 | + |
| 112 | +| Env | Description | Default Value | |
| 113 | +| --- | --- | --- | |
| 114 | +| EMAIL_AUTH_ENABLED | Whether to enable email authentication | `true` | |
| 115 | +| EMAIL_SENDER | Email sender | `Refly <[email protected]>` | |
| 116 | +| RESEND_API_KEY | [Resend](https://resend.com/) API key, used for sending emails | `re_123` | |
| 117 | + |
| 118 | +::: warning |
| 119 | +The default `RESEND_API_KEY` is invalid (just a placeholder). Please set your own API key if needed. |
| 120 | +::: |
| 121 | + |
| 122 | +#### GitHub Authentication |
| 123 | + |
| 124 | +| Env | Description | Default Value | |
| 125 | +| --- | --- | --- | |
| 126 | +| GITHUB_AUTH_ENABLED | Whether to enable GitHub authentication | `false` | |
| 127 | +| GITHUB_CLIENT_ID | GitHub OAuth client ID | `test` | |
| 128 | +| GITHUB_CLIENT_SECRET | GitHub OAuth client secret | `test` | |
| 129 | +| GITHUB_CALLBACK_URL | GitHub OAuth callback URL | `test` | |
| 130 | + |
| 131 | +::: warning |
| 132 | +The default OAuth credentials are invalid (just a placeholder). Please set your own GitHub OAuth credentials if needed. |
| 133 | +::: |
| 134 | + |
| 135 | +::: info |
| 136 | +You can learn more about GitHub OAuth at [GitHub Developer](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app). |
| 137 | +::: |
| 138 | + |
| 139 | +#### Google Authentication |
| 140 | + |
| 141 | +| Env | Description | Default Value | |
| 142 | +| --- | --- | --- | |
| 143 | +| GOOGLE_AUTH_ENABLED | Whether to enable Google authentication | `false` | |
| 144 | +| GOOGLE_CLIENT_ID | Google OAuth client ID | `test` | |
| 145 | +| GOOGLE_CLIENT_SECRET | Google OAuth client secret | `test` | |
| 146 | +| GOOGLE_CALLBACK_URL | Google OAuth callback URL | `test` | |
| 147 | + |
| 148 | +::: warning |
| 149 | +The default OAuth credentials are invalid (just a placeholder). Please set your own Google OAuth credentials if needed. |
| 150 | +::: |
| 151 | + |
| 152 | +::: info |
| 153 | +You can learn more about Google OAuth at [Google Developer](https://developers.google.com/identity/protocols/oauth2). |
| 154 | +::: |
| 155 | + |
| 156 | +### Embeddings Configuration |
| 157 | + |
| 158 | +| Env | Description | Default Value | |
| 159 | +| --- | --- | --- | |
| 160 | +| EMBEDDINGS_PROVIDER | Embeddings provider (either `jina`, `fireworks` or `openai`) | `jina` | |
| 161 | +| EMBEDDINGS_MODEL_NAME | Embeddings model name | `jina-embeddings-v3` | |
| 162 | +| EMBEDDINGS_DIMENSIONS | Embedding vector dimensions | `768` | |
| 163 | +| EMBEDDINGS_BATCH_SIZE | Batch size for embedding processing | `512` | |
| 164 | + |
| 165 | +::: warning |
| 166 | +The default `EMBEDDINGS_PROVIDER` is `jina`. If you want to use other embeddings providers, please set the corresponding environment variables. |
| 167 | +::: |
| 168 | + |
| 169 | +::: warning |
| 170 | +`EMBEDDINGS_DIMENSIONS` must be set to the same value as `REFLY_VEC_DIM` in Qdrant. |
| 171 | +::: |
| 172 | + |
| 173 | +### Reranker |
| 174 | + |
| 175 | +| Env | Description | Default Value | |
| 176 | +| --- | --- | --- | |
| 177 | +| RERANKER_TOP_N | Number of top results to rerank | `10` | |
| 178 | +| RERANKER_MODEL | Reranker model name | `jina-reranker-v2-base-multilingual` | |
| 179 | +| RERANKER_RELEVANCE_THRESHOLD | Relevance threshold for reranking | `0.5` | |
| 180 | + |
| 181 | +::: warning |
| 182 | +Currently, only Jina rerankers are supported. You need to set the `JINA_API_KEY` environment variable. |
| 183 | +::: |
| 184 | + |
| 185 | +### Skill Execution |
| 186 | + |
| 187 | +| Env | Description | Default Value | |
| 188 | +| --- | --- | --- | |
| 189 | +| REFLY_DEFAULT_MODEL | Default AI model | `openai/gpt-4o-mini` | |
| 190 | +| SKILL_IDLE_TIMEOUT | Skill idle timeout in milliseconds | `60000` | |
| 191 | +| SKILL_EXECUTION_TIMEOUT | Skill execution timeout in milliseconds | `180000` | |
| 192 | + |
| 193 | +### Stripe |
| 194 | + |
| 195 | +| Env | Description | Default Value | |
| 196 | +| --- | --- | --- | |
| 197 | +| STRIPE_API_KEY | Stripe API key | (not set) | |
| 198 | +| STRIPE_ACCOUNT_WEBHOOK_SECRET | Stripe account webhook secret | `test` | |
| 199 | +| STRIPE_ACCOUNT_TEST_WEBHOOK_SECRET | Stripe test account webhook secret | `test` | |
| 200 | +| STRIPE_SESSION_SUCCESS_URL | Stripe success redirect URL | (not set) | |
| 201 | +| STRIPE_SESSION_CANCEL_URL | Stripe cancellation redirect URL | (not set) | |
| 202 | +| STRIPE_PORTAL_RETURN_URL | Stripe customer portal return URL | (not set) | |
| 203 | + |
| 204 | +### Quota |
| 205 | + |
| 206 | +#### Request Quota |
| 207 | + |
| 208 | +| Env | Description | Default Value | |
| 209 | +| --- | --- | --- | |
| 210 | +| QUOTA_T1_REQUEST | Tier 1 request quota | `-1` | |
| 211 | +| QUOTA_T2_REQUEST | Tier 2 request quota | `-1` | |
| 212 | + |
| 213 | +#### Storage Quota |
| 214 | + |
| 215 | +| Env | Description | Default Value | |
| 216 | +| --- | --- | --- | |
| 217 | +| QUOTA_STORAGE_FILE | File storage quota | `-1` | |
| 218 | +| QUOTA_STORAGE_OBJECT | Object storage quota | `-1` | |
| 219 | +| QUOTA_STORAGE_VECTOR | Vector storage quota | `-1` | |
| 220 | + |
| 221 | +## Web Frontend |
| 222 | + |
| 223 | +The following are the detailed configurations for the web frontend. You can inject these environment variables into the `refly_web` container. |
| 224 | + |
| 225 | +### General Config |
| 226 | + |
| 227 | +| Env | Description | Default Value | |
| 228 | +| --- | --- | --- | |
| 229 | +| REFLY_API_URL | Refly API server URL | `http://localhost:5800` | |
| 230 | +| COLLAB_URL | Collaboration endpoint URL | `http://localhost:5801` | |
0 commit comments