feat: introduce qq

This commit is contained in:
Nick007
2025-10-24 21:04:25 +08:00
parent fe33010597
commit 25c0819dbd
7 changed files with 138 additions and 13 deletions

View File

@@ -27,7 +27,7 @@ RUN apt-get update && \
libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 \
libxcomposite1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 \
libxss1 libxtst6 libatomic1 libxcomposite1 libxrender1 libxrandr2 libxkbcommon-x11-0 \
libfontconfig1 libdbus-1-3 libnss3 libx11-xcb1 python3-tk
libfontconfig1 libdbus-1-3 libnss3 libx11-xcb1 python3-tk stalonetray
RUN pip install --no-cache-dir python-xlib
@@ -51,6 +51,26 @@ RUN case "$TARGETPLATFORM" in \
rm -f wechat.deb && \
echo "✅ WeChat installation completed for $WECHAT_ARCH"
# Install QQ based on target architecture
RUN case "$TARGETPLATFORM" in \
"linux/amd64") \
QQ_URL="https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.19_250904_amd64_01.deb"; \
QQ_ARCH="x86_64" ;; \
"linux/arm64") \
QQ_URL="https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.19_250904_arm64_01.deb"; \
QQ_ARCH="arm64" ;; \
*) \
echo "❌ Unsupported platform: $TARGETPLATFORM" >&2; \
echo "Supported platforms: linux/amd64, linux/arm64" >&2; \
exit 1 ;; \
esac && \
echo "📦 Downloading QQ for $QQ_ARCH architecture..." && \
curl -fsSL -o qq.deb "$QQ_URL" && \
echo "🔧 Installing QQ..." && \
(dpkg -i qq.deb || (apt-get update && apt-get install -f -y && dpkg -i qq.deb)) && \
rm -f qq.deb && \
echo "✅ QQ installation completed for $QQ_ARCH"
# Clean up
RUN apt-get purge -y --autoremove
RUN apt-get autoclean && \
@@ -61,13 +81,18 @@ RUN apt-get autoclean && \
/var/tmp/* \
/tmp/*
# configure openbox dock mode for stalonetray
RUN sed -i '/<dock>/,/<\/dock>/s/<noStrut>no<\/noStrut>/<noStrut>yes<\/noStrut>/' /etc/xdg/openbox/rc.xml
# set app name
ENV TITLE="WeChat-Selkies"
ENV TZ="Asia/Shanghai"
ENV LC_ALL="zh_CN.UTF-8"
ENV AUTO_START_WECHAT="true"
ENV AUTO_START_QQ="false"
# update favicon
COPY /root/wechat.png /usr/share/selkies/www/icon.png
RUN cp /usr/share/icons/hicolor/128x128/apps/wechat.png /usr/share/selkies/www/icon.png
# add local files
COPY /root /

View File

@@ -45,10 +45,12 @@
### 快速部署
1. **直接使用已构建的镜像进行快速部署**
GitHub Container Registry镜像
```bash
docker run -it -p 3001:3001 -v ./config:/config ghcr.io/nickrunning/wechat-selkies:latest
```
Docker Hub镜像
```bash
docker run -it -p 3001:3001 -v ./config:/config nickrunning/wechat-selkies:latest
@@ -58,7 +60,40 @@ docker run -it -p 3001:3001 -v ./config:/config nickrunning/wechat-selkies:lates
在浏览器中访问:`https://localhost:3001``https://<服务器IP>:3001`
### 自定义部署步骤(源码部署
### docker-compose 部署
1. **创建项目目录并进入**
```bash
mkdir wechat-selkies
cd wechat-selkies
```
2. **创建 docker-compose.yml 文件**
```yaml
services:
wechat-selkies:
image: nickrunning/wechat-selkies:latest # or ghcr.io/nickrunning/wechat-selkies:latest
container_name: wechat-selkies
ports:
- "3001:3001"
volumes:
- ./config:/config
devices:
- /dev/dri:/dev/dri # optional, for hardware acceleration
environment:
- PUID=1000 # user ID
- PGID=100 # group ID
- TZ=Asia/Shanghai # timezone
- LC_ALL=zh_CN.UTF-8 # locale
- AUTO_START_WECHAT=true # default is true
- AUTO_START_QQ=false # default is false
# - CUSTOM_USER=<Your Name> # recommended to set a custom user name
# - PASSWORD=<Your Password> # recommended to set a password for selkies web ui
```
3. **启动服务**
```bash
docker-compose up -d
```
### 源码部署
1. **克隆项目**
```bash
@@ -83,10 +118,10 @@ docker run -it -p 3001:3001 -v ./config:/config nickrunning/wechat-selkies:lates
本项目支持同时推送到 GitHub Container Registry 和 Docker Hub。如需启用 Docker Hub 推送功能请在仓库下添加Environment Secrets和Environment Variables:
**必需的Environment Secrets:**
**Environment Secrets:**
* DOCKERHUB_USERNAME: 你的 Docker Hub 用户名
* DOCKERHUB_TOKEN: 你的 Docker Hub Access Token
**必需的Environment Variables:**
**Environment Variables:**
* ENABLE_DOCKERHUB: 设置为 `true` 来启用 Docker Hub 推送
#### 环境变量配置
@@ -102,6 +137,8 @@ docker run -it -p 3001:3001 -v ./config:/config nickrunning/wechat-selkies:lates
| `LC_ALL` | `zh_CN.UTF-8` | 语言环境 |
| `CUSTOM_USER` | - | 自定义用户名(推荐设置) |
| `PASSWORD` | - | Web UI 访问密码(推荐设置) |
| `AUTO_START_WECHAT` | `true` | 是否自动启动微信客户端 |
| `AUTO_START_QQ` | `false` | 是否自动启动 QQ 客户端 |
#### 端口配置

View File

@@ -58,7 +58,40 @@ docker run -it -p 3001:3001 -v ./config:/config nickrunning/wechat-selkies:lates
Open in browser: `https://localhost:3001` or `https://<server-ip>:3001`
### Custom Deployment (Source Code Deployment)
### docker-compose Deployment
1. **Create project directory and navigate into it**
```bash
mkdir wechat-selkies
cd wechat-selkies
```
2. **Create `docker-compose.yml` file with the following content**
```yaml
services:
wechat-selkies:
image: nickrunning/wechat-selkies:latest # or ghcr.io/nickrunning/wechat-selkies:latest
container_name: wechat-selkies
ports:
- "3001:3001"
volumes:
- ./config:/config
devices:
- /dev/dri:/dev/dri # optional, for hardware acceleration
environment:
- PUID=1000 # user ID
- PGID=100 # group ID
- TZ=Asia/Shanghai # timezone
- LC_ALL=zh_CN.UTF-8 # locale
- AUTO_START_WECHAT=true # default is true
- AUTO_START_QQ=false # default is false
# - CUSTOM_USER=<Your Name> # recommended to set a custom user name
# - PASSWORD=<Your Password> # recommended to set a password for selkies web ui
```
3. **Start the service**
```bash
docker-compose up -d
```
### Source Code Deployment
1. **Clone the repository**
```bash
@@ -82,11 +115,11 @@ For more custom configurations, please refer to [Selkies Base Images from LinuxS
#### Docker Hub Push Configuration
This project supports pushing to both GitHub Container Registry and Docker Hub. Docker Hub push is optional and requires manual configuration. Please add the following Environment Secrets and Environment Variables in your repository to enable Docker Hub push functionality:
**Required Environment Secrets:**
**Environment Secrets:**
* `DOCKERHUB_USERNAME`: Your Docker Hub username
* `DOCKERHUB_TOKEN`: Your Docker Hub Access Token
**Required Environment Variables:**
**Environment Variables:**
* `ENABLE_DOCKERHUB`: Set to `true` to enable Docker Hub push
#### Environment Variables
@@ -102,6 +135,8 @@ Configure the following environment variables in `docker-compose.yml`:
| `LC_ALL` | `zh_CN.UTF-8` | Locale setting |
| `CUSTOM_USER` | - | Custom username (recommended) |
| `PASSWORD` | - | Web UI access password (recommended) |
| `AUTO_START_WECHAT` | `true` | Whether to automatically start the WeChat client |
| `AUTO_START_QQ` | `false` | Whether to automatically start the QQ client |
#### Port Configuration

View File

@@ -2,7 +2,7 @@
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="root-menu" label="MENU">
<item label="xterm" icon="/usr/share/pixmaps/xterm-color_48x48.xpm"><action name="Execute"><command>/usr/bin/xterm</command></action></item>
<item label="WeChat" icon="/usr/share/icons/hicolor/48x48/apps/wechat.png"><action name="Execute"><command>/scripts/wechat/wechat-restart.sh</command></action></item>
<item label="Restore WeChat" icon="/usr/share/icons/hicolor/48x48/apps/wechat.png"><action name="Execute"><command>/scripts/wechat/wechat-unminimize.sh</command></action></item>
<item label="WeChat" icon="/usr/share/icons/hicolor/128x128/apps/wechat.png"><action name="Execute"><command>/scripts/wechat/wechat-restart.sh</command></action></item>
<item label="QQ" icon="/usr/share/icons/hicolor/512x512/apps/qq.png"><action name="Execute"><command>/scripts/qq/qq-restart.sh</command></action></item>
</menu>
</openbox_menu>

3
root/scripts/qq/qq-restart.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
pkill -9 -f /usr/bin/qq 2>/dev/null
nohup /usr/bin/qq --no-sandbox >/dev/null 2>&1 &

View File

@@ -1,7 +1,32 @@
#!/bin/bash
# start WeChat application in the background if wechat exists
if [ -f /usr/bin/wechat ]; then nohup /usr/bin/wechat > /dev/null 2>&1 & fi
# configure openbox dock mode for stalonetray
if [ ! -f /config/.config/openbox/rc.xml ] || grep -A20 "<dock>" /config/.config/openbox/rc.xml | grep -q "<noStrut>no</noStrut>"; then
mkdir -p /config/.config/openbox
[ ! -f /config/.config/openbox/rc.xml ] && cp /etc/xdg/openbox/rc.xml /config/.config/openbox/
sed -i '/<dock>/,/<\/dock>/s/<noStrut>no<\/noStrut>/<noStrut>yes<\/noStrut>/' /config/.config/openbox/rc.xml
openbox --reconfigure
fi
# update openbox menu if differs from default
if [ ! -f /config/.config/openbox/menu.xml ] || ! cmp /defaults/menu.xml /config/.config/openbox/menu.xml; then
mkdir -p /config/.config/openbox
cp /defaults/menu.xml /config/.config/openbox/menu.xml
openbox --reconfigure
fi
nohup stalonetray --dockapp-mode simple > /dev/null 2>&1 &
# start WeChat application in the background if exists and auto-start enabled
if [ "$AUTO_START_WECHAT" = "true" ]; then
if [ -f /usr/bin/wechat ]; then nohup /usr/bin/wechat > /dev/null 2>&1 & fi
fi
# start QQ application in the background if exists and auto-start enabled
if [ "$AUTO_START_QQ" = "true" ]; then
if [ -f /usr/bin/qq ]; then nohup /usr/bin/qq --no-sandbox > /dev/null 2>&1 & fi
fi
# !deprecated: start window switcher application in the background
# start window switcher application in the background
nohup sleep 2 && python /scripts/window_switcher.py > /dev/null 2>&1 &
# nohup sleep 2 && python /scripts/window_switcher.py > /dev/null 2>&1 &

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB