Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
update files
Browse files Browse the repository at this point in the history
  • Loading branch information
yuuki-nya committed Sep 22, 2023
1 parent 6a68e72 commit 2140ae1
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Publish

on:
push:
branches:
- main # 或者你想要触发工作流程的分支

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: yuukinya/chronocat-docke:latest
71 changes: 71 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 使用基于Ubuntu 22.04的基础映像
FROM ubuntu:22.04

# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive
ENV VNC_PASSWD=vncpasswd

# 安装必要的软件包
RUN apt-get update && apt-get install -y \
openbox \
curl \
unzip \
x11vnc \
xvfb \
fluxbox \
supervisor \
libnotify4 \
libnss3 \
xdg-utils \
libsecret-1-0 \
libgbm1 \
libasound2 \
fonts-wqy-zenhei \
&& 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

# 安装LiteLoader
RUN curl -L -o /tmp/LiteLoaderQQNT.zip https://github.com/LiteLoaderQQNT/LiteLoaderQQNT/releases/download/0.5.3/LiteLoaderQQNT.zip \
&& unzip /tmp/LiteLoaderQQNT.zip -d /opt/QQ/resources/app/ \
&& rm /tmp/LiteLoaderQQNT.zip
# 修改/opt/QQ/resources/app/package.json文件
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 \
&& rm /tmp/chronocat-llqqnt.zip

# 创建必要的目录
RUN mkdir -p ~/.vnc

# 设置VNC密码
RUN x11vnc -storepasswd $VNC_PASSWD ~/.vnc/passwd

# 创建启动脚本
RUN echo "#!/bin/bash" > ~/start.sh
RUN echo "rm /tmp/.X1-lock" >> ~/start.sh
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 chmod +x ~/start.sh

# 配置supervisor
RUN echo "[supervisord]" > /etc/supervisor/supervisord.conf
RUN echo "nodaemon=true" >> /etc/supervisor/supervisord.conf
RUN echo "[program:x11vnc]" >> /etc/supervisor/supervisord.conf
RUN echo "command=/usr/bin/x11vnc -display :1 -noxrecord -noxfixes -noxdamage -forever -rfbauth ~/.vnc/passwd" >> /etc/supervisor/supervisord.conf

# 设置容器启动时运行的命令
CMD ["/bin/bash", "-c", "/root/start.sh"]
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
# chronocat-docker
使用docker运行带有chronocat的qqnt,镜像采用ubuntu22.04 + lxde桌面,镜像占用空间约2.2GB,启动内存占用约450MB

使用ubuntu22.04 + openbox + linuxqq 制作

## 使用

```bash
docker run --rm -it -p 16530:16530 5900:5900 yuukinya/chronocat-docker
```

或者下载代码中的docker-compose.yml,然后执行

```bash
docker-compose up -d
```

### VNC登陆

使用VNC软件登陆`服务器IP:5900`,默认密码是`vncpasswd`

### 获取RED_PROTOCOL_TOKEN

```bash
docker exec ubuntu2204 cat /home/user/BetterUniverse/QQNT/RED_PROTOCOL_TOKEN
```

### 修改VNC密码

```bash
docker exec ubuntu2204 sh -c "x11vnc -storepasswd newpasswd /root/.vnc/passwd"
```

其中newpasswd换成你的新密码,完成后重启容器

## TODO

- [ ] 使用docker-compose.yml的environment来修改VNC密码
- [ ] 能固化已登陆QQ的数据



11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
chronocat-docker:
image: yuukinya/chronocat-docker
tty: true
container_name: chronocat-docker
restart: always
ports:
- "5900:5900"
- "16530:16530"
environment:
- TZ=Asia/Shanghai

0 comments on commit 2140ae1

Please sign in to comment.