Skip to content
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

Update + fake site #11

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test
{
log ./caddy.log
root /srv/html/
proxy /ray :6555 {
websocket
header_upstream -Origin
Expand Down
33 changes: 29 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
FROM abiosoft/caddy:builder as builder

ARG version="0.11.1"
ARG version="1.0.3"
ARG plugins="git,cors,realip,expires,cache"


Expand All @@ -13,7 +13,7 @@ RUN VERSION=${version} PLUGINS=${plugins} ENABLE_TELEMETRY=false /bin/sh /usr/bi
#
# Final stage
#
FROM alpine:3.8
FROM alpine:3.10
# process wrapper
LABEL maintainer "sebs sebsclub@outlook.com"

Expand Down Expand Up @@ -48,6 +48,29 @@ RUN apk upgrade --update \
&& echo ${TZ} > /etc/timezone \
&& rm -rf /tmp/v2ray /var/cache/apk/*

# trojan
ARG VERSION='v1.14.1'
ENV TROJAN_CONFIG_DIR /etc/trojan/
RUN apk add --no-cache --virtual .build-deps \
build-base \
cmake \
boost-dev \
openssl-dev \
mariadb-connector-c-dev \
git \
&& mkdir -p \
${TROJAN_CONFIG_DIR} \
&& git clone --branch=${VERSION} https://github.com/trojan-gfw/trojan.git \
&& (cd trojan && cmake . && make -j $(nproc) && strip -s trojan \
&& mv trojan /usr/local/bin) \
&& rm -rf trojan \
&& apk del .build-deps \
&& apk add --no-cache --virtual .trojan-rundeps \
libstdc++ \
boost-system \
boost-program_options \
mariadb-connector-c

# ADD entrypoint.sh /entrypoint.sh
WORKDIR /srv
# node
Expand All @@ -58,7 +81,7 @@ COPY package.json /srv/package.json
RUN npm install
COPY v2ray.js /srv/v2ray.js

ARG version="0.11.1"
ARG version="1.0.3"
LABEL caddy_version="$version"

# Let's Encrypt Agreement
Expand All @@ -82,10 +105,12 @@ VOLUME /root/.caddy /srv

COPY Caddyfile /etc/Caddyfile
COPY index.html /srv/index.html
COPY html /srv/html

# COPY package.json /etc/package.json
# install process wrapper
COPY --from=builder /go/bin/parent /bin/parent
ADD caddy.sh /caddy.sh
EXPOSE 443 80
ENTRYPOINT ["/caddy.sh"]
# CMD ["--conf", "/etc/Caddyfile", "--log", "stdout", "--agree=$ACME_AGREE"]
# CMD ["--conf", "/etc/Caddyfile", "--log", "stdout", "--agree=$ACME_AGREE"]
41 changes: 30 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,59 @@
# 一键 V2ray websocket + TLS

# 一键脚本 V2ray-ws-tls + Trojan

一键就完事了,扫描二维码 或者 复制 vmess链接 无需关心复杂的V2ray 配置,websocket + tls 更安全,伪装更好。

* 自动生成 UUID (调用系统UUID库)
* 默认使用 caddy 自动获取证书
* 自动生成 安卓 v2rayNG vmess链接
* 自动生成 iOS shadowrocket vmess链接
* 自动生成 iOS 二维码
* 自动生成 Android v2rayNG 二维码
* 集成 Trojan 自动生成密码(等于UUID)

## 使用方法


* 提前安装好docker
```
curl -fsSL https://get.docker.com -o get-docker.sh && \
bash get-docker.sh
```

* 解析好域名 确认 你的域名正确解析到了你安装的这台服务器
* 会占用 443 和 80 端口请提前确认没有跑其他的业务 ( lsof -i:80 和 lsof -i:443 能查看)
* 请将下面命令中的 YOURDOMAIN.COM(域名)替换成自己的域名(此IP解析的域名)!!!
* BUILD 容器, v2trj 可以换成自己的镜像名称,或者直接从docker hub上下载相关镜像。

```
sudo docker run -d --rm --name v2ray -p 443:443 -p 80:80 -v $HOME/.caddy:/root/.caddy pengchujin/v2ray_ws:0.08 YOURDOMAIN.COM V2RAY_WS && sleep 3s && sudo docker logs v2ray
sudo docker build -t v2trj .
```
* 如果你想指定固定 uuid 的话, 0890b53a-e3d4-4726-bd2b-52574e8588c4 这个 uuid 改为你自己的,https://www.uuidgenerator.net/ 这个网站可以生成随机 uuid。

* 请将下面命令 v2trj sebs.club 和 testV2trj 分别换成自己的镜像名称,域名和节点名称!!!

```
sudo docker run -d --rm --name v2ray -p 443:443 -p 80:80 -v $HOME/.caddy:/root/.caddy pengchujin/v2ray_ws:0.08 YOURDOMAIN.COM V2RAY_WS 0890b53a-e3d4-4726-bd2b-52574e8588c4 && sleep 3s && sudo docker logs v2ray
sudo docker run -p 443:443 -p 80:80 -v $HOME/.caddy:/root/.caddy v2trj sebs.club testV2trj
```

* 命令执行完会显示链接信息,如果想查看链接信息,执行下面命令即可
* Trojan 客户端配置文件需要修改 "remote_addr" 字段为自己的域名,密码为之前自动生成的UUID(服务端配置文件在/etc/trojan/config.json)

* 跑完请复制保存好自己的 节点信息!(真心忘了或者丢了 sudo docker ps -a 查看 container id 然后 sudo docker stop containerID 重新跑就完事 )

## 查看节点信息

* 查看容器ID
* 进入容器,请将 container-id替换成自己的 容器ID

```
sudo docker logs v2ray
sudo docker exec -it container-id /bin/bash
```
* 想停止这个 docker 和服务
* 查看节点信息

```
sudo docker stop v2ray
node v2ray.js
```

* 或者查看log信息
```
sudo docker logs -f container-id --tail 80
```
有问题欢迎提issue, 感谢大家。参考了 caddy docker 和 v2ray 的 dockerfile 感谢!

感谢pengchujin 感谢fake website的作者
63 changes: 62 additions & 1 deletion caddy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ cat > /etc/Caddyfile <<'EOF'
domain
{
log ./caddy.log
root /srv/html
proxy /one :2333 {
websocket
header_upstream -Origin
Expand Down Expand Up @@ -57,6 +58,58 @@ EOF

sed -i "s/uuid/${uuid}/" /etc/v2ray/config.json

# trojan
cat > /etc/trojan/config.json <<'EOF'
{
"run_type": "server",
"local_addr": "0.0.0.0",
"local_port": 443,
"remote_addr": "127.0.0.1",
"remote_port": 80,
"password": [
"uuid"
],
"log_level": 1,
"ssl": {
"cert": "/root/.caddy/acme/acme-v02.api.letsencrypt.org/sites/domain/domain.crt",
"key": "/root/.caddy/acme/acme-v02.api.letsencrypt.org/sites/domain/domain.key",
"key_password": "",
"cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384",
"cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
"prefer_server_cipher": true,
"alpn": [
"http/1.1"
],
"reuse_session": true,
"session_ticket": false,
"session_timeout": 600,
"plain_http_response": "",
"curves": "",
"dhparam": ""
},
"tcp": {
"prefer_ipv4": false,
"no_delay": true,
"keep_alive": true,
"reuse_port": false,
"fast_open": false,
"fast_open_qlen": 20
},
"mysql": {
"enabled": false,
"server_addr": "127.0.0.1",
"server_port": 3306,
"database": "trojan",
"username": "trojan",
"password": ""
}
}
EOF

sed -i "s/domain/${domain}/g" /etc/trojan/config.json
sed -i "s/uuid/${uuid}/" /etc/trojan/config.json

# js
cat > /srv/sebs.js <<'EOF'
{
"add":"domain",
Expand All @@ -82,10 +135,18 @@ else
fi
pwd
cp /etc/Caddyfile .
caddy --log stdout --agree=false &
sleep 30
killall caddy
sed -i "s/${domain}/${domain}:80/" ./Caddyfile
nohup /bin/parent caddy --log stdout --agree=false &
echo "配置 JSON 详情"
echo " "
cat /etc/v2ray/config.json
echo " "
cat /etc/trojan/config.json
echo " "
node v2ray.js
/usr/bin/v2ray -config /etc/v2ray/config.json
echo "Trojan password: ${uuid}"
/usr/local/bin/trojan /etc/trojan/config.json &
/usr/bin/v2ray -config /etc/v2ray/config.json
Binary file added html/css/images/Thumbs.db
Binary file not shown.
Binary file added html/css/images/bodyBg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/bodyBg2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/bodyBg3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/fastforward.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/mute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/playing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/repeat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/rewind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/shuffle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/css/images/volume.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions html/css/stylesheets/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added html/img/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Alpha波右脑记忆力增强训练</title>
<link rel="stylesheet" href="css/stylesheets/style.css">
<script src="js/jquery-1.7.2.min.js"></script>
</head>
<body class="keBody">
<div class="kePublic">
<!--效果html开始-->
<div id="background"></div>
<div id="player">
<div class="cover"></div>
<div class="ctrl">
<div class="tag">
<strong>Title</strong>
<span class="artist">Artist</span>
<span class="album">Album</span>
</div>
<div class="control">
<div class="left">
<div class="rewind icon"></div>
<div class="playback icon"></div>
<div class="fastforward icon"></div>
</div>
<div class="volume right">
<div class="mute icon left"></div>
<div class="slider left">
<div class="pace"></div>
</div>
</div>
</div>
<div class="progress">
<div class="slider">
<div class="loaded"></div>
<div class="pace"></div>
</div>
<div class="timer left">0:00</div>
<div class="right">
<div class="repeat icon"></div>
<div class="shuffle icon"></div>
</div>
</div>
</div>
</div>
<ul id="playlist"></ul>
<script src="js/jquery-ui-1.8.17.custom.min.js"></script>
<script src="js/script.js"></script>
<!--效果html结束-->
</div>
</body>
</html>
4 changes: 4 additions & 0 deletions html/js/jquery-1.7.2.min.js

Large diffs are not rendered by default.

Loading