From 8f8af073f26a2fd5124679106001f2623653160f Mon Sep 17 00:00:00 2001 From: Nick007 Date: Mon, 20 Oct 2025 20:20:54 +0800 Subject: [PATCH] feat: improve container configuration management and user experience - Add automatic config version control for seamless upgrades - Update autostart script to use wechat-start.sh for better initialization - Add comprehensive WeChat management scripts (start, restart, unminimize) - Enhance right-click menu with WeChat restart and restore functionality - Improve Dockerfile cleanup process for smaller image size - Add volume mounting examples in documentation for data persistence - Include upgrade troubleshooting notes for openbox configuration - Add Star History chart and additional reference links This update ensures users get the latest menu configurations automatically without manual intervention during container updates. --- Dockerfile | 9 ++++++++- README.md | 9 ++++++++- README_en.md | 11 +++++++++-- root/defaults/autostart | 2 +- root/defaults/menu.xml | 8 ++++++++ root/scripts/wechat/wechat-restart.sh | 3 +++ root/scripts/wechat/wechat-start.sh | 3 +++ root/scripts/wechat/wechat-unminimize.sh | 2 ++ 8 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 root/defaults/menu.xml create mode 100755 root/scripts/wechat/wechat-restart.sh create mode 100755 root/scripts/wechat/wechat-start.sh create mode 100755 root/scripts/wechat/wechat-unminimize.sh diff --git a/Dockerfile b/Dockerfile index 6fb05cc..eb6837a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,14 @@ RUN apt-get update && \ libfontconfig1 libdbus-1-3 libnss3 libx11-xcb1 # Clean up -RUN apt-get clean && rm -rf /var/lib/apt/lists/* +RUN apt-get purge -y --autoremove +RUN apt-get autoclean && \ + rm -rf \ + /config/.cache \ + /config/.npm \ + /var/lib/apt/lists/* \ + /var/tmp/* \ + /tmp/* # Install WeChat based on target architecture RUN case "$TARGETPLATFORM" in \ diff --git a/README.md b/README.md index 189dc5b..8c6e6ab 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ 1. **直接使用已构建的镜像进行快速部署** ```bash -docker run -it -p 3001:3001 ghcr.io/nickrunning/wechat-selkies:latest +docker run -it -p 3001:3001 -v ./config:/config ghcr.io/nickrunning/wechat-selkies:latest ``` 2. **访问微信** @@ -81,6 +81,8 @@ docker run -it -p 3001:3001 ghcr.io/nickrunning/wechat-selkies:latest - `./config:/config`: 微信配置和数据持久化目录 +> 如果升级后右键菜单缺少 `WeChat` 相关选项,请先清空本地挂载目录下的openbox目录(如`./config/.config/openbox`)。 + ## 高级配置 ### 硬件加速 @@ -191,3 +193,8 @@ docker-compose logs -f wechat-selkies - [微信官方网站](https://weixin.qq.com/) - [Selkies WebRTC](https://github.com/selkies-project) - [LinuxServer.io](https://github.com/linuxserver) +- [xiaoheiCat/docker-wechat-sogou-pinyin](https://github.com/xiaoheiCat/docker-wechat-sogou-pinyin) + +## 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) \ No newline at end of file diff --git a/README_en.md b/README_en.md index 865ea9d..9ea9c92 100644 --- a/README_en.md +++ b/README_en.md @@ -31,7 +31,7 @@ This project packages the official WeChat Linux client in a Docker container, en 1. **Direct deployment using pre-built images** ```bash -docker run -it -p 3001:3001 ghcr.io/nickrunning/wechat-selkies:latest +docker run -it -p 3001:3001 -v ./config:/config ghcr.io/nickrunning/wechat-selkies:latest ``` 2. **Access WeChat** @@ -81,6 +81,8 @@ Configure the following environment variables in `docker-compose.yml`: - `./config:/config`: WeChat configuration and data persistence directory +> Note: If the right-click menu lacks `WeChat` related options after an upgrade, please clear the `openbox` directory in the local mounted directory (e.g., `./config/.config/openbox`). + ## Advanced Configuration ### Hardware Acceleration @@ -191,4 +193,9 @@ For more information about GPL-3.0 license, please visit: https://www.gnu.org/li - [WeChat Official Website](https://weixin.qq.com/) - [Selkies WebRTC](https://github.com/selkies-project) -- [LinuxServer.io](https://github.com/linuxserver) \ No newline at end of file +- [LinuxServer.io](https://github.com/linuxserver) +- [xiaoheiCat/docker-wechat-sogou-pinyin](https://github.com/xiaoheiCat/docker-wechat-sogou-pinyin) + +## 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) \ No newline at end of file diff --git a/root/defaults/autostart b/root/defaults/autostart index 92f92ec..61e8068 100644 --- a/root/defaults/autostart +++ b/root/defaults/autostart @@ -1 +1 @@ -wechat +/scripts/wechat/wechat-start.sh diff --git a/root/defaults/menu.xml b/root/defaults/menu.xml new file mode 100644 index 0000000..fe9f87f --- /dev/null +++ b/root/defaults/menu.xml @@ -0,0 +1,8 @@ + + + +/usr/bin/xterm +/scripts/wechat/wechat-restart.sh +/scripts/wechat/wechat-unminimize.sh + + diff --git a/root/scripts/wechat/wechat-restart.sh b/root/scripts/wechat/wechat-restart.sh new file mode 100755 index 0000000..e6dddd6 --- /dev/null +++ b/root/scripts/wechat/wechat-restart.sh @@ -0,0 +1,3 @@ +#!/bin/bash +pkill -9 -f /usr/bin/wechat 2>/dev/null +nohup /usr/bin/wechat >/dev/null 2>&1 & \ No newline at end of file diff --git a/root/scripts/wechat/wechat-start.sh b/root/scripts/wechat/wechat-start.sh new file mode 100755 index 0000000..86b701a --- /dev/null +++ b/root/scripts/wechat/wechat-start.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +/usr/bin/wechat \ No newline at end of file diff --git a/root/scripts/wechat/wechat-unminimize.sh b/root/scripts/wechat/wechat-unminimize.sh new file mode 100755 index 0000000..665d6f2 --- /dev/null +++ b/root/scripts/wechat/wechat-unminimize.sh @@ -0,0 +1,2 @@ +#!/bin/bash +xdotool windowmap `xdotool search --name "微信(测试版)"` || xdotool windowmap `xdotool search --name "WeChat Beta"` \ No newline at end of file