Document systemd service setup
This commit is contained in:
@@ -28,6 +28,69 @@ http://127.0.0.1:8080
|
|||||||
http://127.0.0.1:8080/login
|
http://127.0.0.1:8080/login
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## systemd 服务示例
|
||||||
|
|
||||||
|
假设二进制文件放在:
|
||||||
|
|
||||||
|
```text
|
||||||
|
/opt/zhanlu-proxy/zhanlu-proxy
|
||||||
|
```
|
||||||
|
|
||||||
|
凭据文件放在:
|
||||||
|
|
||||||
|
```text
|
||||||
|
/opt/zhanlu-proxy/credentials.json
|
||||||
|
```
|
||||||
|
|
||||||
|
创建环境变量文件 `/etc/zhanlu-proxy/zhanlu-proxy.env`:
|
||||||
|
|
||||||
|
```env
|
||||||
|
ZHANLU_LISTEN_ADDR=:8080
|
||||||
|
ZHANLU_CREDENTIALS_FILE=/opt/zhanlu-proxy/credentials.json
|
||||||
|
ZHANLU_SERVER_BASE_URL=https://api-wuxi-1.cmecloud.cn:8443
|
||||||
|
ZHANLU_UPSTREAM_PATH=/api/acepilot/zhanlu/aiDeveloper/chat
|
||||||
|
ZHANLU_MODELS=glm47,minimax-m25
|
||||||
|
ZHANLU_DEFAULT_MODEL=minimax-m25
|
||||||
|
ZHANLU_UPSTREAM_TIMEOUT=300s
|
||||||
|
OPENAI_COMPAT_API_KEY=change-this-local-secret
|
||||||
|
```
|
||||||
|
|
||||||
|
创建 systemd service 文件 `/etc/systemd/system/zhanlu-proxy.service`:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[Unit]
|
||||||
|
Description=Zhanlu OpenAI-compatible proxy
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
WorkingDirectory=/opt/zhanlu-proxy
|
||||||
|
EnvironmentFile=/etc/zhanlu-proxy/zhanlu-proxy.env
|
||||||
|
ExecStart=/opt/zhanlu-proxy/zhanlu-proxy
|
||||||
|
Restart=always
|
||||||
|
RestartSec=3
|
||||||
|
User=zhanlu-proxy
|
||||||
|
Group=zhanlu-proxy
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
启用并启动服务:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable --now zhanlu-proxy
|
||||||
|
sudo systemctl status zhanlu-proxy
|
||||||
|
```
|
||||||
|
|
||||||
|
查看日志:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
journalctl -u zhanlu-proxy -f
|
||||||
|
```
|
||||||
|
|
||||||
## 登录与凭据
|
## 登录与凭据
|
||||||
|
|
||||||
### 移动云手机号验证码登录
|
### 移动云手机号验证码登录
|
||||||
|
|||||||
Reference in New Issue
Block a user