6 Commits

Author SHA1 Message Date
Nick007
0ab51c11b0 Merge pull request #114 from f841705799/master
Update QQ download URLs in Dockerfile for newer version
2026-05-06 11:05:39 +08:00
weiwudi
179f50f45f Update QQ download URLs in Dockerfile for newer version 2026-04-27 17:02:26 +08:00
github-actions[bot]
35791ff5d3 chore: update upstream package state 2026-04-07 12:45:40 +00:00
Nick007
a5f832dd09 feat: automate upstream wechat version detection 2026-04-07 17:35:47 +08:00
Nick007
77edc4b33e fix: add curl retry for WeChat/QQ download to handle transient network failures 2026-03-23 21:06:24 +08:00
Nick007
680ee6dd4a feat: support minimal image variant with WeChat only (#92)
Add INSTALL_QQ and INSTALL_PCMANFM build args to conditionally skip QQ
and file manager installation. CI builds both :latest (full) and :minimal
(WeChat only) tags for each release.
2026-03-23 19:54:35 +08:00
7 changed files with 308 additions and 34 deletions

125
.github/scripts/detect-upstream.sh vendored Executable file
View File

@@ -0,0 +1,125 @@
#!/usr/bin/env bash
set -euo pipefail
STATE_FILE="${STATE_FILE:-versions/upstream.env}"
TMP_DIR="$(mktemp -d)"
CHANGE_DETECTED="false"
ENV_WECHAT_AMD64_URL="${WECHAT_AMD64_URL-__UNSET__}"
ENV_WECHAT_ARM64_URL="${WECHAT_ARM64_URL-__UNSET__}"
cleanup() {
rm -rf "$TMP_DIR"
}
trap cleanup EXIT
if [[ -f "$STATE_FILE" ]]; then
# shellcheck disable=SC1090
source "$STATE_FILE"
fi
if [[ "$ENV_WECHAT_AMD64_URL" != "__UNSET__" ]]; then
WECHAT_AMD64_URL="$ENV_WECHAT_AMD64_URL"
fi
if [[ "$ENV_WECHAT_ARM64_URL" != "__UNSET__" ]]; then
WECHAT_ARM64_URL="$ENV_WECHAT_ARM64_URL"
fi
WECHAT_AMD64_URL="${WECHAT_AMD64_URL:-https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_x86_64.deb}"
WECHAT_ARM64_URL="${WECHAT_ARM64_URL:-https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_arm64.deb}"
download_package() {
local source_path="$1"
local destination="$2"
case "$source_path" in
http://*|https://*)
curl --fail --silent --show-error --location \
--retry 3 --retry-delay 5 --retry-all-errors \
-o "$destination" "$source_path"
;;
*)
cp "$source_path" "$destination"
;;
esac
}
read_metadata() {
local package_name="$1"
local arch="$2"
local source_path="$3"
local package_path="$TMP_DIR/${package_name}-${arch}.deb"
local version_var="${package_name}_${arch}_VERSION"
local sha_var="${package_name}_${arch}_SHA256"
local current_version="${!version_var:-}"
local current_sha="${!sha_var:-}"
local detected_version
local detected_sha
echo "Checking ${package_name} ${arch} from ${source_path}"
download_package "$source_path" "$package_path"
detected_version="$(dpkg-deb -f "$package_path" Version)"
detected_sha="$(sha256sum "$package_path" | awk '{print $1}')"
printf -v "$version_var" '%s' "$detected_version"
printf -v "$sha_var" '%s' "$detected_sha"
if [[ "$current_version" != "$detected_version" || "$current_sha" != "$detected_sha" ]]; then
CHANGE_DETECTED="true"
fi
}
read_metadata "WECHAT" "AMD64" "$WECHAT_AMD64_URL"
read_metadata "WECHAT" "ARM64" "$WECHAT_ARM64_URL"
if [[ "$CHANGE_DETECTED" == "true" || ! -f "$STATE_FILE" ]]; then
WECHAT_LAST_CHECKED_AT="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
fi
NEW_STATE_FILE="$TMP_DIR/upstream.env"
cat > "$NEW_STATE_FILE" <<EOF
# Upstream package state tracked by automation.
WECHAT_AMD64_URL="$WECHAT_AMD64_URL"
WECHAT_ARM64_URL="$WECHAT_ARM64_URL"
WECHAT_AMD64_VERSION="$WECHAT_AMD64_VERSION"
WECHAT_ARM64_VERSION="$WECHAT_ARM64_VERSION"
WECHAT_AMD64_SHA256="$WECHAT_AMD64_SHA256"
WECHAT_ARM64_SHA256="$WECHAT_ARM64_SHA256"
WECHAT_LAST_CHECKED_AT="$WECHAT_LAST_CHECKED_AT"
EOF
mkdir -p "$(dirname "$STATE_FILE")"
if [[ ! -f "$STATE_FILE" ]] || ! cmp -s "$NEW_STATE_FILE" "$STATE_FILE"; then
cp "$NEW_STATE_FILE" "$STATE_FILE"
fi
echo "Change detected: $CHANGE_DETECTED"
echo "WECHAT_AMD64_VERSION=$WECHAT_AMD64_VERSION"
echo "WECHAT_ARM64_VERSION=$WECHAT_ARM64_VERSION"
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
{
echo "changed=$CHANGE_DETECTED"
echo "wechat_amd64_version=$WECHAT_AMD64_VERSION"
echo "wechat_arm64_version=$WECHAT_ARM64_VERSION"
echo "state_file=$STATE_FILE"
} >> "$GITHUB_OUTPUT"
fi
if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then
{
echo "## Upstream Detection"
echo ""
echo "- Changed: \`$CHANGE_DETECTED\`"
echo "- WeChat amd64: \`$WECHAT_AMD64_VERSION\`"
echo "- WeChat arm64: \`$WECHAT_ARM64_VERSION\`"
echo "- State file: \`$STATE_FILE\`"
} >> "$GITHUB_STEP_SUMMARY"
fi

32
.github/workflows/detect-upstream.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Detect Upstream Package Updates
on:
workflow_dispatch:
schedule:
- cron: '23 */6 * * *'
permissions:
contents: write
jobs:
detect-wechat-updates:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect upstream package changes
id: detect
run: ./.github/scripts/detect-upstream.sh
- name: Commit updated version state
if: steps.detect.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add versions/upstream.env
git commit -m "chore: update upstream package state"
git push

View File

@@ -3,6 +3,10 @@ name: Build and Publish Docker Image
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'versions/upstream.env'
tags:
- 'v*'
@@ -70,6 +74,37 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Extract metadata for minimal image
id: meta-minimal
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }},enable=${{ vars.ENABLE_DOCKERHUB == 'true' }}
flavor: |
latest=false
suffix=-minimal
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=minimal,enable=${{ github.ref == format('refs/heads/{0}', 'master') || startsWith(github.ref, 'refs/tags/') }}
- name: Build and push minimal Docker image
id: build-minimal
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-minimal.outputs.tags }}
labels: ${{ steps.meta-minimal.outputs.labels }}
build-args: |
INSTALL_QQ=false
INSTALL_PCMANFM=false
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Generate artifact attestation
if: github.event_name != 'workflow_dispatch'
uses: actions/attest-build-provenance@v1
@@ -84,11 +119,16 @@ jobs:
echo "### GitHub Container Registry" >> $GITHUB_STEP_SUMMARY
echo "**Registry:** ${{ env.REGISTRY }}" >> $GITHUB_STEP_SUMMARY
echo "**Repository:** ${{ env.IMAGE_NAME }}" >> $GITHUB_STEP_SUMMARY
echo "**Digest:** \`${{ steps.build-image.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Tags:**" >> $GITHUB_STEP_SUMMARY
echo "**Full image digest:** \`${{ steps.build-image.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Minimal image digest:** \`${{ steps.build-minimal.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Tags (full):**" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "**Tags (minimal):**" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta-minimal.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
if [ "${{ vars.ENABLE_DOCKERHUB }}" == "true" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
@@ -115,6 +155,7 @@ jobs:
body: |
## 🐳 Docker Images
### Full (WeChat + QQ + File Manager)
**GitHub Container Registry:**
```bash
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
@@ -127,17 +168,20 @@ jobs:
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest
```
## 🚀 Quick Start
**GitHub Container Registry:**
### Minimal (WeChat only)
```bash
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:minimal
```
## 🚀 Quick Start
**Full:**
```bash
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
```
**Docker Hub** (if enabled):
**Minimal:**
```bash
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${{ steps.meta.outputs.version }}
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:minimal
```
Then visit: https://localhost:3001
Then visit: https://localhost:3001

View File

@@ -13,9 +13,10 @@ LABEL org.opencontainers.image.licenses="GPL-3.0-only"
# Build arguments for multi-arch support
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG INSTALL_QQ=true
ARG INSTALL_PCMANFM=true
RUN echo "🏗️ Building WeChat-Selkies on $BUILDPLATFORM, targeting $TARGETPLATFORM"
# set environment variables
RUN apt-get update && \
apt-get install -y fonts-noto-cjk libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \
libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0 \
@@ -27,8 +28,12 @@ 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 stalonetray inotify-tools \
pcmanfm
libfontconfig1 libdbus-1-3 libnss3 libx11-xcb1 stalonetray inotify-tools
ARG INSTALL_PCMANFM
RUN if [ "$INSTALL_PCMANFM" = "true" ]; then \
apt-get install -y --no-install-recommends pcmanfm; \
fi
RUN pip install --no-cache-dir python-xlib
@@ -46,31 +51,35 @@ RUN case "$TARGETPLATFORM" in \
exit 1 ;; \
esac && \
echo "📦 Downloading WeChat for $WECHAT_ARCH architecture..." && \
curl -fsSL -o wechat.deb "$WECHAT_URL" && \
curl -fsSL --retry 3 --retry-delay 10 --retry-all-errors -o wechat.deb "$WECHAT_URL" && \
echo "🔧 Installing WeChat..." && \
(dpkg -i wechat.deb || (apt-get update && apt-get install -f -y && dpkg -i wechat.deb)) && \
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.22_251203_amd64_01.deb"; \
QQ_ARCH="x86_64" ;; \
"linux/arm64") \
QQ_URL="https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.22_251203_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"
# Install QQ based on target architecture (optional)
ARG INSTALL_QQ
RUN if [ "$INSTALL_QQ" = "true" ]; then \
case "$TARGETPLATFORM" in \
"linux/amd64") \
QQ_URL="https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.27_260401_amd64_01.deb"; \
QQ_ARCH="x86_64" ;; \
"linux/arm64") \
QQ_URL="https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.27_260401_arm64_01.deb"; \
QQ_ARCH="arm64" ;; \
*) \
echo "❌ Unsupported platform: $TARGETPLATFORM" >&2; \
exit 1 ;; \
esac && \
echo "📦 Downloading QQ for $QQ_ARCH architecture..." && \
curl -fsSL --retry 3 --retry-delay 10 --retry-all-errors -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"; \
else \
echo "⏭️ Skipping QQ installation (INSTALL_QQ=$INSTALL_QQ)"; \
fi
# Clean up
RUN apt-get purge -y --autoremove

View File

@@ -22,6 +22,8 @@
> 如果升级后部分功能缺失请先清空本地挂载目录下的openbox目录(如`./config/.config/openbox`)。
> 仓库内置了上游微信版本自动检测机制GitHub Actions 会定时检查官方 `.deb` 包版本,检测到变化后自动更新 `versions/upstream.env` 并触发镜像构建。
## 功能特性
- 🌐 **浏览器访问**:通过 Web 浏览器直接使用微信,无需本地安装
@@ -63,6 +65,12 @@ Docker Hub镜像
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickrunning/wechat-selkies:latest
```
> **精简版镜像**:如果只需要微信(不含 QQ 和文件管理器),可使用 `minimal` 标签,镜像体积更小:
> ```bash
> docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ghcr.io/nickrunning/wechat-selkies:minimal
> ```
> 精简版也支持版本号标签,如 `:1.2.3-minimal`、`:1.2-minimal`,方便锁定特定版本。
2. **访问微信**
在浏览器中访问:`https://localhost:3001``https://<服务器IP>:3001`
@@ -137,6 +145,11 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
在浏览器中访问:`https://localhost:3001` 或 `https://<服务器IP>:3001`
> **构建精简版**:源码部署时可通过 build-arg 构建仅含微信的精简镜像:
> ```bash
> docker build --build-arg INSTALL_QQ=false --build-arg INSTALL_PCMANFM=false -t wechat-selkies:minimal .
> ```
### 配置说明
更多自定义配置请参考 [Selkies Base Images from LinuxServer](https://github.com/linuxserver/docker-baseimage-selkies)。
@@ -233,6 +246,19 @@ git pull && docker compose up -d --build
> **注意:** 微信和QQ的安装包 URL 指向官方最新版本,重新构建镜像时会自动下载最新版。
对于仓库维护者,当前自动化流程如下:
1. `Detect Upstream Package Updates` 每 6 小时检查一次微信官方安装包版本,也支持手动触发
2. 如果检测到版本号或安装包哈希变化,工作流会更新 `versions/upstream.env`
3. 该文件变更提交到 `master` 后,会自动触发 `Build and Publish Docker Image`
版本状态文件位于 `versions/upstream.env`,当前记录了:
- 微信 amd64/arm64 下载地址
- 微信 amd64/arm64 解析出的版本号
- 微信 amd64/arm64 安装包 SHA256
- 最近一次发生变更的检测时间
### 常见问题
1. **无法访问 Web UI**
@@ -310,4 +336,4 @@ docker compose logs -f wechat-selkies
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=nickrunning/wechat-selkies&type=Date)](https://www.star-history.com/#nickrunning/wechat-selkies&Date)
[![Star History Chart](https://api.star-history.com/svg?repos=nickrunning/wechat-selkies&type=Date)](https://www.star-history.com/#nickrunning/wechat-selkies&Date)

View File

@@ -22,6 +22,8 @@ This project packages the official WeChat/QQ Linux client in a Docker container,
> If some features are missing after an upgrade, please clear the `openbox` directory in the local mounted directory (e.g., `./config/.config/openbox`).
> This repository includes automatic upstream WeChat version detection: GitHub Actions periodically checks the official `.deb` packages, updates `versions/upstream.env` when changes are detected, and then triggers the image build workflow.
## Features
- 🌐 **Browser Access**: Use WeChat directly through web browsers without local installation
@@ -61,6 +63,12 @@ Docker Hub image:
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickrunning/wechat-selkies:latest
```
> **Minimal image**: If you only need WeChat (without QQ and file manager), use the `minimal` tag for a smaller image:
> ```bash
> docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ghcr.io/nickrunning/wechat-selkies:minimal
> ```
> Versioned minimal tags are also available, e.g. `:1.2.3-minimal`, `:1.2-minimal`, for pinning to a specific release.
2. **Access WeChat**
Open in browser: `https://localhost:3001` or `https://<server-ip>:3001`
@@ -135,6 +143,11 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
Open in browser: `https://localhost:3001` or `https://<server-ip>:3001`
> **Build minimal version**: When building from source, use build-arg to create a WeChat-only image:
> ```bash
> docker build --build-arg INSTALL_QQ=false --build-arg INSTALL_PCMANFM=false -t wechat-selkies:minimal .
> ```
### Configuration
For more custom configurations, please refer to [Selkies Base Images from LinuxServer](https://github.com/linuxserver/docker-baseimage-selkies).
@@ -232,6 +245,19 @@ git pull && docker compose up -d --build
> **Note:** The WeChat and QQ download URLs point to the latest official versions. Rebuilding the image will automatically download the newest version.
For maintainers, the current automation flow is:
1. `Detect Upstream Package Updates` checks the official WeChat packages every 6 hours and can also be triggered manually
2. If the version or package hash changes, the workflow updates `versions/upstream.env`
3. Once that file is committed to `master`, it automatically triggers `Build and Publish Docker Image`
The version state file is stored at `versions/upstream.env` and currently records:
- WeChat amd64/arm64 download URLs
- Parsed WeChat amd64/arm64 package versions
- WeChat amd64/arm64 package SHA256 hashes
- The last detection time that actually changed the tracked state
### Common Issues
1. **Unable to access Web UI**
@@ -309,4 +335,4 @@ This project is licensed under **MIT License**. See the [LICENSE](LICENSE) file
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=nickrunning/wechat-selkies&type=Date)](https://www.star-history.com/#nickrunning/wechat-selkies&Date)
[![Star History Chart](https://api.star-history.com/svg?repos=nickrunning/wechat-selkies&type=Date)](https://www.star-history.com/#nickrunning/wechat-selkies&Date)

12
versions/upstream.env Normal file
View File

@@ -0,0 +1,12 @@
# Upstream package state tracked by automation.
WECHAT_AMD64_URL="https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_x86_64.deb"
WECHAT_ARM64_URL="https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_arm64.deb"
WECHAT_AMD64_VERSION="4.1.1.4"
WECHAT_ARM64_VERSION="4.1.1.4"
WECHAT_AMD64_SHA256="ce6a5c201839383d6ab0198c026ecec274bd62803044aec61fdca20e02c797e2"
WECHAT_ARM64_SHA256="5deb709bcb94bf368eb39d01934cc8456b3fd811d39b45e061c7348ddd8c05a4"
WECHAT_LAST_CHECKED_AT="2026-04-07T12:45:40Z"