Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
fxjs committed Jul 14, 2024
1 parent cf6c8ea commit 8e99847
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 29 deletions.
22 changes: 15 additions & 7 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#### Text-to-Speech Service (Supports CORS, Authentication)


### Environment Setup
Install [deno](https://docs.deno.com/runtime/manual/), [pnpm](https://pnpm.io/installation)

Expand All @@ -21,18 +22,21 @@ pnpm compile:linux
```
[Reference Compilation Documentation](https://docs.deno.com/runtime/manual/tools/compiler/)


### Environment Variables
```text
TTS_PORT The default startup port is 8901
TTS_AUTH_TOKEN Authentication token (if set to TestToken, the Authorization field must be added in the headers when calling the interface)
```


### Deployment (Examples for Arch, Debian)
##### Method 1. Register as a service
##### Method 1. Install `tzfe-tts.service` Service and Manage with `systemctl`
```shell
curl -fsSL https://tts.tzmf.xyz/install.sh | sh
```
```shell
sudo sh ./install.sh

# Check service status
systemctl status tzfe-tts

Expand All @@ -41,11 +45,16 @@ tail -F /var/log/tzfe-tts/tzfe-tts.log
```

##### Method 2. Docker Image
~_~
- ==

### Uninstall
```shell
sudo sh ./uninstall.sh
curl -fsSL https://tts.tzmf.xyz/uninstall.sh | sh
```

### Configuring Log Rotation (Optional)
```shell
curl -fsSL https://tts.tzmf.xyz/logrotate.sh | sh
```

### Usage
Expand All @@ -66,5 +75,4 @@ fetch('http://0.0.0.0:8901/v1/audio/speech', {
const audio = new Audio(audioUrl);
audio.play();
});
```

```
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ TTS_AUTH_TOKEN 鉴权token (如设置为TestToken,调用接口时需在heade


### 部署(以 Arch、Debian 为例)
##### 方式1. 注册 service 服务
##### 方式1. 安装 tzfe-tts.service 服务,使用 systemctl 进行管理
```shell
curl -fsSL https://tts.tzmf.xyz/install.sh | sh
```
```shell
sudo sh ./install.sh

# 查看服务状态
systemctl status tzfe-tts

Expand All @@ -44,11 +45,16 @@ tail -F /var/log/tzfe-tts/tzfe-tts.log
```

##### 方式2. Docker镜像
~_~
- ==

### 卸载
```shell
sudo sh ./uninstall.sh
curl -fsSL https://tts.tzmf.xyz/uninstall.sh | sh
```

### 配置日志轮转(可选)
```shell
curl -fsSL https://tts.tzmf.xyz/logrotate.sh | sh
```

### 调用
Expand Down
32 changes: 16 additions & 16 deletions logrotate.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/bash

# 日志轮换
touch /etc/logrotate.d/tzfe-tts


#/var/log/tzfe-tts/tzfe-tts.log {
# size 200M
# rotate 10
# compress
# delaycompress
# notifempty
# create 0640 root root
# sharedscripts
# postrotate
# systemctl reload tzfe-tts.service > /dev/null 2>&1 || true
# endscript
#}
# 日志轮转配置文件
CONFIG_FILE="/etc/logrotate.d/tzfe-tts"

cat <<EOL > $CONFIG_FILE
/var/log/tzfe-tts/tzfe-tts.log {
size 200M
rotate 10
compress
delaycompress
notifempty
create 0640 root root
sharedscripts
postrotate
systemctl reload tzfe-tts.service > /dev/null 2>&1 || true
endscript
}
EOL

echo 'done'
1 change: 0 additions & 1 deletion uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service"
BIN_PATH="/usr/local/bin/$SERVICE_NAME"
LOG_DIR="/var/log/$SERVICE_NAME"

# 启动服务
echo "Removing $SERVICE_NAME service..."
systemctl stop $SERVICE_NAME
systemctl disable $SERVICE_NAME
Expand Down

0 comments on commit 8e99847

Please sign in to comment.