├── .buildpacks ├── .gitattributes ├── .github └── FUNDING.yml ├── Aptfile ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── Procfile ├── README.md ├── config.ru ├── config.ru.bac ├── configvar.jpg ├── site.rb └── views └── index.erb /.buildpacks: -------------------------------------------------------------------------------- 1 | https://github.com/heroku/heroku-buildpack-apt 2 | https://github.com/heroku/heroku-buildpack-ruby 3 | 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.html linguist-language=Ruby 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # sumithemmadi 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: sumithemmadi 10 | issuehunt: sumithemmadi 11 | otechie: # Replace with a single Otechie username 12 | custom: # ["https://paypal.me/sumithemmadi"] 13 | -------------------------------------------------------------------------------- /Aptfile: -------------------------------------------------------------------------------- 1 | tor 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'sinatra' 4 | gem 'ruby-hidden-service' 5 | gem 'slim' 6 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | rack (1.6.4) 5 | rack-protection (1.5.3) 6 | rack 7 | ruby-hidden-service (0.0.2) 8 | tor 9 | sinatra (1.4.6) 10 | rack (~> 1.4) 11 | rack-protection (~> 1.4) 12 | tilt (>= 1.3, < 3) 13 | slim (3.0.6) 14 | temple (~> 0.7.3) 15 | tilt (>= 1.3.3, < 2.1) 16 | temple (0.7.6) 17 | tilt (2.0.1) 18 | tor (0.1.2) 19 | 20 | PLATFORMS 21 | ruby 22 | 23 | DEPENDENCIES 24 | ruby-hidden-service 25 | sinatra 26 | slim 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Emmadi Sumith Kumar 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 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec rackup config.ru -p $PORT 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Tor-Hidden-Service 2 | ![image](https://img.shields.io/badge/Heroku-430098?style=for-the-badge&logo=heroku&logoColor=white) ![image](https://img.shields.io/badge/Tor-7D4698?style=for-the-badge&logo=Tor-Browser&logoColor=white) 3 | 4 | [![Version](https://img.shields.io/badge/Version-1.0.3-blue)](https://github.com/sumithemmadi/Ruby-Hidden-Service) 5 | [![Licence](https://img.shields.io/github/license/sumithemmadi/Ruby-Hidden-Service)](https://github.com/sumithemmadi/Ruby-Hidden-Service) 6 | [![issues](https://img.shields.io/github/issues/sumithemmadi/Ruby-Hidden-Service)](https://github.com/sumithemmadi/Ruby-Hidden-Service) 7 | [![stars](https://img.shields.io/github/stars/sumithemmadi/Ruby-Hidden-Service)](https://github.com/sumithemmadi/Ruby-Hidden-Service) 8 | 9 | 10 | _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](https://github.com/sumithemmadi/Tor-Onion-Service-On-Heroku). 11 | ### Prerequisites 12 | - 1 . `ruby` 13 | - 2 . `tor` _v2_ 14 | - 3 . `php` 15 | - 4 . `git` 16 | - 5 . `heroku CLI` 17 | 18 | 19 | ### Install Heroku 20 | - 1 . Create an account on **[https://heroku.com](https://heroku.com)**. 21 | - 2 . Install the Heroku CLI on your computer:
**[https://devcenter.heroku.com/articles/heroku-cli](https://devcenter.heroku.com/articles/heroku-cli)**. 22 |
Check that you have the `heroku-cli` installed by checking the version number in your terminal: 23 | 24 | ```bash 25 | heroku --version 26 | ``` 27 | 28 | - 3 . Connect the `Heroku CLI` to your account by writing the following command in your terminal and follow the instructions on the command line: 29 | ```bash 30 | heroku login 31 | ``` 32 | 33 | ### Quick Start 34 | 35 | - 1 . After installing `Heroku CLI` clone this reposiRubyy. 36 | 37 | - 2 . Clone the repo with below command 38 | ```bash 39 | git clone https://github.com/sumithemmadi/Ruby-Hidden-Service.git 40 | cd Ruby-Hidden-Service 41 | ``` 42 | - 3 . Create a heroku application 43 | 44 | ```bash 45 | heroku apps:create App-Name 46 | ``` 47 | 48 | - `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: 49 | 50 | - _Note: replace `App-Name` with any other name._ 51 | ```bash 52 | $ heroku apps:create ruby-hidden-service 53 | Creating ⬢ ruby-hidden-service... done 54 | https://ruby-hidden-service.herokuapp.com/ | https://git.heroku.com/ruby-hidden-service.git 55 | ``` 56 | - 4 . Now enter the below command 57 | 58 | ```bash 59 | heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi.git 60 | ``` 61 | - Add this buildpack to heroku. 62 | 63 | - 5 . Copy your website `index.html` file to the folder `views` as `index.erb`
64 | 65 | - 6 . Copy SHA from private_key which is located at `/var/lib/tor/hidden_service/` 66 | 67 | - `hostname` 68 | - `private_key` 69 | If you don't know where these files stored refer to **[https://2019.www.torproject.org/docs/tor-onion-service](https://2019.www.torproject.org/docs/tor-onion-service)** 70 | 71 | 72 | - 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](https://dashboard.heroku.com): 73 | - Open your app on heroku then click settings>config vars. 74 | [![image](https://raw.githubusercontent.com/sumithemmadi/Ruby-Hidden-Service/main/configvar.jpg)](https://dashboard.heroku.com) 75 | - Set config vars with `HIDDEN_SERVICE_PRIVATE_KEY`: The contents of a `private_key` file. 76 | 77 | 78 | - 8 . Deploy your changes to heroku 79 | ```bash 80 | git add . 81 | git commit -am "Ruby hidden service" 82 | git push heroku 83 | ``` 84 | 85 | - _Now your app is accessible over Tor_ 86 | - To know your .onion address 87 | - Run the below command on terminal 88 | ``` 89 | cat /var/lib/tor/hidden_service/hostname 90 | ``` 91 | ### My app 92 | 93 | - **[https://ruby-hidden-service.herokuapp.com/](https://ruby-hidden-service.herokuapp.com/)** 94 | 95 | - Tor is ending its support for version 2 (v2) Onion Services. Please refer to `tor v3` 96 | - GitHub Repo for `Tor onion service v3`:[https://github.com/sumithemmadi/Tor-Onion-Service-On-Heroku](https://github.com/sumithemmadi/Tor-Onion-Service-On-Heroku). 97 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | require 'tor/hidden-service' 2 | 3 | hidden_service = Tor::HiddenService.new( 4 | private_key: ENV['HIDDEN_SERVICE_PRIVATE_KEY'], 5 | server_port: ENV['PORT'] || 5000 6 | ) 7 | 8 | hidden_service.start 9 | 10 | require './site' 11 | run Sinatra::Application 12 | -------------------------------------------------------------------------------- /config.ru.bac: -------------------------------------------------------------------------------- 1 | require 'tor/hidden-service' 2 | 3 | hidden_service = Tor::HiddenService.new( 4 | private_key: ENV['HIDDEN_SERVICE_PRIVATE_KEY'], 5 | server_port: ENV['PORT'] || 5000 6 | ) 7 | 8 | hidden_service.start 9 | 10 | require 'sinatra' 11 | 12 | get '/' do 13 | echo it's working. 14 | end 15 | 16 | run Sinatra::Application 17 | -------------------------------------------------------------------------------- /configvar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sumithemmadi/Ruby-Hidden-Service/b911cea0c288ef5e0b7c797a4614f8957e26a520/configvar.jpg -------------------------------------------------------------------------------- /site.rb: -------------------------------------------------------------------------------- 1 | require 'sinatra' 2 | get '/' do 3 | erb :index 4 | end 5 | -------------------------------------------------------------------------------- /views/index.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Ruby Hidden Service 5 | 6 | 7 |

Ruby Hidden Service 8 |

9 |

10 | This is a example page of GitHub repositor Ruby-Hidden-Service 11 |


12 | Onion v2 link => http://sumithivg2245vix.onion

13 |

14 | Tor is ending its support for version 2 (v2) Onion Services, and v2 onion sites have since been deprecated. If you are a site administrator, upgrade to a v3 onion service immediately. 15 |


16 |

17 | GitHub Repo for Tor onion service v3: 18 | https://github.com/sumithemmadi/Tor-Onion-Service-On-Heroku 19 |

20 | 21 | Onion v3 link -> http://sumith........ad.onion 22 | 23 | 24 | --------------------------------------------------------------------------------