From e59bb13291caf5dbf70ae1640a7a79150d01b417 Mon Sep 17 00:00:00 2001 From: phlinhng Date: Thu, 14 May 2020 01:57:39 +0800 Subject: [PATCH 1/7] force http -> https --- trojan_mult.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/trojan_mult.sh b/trojan_mult.sh index 4e06920..2672d45 100644 --- a/trojan_mult.sh +++ b/trojan_mult.sh @@ -66,11 +66,17 @@ http { client_max_body_size 20m; #gzip on; server { - listen 80; + listen 127.0.0.1:80; server_name $your_domain; root /usr/share/nginx/html; index index.php index.html index.htm; } + server { + listen 0.0.0.0:80; + listen [::]:80; + server_name _; + return 301 https://$host$request_uri; + } } EOF #设置伪装站 From 027031022c8d98ee5818f6312662181dd1140bf9 Mon Sep 17 00:00:00 2001 From: phlinhng Date: Thu, 14 May 2020 05:06:59 +0800 Subject: [PATCH 2/7] Update trojan_mult.sh --- trojan_mult.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trojan_mult.sh b/trojan_mult.sh index 2672d45..87e1a2f 100644 --- a/trojan_mult.sh +++ b/trojan_mult.sh @@ -75,7 +75,7 @@ http { listen 0.0.0.0:80; listen [::]:80; server_name _; - return 301 https://$host$request_uri; + return 301 https://$your_domain\$request_uri; } } EOF From 1f84dba8fe88b3e927e8f95d40b483ae2587e60f Mon Sep 17 00:00:00 2001 From: phlinhng Date: Sun, 17 May 2020 03:23:52 +0800 Subject: [PATCH 3/7] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 927a701..c64a5eb 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ -troooojan +本页面为 atrandys 的 trojan 一键脚本之 fork 备份。顺便修复了 atrandys 原版伪装站没有SSL跳转(即访问伪装站不显示小锁)的问题。 +## 用法 +```sh +bash <(curl -sL https://raw.githubusercontent.com/phlinhng/trojan/master/trojan_mult.sh) +``` From 5e032d81aefc176cc079b236d629766e5a0a8b12 Mon Sep 17 00:00:00 2001 From: phlinhng Date: Sun, 17 May 2020 03:24:22 +0800 Subject: [PATCH 4/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c64a5eb..7bcbe06 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -本页面为 atrandys 的 trojan 一键脚本之 fork 备份。顺便修复了 atrandys 原版伪装站没有SSL跳转(即访问伪装站不显示小锁)的问题。 +本页面为 atrandys 的 trojan 一键脚本之 fork 备份。顺便修复了 atrandys 原版脚本中伪装站没有SSL跳转(即访问伪装站不显示小锁)的问题。 ## 用法 ```sh bash <(curl -sL https://raw.githubusercontent.com/phlinhng/trojan/master/trojan_mult.sh) From e5dd636b7bbb3e4db35f07d3f3cfb3c7d15c2379 Mon Sep 17 00:00:00 2001 From: phlinhng Date: Tue, 19 May 2020 13:49:19 +0800 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7bcbe06..829dd85 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -本页面为 atrandys 的 trojan 一键脚本之 fork 备份。顺便修复了 atrandys 原版脚本中伪装站没有SSL跳转(即访问伪装站不显示小锁)的问题。 +本页面为 atrandys 的 trojan 一键脚本之 fork 备份。顺便修复了 atrandys 原版脚本中伪装站没有 SSL 跳转(即访问伪装站不显示小锁)的问题。 ## 用法 ```sh bash <(curl -sL https://raw.githubusercontent.com/phlinhng/trojan/master/trojan_mult.sh) From cbdf937072bc5e79cea4dfa3ca9d8cfaa639d41e Mon Sep 17 00:00:00 2001 From: phlinhng Date: Tue, 14 Jul 2020 02:30:54 +0800 Subject: [PATCH 6/7] universal https redirect --- trojan_mult.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trojan_mult.sh b/trojan_mult.sh index 87e1a2f..f5607e9 100644 --- a/trojan_mult.sh +++ b/trojan_mult.sh @@ -75,7 +75,7 @@ http { listen 0.0.0.0:80; listen [::]:80; server_name _; - return 301 https://$your_domain\$request_uri; + return 301 https://\$host\$request_uri; } } EOF From e57b14203cf0231a7ed92e12c8906f4f57058b85 Mon Sep 17 00:00:00 2001 From: phlinhng Date: Tue, 21 Jul 2020 04:20:33 +0800 Subject: [PATCH 7/7] use ecc certificates --- trojan_mult.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trojan_mult.sh b/trojan_mult.sh index f5607e9..903fafc 100644 --- a/trojan_mult.sh +++ b/trojan_mult.sh @@ -91,8 +91,8 @@ EOF fi mkdir /usr/src/trojan-cert /usr/src/trojan-temp curl https://get.acme.sh | sh - ~/.acme.sh/acme.sh --issue -d $your_domain --standalone - if test -s /root/.acme.sh/$your_domain/fullchain.cer; then + ~/.acme.sh/acme.sh --issue -d $your_domain --standalone --keylength ec-256 + if test -s /root/.acme.sh/${your_domain}_ecc/fullchain.cer; then systemctl start nginx cd /usr/src #wget https://github.com/trojan-gfw/trojan/releases/download/v1.13.0/trojan-1.13.0-linux-amd64.tar.xz @@ -212,7 +212,7 @@ EOF chmod +x ${systempwd}trojan.service systemctl enable trojan.service cd /root - ~/.acme.sh/acme.sh --installcert -d $your_domain \ + ~/.acme.sh/acme.sh --installcert --ecc -d $your_domain \ --key-file /usr/src/trojan-cert/private.key \ --fullchain-file /usr/src/trojan-cert/fullchain.cer \ --reloadcmd "systemctl restart trojan" @@ -364,8 +364,8 @@ read your_domain real_addr=`ping ${your_domain} -c 1 | sed '1{s/[^(]*(//;s/).*//;q}'` local_addr=`curl ipv4.icanhazip.com` if [ $real_addr == $local_addr ] ; then - ~/.acme.sh/acme.sh --issue -d $your_domain --standalone - ~/.acme.sh/acme.sh --installcert -d $your_domain \ + ~/.acme.sh/acme.sh --issue -d $your_domain --standalone --keylength ec-256 + ~/.acme.sh/acme.sh --installcert --ecc -d $your_domain \ --key-file /usr/src/trojan-cert/private.key \ --fullchain-file /usr/src/trojan-cert/fullchain.cer \ --reloadcmd "systemctl restart trojan"