Update trojan-go

This commit is contained in:
Teddysun 2023-11-15 20:52:50 +09:00
parent 9d94a26b12
commit 49ad970132
No known key found for this signature in database
GPG Key ID: 09BD4C080AD6C46D
3 changed files with 124 additions and 114 deletions

View File

@ -1,30 +1,31 @@
# Dockerfile for trojan-go based alpine
# Copyright (C) 2019 - 2021 Teddysun <i@teddysun.com>
# Reference URL:
# https://github.com/p4gefau1t/trojan-go
# https://github.com/v2fly/v2ray-core
# https://github.com/v2fly/geoip
# https://github.com/v2fly/domain-list-community
FROM --platform=${TARGETPLATFORM} alpine:latest
LABEL maintainer="Teddysun <i@teddysun.com>"
ARG TARGETPLATFORM
COPY trojan-go.sh /root/trojan-go.sh
COPY config.json /etc/trojan-go/config.json
RUN set -ex \
&& apk add --no-cache tzdata ca-certificates \
&& chmod +x /root/trojan-go.sh \
&& /root/trojan-go.sh "${TARGETPLATFORM}" \
&& rm -fv /root/trojan-go.sh \
&& mkdir -p /usr/share/trojan-go \
&& wget -O /usr/share/trojan-go/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat \
&& wget -O /usr/share/trojan-go/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat \
&& wget -O /usr/share/trojan-go/geoip-only-cn-private.dat https://github.com/v2fly/geoip/releases/latest/download/geoip-only-cn-private.dat \
&& ln -fs /usr/share/trojan-go/geoip.dat /usr/bin/ \
&& ln -fs /usr/share/trojan-go/geoip-only-cn-private.dat /usr/bin/ \
&& ln -fs /usr/share/trojan-go/geosite.dat /usr/bin/
VOLUME /etc/trojan-go
ENV TZ=Asia/Shanghai
CMD [ "/usr/bin/trojan-go", "-config", "/etc/trojan-go/config.json" ]
# Dockerfile for trojan-go based alpine
# Copyright (C) 2019 - 2023 Teddysun <i@teddysun.com>
# Reference URL:
# https://github.com/p4gefau1t/trojan-go
# https://github.com/v2fly/v2ray-core
# https://github.com/v2fly/geoip
# https://github.com/v2fly/domain-list-community
# https://github.com/Potterli20/trojan-go-fork
FROM --platform=${TARGETPLATFORM} alpine:latest
LABEL maintainer="Teddysun <i@teddysun.com>"
ARG TARGETPLATFORM
COPY trojan-go.sh /root/trojan-go.sh
COPY config.json /etc/trojan-go/config.json
RUN set -ex \
&& apk add --no-cache tzdata ca-certificates \
&& chmod +x /root/trojan-go.sh \
&& /root/trojan-go.sh "${TARGETPLATFORM}" \
&& rm -fv /root/trojan-go.sh \
&& mkdir -p /usr/share/trojan-go \
&& wget -O /usr/share/trojan-go/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat \
&& wget -O /usr/share/trojan-go/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat \
&& wget -O /usr/share/trojan-go/geoip-only-cn-private.dat https://github.com/v2fly/geoip/releases/latest/download/geoip-only-cn-private.dat \
&& ln -fs /usr/share/trojan-go/geoip.dat /usr/bin/ \
&& ln -fs /usr/share/trojan-go/geoip-only-cn-private.dat /usr/bin/ \
&& ln -fs /usr/share/trojan-go/geosite.dat /usr/bin/
VOLUME /etc/trojan-go
ENV TZ=Asia/Shanghai
CMD [ "/usr/bin/trojan-go", "-config", "/etc/trojan-go/config.json" ]

View File

@ -1,65 +1,72 @@
## Trojan-Go Docker Image by Teddysun
[Trojan-Go][1] is An unidentifiable mechanism that helps you bypass [GFW](https://en.wikipedia.org/wiki/Great_Firewall).
Trojan-Go features multiple protocols over `TLS` to avoid both active/passive detections and ISP `QoS` limitations.
Docker images are built for quick deployment in various computing cloud providers.
For more information on docker and containerization technologies, refer to [official document][2].
## Prepare the host
If you need to install docker by yourself, follow the [official installation guide][3].
## Pull the image
```bash
$ docker pull teddysun/trojan-go
```
This pulls the latest release of trojan-go.
It can be found at [Docker Hub][4].
## Start a container
You **must create a configuration file** `/etc/trojan-go/config.json` in host at first:
```
$ mkdir -p /etc/trojan-go
```
A sample in JSON like below:
```
{
"run_type": "server",
"local_addr": "0.0.0.0",
"local_port": 443,
"remote_addr": "127.0.0.1",
"remote_port": 80,
"password": [
"your_awesome_password"
],
"ssl": {
"cert": "server.crt",
"key": "server.key",
"sni": "your-domain-name.com",
"fallback_port": 1234
}
}
```
An online documentation can be found [here](https://p4gefau1t.github.io/trojan-go/)
There is an example to start a container that use host network, run as a trojan-go server like below:
```bash
$ docker run -d --network host --name trojan-go --restart=always -v /etc/trojan-go:/etc/trojan-go teddysun/trojan-go
```
[1]: https://github.com/p4gefau1t/trojan-go
[2]: https://docs.docker.com/
[3]: https://docs.docker.com/install/
## Trojan-Go Docker Image by Teddysun
[Trojan-Go][1] is An unidentifiable mechanism that helps you bypass [GFW](https://en.wikipedia.org/wiki/Great_Firewall).
Trojan-Go features multiple protocols over `TLS` to avoid both active/passive detections and ISP `QoS` limitations.
Docker images are built for quick deployment in various computing cloud providers.
For more information on docker and containerization technologies, refer to [official document][2].
## Prepare the host
If you need to install docker by yourself, follow the [official installation guide][3].
## Pull the image
```bash
$ docker pull teddysun/trojan-go
```
This pulls the latest release of trojan-go.
It can be found at [Docker Hub][4].
## Start a container
You **must create a configuration file** `/etc/trojan-go/config.json` in host at first:
```
$ mkdir -p /etc/trojan-go
```
A sample in JSON like below:
```
{
"run_type": "server",
"local_addr": "0.0.0.0",
"local_port": 443,
"remote_addr": "127.0.0.1",
"remote_port": 80,
"password": [
"your_password"
],
"ssl": {
"cert": "your_cert.crt",
"key": "your_key.key",
"sni": "your-domain-name.com"
},
"router": {
"enabled": true,
"block": [
"geoip:private"
],
"geoip": "/usr/share/trojan-go/geoip.dat",
"geosite": "/usr/share/trojan-go/geosite.dat"
}
}
```
An online documentation can be found [here](https://p4gefau1t.github.io/trojan-go/)
There is an example to start a container that use host network, run as a trojan-go server like below:
```bash
$ docker run -d --network host --name trojan-go --restart=always -v /etc/trojan-go:/etc/trojan-go teddysun/trojan-go
```
[1]: https://github.com/p4gefau1t/trojan-go
[2]: https://docs.docker.com/
[3]: https://docs.docker.com/install/
[4]: https://hub.docker.com/r/teddysun/trojan-go/

View File

@ -1,21 +1,23 @@
{
"run_type": "server",
"local_addr": "0.0.0.0",
"local_port": 443,
"remote_addr": "127.0.0.1",
"remote_port": 80,
"password": [
"your_password"
],
"ssl": {
"cert": "your_cert.crt",
"key": "your_key.key",
"sni": "your-domain-name.com"
},
"router":{
"enabled": true,
"block": [
"geoip:private"
]
}
{
"run_type": "server",
"local_addr": "0.0.0.0",
"local_port": 443,
"remote_addr": "127.0.0.1",
"remote_port": 80,
"password": [
"your_password"
],
"ssl": {
"cert": "your_cert.crt",
"key": "your_key.key",
"sni": "your-domain-name.com"
},
"router": {
"enabled": true,
"block": [
"geoip:private"
],
"geoip": "/usr/share/trojan-go/geoip.dat",
"geosite": "/usr/share/trojan-go/geosite.dat"
}
}