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

Feature/plugins #8

Merged
merged 14 commits into from
Oct 13, 2023
6 changes: 0 additions & 6 deletions after_script.sh

This file was deleted.

6 changes: 0 additions & 6 deletions before_script.sh

This file was deleted.

5 changes: 3 additions & 2 deletions build_exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ GOOS=linux go build -o bin/gtun/gtun-linux_amd64 cmd/gtun/*.go
GOARCH=arm GOOS=linux go build -o bin/gtun/gtun-linux_arm cmd/gtun/*.go
echo "builded gtun...."

cp before_script.sh bin/
cp after_script.sh bin/
cp -r etc/gtun.yaml bin/gtun/
cp -r etc/gtund.yaml bin/gtund/
cp install.sh bin/gtun/
3 changes: 1 addition & 2 deletions build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ cp $WORKSPACE/bin/gtund/gtund .
docker build . -t gtund
echo "builded gtund docker image"


echo "building gtun docker image"
cd $WORKSPACE/docker-build/gtun
cp $WORKSPACE/bin/gtun/gtun-linux_amd64 .
docker build . -t gtun
echo "builded gtun docker image"
echo "builded gtun docker image"
65 changes: 65 additions & 0 deletions docker-build/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: '3'
services:
gtun:
build: ./gtun
container_name: gtun
restart: always
network_mode: host
privileged: true
volumes:
- /opt/apps/logs:/opt/logs
environment:
TIME_ZONE: Asia/Shanghai
settings: |
settings:
CN:
proxy_file: "https://www.ipdeny.com/ipblocks/data/countries/us.zone"
route:
- trace_addr: ${CN_SERVER_IP}:${CN_SERVER_TRACE_PORT}
scheme: "kcp"
addr: ${CN_SERVER_IP}:${CN_SERVER_PORT}
auth_key: ""
proxy:
"tproxy_tcp": |
{
"read_timeout": 30,
"write_timeout": 30,
"listen_addr": ":8524",
"rate_limit": 50,
"region": "CN"
}
"tproxy_udp": |
{
"read_timeout": 30,
"write_timeout": 30,
"session_timeout": 30,
"listen_addr": ":8524",
"rate_limit": 50,
"region": "CN"
}
log:
days: 5
level: Debug
path: gtun.log

http_server:
listen_addr: ":9001"
gtund:
build: ./gtund
container_name: gtund
restart: always
network_mode: host
volumes:
- /opt/apps/logs:/logs
environment:
TIME_ZONE: Asia/Shanghai
settings: |
server:
- listen: ":3002"
authKey: "rewrite with your auth key"
scheme: "kcp"
trace: ":3003"
log:
days: 5
level: "debug"
path: "gtund.log"
2 changes: 1 addition & 1 deletion docker-build/gtun/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ COPY gtun-linux_amd64 /gtun
COPY start.sh /
RUN chmod +x start.sh && chmod +x gtun
RUN mkdir /opt/logs
CMD /start.sh
CMD /start.sh
29 changes: 0 additions & 29 deletions docker-build/gtun/docker-compose.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion docker-build/gtun/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ if [ "$settings" != "" ]; then
echo "$settings" > /gtun.yaml
fi

/gtun -c /gtun.yaml
/gtun -c /gtun.yaml
22 changes: 0 additions & 22 deletions docker-build/gtund/docker-compose.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion docker-build/gtund/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ if [ "$settings" != "" ]; then
echo "$settings" > /gtund.yaml
fi

/gtund -c /gtund.yaml
/gtund -c /gtund.yaml
50 changes: 31 additions & 19 deletions etc/gtun.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
forwards:
- region: US
tcp:
listen: ":2012"
udp:
listen: ":2012"
transport:
- server: "ip:port"
authKey: "rewrite with your auth key"
scheme: kcp
traceAddr: ""
- server: "ip:port"
auth_key: "rewrite with your auth key"
scheme: mux
traceAddr: ""
rateLimit: 1000

settings:
CN:
proxy_file: "https://www.ipdeny.com/ipblocks/data/countries/us.zone"
route:
- trace_addr: ${CN_SERVER_IP}:${CN_SERVER_TRACE_PORT}
scheme: "kcp"
addr: ${CN_SERVER_IP}:${CN_SERVER_PORT}
auth_key: ""
proxy:
"tproxy_tcp": |
{
"read_timeout": 30,
"write_timeout": 30,
"listen_addr": ":8524",
"rate_limit": 50,
"region": "CN"
}
"tproxy_udp": |
{
"read_timeout": 30,
"write_timeout": 30,
"session_timeout": 30,
"listen_addr": ":8524",
"rate_limit": 50,
"region": "CN"
}
log:
days: 5
level: "info"
path: "gtun.log"
level: Debug
path: gtun.log

http_server:
listen_addr: ":9001""
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ go 1.16

require (
github.com/ICKelin/optw v0.0.0-20211219021958-28f4d1f075ef
github.com/agiledragon/gomonkey/v2 v2.10.1
github.com/astaxie/beego v1.12.3
github.com/belogik/goes v0.0.0-20151229125003-e54d722c3aff
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58
github.com/gogo/protobuf v1.3.1
github.com/gogo/protobuf v1.3.2
github.com/smartystreets/goconvey v1.8.1
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8
gopkg.in/yaml.v2 v2.4.0
)
Loading