From 67c06f55ebab2c2d0b2801ad8e6935dd17b8af6c Mon Sep 17 00:00:00 2001 From: Harry Feng Date: Thu, 12 Jan 2023 14:47:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20docker=20=E9=95=9C?= =?UTF-8?q?=E5=83=8F=EF=BC=8C=E5=A2=9E=E5=8A=A0=20lua=20=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=89=80=E9=9C=80=E7=9A=84=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e3d08035..742137d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM alpine:latest # 安装编译器和依赖包 RUN apk update \ - && apk add --no-cache git gcc libc-dev zlib-dev zlib-static pcre-dev make curl + && apk add --no-cache git gcc libc-dev zlib-dev zlib-static pcre-dev lua-dev make curl luarocks RUN git clone --depth 1 https://github.com/junegunn/vim-plug.git /vim-plug RUN git clone --depth 1 https://github.com/dzpao/vim-mbs.git /vim-mbs @@ -15,6 +15,9 @@ RUN git clone --depth 1 https://github.com/mhinz/vim-startify.git /vim-startify RUN git clone --depth 1 https://github.com/mudclient/tintin.git --branch beta-develop WORKDIR /tintin/src/ +# 安装 rex_pcre for lua5.1 +RUN luarocks-5.1 install lrexlib-pcre + # 这里 hack 了一下 gcc,强制静态编译。 ENV PATH=.:/sbin:/bin:/usr/sbin:/usr/bin RUN echo '/usr/bin/gcc --static $*' > gcc && chmod +x gcc @@ -34,7 +37,7 @@ ENV LANG=zh_CN.UTF8 \ WORKDIR /paotin/ RUN apk update \ - && apk add --no-cache tmux bash ncurses less neovim nano + && apk add --no-cache tmux bash ncurses less neovim nano lua5.1 pcre # 设置时区为上海 RUN apk add --no-cache tzdata \ @@ -65,6 +68,9 @@ COPY --from=0 /mru /paotin/.local/share/nvim/plugged/mru/ COPY --from=0 /BufExplorer /paotin/.local/share/nvim/plugged/BufExplorer/ COPY --from=0 /vim-startify /paotin/.local/share/nvim/plugged/BufExplorer/ +RUN mkdir -p /usr/local/lib/lua/5.1 +COPY --from=0 /usr/local/lib/lua/5.1/rex_pcre.so /usr/local/lib/lua/5.1/ + COPY --from=0 /tintin/src/tt++ /paotin/bin/ RUN mkdir -p /paotin/log/ From 13e4220a9f5e7bb1cb9aeb1e6c477d03e2f55882 Mon Sep 17 00:00:00 2001 From: Harry Feng Date: Thu, 12 Jan 2023 18:26:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=8F=90=E4=BE=9B=20auto?= =?UTF-8?q?=20=E5=8F=82=E6=95=B0=E5=9C=A8=E5=90=AF=E5=8A=A8=20UI=20?= =?UTF-8?q?=E5=90=8E=E7=BB=A7=E7=BB=AD=E5=AE=8C=E6=88=90=20tt=20=E7=9A=84?= =?UTF-8?q?=E6=8B=89=E8=B5=B7=E4=B8=8E=E8=A7=92=E8=89=B2=E7=9A=84=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=8A=A8=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/start-ui | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/start-ui b/bin/start-ui index 284b4c79..a2222998 100755 --- a/bin/start-ui +++ b/bin/start-ui @@ -38,6 +38,12 @@ $TMUXCMD last-pane $TMUXCMD send-keys -t $SESSION "sleep 0.1; tmux resize-pane -y $HEIGHT; clear; doc HOW-TO-PLAY.md" $TMUXCMD send-keys -t $SESSION Enter +# 针对单 ID 挂机用户,可以通过提供 auto 参数在启动 UI 后继续完成 tt 的拉起与角色的登录动作 +if [ "x$MODE" == "xauto" ]; then + $TMUXCMD send-keys -t $SESSION "start $HOSTNAME" + $TMUXCMD send-keys -t $SESSION Enter +fi + echo UI 已创建。 exec $TMUXCMD attach-session -t $SESSION