mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/docker-easyconnect/docker-easyconnect.git
synced 2026-09-20 08:03:33 +08:00
support chromium version (#455)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
ARG ANDROID_PATCH MIRROR_URL=http://ftp.cn.debian.org/debian/ EC_HOST VPN_TYPE=EC_GUI
|
||||
ARG ANDROID_PATCH MIRROR_URL=http://ftp.cn.debian.org/debian/ EC_HOST VPN_TYPE=EC_GUI http_proxy https_proxy CHROMIUM
|
||||
|
||||
COPY ["./build-scripts/config-apt.sh", "./build-scripts/get-echost-names.sh", "./build-scripts/add-qemu.sh", \
|
||||
"/tmp/build-scripts/"]
|
||||
@@ -19,7 +19,10 @@ RUN . /tmp/build-scripts/config-apt.sh && \
|
||||
libx11-xcb1 libnss3 libasound2 iptables xclip libxtst6 \
|
||||
dante-server tigervnc-standalone-server tigervnc-tools psmisc flwm x11-utils \
|
||||
busybox libssl-dev iproute2 tinyproxy-bin libxss1 ca-certificates \
|
||||
fonts-wqy-microhei socat $qemu_pkgs $extra_pkgs && \
|
||||
fonts-wqy-microhei socat wget $qemu_pkgs $extra_pkgs && \
|
||||
if [ -n "$CHROMIUM" ]; then \
|
||||
apt-get install -y --no-install-recommends --no-install-suggests chromium; \
|
||||
fi && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN groupadd -r socks && useradd -r -g socks socks
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM debian:bookworm-slim AS build
|
||||
|
||||
ARG ANDROID_PATCH BUILD_ENV=local MIRROR_URL=http://ftp.cn.debian.org/debian/ EC_HOST
|
||||
ARG ANDROID_PATCH BUILD_ENV=local MIRROR_URL=http://ftp.cn.debian.org/debian/ EC_HOST http_proxy https_proxy
|
||||
|
||||
COPY ["./build-scripts/config-apt.sh", "./build-scripts/get-echost-names.sh", "/tmp/build-scripts/"]
|
||||
|
||||
@@ -12,7 +12,7 @@ RUN . /tmp/build-scripts/config-apt.sh && \
|
||||
esac && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends --no-install-suggests ca-certificates \
|
||||
busybox libssl-dev automake $go $ecgccpkg build-essential
|
||||
busybox libssl-dev automake $go $ecgccpkg build-essential wget
|
||||
|
||||
RUN mkdir results && cd results && mkdir fake-hwaddr tinyproxy-ws novnc fake-getlogin && mkdir /tmp/src -p
|
||||
|
||||
@@ -27,7 +27,7 @@ RUN . /tmp/build-scripts/get-echost-names.sh && \
|
||||
ARG TINYPROXY_COMMIT=991e47d8ebd4b12710828b2b486535e4c25ba26c
|
||||
|
||||
RUN cd /tmp/src/ && \
|
||||
busybox wget https://github.com/tinyproxy/tinyproxy/archive/${TINYPROXY_COMMIT}.zip -O tinyproxy.zip && \
|
||||
wget https://github.com/tinyproxy/tinyproxy/archive/${TINYPROXY_COMMIT}.zip -O tinyproxy.zip && \
|
||||
busybox unzip tinyproxy.zip && mv tinyproxy-${TINYPROXY_COMMIT} tinyproxy && cd tinyproxy && \
|
||||
./autogen.sh --prefix=/usr && make && install -D src/tinyproxy /results/tinyproxy-ws/usr/bin/tinyproxy
|
||||
|
||||
@@ -36,17 +36,18 @@ ARG NOVNC_METHOD=min-size GOPROXY=http://proxy.golang.com.cn,direct
|
||||
RUN cd /tmp/src/ && \
|
||||
case "${NOVNC_METHOD}" in \
|
||||
min-size ) \
|
||||
busybox wget https://github.com/novnc/noVNC/archive/refs/heads/master.zip -O novnc.zip && \
|
||||
busybox wget https://github.com/novnc/websockify-other/archive/refs/heads/master.zip -O novnc-websockify.zip && \
|
||||
wget https://github.com/novnc/noVNC/archive/refs/heads/master.zip -O novnc.zip && \
|
||||
wget https://github.com/novnc/websockify-other/archive/refs/heads/master.zip -O novnc-websockify.zip && \
|
||||
busybox unzip novnc.zip && mv noVNC-master novnc && ln -s vnc.html novnc/index.html && \
|
||||
sed -i "s#UI.initSetting('path', 'websockify')#UI.initSetting('path','websockify/websockify')#" novnc/app/ui.js && \
|
||||
mkdir -p /results/novnc/usr/local/share/ && mv novnc /results/novnc/usr/local/share/novnc && \
|
||||
busybox unzip novnc-websockify.zip && mv websockify-other-master novnc-websockify && \
|
||||
cd novnc-websockify/c/ && make && install -D websockify /results/novnc/usr/local/bin/websockify ;; \
|
||||
easy-novnc ) \
|
||||
busybox wget https://github.com/pgaskin/easy-novnc/archive/refs/heads/master.zip -O easy-novnc.zip && \
|
||||
wget https://github.com/pgaskin/easy-novnc/archive/refs/heads/master.zip -O easy-novnc.zip && \
|
||||
busybox unzip easy-novnc.zip && mv easy-novnc-master easy-novnc && cd easy-novnc && \
|
||||
go build -ldflags "-s -w" -gccgoflags "-Wl,-s,-gc-sections -fdata-sections -ffunction-sections -static-libgo" && \
|
||||
install -D easy-novnc /results/novnc/usr/local/bin/easy-novnc ;; \
|
||||
* ) printf "Not a vaild value of NOVNC_METHOD: %s\n" "${NOVNC_METHOD}" >&2 && false ;; \
|
||||
esac && ln -s novnc-${NOVNC_METHOD}.sh /results/novnc/usr/local/bin/novnc
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
ARG ANDROID_PATCH BUILD_ENV=local MIRROR_URL=http://ftp.cn.debian.org/debian/ EC_HOST
|
||||
ARG ANDROID_PATCH BUILD_ENV=local MIRROR_URL=http://ftp.cn.debian.org/debian/ EC_HOST http_proxy https_proxy
|
||||
|
||||
COPY ["./build-scripts/config-apt.sh", "./build-scripts/get-echost-names.sh", "./build-scripts/add-qemu.sh", \
|
||||
"/tmp/build-scripts/"]
|
||||
@@ -10,7 +10,7 @@ RUN . /tmp/build-scripts/config-apt.sh && \
|
||||
. /tmp/build-scripts/add-qemu.sh && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends --no-install-suggests iptables \
|
||||
dante-server busybox iproute2 tinyproxy-bin ca-certificates ${qemu_pkgs} socat && \
|
||||
dante-server busybox iproute2 tinyproxy-bin ca-certificates ${qemu_pkgs} socat wget && \
|
||||
for command in ps kill killall; do ln -s "$(which busybox)" /usr/local/bin/"${command}" || exit 1 ; done && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -20,7 +20,7 @@ ARG EC_CLI_URL="https://github.com/shmilee/scripts/releases/download/v0.0.1/easy
|
||||
COPY ./build-scripts/mk-qemu-wrapper.sh /tmp/build-scripts/
|
||||
|
||||
RUN EC_DIR=/usr/share/sangfor/EasyConnect/resources && cd /tmp && \
|
||||
busybox wget "${EC_CLI_URL}" -O easyconn.deb && \
|
||||
wget "${EC_CLI_URL}" -O easyconn.deb && \
|
||||
dpkg -x easyconn.deb easyconn && \
|
||||
bash -c "mkdir -p ${EC_DIR}/{bin,lib64,shell,logs}/" && \
|
||||
bash -c "cp easyconn/${EC_DIR}/bin/{CSClient,easyconn,ECAgent,svpnservice,ca.crt,cert.crt} \
|
||||
@@ -42,7 +42,7 @@ RUN cd /tmp && \
|
||||
for ver in 7.6.3 7.6.7 ; do { \
|
||||
vername=EC_$( echo "$ver" | sed 's/\.//g' )_URL && \
|
||||
url="$(eval printf %s \"\$$vername\")" && \
|
||||
if [ -n "${url}" ]; then busybox wget "${url}" -O EasyConnect.deb && dpkg -x EasyConnect.deb ec && \
|
||||
if [ -n "${url}" ]; then wget "${url}" -O EasyConnect.deb && dpkg -x EasyConnect.deb ec && \
|
||||
cp -r ec/usr/share/sangfor/EasyConnect/resources/conf \
|
||||
/usr/share/sangfor/EasyConnect/resources/conf_$ver && \
|
||||
rm -r *; fi ;} || exit 1 ; done
|
||||
|
||||
@@ -18,7 +18,7 @@ RUN . /tmp/build-scripts/config-apt.sh && \
|
||||
apt-get install -y --no-install-recommends --no-install-suggests $qemu_pkgs $extra_pkgs \
|
||||
ca-certificates libx11-xcb1 libnss3 libasound2 iptables fonts-wqy-microhei \
|
||||
dante-server psmisc libxaw7 xclip busybox libssl-dev iproute2 tinyproxy-bin libxss1 \
|
||||
socat libxtst6 && \
|
||||
socat libxtst6 wget && \
|
||||
cd /tmp && apt-get download x11-utils && dpkg -x x11-utils_*.deb x11-utils && \
|
||||
mkdir -p /usr/local/bin && cp x11-utils/usr/bin/xmessage /usr/local/bin && rm -r x11-utils* && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
2. 在终端输入: `docker run --rm --device /dev/net/tun --cap-add NET_ADMIN -ti -e PASSWORD=xxxx -e URLWIN=1 -v $HOME/.atrust-data:/root -p 127.0.0.1:5901:5901 -p 127.0.0.1:1080:1080 -p 127.0.0.1:8888:8888 -p 127.0.0.1:54631:54631 --sysctl net.ipv4.conf.default.route_localnet=1 hagb/docker-atrust`;
|
||||
3. 使用vnc客户端连接vnc, 地址:127.0.0.1,端口: 5901, 密码 xxxx;
|
||||
4. 成功连上后你应该能看到 aTrust 的登录窗口;若需要 web 登录,在宿主机的浏览器打开 aTrust 弹出的网址网址登录即可;若需要无人值守的自动化登录和保活,请[参见此处](https://github.com/kenvix/aTrustLogin)。
|
||||
|
||||
5. 若必须经过 web 界面登录或 web 端需要唤起 `atrust://browserstart` 详见 [#433](https://github.com/docker-easyconnect/docker-easyconnect/issues/443),你可以使用内置 chromium 版镜像,启动命令需加上 `-e CHROMIUM=1`,详见 [构建带有chromium的VNC镜像](doc/build.md#构建带有-chromium-的-VNC-镜像)。
|
||||
|
||||
## 拉取
|
||||
|
||||
|
||||
1
build-args/atrust-2.5.16.20-amd64.txt
Normal file
1
build-args/atrust-2.5.16.20-amd64.txt
Normal file
@@ -0,0 +1 @@
|
||||
--build-arg VPN_URL=https://atrustcdn.sangfor.com/standard/linux/2.5.16.20/uos/amd64/aTrustInstaller_amd64.deb --build-arg VPN_TYPE=ATRUST
|
||||
1
build-args/atrust-2.5.16.20-arm64.txt
Normal file
1
build-args/atrust-2.5.16.20-arm64.txt
Normal file
@@ -0,0 +1 @@
|
||||
--build-arg VPN_URL=https://atrustcdn.sangfor.com/standard/linux/2.5.16.20/uos/arm64/aTrustInstaller_arm64.deb --build-arg VPN_TYPE=ATRUST
|
||||
1
build-args/atrust-2.5.16.20-mips64le.txt
Normal file
1
build-args/atrust-2.5.16.20-mips64le.txt
Normal file
@@ -0,0 +1 @@
|
||||
--build-arg VPN_URL=https://atrustcdn.sangfor.com/standard/linux/2.5.16.20/uos/mips64el/aTrustInstaller_mips64el.deb --build-arg VPN_TYPE=ATRUST
|
||||
@@ -1 +1 @@
|
||||
atrust-2.4.10.50-amd64.txt
|
||||
atrust-2.5.16.20-amd64.txt
|
||||
@@ -1 +1 @@
|
||||
atrust-2.4.10.50-arm64.txt
|
||||
atrust-2.5.16.20-arm64.txt
|
||||
@@ -1 +1 @@
|
||||
atrust-2.4.10.50-mips64le.txt
|
||||
atrust-2.5.16.20-mips64le.txt
|
||||
@@ -7,9 +7,9 @@ echo "$VPN_TYPE" > /etc/vpn-type &&
|
||||
cd /tmp &&
|
||||
. ./build-scripts/get-echost-names.sh &&
|
||||
if [ -z "${VPN_DEB_PATH}" ]; then
|
||||
busybox wget "${VPN_URL}" -O VPN.deb
|
||||
wget "${VPN_URL}" -O VPN.deb
|
||||
else
|
||||
busybox wget "${VPN_URL}" -O VPN.zip &&
|
||||
wget "${VPN_URL}" -O VPN.zip &&
|
||||
busybox unzip -p VPN.zip "${VPN_DEB_PATH}" > VPN.deb &&
|
||||
rm VPN.zip
|
||||
fi &&
|
||||
@@ -60,7 +60,7 @@ ELECTRON_URLS=(
|
||||
if [ -z "${ELECTRON_URL}" ]; then
|
||||
ELECTRON_URL="${ELECTRON_URLS[$(dpkg --print-architecture)]}"
|
||||
fi &&
|
||||
busybox wget "${ELECTRON_URL}" -O electron.zip &&
|
||||
wget "${ELECTRON_URL}" -O electron.zip &&
|
||||
busybox unzip electron.zip -od /usr/share/sangfor/EasyConnect/ &&
|
||||
rm electron.zip &&
|
||||
mv /usr/share/sangfor/EasyConnect/{electron,EasyConnect}
|
||||
|
||||
16
doc/build.md
16
doc/build.md
@@ -23,6 +23,9 @@
|
||||
- `MIRROR_URL`: Debian 镜像站,默认为 <http://ftp.cn.debian.org/debian/>,设为空则使用默认镜像站
|
||||
- `USE_EC_ELECTRON`(仅适用于图形界面版): 默认为空,是否使用来自 EasyConnect 的 electron,不为空时使用来自 EasyConnect 的 electron.
|
||||
- `VPN_DEB_PATH`(仅适用于图形界面版): 默认为空。非空时表示 `VPN_URL` 是一个 zip 包的地址(见<https://github.com/Hagb/docker-easyconnect/issues/25#issuecomment-1233369467>),而 `VPN_DEB_PATH` 则是 zip 包中的 deb 包的路径。
|
||||
- `http_proxy`: 默认为空,不为空时 http 协议的连接走该代理,注意若代理 ip 为本机 `127.0.0.1` 时,需要在 build 命令后加上参数 `--network host` 。
|
||||
- `https_proxy`: 同上,不为空时 https 协议走该代理。
|
||||
- `CHROMIUM`: 默认为空,不为空时,将安装 chromium,用于 web 认证。
|
||||
- **`VPN_TYPE`**:默认为 `EC_GUI`。构建 aTrust 镜像时,需要将该参数设为 `ATRUST`。
|
||||
- **`VPN_URL`**(仅适用于图形界面版): EasyConnect 的 deb 包下载地址(`VPN_DEB_PATH` 非空时则是包含 deb 包的 zip 包下载地址),各版本的下载地址可见于 [../build-args/](../build-args/)。
|
||||
|
||||
@@ -31,6 +34,8 @@
|
||||
|
||||
- `EC_HOST`: EasyConnect deb 包的架构,同上文
|
||||
- `MIRROR_URL`: Debian 镜像站,同上文
|
||||
- `http_proxy`: 同上文
|
||||
- `https_proxy`: 同上文
|
||||
- `TINYPROXY_COMMIT`: 构建支持 websocket 的 [tinyproxy](https://github.com/tinyproxy/tinyproxy) 的 commit.
|
||||
- `NOVNC_METHOD`: 提供 noVNC 服务的方式,默认为 `min-size`,可选选项有
|
||||
|
||||
@@ -66,3 +71,14 @@ docker image build $(cat build-args/7.6.7-amd64.txt) -f Dockerfile.build -t hagb
|
||||
docker image build $(cat build-args/7.6.7-amd64.txt) --tag hagb/docker-easyconnect -f Dockerfile.vncless .
|
||||
```
|
||||
|
||||
### 构建带有 chromium 的 VNC 镜像
|
||||
|
||||
(使用本机代理,以 aTrust 为例)
|
||||
|
||||
```bash
|
||||
git clone https://github.com/hagb/docker-easyconnect.git
|
||||
cd docker-easyconnect
|
||||
docker image build --network host $(cat build-args/atrust-arm64.txt) --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} --build-arg MIRROR_URL="http://mirrors.ustc.edu.cn/debian/" -f Dockerfile.build -t hagb/docker-easyconnect:build .
|
||||
docker image build --network host $(cat build-args/atrust-arm64.txt) --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} --build-arg CHROMIUM=1 --build-arg MIRROR_URL="http://mirrors.ustc.edu.cn/debian/" -f Dockerfile -t hagb/docker-atrust:chromium .
|
||||
```
|
||||
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
|
||||
- `VNC_SIZE`: 默认为空,为空时 VNC 服务分辨率为 `1110x620`(7.6.7 版 EasyConnect 登录后的默认窗口尺寸),可设置为自定义的 VNC 分辨率。
|
||||
|
||||
- `CHROMIUM`: 默认为空,不为空时需运行装有 chromium 的镜像,详见 [build](./build.md#构建带有-chromium-的-VNC-镜像)
|
||||
|
||||
## 服务说明
|
||||
|
||||
### 代理服务
|
||||
|
||||
@@ -210,6 +210,13 @@ then
|
||||
start_tigervncserver &
|
||||
fi
|
||||
|
||||
# 环境变量 CHROMIUM 不为空时,删除可能存在的锁,并启动 chromium
|
||||
if [ -n "$CHROMIUM" ]; then
|
||||
rm -rf /root/.config/chromium/
|
||||
bash -c "chromium --no-sandbox" &
|
||||
disown
|
||||
fi
|
||||
|
||||
init_vpn_config
|
||||
wait
|
||||
|
||||
|
||||
Reference in New Issue
Block a user