优惠发布
商家八卦

如何解决next-terminal中文乱码

主机资讯之前安利过next-terminal,算是开源跳板机系统里面比较好用的了,虽没有jumpserver那么细,web端日常使用或者管理小鸡应该是够用了。由于涉及字体版权问题,开发者默认没有内置中文字体,群里经常有人问为啥中文乱码,所以写个安装教程供大家参考,我就不班门弄斧了,直接贴配置。

1.sqlite数据库最简安装

创建文件夹和文件:
mkdir -p /root/next-terminal/drive
mkdir -p /root/next-terminal/recording/
touch /root/next-terminal/next-terminal.db
cd /root/next-terminal/
下载可以免费商用的华为鸿蒙字体:
curl -o msyh.ttf https://tutu.ovh/work/fonts/HarmonyOS%20Sans/HarmonyOS_Sans_SC/HarmonyOS_Sans_SC_Medium.ttf
编写docker-compose的yml文件:
vim docker-compose.yml
version: '3.3'
services:
next-terminal:
image: "dushixiang/next-terminal:latest"
ports:
- "8088:8088"
volumes:
- /root/next-terminal/drive:/usr/local/next-terminal/drive
- /root/next-terminal/recording:/usr/local/next-terminal/recording
- /root/next-terminal/next-terminal.db:/usr/local/next-terminal/next-terminal.db
- /root/next-terminal/msyh.ttf:/usr/local/share/fonts/msyh.ttf
启动:
docker-compose up -d
停止:
docker-compose down
升级更新:
docker-compose pull && docker-compose up -d && docker image prune -a -f

2.使用MySQL数据库安装

创建文件夹和文件:
mkdir -p /root/next-terminal/drive
mkdir -p /root/next-terminal/recording/
touch /root/next-terminal/next-terminal.db
cd /root/next-terminal/
下载可以免费商用的华为鸿蒙字体:
curl -o msyh.ttf https://tutu.ovh/work/fonts/HarmonyOS%20Sans/HarmonyOS_Sans_SC/HarmonyOS_Sans_SC_Medium.ttf
编写docker-compose的yml文件:
vim docker-compose.yml
version: '3.3'
services:
mysql:
image: mysql:8.0
environment:
MYSQL_DATABASE: next-terminal
MYSQL_USER: next-terminal
MYSQL_PASSWORD: next-terminal
MYSQL_ROOT_PASSWORD: next-terminal
ports:
- "3306:3306"
next-terminal:
image: "dushixiang/next-terminal:latest"
environment:
DB: "mysql"
MYSQL_HOSTNAME: "mysql"
MYSQL_PORT: 3306
MYSQL_USERNAME: "next-terminal"
MYSQL_PASSWORD: "next-terminal"
MYSQL_DATABASE: "next-terminal"
ports:
- "8088:8088"
volumes:
- /root/next-terminal/drive:/usr/local/next-terminal/drive
- /root/next-terminal/recording:/usr/local/next-terminal/recording
- /root/next-terminal/msyh.ttf:/usr/local/share/fonts/msyh.ttf
depends_on:
- mysql
启动:
docker-compose up -d
停止:
docker-compose down
升级更新:
docker-compose pull; docker-compose up -d; docker image prune -a -f

3.对于已经在使用中的next-terminal,可以直接拷贝到对应目录进行配置。

curl -o msyh.ttf https://tutu.ovh/work/fonts/HarmonyOS%20Sans/HarmonyOS_Sans_SC/HarmonyOS_Sans_SC_Medium.ttf
docker cp msyh.ttf be5aa8afa2f0:/usr/local/share/msyh.ttf
docker exec -it be5aa8afa2f0 mkfontscale
docker exec -it be5aa8afa2f0 mkfontdir
docker exec -it be5aa8afa2f0 fc-cache
未经允许不得转载:主机资讯-VPS商家前沿资讯 » 如何解决next-terminal中文乱码