Skip to content

[pull] master from Hagb:master #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 103 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
0e141e9
Add support for non-amd64 architecture via qemu-user
Hagb Feb 8, 2022
ea937b4
Merge branch 'develop' into non-amd64
Hagb Feb 8, 2022
655808c
Improve method to get network interfaces
Hagb Feb 9, 2022
92a8d41
Add support for ipv6 client
Hagb Feb 9, 2022
63dafe1
Keep the compatibility with OCI format of dockerfile
Hagb Mar 19, 2022
72cbfc2
Refactor dockerfiles and add support for non-amd64 GUI
Hagb Mar 19, 2022
80e8216
Add document of ELECTRON_URL
Hagb Mar 20, 2022
60ef04d
No need to apply fake-hwaddr hack to the GUI frontend
Hagb Mar 20, 2022
7edc031
Add document of MIRROR_URL
Hagb Mar 20, 2022
080db62
Merge branch 'non-amd64' into develop
Hagb Mar 20, 2022
502bcca
Add a workaround for qemu-user memory leak
Hagb Mar 21, 2022
f2ae594
Print ECAgent OOM message to stderr
Hagb Mar 21, 2022
ba974b0
Merge branch 'master' into develop
Hagb Sep 19, 2022
007d391
Rename Dockerfile.fake-hwaddr to Dockerfile.build
Hagb Sep 20, 2022
2fc81f4
Clean up build scripts
Hagb Sep 20, 2022
e746bc4
Set ftp.cn.debian.org as the default mirror
Hagb Sep 20, 2022
32cac7c
Compile tinyproxy for websocket support
Hagb Sep 20, 2022
eb8274a
Make noVNC cross-platform
Hagb Sep 20, 2022
90bfb39
Correctly replace mirror url
Hagb Sep 20, 2022
890c19f
Use official electron by default even in amd64 and i386
Hagb Sep 20, 2022
12409d7
Install CA certificates for TLS certificate validation
Hagb Sep 20, 2022
f6090f5
Remove building stage image before push images
Hagb Sep 21, 2022
f533949
Support non-amd64 deb package of EasyConnect
Hagb Sep 24, 2022
2d5c909
Avoid login failure in poor-performance environment
Hagb Sep 24, 2022
dc5b800
Add support for EasyConnect deb package inside zip file
Hagb Sep 24, 2022
e18ff59
Suppress error output when trying to rm non-existent ECDomainFile
Hagb Sep 24, 2022
1f0521a
Remove obsolete config items in tinyproxy.conf
Hagb Sep 24, 2022
8367184
Use filesystem instead of pipe to swap EasyConnect zip
Hagb Sep 25, 2022
6bc1043
Change the method to clean subprocess in start-sangfor.sh
Hagb Sep 25, 2022
227e4a7
Make electron use shared libraries under its direction
Hagb Jan 17, 2023
5ed3825
Merge branch 'master' into develop
Hagb Jan 18, 2023
ea07ea9
Merge branch 'master' into develop
Hagb Jan 19, 2023
b93d0d5
Merge branch 'master' into develop
Hagb Mar 7, 2023
59265bf
Make 7.6.7 default and support multi-arch build in github action
Hagb Jun 24, 2023
f47846f
Fix build arguments of 7.6.7 mips64le
Hagb Jun 25, 2023
380a726
Remove unnecessary `break` command
Hagb Jun 25, 2023
c5b570d
Fix opening url
Hagb Jun 26, 2023
676631a
Refactor and prepare to add aTrust
Hagb Jul 14, 2023
25516e1
Add script to check library deps of Sangfor VPN
Hagb Jul 15, 2023
3f1216e
Add aTrust support (#198)
Hagb Jul 15, 2023
bbffdec
Fix saving url from Sangfor VPN
Hagb Jul 15, 2023
9ea0c0b
Correct killed processes of aTrust
Hagb Jul 16, 2023
2461335
Use iptables-legacy if support for nftables is too limited
Hagb Jul 16, 2023
c5391d8
Update documents
Hagb Jul 16, 2023
199dae8
Add document about certificate in EasyConnect arm64 or mips64el
Hagb Jul 17, 2023
aa8a1e3
Merge branch 'atrust' into develop
Hagb Jul 17, 2023
5a7a4d4
Build aTrust image in GitHub Actions
Hagb Jul 17, 2023
67db766
Fix github action
Hagb Jul 17, 2023
ed4cb8a
Fix aTrust image tagging in GitHub Action
Hagb Jul 17, 2023
9014201
Fix action
Hagb Jul 17, 2023
9fa4dd3
Fix typo
Hagb Jul 17, 2023
bb7571f
Mention more related projects
Hagb Jul 17, 2023
eb32371
Create temporary tun device for danted
Hagb Jul 17, 2023
70b990a
Start services parallelly
Hagb Jul 18, 2023
d679b62
Set vpn configuration variables to envirnoment variables
Hagb Jul 18, 2023
940e82b
Add /usr/sbin/dmidecode as a dummy command
Hagb Jul 18, 2023
5f2a983
Unhardcode X display argument and use stalonetray to show systray
Hagb Jul 18, 2023
8685095
Make danted log only errors and print to stderr
Hagb Jul 18, 2023
4cc0ac4
Fix EasyConnect configuration synchronization
Hagb Jul 19, 2023
7f076a6
Clean up doc/usage.md
Hagb Jul 21, 2023
b3127cb
Use https to download EasyConnect
Hagb Jul 21, 2023
6bf6ad7
doc: docker run with --rm
Hagb Jul 24, 2023
5a3e0fd
Add document about EasyConnect versions matching
Hagb Jul 25, 2023
64891dd
Rename env variable ECPASSWORD to CLIP_TEXT and add related document
Hagb Jul 25, 2023
e1e248f
Delete hooks for building image in DockerHub
Hagb Jul 25, 2023
b7d1e8a
Clean up some examples
Hagb Jul 25, 2023
2b603c0
Add development document
Hagb Jul 25, 2023
604c6ef
Add document about routing
Hagb Jul 26, 2023
e13ece4
Use qemu-user >= 8.0.0 which fixes a memory leak bug
Hagb Jul 26, 2023
41a7707
Fix syntax error
Hagb Jul 26, 2023
35fb642
Reserve /tmp/.X11-unix when remove /tmp/
Hagb Jul 26, 2023
fe1fd0a
Fix deps when using qemu-user
Hagb Jul 26, 2023
ea1cf7c
Add support for timed pinging
Hagb Jul 26, 2023
47350c0
Add document about mac address
Hagb Jul 26, 2023
9c1dd38
Update document and output about tun
Hagb Jul 26, 2023
00f8dd7
Set max open files to a working value
Hagb Jul 26, 2023
077f74e
Merge branch 'develop'
Hagb Jul 26, 2023
f81ff9e
Fix github action
Hagb Jul 26, 2023
c369e9d
Add empty workflow in preparation for checking easyconnect versions
Hagb Oct 14, 2023
b58674f
Fix dependencies conflict
Hagb Oct 18, 2023
4e4d45e
Update images when there is a new easyConnect version
redjumper Oct 28, 2023
a571dcf
Update pkg_version.xml
invalid-email-address Oct 28, 2023
ec1c17e
Merge pull request #308 from redjumper/master
Hagb Nov 15, 2023
e9a7b23
Update aTrust client to 2.3.10_sp3
Hagb Jan 3, 2024
fd5d3d0
fixed: action build fail
aimuz Jan 15, 2024
f69afae
Add write permission for the action checking version
Hagb Oct 14, 2023
0a08c66
Update pkg_version.xml manually
Hagb May 6, 2024
3753fa8
Merge pull request #321 from aimuz/patch-1
Hagb May 6, 2024
3cb2d5d
Fix incorrect build arguments of atrust-2.3.10_sp4
Hagb May 6, 2024
f0bb9f2
Want maintainer
Hagb May 6, 2024
e5d0464
Fix port examples of env FORWARD config
yuantuo666 May 14, 2024
a351f1f
Merge pull request #350 from yuantuo666/patch-1
JHees May 15, 2024
99285e3
Change the danted internal server address binding to IP address (#351)
redjumper May 21, 2024
71f1b24
Fix aTrust on podman and other potential errors about aTrust
Hagb Jul 6, 2024
75fb271
Fix DNS rejection error of aTrust
Hagb Jul 7, 2024
5283e76
Add missing dependenies and conditions
Hagb Jul 7, 2024
2cccdb7
Add missing dependenies and conditions
Hagb Jul 7, 2024
4649be7
优化保活逻辑 (#367)
Einskai Jul 15, 2024
81d7068
Fix the segmentation fault when pinging url (#369)
Hagb Aug 18, 2024
7acc050
修复捕获信号 (#385)
moeshin Oct 8, 2024
6807742
Update atrust deb urls (#382)
EdenBob Oct 8, 2024
d78ea5f
Update README.md to introduce aTrustLogin
kenvix Nov 3, 2024
51617fe
Merge pull request #400 from kenvix/patch-1
Hagb Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions .github/actions/build-and-push-docker-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: Build and Push Docker Image
description: Build and Push Docker Image
inputs:
registry_username:
description: "Username for image registry"
required: true
registry_password:
description: "Password for image registry"
required: true
ec_image_name:
description: 'Name of the easyconnect image to push'
required: true
default: 'hagb/docker-easyconnect'
atrust_image_name:
description: 'Name of the atrust image to push'
required: true
default: 'hagb/docker-atrust'
archs:
description: 'Archs of the easyconnect image to push'
required: true
default: 'mips64le arm64 i386 amd64'
runs:
using: 'composite'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to Docker registry
uses: docker/login-action@v1
with:
username: ${{ inputs.registry_username }}
password: ${{ inputs.registry_password }}

- name: Build Docker image
shell: bash
run: |
to-tag() {
tag="$( IFS=-; printf %s "$*"; )"
if [ -n "$tag" ]; then
printf %s "$tag"
else
echo latest
fi
}
docker-build() {
#docker pull $1
docker buildx build --build-arg BUILD_ENV=actions "$@"
}
branch="$(git branch --show-current)"
case "$branch" in
master) prefix= ;;
develop) prefix=dev ;;
*) prefix="$branch" ;;
esac

build() {
for ver in 7.6.3 7.6.7; do
docker-build --platform "$1" -t hagb/docker-easyconnect:build $(cat build-args/$ver-"$1".txt) -f Dockerfile.build .
docker-build --platform "$1" -t ${{ inputs.ec_image_name }}:$(to-tag $prefix $ver $1) $(cat build-args/$ver-"$1".txt) -f Dockerfile .
docker-build --platform "$1" -t ${{ inputs.ec_image_name }}:$(to-tag $prefix vncless $ver $1) $(cat build-args/$ver-"$1".txt) -f Dockerfile.vncless .
done

if [ -e build-args/atrust-"$1".txt ]; then
docker-build --platform "$1" -t hagb/docker-easyconnect:build $(cat build-args/atrust-"$1".txt) -f Dockerfile.build .
docker-build --platform "$1" -t ${{ inputs.atrust_image_name }}:$(to-tag $prefix $1) $(cat build-args/atrust-"$1".txt) -f Dockerfile .
docker-build --platform "$1" -t ${{ inputs.atrust_image_name }}:$(to-tag $prefix vncless $1) $(cat build-args/atrust-"$1".txt) -f Dockerfile.vncless .
fi

if [ amd64 = "$1" ]; then
docker-build -t ${{ inputs.ec_image_name }}:$(to-tag $prefix cli) -f Dockerfile.cli .
fi
}

sudo apt-get update
sudo apt-get -y install binfmt-support qemu-user-static

for arch in ${{ inputs.archs }}; do
build $arch
done

docker image rm hagb/docker-easyconnect:build

- name: Push Docker image
shell: bash
run: |
to-tag() {
IFS=-
tag="$(printf %s "$*")"
if [ -n "$tag" ]; then
printf %s "$tag"
else
echo latest
fi
}
branch="$(git branch --show-current)"
case "$branch" in
master)
prefix=
;;
develop)
prefix=dev
;;
*)
prefix="$branch"
;;
esac

token="$( curl -sH "Content-Type: application/json" \
-X POST -d "{\"username\": \"${{ inputs.registry_username }}\", \"password\": \"${{ inputs.registry_password }}\"}" \
https://hub.docker.com/v2/users/login/ |
jq -r .token )"
delete_tag() {
curl -sH "Content-Type: application/json" -X DELETE -H "Authorization: JWT $token" \
https://hub.docker.com/v2/repositories/$1/tags/$2/
}

docker push --all-tags ${{ inputs.ec_image_name }}
docker push --all-tags ${{ inputs.atrust_image_name }}

for ver in 7.6.3 7.6.7; do
for vncless in "" vncless; do
for arch in ${{ inputs.archs }}; do
docker manifest create ${{ inputs.ec_image_name }}:$(to-tag $prefix $vncless $ver) --amend ${{ inputs.ec_image_name }}:$(to-tag $prefix $vncless $ver $arch)
done

docker manifest push ${{ inputs.ec_image_name }}:$(to-tag $prefix $vncless $ver)

if [ 7.6.7 = $ver ]; then
for arch in ${{ inputs.archs }}; do
docker manifest create ${{ inputs.ec_image_name }}:$(to-tag $prefix $vncless) --amend ${{ inputs.ec_image_name }}:$(to-tag $prefix $vncless $ver $arch)
done
docker manifest push ${{ inputs.ec_image_name }}:$(to-tag $prefix $vncless)
fi

for arch in ${{ inputs.archs }}; do
delete_tag ${{ inputs.ec_image_name }} $(to-tag $prefix $vncless $ver $arch)
done
done
done

for vncless in "" vncless; do
for arch in ${{ inputs.archs }}; do
if [ -e build-args/atrust-"$arch".txt ]; then
docker manifest create ${{ inputs.atrust_image_name }}:$(to-tag $prefix $vncless) --amend ${{ inputs.atrust_image_name }}:$(to-tag $prefix $vncless $arch)
fi
done

docker manifest push ${{ inputs.atrust_image_name }}:$(to-tag $prefix $vncless)

for arch in ${{ inputs.archs }}; do
[ ! -e build-args/atrust-$arch.txt ] || delete_tag ${{ inputs.atrust_image_name }} $(to-tag $prefix $vncless $arch)
done
done
44 changes: 5 additions & 39 deletions .github/workflows/build-and-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,12 @@ name: Build And Push Docker Image

on: workflow_dispatch

env:
IMAGE_NAME: hagb/docker-easyconnect

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to Docker registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker image
run: |
docker-build() {
#docker pull $1
docker build -t $1 --build-arg BUILD_ENV=actions "${@:2}"
}
pirefix=""
latest_name="latest"
if [ "$(git branch --show-current)" = develop ]; then prefix=dev- ; latest_name=dev ; fi

docker-build fake-hwaddr -f Dockerfile.fake-hwaddr .

docker-build ${{ env.IMAGE_NAME }}:${prefix}cli -f Dockerfile.cli .

docker-build ${{ env.IMAGE_NAME }}:${prefix}7.6.3 --build-arg EC_URL=$(cat ec_urls/7.6.3.txt) -f Dockerfile .
docker-build ${{ env.IMAGE_NAME }}:${prefix}7.6.7 --build-arg EC_URL=$(cat ec_urls/7.6.7.txt) -f Dockerfile .

docker-build ${{ env.IMAGE_NAME }}:${prefix}vncless-7.6.3 --build-arg EC_URL=$(cat ec_urls/7.6.3.txt) -f Dockerfile.vncless .
docker-build ${{ env.IMAGE_NAME }}:${prefix}vncless-7.6.7 --build-arg EC_URL=$(cat ec_urls/7.6.7.txt) -f Dockerfile.vncless .

docker tag ${{ env.IMAGE_NAME }}:${prefix}7.6.3 ${{ env.IMAGE_NAME }}:${latest_name}

- name: Push Docker image
run: |
docker push --all-tags ${{ env.IMAGE_NAME }}
- uses: actions/checkout@v2
- uses: ./.github/actions/build-and-push-docker-image
with:
registry_username: ${{secrets.DOCKERHUB_USERNAME}}
registry_password: ${{secrets.DOCKERHUB_TOKEN}}
46 changes: 46 additions & 0 deletions .github/workflows/check-easyconnect-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Check EasyConnect versions

on:
workflow_dispatch:
schedule:
- cron: '30 3 * * *'

permissions:
contents: write

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Compare pkg_version.xml
id: compare
run: |
wget http://download.sangfor.com.cn/download/product/sslvpn/pkg/pkg_version.xml -O pkg_version_remote.xml
if diff pkg_version.xml pkg_version_remote.xml >/dev/null; then
echo "different=false" >> $GITHUB_OUTPUT
else
echo "different=true" >> $GITHUB_OUTPUT
fi
shell: bash

- name: Replace pkg_version.xml
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
cp pkg_version_remote.xml pkg_version.xml
git add pkg_version.xml
git commit -m "Update pkg_version.xml"
git push
if: steps.compare.outputs.different == 'true'

- name: Rebuild EasyConnect
uses: ./.github/actions/build-and-push-docker-image
with:
registry_username: ${{secrets.DOCKERHUB_USERNAME}}
registry_password: ${{secrets.DOCKERHUB_TOKEN}}
if: steps.compare.outputs.different == 'true'
44 changes: 27 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
FROM debian:buster-slim
FROM debian:bookworm-slim

ARG BUILD_ENV=local
ARG ANDROID_PATCH MIRROR_URL=http://ftp.cn.debian.org/debian/ EC_HOST VPN_TYPE=EC_GUI

RUN if [ "${BUILD_ENV}" = "local" ]; then sed -i s/deb.debian.org/mirrors.aliyun.com/ /etc/apt/sources.list; fi &&\
COPY ["./build-scripts/config-apt.sh", "./build-scripts/get-echost-names.sh", "./build-scripts/add-qemu.sh", \
"/tmp/build-scripts/"]

RUN . /tmp/build-scripts/config-apt.sh && \
. /tmp/build-scripts/get-echost-names.sh && \
. /tmp/build-scripts/add-qemu.sh && \
apt-get update && \
if [ "ATRUST" = "$VPN_TYPE" ]; then \
extra_pkgs="libssl1.1 libatk-bridge2.0-0 libgtk-3-0 libgbm1 libqt5x11extras5 procps \
libqt5core5a libqt5network5 libqt5widgets5 libldap-2.4-2 stalonetray"; \
else \
extra_pkgs="libgtk2.0-0 libdbus-glib-1-2 libgconf-2-4 libnspr4:$EC_HOST libnss3:$EC_HOST"; \
fi && \
apt-get install -y --no-install-recommends --no-install-suggests \
libgtk2.0-0 libx11-xcb1 libxtst6 libnss3 libasound2 libdbus-glib-1-2 iptables xclip\
dante-server tigervnc-standalone-server tigervnc-common psmisc flwm x11-utils\
busybox libssl-dev iproute2 tinyproxy-bin socat \
fonts-wqy-microhei
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 && \
rm -rf /var/lib/apt/lists/*

RUN groupadd -r socks && useradd -r -g socks socks

ARG EC_URL
COPY ["./build-scripts/install-vpn-gui.sh", "./build-scripts/mk-qemu-wrapper.sh", "/tmp/build-scripts/"]

RUN cd tmp &&\
busybox wget "${EC_URL}" -O EasyConnect.deb &&\
dpkg -i EasyConnect.deb && rm EasyConnect.deb
COPY ./docker-root-preinst /

COPY ./docker-root /
ARG VPN_URL ELECTRON_URL USE_VPN_ELECTRON VPN_DEB_PATH

RUN rm -f /usr/share/sangfor/EasyConnect/resources/conf/easy_connect.json &&\
mv /usr/share/sangfor/EasyConnect/resources/conf/ /usr/share/sangfor/EasyConnect/resources/conf_backup
RUN /tmp/build-scripts/install-vpn-gui.sh

RUN busybox wget https://github.com/pgaskin/easy-novnc/releases/download/v1.1.0/easy-novnc_linux-64bit -O /usr/bin/easy-novnc &&\
chmod +x /usr/bin/easy-novnc
COPY ./docker-root /

COPY --from=fake-hwaddr fake-hwaddr/fake-hwaddr.so /usr/local/lib/fake-hwaddr.so
COPY --from=hagb/docker-easyconnect:build /results/fake-hwaddr/ /results/fake-getlogin/ /results/tinyproxy-ws/ /results/novnc/ /

#ENV TYPE="" PASSWORD="" LOOP=""
#ENV DISPLAY
#ENV USE_NOVNC=""

ENV PING_INTERVAL=1800

VOLUME /root/ /usr/share/sangfor/EasyConnect/resources/logs/

CMD ["start.sh"]
52 changes: 52 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM debian:bookworm-slim AS build

ARG ANDROID_PATCH BUILD_ENV=local MIRROR_URL=http://ftp.cn.debian.org/debian/ EC_HOST

COPY ["./build-scripts/config-apt.sh", "./build-scripts/get-echost-names.sh", "/tmp/build-scripts/"]

RUN . /tmp/build-scripts/config-apt.sh && \
. /tmp/build-scripts/get-echost-names.sh && \
case "$(dpkg --print-architecture)" in \
amd64 | i386 | arm64 ) go=golang-go ;; \
* ) go=gccgo-go ;; \
esac && \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests ca-certificates \
busybox libssl-dev automake $go $ecgccpkg build-essential

RUN mkdir results && cd results && mkdir fake-hwaddr tinyproxy-ws novnc fake-getlogin && mkdir /tmp/src -p

COPY fake-hwaddr /tmp/src/fake-hwaddr/
COPY fake-getlogin /tmp/src/fake-getlogin/

RUN . /tmp/build-scripts/get-echost-names.sh && \
cd /tmp/src/fake-hwaddr && CC=${ec_cc} make clean all && install -D fake-hwaddr.so /results/fake-hwaddr/usr/local/lib/fake-hwaddr.so && \
cd /tmp/src/fake-getlogin && CC=${ec_cc} make clean all && install -D fake-getlogin.so /results/fake-getlogin/usr/local/lib/fake-getlogin.so

# https://github.com/tinyproxy/tinyproxy/pull/211#issue-382736027
ARG TINYPROXY_COMMIT=991e47d8ebd4b12710828b2b486535e4c25ba26c

RUN cd /tmp/src/ && \
busybox 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

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 && \
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 && \
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
Loading