Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Replace shadowsocks-libev&v2ray to shadowsocks-rust&xray-plugin #13

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
FROM debian:sid
FROM alpine:3.16

ARG V2RAY_VERSION=v1.3.1
ENV XRAY_PLUGIN_VERSION v1.5.5
ENV SHADOWSOCKS_VERSION v1.14.3

COPY conf/ /conf
COPY entrypoint.sh /entrypoint.sh

ARG DEBIAN_FRONTEND=noninteractive
RUN set -ex\
&& apt update -y \
&& apt install -y wget qrencode shadowsocks-libev nginx-light jq \
&& apt clean -y \
&& apk add --no-cache libqrencode wget nginx jq \
&& chmod +x /entrypoint.sh \
&& mkdir -p /etc/shadowsocks-libev /v2raybin /wwwroot \
&& wget -O- "https://github.com/shadowsocks/v2ray-plugin/releases/download/${V2RAY_VERSION}/v2ray-plugin-linux-amd64-${V2RAY_VERSION}.tar.gz" | \
tar zx -C /v2raybin \
&& install /v2raybin/v2ray-plugin_linux_amd64 /usr/bin/v2ray-plugin \
&& rm -rf /v2raybin
&& mkdir -p /etc/shadowsocks-libev /wwwroot \
&& wget -O /root/xray-plugin.tar.gz https://github.com/teddysun/xray-plugin/releases/download/${XRAY_PLUGIN_VERSION}/xray-plugin-linux-amd64-${XRAY_PLUGIN_VERSION}.tar.gz \
&& tar xvzf /root/xray-plugin.tar.gz -C /root \
&& mv /root/xray-plugin_linux_amd64 /usr/local/bin/xray-plugin \
&& rm -f /root/xray-plugin.tar.gz \
&& wget -O /root/shadowsocks-plugin.tar.xz https://github.com/shadowsocks/shadowsocks-rust/releases/download/${SHADOWSOCKS_VERSION}/shadowsocks-${SHADOWSOCKS_VERSION}.x86_64-unknown-linux-musl.tar.xz \
&& tar xvf /root/shadowsocks-plugin.tar.xz -C /root \
&& mv /root/ss* /usr/local/bin/ \
&& rm -f /root/shadowsocks-plugin.tar.xz \
&& apk del wget

CMD /entrypoint.sh
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Personal VPN
## Shadowsocks+V2Ray-plugin
## [shadowsocks-rust](https://github.com/shadowsocks/shadowsocks-rust)+[xray-plugin](https://github.com/teddysun/xray-plugin)

Click the button below to deploy to Heroku

Expand Down Expand Up @@ -50,9 +50,9 @@ Path: "/" + value of V2_Path in app Config Vars

Those without a client can also download from here (Android):

[shadowsocks](https://github.com/shadowsocks/shadowsocks-android/releases/latest/download/shadowsocks--universal-5.1.9.apk)
[shadowsocks](https://github.com/shadowsocks/shadowsocks-android/releases/latest/)

[v2ray-plugin](https://github.com/shadowsocks/v2ray-plugin-android/releases/latest/download/v2ray-arm64-v8a-1.3.1.apk)
[v2ray-plugin](https://github.com/shadowsocks/v2ray-plugin-android/releases/latest/)

windows:

Expand Down
2 changes: 1 addition & 1 deletion conf/nginx_ss.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
cat <<EOF
server {
listen ${PORT};
Expand Down
22 changes: 11 additions & 11 deletions conf/shadowsocks-libev_config.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash
#!/bin/sh
# Fast_open must be false on heroku
cat <<EOF
{
"server":"127.0.0.1",
"server_port":"2333",
"password":${PASSWORD_JSON},
"timeout":300,
"method":"${ENCRYPT}",
"server": "127.0.0.1",
"server_port": 2333,
"password": $(echo -n "$PASSWORD" | jq -Rc),
"timeout": 300,
"method": "${ENCRYPT}",
"mode": "tcp_only",
"fast_open":false,
"reuse_port":true,
"no_delay":true,
"plugin": "v2ray-plugin",
"plugin_opts":"server;path=/${V2_Path}"
"fast_open": false,
"reuse_port": true,
"no_delay": true,
"plugin": "xray-plugin",
"plugin_opts": "server;path=/${V2_Path}"
}
EOF
16 changes: 7 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/bin/bash
#!/bin/sh

if [[ -z "${PASSWORD}" ]]; then
export PASSWORD="5c301bb8-6c77-41a0-a606-4ba11bbab084"
fi
echo ${PASSWORD}

export PASSWORD_JSON="$(echo -n "$PASSWORD" | jq -Rc)"

if [[ -z "${ENCRYPT}" ]]; then
export ENCRYPT="chacha20-ietf-poly1305"
fi
Expand All @@ -30,13 +28,13 @@ case "$AppName" in
;;
esac

bash /conf/shadowsocks-libev_config.json > /etc/shadowsocks-libev/config.json
sh /conf/shadowsocks-libev_config.json > /etc/shadowsocks-libev/config.json
echo /etc/shadowsocks-libev/config.json
cat /etc/shadowsocks-libev/config.json

bash /conf/nginx_ss.conf > /etc/nginx/conf.d/ss.conf
echo /etc/nginx/conf.d/ss.conf
cat /etc/nginx/conf.d/ss.conf
sh /conf/nginx_ss.conf > /etc/nginx/http.d/ss.conf
echo /etc/nginx/http.d/ss.conf
cat /etc/nginx/http.d/ss.conf


if [ "$AppName" = "no" ]; then
Expand All @@ -49,6 +47,6 @@ else
echo -n "${ss}" | qrencode -s 6 -o /wwwroot/${QR_Path}/vpn.png
fi

ss-server -c /etc/shadowsocks-libev/config.json &
rm -rf /etc/nginx/sites-enabled/default
ssserver -c /etc/shadowsocks-libev/config.json &
rm -rf /etc/nginx/http.d/default.conf
nginx -g 'daemon off;'