Skip to content

sumithemmadi/Ruby-Hidden-Service

Repository files navigation

Tor-Hidden-Service

image image

Version Licence issues stars

Note: Tor is ending its support for version 2 (v2) Onion Services, and v2 onion sites have since been deprecated. Please refer to tor v3 Tor-Onion-Service-On-Heroku.

Prerequisites

  • 1 . ruby
  • 2 . tor v2
  • 3 . php
  • 4 . git
  • 5 . heroku CLI

Install Heroku

heroku --version
  • 3 . Connect the Heroku CLI to your account by writing the following command in your terminal and follow the instructions on the command line:
heroku login

Quick Start

  • 1 . After installing Heroku CLI clone this reposiRubyy.

  • 2 . Clone the repo with below command

git clone https://github.com/sumithemmadi/Ruby-Hidden-Service.git
cd Ruby-Hidden-Service
  • 3 . Create a heroku application
heroku apps:create App-Name
  • heroku apps:create App-Name this command creates the application as well as a git remote, that you can use to push your code to Heroku:

  • Note: replace App-Name with any other name.

$ heroku apps:create ruby-hidden-service
Creating ⬢ ruby-hidden-service... done
https://ruby-hidden-service.herokuapp.com/ | https://git.heroku.com/ruby-hidden-service.git
  • 4 . Now enter the below command
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi.git
  • Add this buildpack to heroku.

  • 5 . Copy your website index.html file to the folder views as index.erb

  • 6 . Copy SHA from private_key which is located at /var/lib/tor/hidden_service/

  • 7 . Tor hidden services require a private_key and it's SHA to generate .onion name. You'll need to provide this as env vars.You can also edit config vars from your app’s Settings tab in the Heroku Dashboard:

    • Open your app on heroku then click settings>config vars. image
    • Set config vars with HIDDEN_SERVICE_PRIVATE_KEY: The contents of a private_key file.
  • 8 . Deploy your changes to heroku

git add .
git commit -am "Ruby hidden service"
git push heroku
  • Now your app is accessible over Tor
  • To know your .onion address
  • Run the below command on terminal
cat /var/lib/tor/hidden_service/hostname

My app