-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
henry
committed
Mar 22, 2024
1 parent
4b62979
commit 0611a2d
Showing
5 changed files
with
457 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbookworm | ||
|
||
# title | ||
ENV TITLE=wechat | ||
ENV GTK_IM_MODULE=fcitx | ||
ENV QT_IM_MODULE=fcitx | ||
ENV XMODIFIERS=@im=fcitx | ||
|
||
COPY /packages/wechat-beta_1.0.0.145_amd64.deb /tmp/ | ||
|
||
RUN \ | ||
echo "**** add icon ****" && \ | ||
curl -o \ | ||
/kclient/public/icon.png \ | ||
https://open.weixin.qq.com/zh_CN/htmledition/res/assets/res-design-download/icon16_wx_logo.png && \ | ||
echo "**** Lift login restrictions ****" && \ | ||
curl -L -o /tmp/weixin_2.1.1_amd64.deb http://archive.ubuntukylin.com/software/pool/partner/weixin_2.1.1_amd64.deb && \ | ||
dpkg -X /tmp/weixin_2.1.1_amd64.deb /tmp/out && \ | ||
cp /tmp/out/usr/lib/libactivation.so /usr/lib/libactivation.so && \ | ||
cp /tmp/out/etc/.kyact /etc/.kyact && \ | ||
cp /tmp/out/etc/LICENSE /etc/LICENSE && \ | ||
echo 'DISTRIB_ID=Kylin\nDISTRIB_RELEASE=V10\nDISTRIB_CODENAME=kylin\nDISTRIB_DESCRIPTION="Kylin V10 SP1"\nDISTRIB_KYLIN_RELEASE=V10\nDISTRIB_VERSION_TYPE=enterprise\nDISTRIB_VERSION_MODE=normal' > /etc/lsb-release && \ | ||
echo "**** install packages ****" && \ | ||
apt-get update && \ | ||
apt-get install --no-install-recommends -y \ | ||
libqt5gui5 \ | ||
thunar \ | ||
tint2 && \ | ||
apt-get install -y --no-install-recommends \ | ||
libxrandr2 \ | ||
libxkbcommon0 \ | ||
libxkbcommon-x11-0 \ | ||
libxcb-icccm4 \ | ||
libxcb-glx0 \ | ||
libxcb-randr0 \ | ||
libxcb-shm0 \ | ||
libxcb-render0 \ | ||
libxcb-image0 \ | ||
libxcb-xfixes0 \ | ||
libxcb-shape0 \ | ||
libxcb-sync1 \ | ||
libxcb-render-util0 \ | ||
libxcb-keysyms1 \ | ||
libx11-xcb1 \ | ||
libfontconfig1 \ | ||
libatomic1 \ | ||
libatk1.0-0 \ | ||
libxcb-keysyms1 \ | ||
libatk-bridge2.0-0 && \ | ||
apt-get install -y \ | ||
fonts-noto-cjk \ | ||
im-config \ | ||
zenity \ | ||
fcitx \ | ||
fcitx-googlepinyin \ | ||
fcitx-config-gtk && \ | ||
apt-get install -y --no-install-recommends \ | ||
/tmp/wechat-beta_1.0.0.145_amd64.deb && \ | ||
echo "**** openbox tweaks ****" && \ | ||
sed -i \ | ||
's/NLMC/NLIMC/g' \ | ||
/etc/xdg/openbox/rc.xml && \ | ||
echo "**** cleanup ****" && \ | ||
apt-get autoclean && \ | ||
rm -rf \ | ||
/config/.cache \ | ||
/var/lib/apt/lists/* \ | ||
/var/tmp/* \ | ||
/tmp/* | ||
|
||
# add local files | ||
COPY /root / | ||
|
||
# ports and volumes | ||
EXPOSE 3000 | ||
|
||
VOLUME /config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,149 @@ | ||
# docker-wechat | ||
# [sassv/wechat](https://github.com/henry-proj/docker-wechat) | ||
可在网页访问的微信,使用的Linux原生版本微信,版本号为wechat-beta-1.0.0.0,基础镜像来自于[LinuxServer.io](https://www.linuxserver.io/) | ||
|
||
## 支持的架构 | ||
该镜像支持的架构有: | ||
| Architecture | Available | Tag | | ||
|-----------|---|--------------------------------| | ||
|x86-64|✅|amd64-<版本标签>| | ||
|ARM64|❌|arm64v8-<版本标签>| | ||
|armhf|❌| | ||
|
||
## 应用程序设置 | ||
该应用程序可以通过以下地址访问: | ||
- http://yourhost:3000/ | ||
- https://yourhost:3001/ | ||
### 所有基于 KasmVNC 的 GUI 容器中的选项 | ||
该容器基于Docker Baseimage KasmVNC,这意味着有额外的环境变量和运行配置来启用或禁用特定功能。 | ||
#### 可选环境变量 | ||
|Variable|Description| | ||
|---|---| | ||
|CUSTOM_PORT|Internal port the container listens on for http if it needs to be swapped from the default 3000.| | ||
|CUSTOM_HTTPS_PORT|Internal port the container listens on for https if it needs to be swapped from the default 3001.| | ||
|CUSTOM_USER|HTTP Basic auth username, abc is default.| | ||
|PASSWORD|HTTP Basic auth password, abc is default. If unset there will be no auth| | ||
|SUBFOLDER|Subfolder for the application if running a subfolder reverse proxy, need both slashes IE /subfolder/| | ||
|TITLE|The page title displayed on the web browser, default "KasmVNC Client".| | ||
|FM_HOME|This is the home directory (landing) for the file manager, default "/config".| | ||
|START_DOCKER|If set to false a container with privilege will not automatically start the DinD Docker setup.| | ||
|DRINODE|If mounting in /dev/dri for DRI3 GPU Acceleration allows you to specify the device to use IE /dev/dri/renderD128| | ||
|LC_ALL|Set the Language for the container to run as IE fr_FR.UTF-8 ar_AE.UTF-8| | ||
|NO_DECOR|If set the application will run without window borders for use as a PWA.| | ||
|NO_FULL|Do not autmatically fullscreen applications when using openbox.| | ||
#### 可选的运行配置 | ||
|Variable|Description| | ||
|---|---| | ||
|--privileged|Will start a Docker in Docker (DinD) setup inside the container to use docker in an isolated environment. For increased performance mount the Docker directory inside the container to the host IE -v /home/user/docker-data:/var/lib/docker.| | ||
|-v /var/run/docker.sock:/var/run/docker.sock|Mount in the host level Docker socket to either interact with it via CLI or use Docker enabled applications.| | ||
|--device /dev/dri:/dev/dri|Mount a GPU into the container, this can be used in conjunction with the DRINODE environment variable to leverage a host video card for GPU accelerated appplications. Only Open Source drivers are supported IE (Intel,AMDGPU,Radeon,ATI,Nouveau)| | ||
## 用法 | ||
为了帮助您开始从此映像创建容器,您可以使用 docker-compose 或 docker cli。 | ||
### docker-compose(推荐) | ||
```yaml | ||
services: | ||
wechat: | ||
image: sassv/wechat:latest | ||
container_name: wechat | ||
security_opt: | ||
- seccomp:unconfined #optional | ||
environment: | ||
- PUID=1000 | ||
- PGID=1000 | ||
- TZ=Etc/UTC | ||
- LC_ALL=zh_CN.UTF-8 | ||
- CUSTOM_USER=admin | ||
- PASSWORD=admin | ||
- DRINODE=/dev/dri/renderD128 | ||
devices: | ||
- /dev/dri:/dev/dri | ||
volumes: | ||
- /data/docker-data/wechat/data:/config | ||
ports: | ||
- 3000:3000 | ||
- 3001:3001 | ||
shm_size: "4gb" | ||
restart: unless-stopped | ||
#network_mode: "host" | ||
``` | ||
### docker cli | ||
```yaml | ||
docker run -d \ | ||
--name=wechat \ | ||
--security-opt seccomp=unconfined `#optional` \ | ||
-e PUID=1000 \ | ||
-e PGID=1000 \ | ||
-e TZ=Etc/UTC \ | ||
-e DRINODE=/dev/dri/renderD128 \ | ||
-p 3000:3000 \ | ||
-p 3001:3001 \ | ||
-v /data/docker-data/wechat/data:/config \ | ||
--device /dev/dri:/dev/dri \ | ||
--shm-size="4gb" \ | ||
--restart unless-stopped \ | ||
sassv/wechat:latest | ||
``` | ||
## 参数 | ||
容器是通过在运行时传递的参数(如上述所示)进行配置的。这些参数用冒号分隔,并分别表示`< external >:< internal >`。例如,`-p 8080:80` 将使容器内的80端口可以从容器外部的主机 IP 的8080端口上进行访问。 | ||
|Parameter|Function| | ||
|---|---| | ||
|-p 3000|Chromium desktop gui.| | ||
|-p 3001|HTTPS Chromium desktop gui.| | ||
|-e PUID=1000|for UserID - see below for explanation| | ||
|-e PGID=1000|for GroupID - see below for explanation| | ||
|-e TZ=Etc/UTC|specify a timezone to use, see this list.| | ||
|-v /config|Users home directory in the container, stores local files and settings| | ||
|--shm-size=|This is needed for any modern website to function like youtube.| | ||
|--security-opt seccomp=unconfined|For Docker Engine only, many modern gui apps need this to function on older hosts as syscalls are unknown to Docker. Chromium runs in no-sandbox test mode without it.| | ||
## 通过域名访问 | ||
### Nginx配置 | ||
```conf | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
listen 443 ssl; | ||
listen [::]:443 ssl; | ||
server_name wechat.example.com; | ||
ssl_certificate /etc/nginx/ssl/example.com/example.com.crt; | ||
ssl_certificate_key /etc/nginx/ssl/example.com/example.com.key; | ||
if ($scheme != "https") { | ||
return 301 https://$host$request_uri; | ||
} | ||
location / { | ||
# WebSocket Support | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
# Host and X headers | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
add_header 'Cross-Origin-Embedder-Policy' 'require-corp'; | ||
add_header 'Cross-Origin-Opener-Policy' 'same-origin'; | ||
add_header 'Cross-Origin-Resource-Policy' 'same-site'; | ||
# Connectivity Options | ||
proxy_http_version 1.1; | ||
proxy_read_timeout 1800s; | ||
proxy_send_timeout 1800s; | ||
proxy_connect_timeout 1800s; | ||
proxy_buffering off; | ||
proxy_pass http://127.0.0.1:3000; | ||
} | ||
} | ||
``` | ||
## 输入法 | ||
此镜像默认已安装中文语言包、fcitx输入法框架、googlepinyin输入法。但是还需要对输入法进行配置。 | ||
- 浏览器打开Web界面[http://yourhost:3000](http://yourhost:3000) | ||
- 激活输入法(点击右一小企鹅图标) | ||
- 配置输入法(点击左一小企鹅图标) | ||
- 在输入法配置界面中全局配置选项卡设置切换激活/非激活输入法的快捷键(建议shift+空格) | ||
|
||
## 已知问题 | ||
- KasmVNC不能使用启用本地输入法选项 | ||
- 微信不能接打语音电话和视频电话(微信会崩溃) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# default file copies first run | ||
if [ ! -f $HOME/.config/tint2/tint2rc ]; then | ||
mkdir -p $HOME/.config/tint2 | ||
cp /defaults/tint2rc $HOME/.config/tint2/tint2rc | ||
fi | ||
|
||
# Start UI | ||
tint2 & | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<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> | ||
</menu> | ||
</openbox_menu> |
Oops, something went wrong.