在我这里会有 io.listen 相关报错,
sed -i 's/io.listen/io/g' /usr/local/lib/node_modules/web-terminal/lib/terminal.js
即可。
Dockerlization
由于你不知道用户会搞出什么名堂,最好还是虚拟化一下。
Dockerfile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
FROM node:14# node >= 10
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list # 清华源 RUN apt-get update RUN apt-get install -y x11-apps traceroute psmisc # cal commands
# could add npm mirror RUN npm install web-terminal -g RUN sed -i 's/io.listen/io/g' /usr/local/lib/node_modules/web-terminal/lib/terminal.js
RUN useradd -m -s /bin/bash nefu RUNexport WEB_SHELL=bash
EXPOSE8088
CMD [ "su", "-", "nefu", "-c", "web-terminal --port 8088" ] # must be list form