From 8df50b60607fd8487fc75bdd6547ab2b8c7e6df5 Mon Sep 17 00:00:00 2001 From: wanghe-fit2cloud Date: Mon, 8 Jan 2024 17:52:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20One=20API=20=E9=BB=98=E8=AE=A4=E9=80=89?= =?UTF-8?q?=E6=8B=A9=20MySQL=20=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/one-api/0.5.11/data.yml | 38 +++++++++++++++++++++----- apps/one-api/0.5.11/docker-compose.yml | 7 ++++- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/apps/one-api/0.5.11/data.yml b/apps/one-api/0.5.11/data.yml index 017018f8e..8e1f8ecbe 100644 --- a/apps/one-api/0.5.11/data.yml +++ b/apps/one-api/0.5.11/data.yml @@ -1,5 +1,36 @@ additionalProperties: formFields: + - default: "" + envKey: PANEL_DB_HOST + key: mysql + labelEn: Database Service + labelZh: 数据库服务 + required: true + type: service + - default: oneapi + envKey: PANEL_DB_NAME + labelEn: Database + labelZh: 数据库名 + random: true + required: true + rule: paramCommon + type: text + - default: oneapi + envKey: PANEL_DB_USER + labelEn: User + labelZh: 数据库用户 + random: true + required: true + rule: paramCommon + type: text + - default: oneapi + envKey: PANEL_DB_USER_PASSWORD + labelEn: Password + labelZh: 数据库用户密码 + random: true + required: true + rule: paramComplexity + type: password - default: 3000 edit: true envKey: PANEL_APP_PORT_HTTP @@ -14,11 +45,4 @@ additionalProperties: labelEn: Time Zone labelZh: 时区 required: true - type: text - - default: '' - edit: true - envKey: SQL_DSN - labelEn: SQL_DSN - labelZh: SQL_DSN - required: false type: text \ No newline at end of file diff --git a/apps/one-api/0.5.11/docker-compose.yml b/apps/one-api/0.5.11/docker-compose.yml index 89d06a2d9..685a80691 100644 --- a/apps/one-api/0.5.11/docker-compose.yml +++ b/apps/one-api/0.5.11/docker-compose.yml @@ -11,8 +11,13 @@ services: volumes: - ./data:/data environment: + - SQL_DSN=${PANEL_DB_USER}:${PANEL_DB_USER_PASSWORD}@tcp(${PANEL_DB_HOST}:3306)/${PANEL_DB_NAME} # 修改此行,或注释掉以使用 SQLite 作为数据库 - TZ=${TZ} - - SQL_DSN=${SQL_DSN} +# - REDIS_CONN_STRING=redis://redis +# - SESSION_SECRET=random_string # 修改为随机字符串 +# - NODE_TYPE=slave # 多机部署时从节点取消注释该行 +# - SYNC_FREQUENCY=60 # 需要定期从数据库加载数据时取消注释该行 +# - FRONTEND_BASE_URL=https://openai.justsong.cn # 多机部署时从节点取消注释该行 labels: createdBy: "Apps" networks: