From 1717e49a6238b4de352ba323b3df1881d53a3bd3 Mon Sep 17 00:00:00 2001 From: yuuki-nya Date: Mon, 25 Sep 2023 17:23:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0chrono=E8=87=B30.0.46?= =?UTF-8?q?=EF=BC=8C=E9=80=82=E9=85=8D=E5=85=B6=E9=85=8D=E4=BB=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=B7=B2=E7=99=BB=E9=99=86?= =?UTF-8?q?QQ=E6=95=B0=E6=8D=AE=E5=9B=BA=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 12 ++++-------- README.md | 47 ++++++++++++++++++++++++++++++++++++++++------ docker-compose.yml | 5 ++++- 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index afab61f..e594367 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,9 +24,6 @@ RUN apt-get update && apt-get install -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -# 新增用户 -RUN useradd -m -s /bin/bash user && echo 'user' - # 安装Linux QQ RUN curl -o /root/linuxqq_3.1.2-13107_amd64.deb https://dldir1.qq.com/qqfile/qq/QQNT/ad5b5393/linuxqq_3.1.2-13107_amd64.deb RUN dpkg -i /root/linuxqq_3.1.2-13107_amd64.deb && apt-get -f install -y && rm /root/linuxqq_3.1.2-13107_amd64.deb @@ -39,10 +36,9 @@ RUN curl -L -o /tmp/LiteLoaderQQNT.zip https://github.com/LiteLoaderQQNT/LiteLoa RUN sed -i 's/"main": ".\/app_launcher\/index.js"/"main": ".\/LiteLoader"/' /opt/QQ/resources/app/package.json # 安装chronocat -RUN curl -L -o /tmp/chronocat-llqqnt.zip https://github.com/chrononeko/chronocat/releases/download/v0.0.45/chronocat-llqqnt-v0.0.45.zip \ - && mkdir -p /home/user/LiteLoaderQQNT/plugins \ - && unzip /tmp/chronocat-llqqnt.zip -d /home/user/LiteLoaderQQNT/plugins/ \ - && chown -R user /home/user/LiteLoaderQQNT \ +RUN curl -L -o /tmp/chronocat-llqqnt.zip https://ghproxy.com/https://github.com/chrononeko/chronocat/releases/download/v0.0.46/chronocat-llqqnt-v0.0.46.zip \ + && mkdir -p /root/LiteLoaderQQNT/plugins \ + && unzip /tmp/chronocat-llqqnt.zip -d /root/LiteLoaderQQNT/plugins/ \ && rm /tmp/chronocat-llqqnt.zip # 创建必要的目录 @@ -58,7 +54,7 @@ RUN echo "Xvfb :1 -screen 0 1280x1024x16 &" >> ~/start.sh RUN echo "export DISPLAY=:1" >> ~/start.sh RUN echo "fluxbox &" >> ~/start.sh RUN echo "x11vnc -display :1 -noxrecord -noxfixes -noxdamage -forever -rfbauth ~/.vnc/passwd &" >> ~/start.sh -RUN echo "su -c 'qq' user" >> ~/start.sh +RUN echo "su -c 'qq' root" >> ~/start.sh RUN chmod +x ~/start.sh # 配置supervisor diff --git a/README.md b/README.md index e4fcfca..f115c99 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,12 @@ ## 使用 +### 快速运行 + +容器重建会丢失已登陆QQ数据 + ```bash -docker run -d --name chronocat-docker -p 16530:16530 -p 5900:5900 yuukinya/chronocat-docker +docker run -d --name chronocat-docker -p 16530:16530 -p 5900:5900 -v ${PWD}/config:/root/.chronocat/config yuukinya/chronocat-docker ``` 或者下载代码中的docker-compose.yml,然后执行 @@ -14,16 +18,37 @@ docker run -d --name chronocat-docker -p 16530:16530 -p 5900:5900 yuukinya/chron docker-compose up -d ``` -### VNC登陆 +### QQ登陆数据固化(可选) -使用VNC软件登陆`服务器IP:5900`,默认密码是`vncpasswd` +先完成上面的`快速运行`,保证容器在运行状态 -### 获取RED_PROTOCOL_TOKEN +```bash +# 进入项目目录 +mkdir data +# 复制数据到data目录 +docker cp chronocat-docker:/root/.config/QQ ./data +``` + +如果之前是docker run运行的,执行 ```bash -docker exec chronocat-docker cat /home/user/BetterUniverse/QQNT/RED_PROTOCOL_TOKEN +docker rm -f chronocat-docker && run -d --name chronocat-docker -p 16530:16530 -p 5900:5900 -v ${PWD}/config:/root/.chronocat/config -v ${PWD}/data/QQ:/root/.config/QQ yuukinya/chronocat-docker ``` +如果之前是docker-compose运行的,编辑docker-compose.yml,把volumes下两行的开头注释去掉,保存,再执行 + +```bash +docker-compose up -d +``` + +### VNC登陆 + +使用VNC软件登陆`服务器IP:5900`,默认密码是`vncpasswd` + +### 修改chronocat配置 + +修改当前目录/config/chronocat.yml,修改后重启容器即可 + ### 修改VNC密码 ```bash @@ -39,8 +64,18 @@ docker exec chronocat-docker sh -c "x11vnc -storepasswd newpasswd /root/.vnc/pas ## TODO +- [x] 能固化已登陆QQ的数据 - [ ] 使用docker的environment来指定VNC密码 -- [ ] 能固化已登陆QQ的数据(可能因为容器重建随机生成设备ID而无法实现) +## 更新日志 + +### 2023-9-25 + +- 更新chronocat至0.0.46 +- 修改chronocat配置映射至宿主机 +- 固化已登陆QQ数据 + +### 2023-9-22 +- 初始版本 diff --git a/docker-compose.yml b/docker-compose.yml index d95c1d1..02fa80c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,4 +8,7 @@ services: - "5900:5900" - "16530:16530" environment: - - TZ=Asia/Shanghai \ No newline at end of file + - TZ=Asia/Shanghai + volumes: + - ./config:/root/.chronocat/config + # - ./data/QQ:/root/.config/QQ #QQ数据固化目录,请先阅读README再使用