2023-03-11 15:03:18 +08:00
|
|
|
# Server configuration.
|
|
|
|
|
# The server will listen to localhost:3080 request by default. You can set the target ip as you want.
|
|
|
|
|
# If you want this server can be used outside your local machine, for example to share with other
|
|
|
|
|
# machine or expose this from a docker container, set HOST=0.0.0.0 or your external ip interface.
|
|
|
|
|
#
|
|
|
|
|
# Tips: HOST=0.0.0.0 means listening on all interface. It's not a real ip. Use localhost:port rather
|
|
|
|
|
# than 0.0.0.0:port to open it.
|
|
|
|
|
HOST=localhost
|
2023-03-06 15:56:25 -05:00
|
|
|
PORT=3080
|
|
|
|
|
NODE_ENV=development
|
2023-03-10 21:05:35 +08:00
|
|
|
|
2023-03-11 15:03:18 +08:00
|
|
|
# Change this to proxy any API request. It's useful if your machine have difficulty calling the original API server.
|
|
|
|
|
# PROXY="http://YOUR_PROXY_SERVER"
|
|
|
|
|
|
2023-03-06 21:12:36 -05:00
|
|
|
# Change this to your MongoDB URI if different and I recommend appending chatgpt-clone
|
|
|
|
|
MONGO_URI="mongodb://127.0.0.1:27017/chatgpt-clone"
|
2023-03-10 21:05:35 +08:00
|
|
|
|
2023-04-05 21:21:02 +08:00
|
|
|
|
|
|
|
|
#############################
|
|
|
|
|
# Endpoint OpenAI:
|
|
|
|
|
#############################
|
|
|
|
|
|
|
|
|
|
# Access key from OpenAI platform
|
|
|
|
|
# Leave it blank to disable this endpoint
|
2023-03-11 15:03:18 +08:00
|
|
|
OPENAI_KEY=
|
2023-03-29 10:17:24 -04:00
|
|
|
|
2023-04-05 21:21:02 +08:00
|
|
|
# Identify the available models, sperate by comma, and not space in it
|
2023-04-10 00:41:34 +08:00
|
|
|
# The first will be default
|
2023-04-05 21:21:02 +08:00
|
|
|
# Leave it blank to use internal settings.
|
2023-04-10 00:41:34 +08:00
|
|
|
OPENAI_MODELS=gpt-3.5-turbo,gpt-3.5-turbo-0301,text-davinci-003,gpt-4
|
2023-04-05 21:21:02 +08:00
|
|
|
|
|
|
|
|
# Reverse proxy setting for OpenAI
|
|
|
|
|
# https://github.com/waylaidwanderer/node-chatgpt-api#using-a-reverse-proxy
|
|
|
|
|
# OPENAI_REVERSE_PROXY=<YOUR REVERSE PROXY>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#############################
|
|
|
|
|
# Endpoint BingAI (Also jailbreak Sydney):
|
|
|
|
|
#############################
|
|
|
|
|
|
|
|
|
|
# BingAI Tokens: the "_U" cookies value from bing.com
|
|
|
|
|
# Leave it and BINGAI_USER_TOKEN blank to disable this endpoint.
|
2023-04-11 21:50:53 -04:00
|
|
|
# Set to "user_provided" to allow user provided token.
|
|
|
|
|
# BINGAI_TOKEN="user_provided"
|
|
|
|
|
BINGAI_TOKEN=user_provided
|
2023-04-05 21:21:02 +08:00
|
|
|
|
2023-04-08 00:14:44 +08:00
|
|
|
# BingAI Host:
|
|
|
|
|
# Necessary for some people in different countries, e.g. China (https://cn.bing.com)
|
|
|
|
|
# Leave it blank to use default server.
|
|
|
|
|
# BINGAI_HOST="https://cn.bing.com"
|
|
|
|
|
|
2023-04-05 21:21:02 +08:00
|
|
|
|
|
|
|
|
#############################
|
|
|
|
|
# Endpoint chatGPT:
|
|
|
|
|
#############################
|
2023-03-14 01:24:43 +08:00
|
|
|
|
2023-03-22 20:09:52 -04:00
|
|
|
# ChatGPT Browser Client (free but use at your own risk)
|
|
|
|
|
# Access token from https://chat.openai.com/api/auth/session
|
2023-04-05 21:21:02 +08:00
|
|
|
# Exposes your access token to CHATGPT_REVERSE_PROXY
|
|
|
|
|
# Leave it blank to disable this endpoint
|
2023-04-10 00:41:34 +08:00
|
|
|
# Set to "user_provide" to allow user provided token.
|
|
|
|
|
# CHATGPT_TOKEN="user_provide"
|
2023-03-22 20:09:52 -04:00
|
|
|
CHATGPT_TOKEN=
|
2023-04-05 21:21:02 +08:00
|
|
|
|
|
|
|
|
# Identify the available models, sperate by comma, and not space in it
|
2023-04-10 00:41:34 +08:00
|
|
|
# The first will be default
|
2023-04-05 21:21:02 +08:00
|
|
|
# Leave it blank to use internal settings.
|
2023-04-10 00:41:34 +08:00
|
|
|
CHATGPT_MODELS=text-davinci-002-render-sha,text-davinci-002-render-paid,gpt-4
|
2023-04-05 21:21:02 +08:00
|
|
|
|
|
|
|
|
# Reverse proxy setting for OpenAI
|
|
|
|
|
# https://github.com/waylaidwanderer/node-chatgpt-api#using-a-reverse-proxy
|
|
|
|
|
# By default it will use the node-chatgpt-api recommended proxy, (it's a third party server)
|
|
|
|
|
# CHATGPT_REVERSE_PROXY=<YOUR REVERSE PROXY>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#############################
|
|
|
|
|
# Search:
|
|
|
|
|
#############################
|
2023-03-22 20:09:52 -04:00
|
|
|
|
2023-03-23 11:49:54 -04:00
|
|
|
# ENABLING SEARCH MESSAGES/CONVOS
|
2023-03-22 20:09:52 -04:00
|
|
|
# Requires installation of free self-hosted Meilisearch or Paid Remote Plan (Remote not tested)
|
|
|
|
|
# The easiest setup for this is through docker-compose, which takes care of it for you.
|
2023-04-05 21:21:02 +08:00
|
|
|
# SEARCH=1
|
|
|
|
|
SEARCH=1
|
2023-03-23 11:49:54 -04:00
|
|
|
|
2023-03-22 20:09:52 -04:00
|
|
|
# REQUIRED FOR SEARCH: MeiliSearch Host, mainly for api server to connect to the search server.
|
2023-03-23 11:49:54 -04:00
|
|
|
# must replace '0.0.0.0' with 'meilisearch' if serving meilisearch with docker-compose
|
2023-03-25 10:20:39 -04:00
|
|
|
# MEILI_HOST='http://meilisearch:7700' # <-- docker-compose (should already be setup on docker-compose.yml)
|
|
|
|
|
MEILI_HOST='http://0.0.0.0:7700' # <-- local/remote
|
2023-03-23 11:49:54 -04:00
|
|
|
|
2023-03-22 20:09:52 -04:00
|
|
|
# REQUIRED FOR SEARCH: MeiliSearch HTTP Address, mainly for docker-compose to expose the search server.
|
2023-03-23 11:49:54 -04:00
|
|
|
# must replace '0.0.0.0' with 'meilisearch' if serving meilisearch with docker-compose
|
2023-03-25 10:20:39 -04:00
|
|
|
# MEILI_HTTP_ADDR='meilisearch:7700' # <-- docker-compose (should already be setup on docker-compose.yml)
|
|
|
|
|
MEILI_HTTP_ADDR='0.0.0.0:7700' # <-- local/remote
|
2023-03-23 11:49:54 -04:00
|
|
|
|
|
|
|
|
# REQUIRED FOR SEARCH: In production env., needs a secure key, feel free to generate your own.
|
2023-03-22 20:09:52 -04:00
|
|
|
# This master key must be at least 16 bytes, composed of valid UTF-8 characters.
|
|
|
|
|
# Meilisearch will throw an error and refuse to launch if no master key is provided or if it is under 16 bytes,
|
|
|
|
|
# Meilisearch will suggest a secure autogenerated master key.
|
2023-03-23 12:45:42 -04:00
|
|
|
# Using docker, it seems recognized as production so use a secure key.
|
2023-03-23 15:37:25 -04:00
|
|
|
# MEILI_MASTER_KEY= # <-- empty/insecure key works for local/remote
|
2023-03-23 13:30:55 -04:00
|
|
|
MEILI_MASTER_KEY=JKMW-hGc7v_D1FkJVdbRSDNFLZcUv3S75yrxXP0SmcU # <-- ready made secure key for docker-compose
|
|
|
|
|
|
2023-03-14 01:24:43 +08:00
|
|
|
|
2023-04-05 21:21:02 +08:00
|
|
|
#############################
|
2023-03-21 19:44:31 -04:00
|
|
|
# User System
|
2023-04-05 21:21:02 +08:00
|
|
|
#############################
|
|
|
|
|
|
|
|
|
|
# Enable the user system.
|
2023-03-14 01:24:43 +08:00
|
|
|
# this is not a ready to use user system.
|
|
|
|
|
# dont't use it, unless you can write your own code.
|
2023-03-23 16:26:22 -04:00
|
|
|
# ENABLE_USER_SYSTEM= # <-- make sure you don't comment this back in if you're not using your own user system
|