解决安装next-terminal出现中文乱码问题

next-terminal,一个比较简单的开源跳板机,我们有朋友在安装后有出现中文乱码问题,这里提供解决方案。

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、替换

如果我们有在使用的可以你可以直接替换。

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

 

投上你的一票

本文出处:老蒋部落 » 解决安装next-terminal出现中文乱码问题 | 欢迎分享( 公众号:老蒋朋友圈 )

公众号 「老蒋朋友圈」获取站长新知 / 加QQ群 【1012423279】获取商家优惠推送