├── README.md ├── trojan-go-quickstart.sh └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # trojan-go-quickstart 2 | 3 | A simple installation script for trojan-go server. 4 | 5 | This script will help you install the trojan-go binary to `/usr/bin`, a template for server configuration to `/etc/trojan-go`, install the geoip list to `/usr/share/trojan-go`, and (if applicable) a systemd service to `/etc/systemd/system`. It only works on `linux-amd64` machines. 6 | 7 | ## Usage 8 | 9 | - via `curl` 10 | ``` 11 | sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/DongfeiSay/trojan-go-quickstart/master/trojan-go-quickstart.sh)" 12 | ``` 13 | - via `wget` 14 | ``` 15 | sudo bash -c "$(wget -O- https://raw.githubusercontent.com/DongfeiSay/trojan-go-quickstart/master/trojan-go-quickstart.sh)" 16 | ``` 17 | -------------------------------------------------------------------------------- /trojan-go-quickstart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _INSTALL(){ 4 | if [ -f /etc/centos-release ]; then 5 | yum install -y wget curl zip 6 | else 7 | apt install -y wget curl zip 8 | fi 9 | mkdir /etc/trojan-go 10 | mkdir /usr/share/trojan-go 11 | wget -N --no-check-certificate https://github.com/p4gefau1t/trojan-go/releases/download/$(curl -fsSL https://api.github.com/repos/p4gefau1t/trojan-go/releases | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')/trojan-go-linux-amd64.zip && unzip -d /usr/share/trojan-go/ ./trojan-go-linux-amd64.zip && mv /usr/share/trojan-go/trojan-go /usr/bin/ && chmod +x /usr/bin/trojan-go && rm -rf ./trojan-go-linux-amd64.zip 12 | cp /usr/share/trojan-go/example/server.json /etc/trojan-go/config.json 13 | cp /usr/share/trojan-go/example/trojan-go.service /etc/systemd/system/trojan-go.service 14 | systemctl daemon-reload 15 | systemctl enable trojan-go 16 | echo Done! 17 | } 18 | 19 | _INSTALL 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 GreaterFire 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------