Skip to content

Commit

Permalink
Merge pull request #3 from YulinChan/gost-plugin
Browse files Browse the repository at this point in the history
setup software in dockerfile
  • Loading branch information
cylind authored Nov 5, 2023
2 parents 09965fb + 94ebc88 commit da16ad4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ ENV WSPATH=/ws-ss-gost
ENV PASSWORD=PHKPixmEq6oAeQX5
ENV ENCRYPT_METHOD=chacha20-ietf-poly1305

RUN chmod a+x /opt/entrypoint.sh
RUN VERSION=$(wget -O- https://api.github.com/repos/shadowsocks/shadowsocks-rust/releases/latest | grep 'tag_name' | cut -d\" -f4) && \
SS_URL="https://github.com/shadowsocks/shadowsocks-rust/releases/download/${VERSION}/shadowsocks-${VERSION}.x86_64-unknown-linux-musl.tar.xz" && \
wget ${SS_URL} && tar xf shadowsocks-*.tar.xz -C /usr/local/bin && rm shadowsocks-*.tar.xz && \
url=$(wget -O- "https://api.github.com/repos/maskedeken/gost-plugin/releases/latest" | grep -Eo 'https.*?gost-plugin-linux-amd64.*?gz') && \
wget "$url" && tar xf gost-plugin-linux-amd64*.tar.gz && mv ./linux-amd64/gost-plugin /usr/local/bin/ws-plugin && rm -rf *linux-amd64* && \
chmod a+x /opt/entrypoint.sh /usr/local/bin/*

EXPOSE 3000

Expand Down
9 changes: 1 addition & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@ server {
}
}
EOF
## setup shadowsock-rust
VERSION=$(wget -O- https://api.github.com/repos/shadowsocks/shadowsocks-rust/releases/latest | grep 'tag_name' | cut -d\" -f4)
SS_URL="https://github.com/shadowsocks/shadowsocks-rust/releases/download/${VERSION}/shadowsocks-${VERSION}.x86_64-unknown-linux-musl.tar.xz"
wget ${SS_URL} && tar xf shadowsocks-*.tar.xz -C /usr/local/bin && rm shadowsocks-*.tar.xz && chmod a+x /usr/local/bin/ss*
## setup websocket-plugin
url=$(wget -O- "https://api.github.com/repos/maskedeken/gost-plugin/releases/latest" | grep -Eo 'https.*?gost-plugin-linux-amd64.*?gz')
wget "$url" && tar xf gost-plugin-linux-amd64*.tar.gz && mv ./linux-amd64/gost-plugin /usr/local/bin/ws-plugin && rm -rf *linux-amd64*
chmod a+x /usr/local/bin/ws-plugin

## start service
ssserver -s "127.0.0.1:9008" -m "${ENCRYPT_METHOD}" -k "${PASSWORD}" --plugin "ws-plugin" --plugin-opts "server;path=${WSPATH};logLevel=0" -d
nginx -g "daemon off;"
Expand Down

0 comments on commit da16ad4

Please sign in to comment.