Use Vuepress to generate a static site for docs.
This commit is contained in:
7
docs/guide/buymeacoffee.md
Normal file
7
docs/guide/buymeacoffee.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Donation
|
||||
|
||||
> If this project is helpful to you, it is also helping me.
|
||||
|
||||
If you want to support me, Buy me a coffee ❤️ [https://www.buymeacoffee.com/WongSaang](https://www.buymeacoffee.com/WongSaang)
|
||||
|
||||

|
||||
79
docs/guide/configuration.md
Normal file
79
docs/guide/configuration.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# Configuration Reference
|
||||
|
||||
## Database
|
||||
|
||||
By default, the backend uses the built-in Sqlite to store data. If an external database is not connected, the data will be lost after the container is destroyed.
|
||||
|
||||
The `chatgpt-ui-wsgi-server` image provides the environment variable `DB_URL` to configure the connection to an external database. The following table shows the link format of the `DB_URL`.
|
||||
|
||||
| DB | LINK |
|
||||
|----------------------|--------------------------------------------------|
|
||||
| PostgreSQL | postgres://USER:PASSWORD@HOST:PORT/DATABASE_NAME |
|
||||
| MySQL | mysql://USER:PASSWORD@HOST:PORT/DATABASE_NAME |
|
||||
| SQLite | sqlite:///PATH |
|
||||
|
||||
For example, if I am using PostgreSQL, the configuration is as follows:
|
||||
|
||||
```
|
||||
backend-wsgi-server:
|
||||
image: wongsaang/chatgpt-ui-wsgi-server:latest
|
||||
environment:
|
||||
- DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt
|
||||
```
|
||||
|
||||
## Email verification
|
||||
|
||||
If you open the user registration feature and need to send email activation links to users, you need to configure the following environment variables in the `wsgi-server` service:
|
||||
|
||||
| Parameters | Description | Default |
|
||||
|----------------------|--------------------------------------------------|-----|
|
||||
| ACCOUNT_EMAIL_VERIFICATION | E-mail authentication method, optional value: none, optional, mandatory | optional |
|
||||
| EMAIL_HOST | SMTP server address | smtp.mailgun.org |
|
||||
| EMAIL_PORT | SMTP server port | 587 |
|
||||
| EMAIL_HOST_USER | User name | - |
|
||||
| EMAIL_HOST_PASSWORD | Password | - |
|
||||
| EMAIL_USE_TLS | Whether to encrypt | True |
|
||||
| EMAIL_FROM | From email | webmaster@localhost |
|
||||
|
||||
## API Proxy
|
||||
|
||||
If you are unable to request the OpenAI API address due to network restrictions, you can configure a proxy in the `wsgi-server` service. You will need to search for how to set up a proxy server on your own.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
backend-wsgi-server:
|
||||
image: wongsaang/chatgpt-ui-wsgi-server:latest
|
||||
environment:
|
||||
- OPENAI_API_PROXY=https://openai.proxy.com/v1
|
||||
```
|
||||
|
||||
## Backend CSRF whitelist
|
||||
|
||||
If you encounter `CSRF verification failed` while accessing the management background, your `APP_DOMAIN` may not be configured correctly. Under the `wsgi-server` service, there is an environment variable `wsgi-server`. Its value should be the address and port of `backend-web-server`, default: `localhost:9000`.
|
||||
|
||||
Suppose I have resolved the domain name `chagpt.com` to the server, and my `backend-web-server` service is bound to port 9000. The correct configuration is as follows:
|
||||
|
||||
```
|
||||
backend-wsgi-server:
|
||||
image: wongsaang/chatgpt-ui-wsgi-server:latest
|
||||
environment:
|
||||
- APP_DOMAIN=chagpt.com:9000
|
||||
```
|
||||
|
||||
## Client Configuration
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
|-----------------------|---------------------------------------------|----------------------------|
|
||||
| SERVER_DOMAIN | Server Address | http://backend-web-server |
|
||||
| NUXT_PUBLIC_APP_NAME | Application Name | ChatGPT UI |
|
||||
| NUXT_PUBLIC_TYPEWRITER| Enable Typewriter Effect [true/false] | true |
|
||||
| NUXT_PUBLIC_TYPEWRITER_DELAY | Typewriter Effect Delay in milliseconds | 50 |
|
||||
|
||||
## User Registration Control
|
||||
|
||||
After deployment, there is an `open_registration` setting under `Chat->Settings` in the admin panel to control whether user registration is allowed. The default value is `True` (allowing user registration). If not needed, please change it to `False`.
|
||||
|
||||
## Web Search Function Control
|
||||
|
||||
This feature is disabled by default. You can enable it in the admin panel under `Chat->Settings`. There is a setting called `open_web_search`, set its value to `True`.
|
||||
62
docs/guide/development.md
Normal file
62
docs/guide/development.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# Development Guide
|
||||
|
||||
## Front-end
|
||||
|
||||
Required skills: [Vue](https://vuejs.org/), [Nuxt](https://nuxt.com/)
|
||||
|
||||
Project address: [https://github.com/WongSaang/chatgpt-ui](https://github.com/WongSaang/chatgpt-ui)
|
||||
|
||||
### Environment Setup
|
||||
Install the latest stable version of node.js. If you need to package it as a docker image, you also need to install docker.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Start development server
|
||||
|
||||
```
|
||||
yarn dev
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
```
|
||||
yarn build
|
||||
```
|
||||
|
||||
### Package as a docker image
|
||||
|
||||
```
|
||||
docker build -t image-name:latest .
|
||||
```
|
||||
|
||||
|
||||
## Back-end
|
||||
|
||||
Required skills: [Python](https://www.python.org/), [Django](https://djangoproject.com/)
|
||||
|
||||
Project address: [https://github.com/WongSaang/chatgpt-ui-server](https://github.com/WongSaang/chatgpt-ui-server)
|
||||
|
||||
### Environment Setup
|
||||
Install Python, pip/pipenv. If you need to package it as a docker image, you also need to install docker.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### Start development server
|
||||
|
||||
```
|
||||
python manage.py runserver
|
||||
```
|
||||
|
||||
### Package as a docker image
|
||||
|
||||
```
|
||||
docker build -t image-name:latest .
|
||||
```
|
||||
13
docs/guide/problems.md
Normal file
13
docs/guide/problems.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Encountering Issues
|
||||
|
||||
## Searching for Issues
|
||||
|
||||
If you encounter any issues while using the project, you can search for related keywords on the project's [Issues](https://github.com/WongSaang/chatgpt-ui/issues) page to see if others have faced similar issues and if there are any solutions available.
|
||||
|
||||
## Submitting an Issue
|
||||
|
||||
If you cannot find a solution, you can communicate with the project maintainers by submitting an issue. [Submit an Issue](https://github.com/WongSaang/chatgpt-ui/issues/new)
|
||||
|
||||
**Note**
|
||||
|
||||
The title should be clear and concise, and the description should provide as much detail as possible about the issue or suggestion. If possible, it is best to provide reproducible steps and screenshots.
|
||||
112
docs/guide/quick-start.md
Normal file
112
docs/guide/quick-start.md
Normal file
@@ -0,0 +1,112 @@
|
||||
# Quick Start
|
||||
|
||||
This project provides related docker images for deployment on a VPS or your local computer. Please note that if your network is unable to request the OpenAI API address, you need to configure a proxy. If you want to make it available to other users, it's best to have a domain name and resolve it to the server.
|
||||
|
||||
You also need an OpenAI API Key, and there are multiple ways to obtain it online, please search for it yourself.
|
||||
|
||||
## Quick deployment through script
|
||||
|
||||
**Note: This script has only been verified on Ubuntu Server 22.04 LTS.**
|
||||
|
||||
```
|
||||
bash <(curl -Ls https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/deployment.sh)
|
||||
```
|
||||
|
||||
## Deployment through Docker Compose
|
||||
|
||||
|
||||
### Prepare docker-compose.yml
|
||||
|
||||
The project provides a sample `docker-compose.yml`. If you want to customize the configuration, please refer to the [configuration reference](/en/guide/configuration) section.
|
||||
|
||||
You can download the `docker-compose.yml` template to your local machine or server by clicking on the link below:
|
||||
|
||||
[https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/docker-compose.yml](https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/docker-compose.yml)
|
||||
|
||||
You can also manually create the `docker-compose.yml` file and copy the following content into the file:
|
||||
|
||||
```
|
||||
version: '3'
|
||||
services:
|
||||
client:
|
||||
platform: linux/x86_64
|
||||
image: wongsaang/chatgpt-ui-client:latest
|
||||
environment:
|
||||
- SERVER_DOMAIN=http://backend-web-server
|
||||
# - NUXT_PUBLIC_APP_NAME='ChatGPT UI' # The name of the application
|
||||
# - NUXT_PUBLIC_TYPEWRITER=true # Whether to enable the typewriter effect, default false
|
||||
# - NUXT_PUBLIC_TYPEWRITER_DELAY=50 # The delay time of the typewriter effect, default 50ms
|
||||
depends_on:
|
||||
- backend-web-server
|
||||
ports:
|
||||
- '${CLIENT_PORT:-80}:80'
|
||||
networks:
|
||||
- chatgpt_ui_network
|
||||
restart: always
|
||||
backend-wsgi-server:
|
||||
platform: linux/x86_64
|
||||
image: wongsaang/chatgpt-ui-wsgi-server:latest
|
||||
environment:
|
||||
- APP_DOMAIN=${APP_DOMAIN:-localhost:9000}
|
||||
- SERVER_WORKERS=3 # The number of worker processes for handling requests.
|
||||
# - DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt # If this parameter is not set, the built-in Sqlite will be used by default. It should be noted that if you do not connect to an external database, the data will be lost after the container is destroyed.
|
||||
- DJANGO_SUPERUSER_USERNAME=admin # default superuser name
|
||||
- DJANGO_SUPERUSER_PASSWORD=password # default superuser password
|
||||
- DJANGO_SUPERUSER_EMAIL=admin@example.com # default superuser email
|
||||
- ACCOUNT_EMAIL_VERIFICATION=${ACCOUNT_EMAIL_VERIFICATION:-none} # Determines the e-mail verification method during signup – choose one of "none", "optional", or "mandatory". Default is "optional". If you don't need to verify the email, you can set it to "none".
|
||||
# If you want to use the email verification function, you need to configure the following parameters
|
||||
# - EMAIL_HOST=SMTP server address
|
||||
# - EMAIL_PORT=SMTP server port
|
||||
# - EMAIL_HOST_USER=
|
||||
# - EMAIL_HOST_PASSWORD=
|
||||
# - EMAIL_USE_TLS=True
|
||||
# - EMAIL_FROM=no-reply@example.com #Default sender email address
|
||||
ports:
|
||||
- '${WSGI_PORT:-8000}:8000'
|
||||
networks:
|
||||
- chatgpt_ui_network
|
||||
restart: always
|
||||
backend-web-server:
|
||||
platform: linux/x86_64
|
||||
image: wongsaang/chatgpt-ui-web-server:latest
|
||||
environment:
|
||||
- BACKEND_URL=http://backend-wsgi-server:8000
|
||||
ports:
|
||||
- '${SERVER_PORT:-9000}:80'
|
||||
depends_on:
|
||||
- backend-wsgi-server
|
||||
networks:
|
||||
- chatgpt_ui_network
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
chatgpt_ui_network:
|
||||
driver: bridge
|
||||
```
|
||||
|
||||
### Starting the Service
|
||||
|
||||
After modifying the configuration as needed, you can start the service by running the following command:
|
||||
|
||||
```
|
||||
docker-compose up --pull always -d
|
||||
```
|
||||
|
||||
This command is used to start the services specified in the Docker Compose configuration. The specific meanings of the parameters are as follows:
|
||||
|
||||
- `up`: start the services specified in the Docker Compose configuration.
|
||||
- `--pull always`: before starting the service each time, the latest version of the image will be pulled from the Docker image repository. This ensures that the image used is always up to date.
|
||||
- `-d`: run the service in the background. If this parameter is not added, the service will run in the current terminal window until the user manually stops it.
|
||||
|
||||
## After Deployment
|
||||
|
||||
Access the management panel at `http(s)://your.domain:9000/admin` or `http(s)://123.123.123.123:9000/admin` using the default superuser account:
|
||||
|
||||
- username: **admin**
|
||||
- password: **password**
|
||||
|
||||
Before starting a chat, you need to add an OpenAI API key. In the management panel, in the "Settings" section, there is a record named `openai_api_key`. Set the value to your API key.
|
||||
|
||||
Now you can access the client at `http(s)://your.domain` or `http://123.123.123.123` to start chatting.
|
||||
|
||||
🎉🎉🎉 Have fun!
|
||||
Reference in New Issue
Block a user