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

Add DeepL English translation #480

Open
wants to merge 4 commits into
base: master
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ build/
*.key
*.dat
trojan-go

docs/.hugo_build.lock
26 changes: 21 additions & 5 deletions docs/config.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
baseURL = "https://p4gefau1t.github.io/trojan-go"

languageCode = "zh-CN"
languageCode = "en-US"
title = "Trojan-Go Docs"
theme = "hugo-theme-techdoc"

hasCJKLanguage = true
metaDataFormat = "yaml"

defaultContentLanguage = "zh"
defaultContentLanguage = "en"
defaultContentLanguageInSubdir= true
enableMissingTranslationPlaceholders = false


[languages]
[languages.zh]
languageName = '中文'
contentDir = 'content/zh'
weight = 1
[languages.en]
languageName = 'English'
contentDir = 'content/en'
weight = 2

[params]

# Source Code repository section
Expand Down Expand Up @@ -68,14 +79,19 @@ enableMissingTranslationPlaceholders = false
# See https://gohugo.io/content-management/menus/
[menu]
[[menu.main]]
name = "Home"
url = "/"
name = "English (DeepL)"
url = "/en/"
weight = 1

[[menu.main]]
name = "Chinese (original)"
url = "/zh/"
weight = 2

[[menu.main]]
name = "GitHub"
url = "https://github.com/p4gefau1t"
weight = 2
weight = 3

# Markup configure section
# See https://gohugo.io/getting-started/configuration-markup/
Expand Down
24 changes: 24 additions & 0 deletions docs/content/en/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: "Introduction"
draft: false
weight: 10
---

# Trojan-Go

{{% panel status="notice" title="English translation" %}}
Note that the documentation for Trojan-Go was translated from original Chinese using the automatic translation service [DeepL](https://www.deepl.com/translator). Please submit a PR if you find any discrepancy.
{{% /panel %}}


Here is the documentation for Trojan-Go, you can find some tips on how to use it in the left navigation bar, as well as a full description of the configuration file.

Trojan-Go is a complete Trojan proxy implemented in Go, compatible with the Trojan protocol and the original configuration file format. It supports and is compatible with most of the features of the Trojan-GFW version, and extends it with more useful features.

The primary goal of Trojan-Go is to guarantee transmission security and stealth. With this in mind, the performance and ease of use of the transfer is improved as much as possible.

If you encounter configuration and usage problems, find software bugs, or have better ideas, feel free to join Trojan-Go's [Telegram Feedback Group](https://t.me/trojan_go_chat).

----

> Across the Great Wall, we can reach every corner in the world.
7 changes: 7 additions & 0 deletions docs/content/en/advance/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Advanced Configuration"
draft: false
weight: 30
---

This section describes more complex methods of Trojan-Go configuration. Features that are not compatible with the original version of Trojan will be explicitly marked in the subsections.
36 changes: 36 additions & 0 deletions docs/content/en/advance/aead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "Secondary encryption with Shadowsocks AEAD"
draft: false
weight: 8
---

{{% panel status="caution" title="Compatibility" %}}
Note that Trojan does not support this feature
{{% /panel %}}

The Trojan protocol itself is not encrypted and its security relies on the underlying TLS. in general, TLS security is good and there is no need to encrypt Trojan traffic again. However, there are some scenarios where you may not be able to guarantee the security of a TLS tunnel.

- You use a Websocket, relayed through an untrusted CDN (e.g. a domestic CDN)

- Your connection to the server is subject to a man-in-the-middle attack by GFW against TLS

- Your certificate is invalid and you cannot verify its validity

- You use a pluggable transport layer that cannot guarantee cryptographic security

etc.

Trojan-Go supports encryption of Trojan-Go using Shadowsocks AEAD. The essence of this is to add a layer of Shadowsocks AEAD encryption underneath the Trojan protocol. Both the server and client must be enabled and the password and encryption must be the same, otherwise communication will not be possible.

To turn on AEAD encryption, simply add a ```shadowsocks``` option to

```json
...
"shadowsocks": {
"enabled": true,
"method": "AES-128-GCM",
"password": "1234567890"
}
```

If omitted, AES-128-GCM is used by default. for more information, see the section "Complete Configuration Files".
117 changes: 117 additions & 0 deletions docs/content/en/advance/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: "Managing users dynamically using the API"
draft: false
weight: 10
---

{{% panel status="caution" title="Compatibility" %}}
Note that Trojan does not support this feature
{{% /panel %}}

Trojan-Go provides a set of APIs using gRPC, which supports the following features.

- user information addition, deletion, and checking

- traffic statistics

- speed statistics

- IP connection statistics

Trojan-Go itself has integrated API control, i.e. you can use one Trojan-Go instance to control another Trojan-Go server.

You need to add API settings to the configuration of the server you need to be controlled, e.g.

```json
{
...
"api": {
"enabled": true,
"api_addr": "127.0.0.1",
"api_port": 10000,
}
}
```

Then start the Trojan-Go server

```shell
. /trojan-go -config . /server.json
```

You can then use another Trojan-Go to connect to that server for administration, with the basic command format

```shell
. /trojan-go -api-addr SERVER_API_ADDRESS -api COMMAND
```

where ```SERVER_API_ADDRESS``` is the API address and port, e.g. 127.0.0.1:10000

```COMMAND``` is the API command, the legal commands are

- list List all users

- get to get information about a user

- set set the information of a user (add/remove/modify)

Here are some examples

1. list all user information

```shell
. /trojan-go -api-addr 127.0.0.1:10000 -api list
```

All user information will be exported as json, the information includes the number of online IPs, live speed, total upload and download traffic, etc. Here is an example of the returned results

```json
[{"user":{"hash":"d63dc919e201d7bc4c825630d2cf25fdc93d4b2f0d46706d29038d01"},"status":{"traffic_total":{"upload_traffic":36393,"download_traffic":186478},"speed_current":{"upload_speed":25210,"download_speed":72384},"speed_limit":{"upload_speed":5242880,"download_speed":5242880},"ip_limit":50}}]
```

All traffic units are bytes.

2. Get a user's information

You can use -target-password to specify the password, or -target-hash to specify the SHA224 hash of the target user's password. The format is the same as the list command

```shell
. /trojan-go -api-addr 127.0.0.1:10000 -api get -target-password password
```

or

```shell
. /trojan-go -api-addr 127.0.0.1:10000 -api get -target-hash d63dc919e201d7bc4c825630d2cf25fdc93d4b2f0d46706d29038d01
```

The above two commands are equivalent. The following example uses the plaintext password in a uniform way, and the hash specifies a certain user in a similar way.

The user information will be exported in the form of json in a format similar to the list command. Here is an example of the returned result

```json
{"user":{"hash":"d63dc919e201d7bc4c825630d2cf25fdc93d4b2f0d46706d29038d01"},"status":{"traffic_total":{"upload_traffic":36393,"download_traffic":186478},"speed_current":{"upload_speed":25210,"download_speed":72384},"speed_limit":{"upload_speed":5242880,"download_speed":5242880},"ip_limit":50}}
```

3. add a user information

```shell
. /trojan-go -api-addr 127.0.0.1:10000 -api set -add-profile -target-password password
```

4. delete a user information

```shell
. /trojan-go -api-addr 127.0.0.1:10000 -api set -delete-profile -target-password password
```

5. modify a user information

```shell
. /trojan-go -api-addr 127.0.0.1:10000 -api set -modify-profile -target-password password \
-ip-limit 3 \
-upload-speed-limit 5242880 \
-download-speed-limit 5242880
```

This command limits the upload and download speed to 5MiB/s for users with password, and the number of connected IPs is limited to 3. Note that the unit of 5242880 here is bytes. If you fill in 0 or a negative number, it means no limit is applied.
Loading