Skip to content
This repository has been archived by the owner on Mar 26, 2023. It is now read-only.

(Deprecated) Setup

lu4p edited this page Nov 21, 2019 · 1 revision

Deprecated

On Linux.

You need to have go, git and tor installed e.g.

apt

sudo apt install git golang-go tor

pacman

sudo pacman -S tor go git

Clone this repo via git

git clone https://github.com/lu4p/ToRat

Then run the Setup Script

cd ./ToRat
./setup.sh

This will get and setup the following packages for you.

https://github.com/lu4p/ToRat_client

https://github.com/lu4p/ToRat_server

https://github.com/lu4p/genCert

Furthermore it will install tor and setup a hidden service and generate a TLS Certificate

Building

Server

On Linux.

To build the Server run

cd ./ToRat/ToRat_server
go build

Client with embedded Tor

Client for Windows

On Windows.

Prerequesites

You can build the client on Windows by executing the following, it may also be useful to remove all log calls.

Build tor statically

To embed tor in the binary it is required to build tor statically this will take a while but is only required once.

set PATH=C:\msys64\usr\bin;%PATH%
set MSYSTEM=MINGW64
bash -lc "pacman -Sy --noconfirm --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain git mingw-w64-i686-cmake mingw-w64-x86_64-cmake"
cd %HOMEPATH%\go\src\github.com\cretz\
git clone github.com/cretz/tor-static --recursive
bash -lc "export PATH=/mingw64/bin:$PATH && cd c/Users/Your_USERNAME_HERE/go/src/github.com/cretz/tor-static && /c/go/bin/go run build.go build-all"

IMPORTANT: change the username to your current username in the last command

Test the static tor Build

set PATH=C:\msys64\mingw64\bin;%PATH%
set MSYSTEM=MINGW64
go get -u github.com/cretz/bine/tor
cd %HOMEPATH%\go\src\github.com\cretz\tor-static
go test -v build_test.go -tor.verbose

Build client

set PATH=C:\msys64\usr\bin;%PATH%
set MSYSTEM=MINGW64
cd  %HOMEPATH%\go\src\github.com\lu4p\ToRat_client
go build --ldflags "-s -w -H windowsgui"

For testing the -H windowsgui flag should be omitted.


Client for Linux

On Linux.

sudo apt install build-essential libtool autopoint -y
cd ~/go/src/github.com/cretz/
git clone github.com/cretz/tor-static --recursive
cd ~/go/src/github.com/cretz/tor-static
go run build.go build-all
cd ./ToRat/ToRat_client
go build -ldflags "-s -w"

Client for Mac OS

On Mac OS.

Prerequisites

  • Normal build tools (e.g. Xcode command line tools)
  • Libtool (e.g. brew install libtool)
  • Autoconf and Automake (e.g. brew install automake)
  • autopoint (can be found in gettext, e.g. brew install gettext)
    • Note, by default this is assumed to be at /usr/local/opt/gettext/bin. Use -autopoint-path to change it.

Build

go get -u github.com/cretz/tor-static
cd ~/go/src/github.com/cretz/tor-static
go run build.go build-all
cd ~/go/src/github.com/lu4p/ToRat_client
go build -ldflags "-s -w"

Client without Tor

On Linux.

Client for Linux

cd ./ToRat/ToRat_client
env GOOS=linux go build -ldflags "-s -w" -tags "notor"

Client for Windows

cd ./ToRat/ToRat_client
env GOOS=windows go build -ldflags "-s -w" -tags "notor"

Client for MacOS

cd ./ToRat/ToRat_client
env GOOS=darwin go build -ldflags "-s -w" -tags "notor"
Clone this wiki locally