From 624b834632f9a9a6d70ccc5d4453044606f0e9ed Mon Sep 17 00:00:00 2001 From: Shuming Liu Date: Mon, 17 Aug 2026 10:53:54 +0800 Subject: [PATCH] change the url --- android/README.md | 4 ++-- .../oraltrainer/sdk/OralTrainerSdkConfig.kt | 2 +- sentence_api/.env.example | 2 +- sentence_api/DEPLOYMENT.md | 20 +++++++++---------- sentence_api/UPDATE.md | 2 +- sentence_api/nginx.conf.example | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/android/README.md b/android/README.md index 44ca8f5..cbcd288 100644 --- a/android/README.md +++ b/android/README.md @@ -68,7 +68,7 @@ OralTrainerSdk.init( ## Sentence Boundary API -The SDK defaults to `https://video_service.d1kt.cn` and requests: +The SDK defaults to `https://videoservice.d1kt.cn` and requests: ```text GET /api/v1/videos/{sha256}/sentence-boundaries @@ -93,7 +93,7 @@ Override the service only when a staging or private deployment is required: OralTrainerSdk.init( context, OralTrainerSdkConfig( - sentenceBoundaryApiBaseUrl = "https://video_service.d1kt.cn", + sentenceBoundaryApiBaseUrl = "https://videoservice.d1kt.cn", assessmentApiKey = BuildConfig.ORAL_TRAINER_CLIENT_KEY, ) ) diff --git a/android/oral-trainer-sdk/src/main/java/cn/learningpad/oraltrainer/sdk/OralTrainerSdkConfig.kt b/android/oral-trainer-sdk/src/main/java/cn/learningpad/oraltrainer/sdk/OralTrainerSdkConfig.kt index 92443f1..4403e60 100644 --- a/android/oral-trainer-sdk/src/main/java/cn/learningpad/oraltrainer/sdk/OralTrainerSdkConfig.kt +++ b/android/oral-trainer-sdk/src/main/java/cn/learningpad/oraltrainer/sdk/OralTrainerSdkConfig.kt @@ -8,6 +8,6 @@ data class OralTrainerSdkConfig @JvmOverloads constructor( val userAgent: String = "OralTrainerSdk/0.1.0", val connectTimeoutMs: Int = 15_000, val readTimeoutMs: Int = 30_000, - val sentenceBoundaryApiBaseUrl: String = "https://video_service.d1kt.cn", + val sentenceBoundaryApiBaseUrl: String = "https://videoservice.d1kt.cn", val assessmentApiKey: String? = null, ) diff --git a/sentence_api/.env.example b/sentence_api/.env.example index d9af6fa..de4b039 100644 --- a/sentence_api/.env.example +++ b/sentence_api/.env.example @@ -1,5 +1,5 @@ ORAL_TRAINER_DATA_DIR=/app/sentence_api/data -PUBLIC_BASE_URL=https://video_service.d1kt.cn +PUBLIC_BASE_URL=https://videoservice.d1kt.cn ADMIN_API_KEY=replace-with-a-long-random-secret CLIENT_API_KEY=replace-with-a-separate-client-secret diff --git a/sentence_api/DEPLOYMENT.md b/sentence_api/DEPLOYMENT.md index d17e292..7b81c1d 100644 --- a/sentence_api/DEPLOYMENT.md +++ b/sentence_api/DEPLOYMENT.md @@ -163,7 +163,7 @@ openssl rand -hex 32 分别生成两个随机值,填入 `.env` 的 `ADMIN_API_KEY` 和 `CLIENT_API_KEY`,并确认: ```dotenv -PUBLIC_BASE_URL=https://video_service.d1kt.cn +PUBLIC_BASE_URL=https://videoservice.d1kt.cn MOSS_TRANSCRIBE_URL=http://127.0.0.1:8001/v1/audio/transcriptions ``` @@ -200,7 +200,7 @@ python3.12 -m venv .venv-api python -m pip install -r sentence_api/requirements.txt export ORAL_TRAINER_DATA_DIR=/opt/oral-trainer-data -export PUBLIC_BASE_URL=https://video_service.d1kt.cn +export PUBLIC_BASE_URL=https://videoservice.d1kt.cn export ADMIN_API_KEY='替换为随机密钥' export MOSS_TRANSCRIBE_URL=http://127.0.0.1:8001/v1/audio/transcriptions @@ -241,7 +241,7 @@ sudo journalctl -u oral-trainer-api -f ## 4. 配置 Nginx(HTTP 回源) 本机 Nginx 只监听 80 端口提供 HTTP,不在本机终结 HTTPS。总出口(线上边缘网关) -在 `https://video_service.d1kt.cn` 终结 TLS 证书后,把请求以 HTTP 转发到本机 +在 `https://videoservice.d1kt.cn` 终结 TLS 证书后,把请求以 HTTP 转发到本机 内网 IP 的 80 端口。因此本机不需要证书,也不需要安装 certbot。 ```bash @@ -263,14 +263,14 @@ sudo systemctl reload nginx 本地验证(走本机 Nginx): ```bash -curl -H 'Host: video_service.d1kt.cn' http://127.0.0.1/healthz +curl -H 'Host: videoservice.d1kt.cn' http://127.0.0.1/healthz ``` -公网验证(经总出口映射,需先在网关配置好 `https://video_service.d1kt.cn` +公网验证(经总出口映射,需先在网关配置好 `https://videoservice.d1kt.cn` 到本机内网 IP:80 的映射): ```bash -curl https://video_service.d1kt.cn/healthz +curl https://videoservice.d1kt.cn/healthz ``` 证书的申请与续期都在总出口完成,本机无需任何证书配置。 @@ -278,7 +278,7 @@ curl https://video_service.d1kt.cn/healthz 管理后台地址: ```text -https://video_service.d1kt.cn/admin +https://videoservice.d1kt.cn/admin ``` 后台的管理密钥保存在当前浏览器的 `localStorage`,接口请求通过 `X-Admin-Key` 发送。 @@ -300,8 +300,8 @@ https://video_service.d1kt.cn/admin 查询处理状态: ```bash -curl https://video_service.d1kt.cn/api/v1/videos -curl https://video_service.d1kt.cn/api/v1/videos/{sha256} +curl https://videoservice.d1kt.cn/api/v1/videos +curl https://videoservice.d1kt.cn/api/v1/videos/{sha256} ``` 如果转写服务未配置,上传仍会使用原来的静音检测生成边界,但句子文本为空,无法开始测验。配置好转写服务后可在后台点击“重新处理”。 @@ -336,7 +336,7 @@ ffmpeg -i input.mkv \ ```bash curl -X POST \ - https://video_service.d1kt.cn/api/v1/videos/{sha256}/sentences/0/assessments \ + https://videoservice.d1kt.cn/api/v1/videos/{sha256}/sentences/0/assessments \ -H 'X-Client-Key: 替换为客户端密钥' \ -F audio=@student.wav \ -F language=en diff --git a/sentence_api/UPDATE.md b/sentence_api/UPDATE.md index 3a10e1b..b177910 100644 --- a/sentence_api/UPDATE.md +++ b/sentence_api/UPDATE.md @@ -94,7 +94,7 @@ docker compose up -d # 检测到配置变化会自动重建容器 sudo cp sentence_api/nginx.conf.example /etc/nginx/sites-available/oral-trainer sudo nginx -t sudo systemctl reload nginx -curl -H 'Host: video_service.d1kt.cn' http://127.0.0.1/healthz +curl -H 'Host: videoservice.d1kt.cn' http://127.0.0.1/healthz ``` ## 3. 更新 Whisper(不常需要) diff --git a/sentence_api/nginx.conf.example b/sentence_api/nginx.conf.example index 9b8a2bd..f6682df 100644 --- a/sentence_api/nginx.conf.example +++ b/sentence_api/nginx.conf.example @@ -1,10 +1,10 @@ # 本机 Nginx 只提供 HTTP(端口 80),不在本机终结 HTTPS: -# 证书由“总出口”(线上边缘网关)终结,网关把 https://video_service.d1kt.cn +# 证书由“总出口”(线上边缘网关)终结,网关把 https://videoservice.d1kt.cn # 映射到本机内网 IP 的 80 端口,以 HTTP 回源。本机不需要证书,也不要监听 443。 server { listen 80; - server_name video_service.d1kt.cn; + server_name videoservice.d1kt.cn; client_max_body_size 12g; client_body_timeout 7200s;