From f95f5948ffa5cb7b5ec31dcc8e3996c3624de393 Mon Sep 17 00:00:00 2001 From: JustSong Date: Sat, 22 Apr 2023 22:29:00 +0800 Subject: [PATCH] Update README --- README.en.md | 95 ---------------------------------------------------- README.md | 39 ++++++++++----------- 2 files changed, 17 insertions(+), 117 deletions(-) delete mode 100644 README.en.md diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 7387244e..00000000 --- a/README.en.md +++ /dev/null @@ -1,95 +0,0 @@ -

- 中文 | English -

- -

- one-api logo -

- -
- -# Gin Template - -_✨ Template for Gin & React projects ✨_ - -
- -

- - license - - - release - - - release - - - GoReportCard - -

- -

- Download - · - Tutorial - · - Feedback - · - Demo -

- -## Features -+ [x] Built-in user management. -+ [x] Built-in file management. -+ [x] [GitHub OAuth](https://github.com/settings/applications/new). -+ [x] WeChat official account authorization (need [wechat-server](https://github.com/songquanpeng/wechat-server)). -+ [x] Email verification & password reset. -+ [x] Request rate limiting. -+ [x] Static files caching. -+ [x] Mobile friendly UI. -+ [x] Token based authorization. -+ [x] Use GitHub Actions to build releases & Docker images. -+ [x] Cloudflare Turnstile user validation. - -## Deployment -### Manual deployment -1. Download built binary from [GitHub Releases](https://github.com/songquanpeng/one-api/releases/latest) or build from source: - ```shell - git clone https://github.com/songquanpeng/one-api.git - go mod download - go build -ldflags "-s -w" -o one-api - ```` -2. Run it: - ```shell - chmod u+x one-api - ./one-api --port 3000 --log-dir ./logs - ``` -3. Visit [http://localhost:3000/](http://localhost:3000/) and login. The username for the initial account is `root` and the password is `123456`. - -### Deploy with Docker -Execute: `docker run -d --restart always -p 3000:3000 -v /home/ubuntu/data/one-api:/data -v /etc/ssl/certs:/etc/ssl/certs:ro justsong/one-api` - -Data will be saved in `/home/ubuntu/data/one-api`. - -## Configurations -The system works out of the box. - -You can configure the system by set environment variables or specify command line arguments. - -After the system starts, use `root` user to log in to the system and do further configuration. - -### Environment Variables -1. `REDIS_CONN_STRING`: when set, Redis will be used as the storage for request rate limitation instead of memory storage. - + Example: `REDIS_CONN_STRING=redis://default:redispw@localhost:49153` -2. `SESSION_SECRET`: when set, a fixed session key will be used so that the logged-in users' cookie remains valid across system reboots. - + Example: `SESSION_SECRET=random_string` -3. `SQL_DSN`: when set, the target SQL database will be used instead of SQLite. - + Example: `SQL_DSN=root:123456@tcp(localhost:3306)/one-api` - -### Command line Arguments -1. `--port `: specify the port number, the default value is `3000`. - + Example: `--port 3000` -2. `--log-dir `: specify the log dir, if not set, the log won't be saved. - + Example: `--log-dir ./logs` -3. `--version`: print the version and exit. \ No newline at end of file diff --git a/README.md b/README.md index 316f7ed4..19cbd4b8 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,12 @@ -

- 中文 | English -

-

one-api logo

-# Gin One API +# One API -_✨ 用于 Gin & React 项目的模板 ✨_ +_✨ All in one 的 OpenAI 接口,整合各种 API 访问方式,开箱即用✨_
@@ -40,19 +36,23 @@ _✨ 用于 Gin & React 项目的模板 ✨_

## 功能 -+ [x] 内置用户管理 -+ [x] 内置文件管理 -+ [x] [GitHub 开放授权](https://github.com/settings/applications/new) -+ [x] 微信公众号授权(需要 [wechat-server](https://github.com/songquanpeng/wechat-server)) -+ [x] 邮箱验证以及通过邮件进行密码重置 -+ [x] 请求频率限制 -+ [x] 静态文件缓存 -+ [x] 移动端适配 -+ [x] 基于令牌的鉴权 -+ [x] 使用 GitHub Actions 自动打包可执行文件与 Docker 镜像 -+ [x] Cloudflare Turnstile 用户校验 +1. 多种 API 访问方式: + + [ ] One API 服务端中继 + + [ ] [API2D](https://api2d.com/r/197971) +2. 聚合多种 API 访问方式,通过负载均衡的方式进行访问。 +3. 单个访问渠道支持设置多个 API Key,利用起来你的多个 API Key。 +4. 多种用户登录注册方式: + + 邮箱登录注册以及通过邮箱进行密码重置。 + + [GitHub 开放授权](https://github.com/settings/applications/new)。 + + 微信公众号授权(需要额外部署 [WeChat Server](https://github.com/songquanpeng/wechat-server))。 +5. 支持用户管理。 ## 部署 +### 基于 Docker 进行部署 +执行:`docker run -d --restart always -p 3000:3000 -v /home/ubuntu/data/one-api:/data -v /etc/ssl/certs:/etc/ssl/certs:ro justsong/one-api` + +数据将会保存在宿主机的 `/home/ubuntu/data/one-api` 目录。 + ### 手动部署 1. 从 [GitHub Releases](https://github.com/songquanpeng/one-api/releases/latest) 下载可执行文件或者从源码编译: ```shell @@ -69,11 +69,6 @@ _✨ 用于 Gin & React 项目的模板 ✨_ 更加详细的部署教程[参见此处](https://iamazing.cn/page/how-to-deploy-a-website)。 -### 基于 Docker 进行部署 -执行:`docker run -d --restart always -p 3000:3000 -v /home/ubuntu/data/one-api:/data -v /etc/ssl/certs:/etc/ssl/certs:ro justsong/one-api` - -数据将会保存在宿主机的 `/home/ubuntu/data/one-api` 目录。 - ## 配置 系统本身开箱即用。