Giter Site home page Giter Site logo

torelay's Introduction

TORelay.com

http://torelay.com

A simple TOR relay app.

Image of Torelay

TORelay is written using the Lumen Web Framework.

Minimum requirement

The Lumen framework has a few system requirements:

  • Linux server (recommended)
  • PHP >= 5.4
  • Mcrypt PHP Extension
  • OpenSSL PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension

Installing nginx websever on ubuntu based system

sudo apt get update
sudo apt get upgrade

# install nginx and php5
sudo apt-get install nginx php5-fpm php5-cli php5-mcrypt php5-curl curl git

# install composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

# clone the clone codebase
cd ~
mkdir www
cd www
git clone https://github.com/yadakhov/torelay
cd torelay
composer install
# storage folder needs to be writable by the web server
sudo chmod o+w -R storage
# configurations
cp .env.example .env
# change configurations to match your server
nano .env

# nginx virtual host
cd /etc/nginx/sites-available/
sudo touch torelay
sudo nano torelay

# Copy and paste nginx configurations. Change USERNAME to your account username. 
server {
    listen 80;
    server_name torelay.app;
    root "/home/USERNAME/www/torelay/public";

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log /var/log/nginx/torelay.app-access.log;
    error_log  /var/log/nginx/torelay.app-error.log error;

    sendfile off;

    client_max_body_size 100m;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

    location ~ /\.ht {
        deny all;
    }
}

# save and exit

# symlink conf to sites-enabled folder
sudo ln -s /etc/nginx/sites-available/torelay  /etc/nginx/sites-enabled/torelay

# restart nginx server and php5-fpm
sudo service nginx restart
# You should see OK for the last command or you screwed up
# To view nginx log do the following
tail -f /var/log/nginx/error.log

sudo service php5-fpm restart

For local http://torelay.app url to work

sudo nano /etc/hosts
# add this line
127.0.0.1       torelay.app

Install TOR on your machine

sudo apt-get install tor
# TOR configurations
sudo nano /etc/tor/torrc
# Make sure you have this line
RunAsDaemon 1
ControlPort 9051
CookieAuthentication 1
# restart tor service
sudo service tor restart

Ensure TOR runs on boot

sudo apt-get install rcconf
sudo rcconf

The web server user 'www-data' needs sudo

This may weaken your security. A good idea is to run your webserver as another user other than www-data

sudo visudo
# Add the following end of file:
www-data ALL = NOPASSWD : ALL
# Save and exit

TOR

This product is produced independently from the Tor anonymity software and carries no guarantee from The Tor Project about quality, suitability or anything else.

torelay's People

Contributors

yadakhov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

torelay's Issues

Support gzip compression

http://www.reddit.com/r/webdev/comments/382vw9/a_simple_tor_relay_website_i_coded_over_the/crs611c

This is a really cool idea.
I tried it at work with kickass.to but I just got back a bunch of garbled text (this is just a small sample):
��}�v�H��s�+�ٷ�Ҕ��J�G���d�E���z||�@�DXXD���2g�d�b�<���������I� "�봻K$�̈"#c��W�8�xx���1$#���+� �#?�_7I2~��;�L��F�]ն��k,� ��n�I��Z��{��{5� #X��_S��u�0$�r:� ��_� �Nv�K�X��u����ؽP'���VpN/W؈�n\y|2�d���s��k�_y����/��Oc�����T�.���'^,��p9�

User agent randomization

Hi!

It looks like you use a certain set of user agents to obscure the fact that the data is coming from torelay.com instead of a regular client. As of my understanding of the TOR network it would be better to send the user agent of the latest TOR Browser Bundle ("Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Firefox/31.0"), which is used by all TOR Browser instances on all platforms to make the torelay.com traffic more difficult to differentiate from regular TOR traffic.

--rec0de

User Agent / HTTP Header not sent properly

Hi!

It looks like your use of 'CURLOPT_HTTPHEADER' is incorrect as you only set the Useragent, not the entire header. Viewing ipnumber.info trough torelay shows that an empty user agent is sent.
If you want to send header values you have to prefix them with the name of the value you want to change (see http://curl.haxx.se/libcurl/c/CURLOPT_HTTPHEADER.html).
As you are only sending the user agent for now, I would suggest replacing 'CURLOPT_HTTPHEADER' with 'CURLOPT_USERAGENT'.

--rec0de

White list some urls

Some url such as jquery cdn and bootstrap cdn doesn't need to go through URL injection.

Roboto font loaded over plaintext HTTP

Hi!

I just looked trough your code and noticed that the Roboto Webfont is loaded over plaintext HTTP even if the main connection is TLS encrypted.
This causes a 'mixed content' warning in Firefox (and perhaps Chrome?)

Additionaly I would suggest enabling HSTS headers to prevent downgrading attacks.

Thanks for creating this :)

-- rec0de

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.