change the url

This commit is contained in:
2026-08-17 10:53:54 +08:00
parent c50c82a90f
commit 624b834632
6 changed files with 17 additions and 17 deletions

View File

@@ -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,
)
)

View File

@@ -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,
)

View File

@@ -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

View File

@@ -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. 配置 NginxHTTP 回源)
本机 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

View File

@@ -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不常需要

View File

@@ -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;