Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
hiifeng authored Dec 28, 2022
1 parent ec0fae7 commit 27ac4da
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM nginx:latest
MAINTAINER ifeng <https://t.me/HiaiFeng>
EXPOSE 80
USER root

RUN apt-get update && apt-get install -y supervisor wget unzip

#定义 UUID 及 伪装路径,请自行修改.(注意:伪装路径前无需加/符号,程序已自行添加.)
ENV UUID de04add9-5c68-8bab-950c-08cd5320df18
ENV VMESS_WSPATH vmess
ENV VLESS_WSPATH vless

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY nginx.conf /etc/nginx/nginx.conf

RUN mkdir /etc/v2ray /usr/local/v2ray
COPY config.json /etc/v2ray/
COPY entrypoint.sh /usr/local/v2ray/
RUN chmod a+x /usr/local/v2ray/entrypoint.sh

RUN wget -q -O /tmp/v2ray-linux-64.zip https://github.com/v2fly/v2ray-core/releases/download/v4.45.0/v2ray-linux-64.zip && \
unzip -d /usr/local/v2ray /tmp/v2ray-linux-64.zip

ENTRYPOINT [ "/usr/local/v2ray/entrypoint.sh" ]
CMD ["/usr/bin/supervisord"]
53 changes: 53 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"log": {
"access": "/dev/null",
"error": "/dev/null",
"loglevel": "warning"
},
"inbounds": [{
"port": 10000,
"listen": "127.0.0.1",
"protocol": "vmess",
"settings": {
"clients": [{
"id": "UUID",
"alterId": 0
}]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/VMESS_WSPATH"
}
}
},
{
"port": 20000,
"listen": "127.0.0.1",
"protocol": "vless",
"settings": {
"clients": [{
"id": "UUID"
}],
"decryption": "none"
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/VLESS_WSPATH"
}
}
}
],
"outbounds": [{
"protocol": "freedom",
"settings": {}
}],
"dns": {
"server": [
"8.8.8.8",
"8.8.4.4",
"localhost"
]
}
}
11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
# Create By ifeng
# Web Site:https://www.hicairo.com
# Telegram:https://t.me/HiaiFeng

sed -i "s/UUID/$UUID/g" /etc/v2ray/config.json
sed -i "s/VMESS_WSPATH/$VMESS_WSPATH/g" /etc/v2ray/config.json
sed -i "s/VLESS_WSPATH/$VLESS_WSPATH/g" /etc/v2ray/config.json
sed -i "s/VMESS_WSPATH/$VMESS_WSPATH/g" /etc/nginx/nginx.conf
sed -i "s/VLESS_WSPATH/$VLESS_WSPATH/g" /etc/nginx/nginx.conf
exec "$@"
68 changes: 68 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

user nginx;
worker_processes auto;

error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

#include /etc/nginx/conf.d/*.conf;

server {
listen 80 default_server;
listen [::]:80 default_server;

server_name _;
charset utf-8;
root html;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

location /VMESS_WSPATH {
proxy_redirect off;
proxy_pass http://127.0.0.1:10000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /VLESS_WSPATH {
proxy_redirect off;
proxy_pass http://127.0.0.1:20000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
31 changes: 31 additions & 0 deletions supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Create By ifeng
# Web Site:https://www.hicairo.com
# Telegram:https://t.me/HiaiFeng

[supervisord]
nodaemon=true
logfile=/var/log/supervisord.log
pidfile=/run/supervisord.pid

[program:v2ray]
command=/usr/local/v2ray/v2ray -config=/etc/v2ray/config.json
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
autorestart=false
startretries=0

[program:nginx]
command=nginx -g 'daemon off;'
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
autorestart=false
startretries=0

# The below configure can be applied when Docker orchestrator like Docker Swarm or K8S is used.
# By default, supervisor will attempt to restart a failed process.
# Refer to http://supervisord.org/configuration.html for more info.
#[eventlistener:processes]
#command=stop-supervisor.sh
#events=PROCESS_STATE_STOPPED, PROCESS_STATE_EXITED, PROCESS_STATE_FATAL

0 comments on commit 27ac4da

Please sign in to comment.