Tor에서 .onion 도메인으로 미러를 만드는 방법?

Hello! I’m using a standard installation of Docker Discourse on Ubuntu and want to setup a forum mirror in .onion Tor network.

I have installed Tor on server and now I have myonionsite.onion address.

#install
apt install -y tor

#uncomment in /etc/tor/torrc
HiddenServiceDir /var/lib/tor/myonionsite/
HiddenServicePort 80 127.0.0.1:8080
HiddenServiceVersion 3

#restart
systemctl restart tor
systemctl enable tor

cat /var/lib/tor/myonionsite/hostname

But this address show default nginx page, not my community.

Need help :pleading_face: :pray:

There is a TOR template for discourse:

It was last updated 6 years ago so I’m not sure if it’d still work but if it still works, this should get you going. Read the template to understand how it works.

You’ll need to include the template in your app.yml and define DISCOURSE_ONION link (which is your .onion address.

Further discussion: Template for serving through an .onion address with Docker

Doesn’t work or am I doing something wrong…

My steps:

  1. apt install tor

  2. edit file /etc/tor/torrc

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:8080
HiddenServiceVersion 3
  1. restart
systemctl restart tor
systemctl enable tor
  1. check my onion domain
cat /var/lib/tor/hidden_service/hostname
  1. go to cd /var/discourse/ and edit app.yml
    add templates web.onion.template.yml
    add DISCOURSE_ONION look like:
DISCOURSE_HOSTNAME example.com
DISCOURSE_ONION example.onion
  1. ./launcher rebuild app

After these settings, the forum is not available in clearnet and in Tor. Maybe I need change post? :pensive:

Maybe I need install new nginx? 1. apt install nginx tor

Hi mate, did you find solution to setting up TOR correctly ?

The web.onion.template.yml needs some updates in order to work.

Please try this patch.

Besides that, you probably also need to point HiddenServicePort to 80 127.0.0.1:80 instead of 80 127.0.0.1:8080.

How we can do it if we are not exposing Discourse directly because using aproxy like Nginx?

Using the container IP should work? (:

이론적으로 Discourse가 동일한 인스턴스를 두 개의 도메인(.com과 .onion)으로 제공할 수 있나요?

예를 들어, 사용자가 어떤 도메인으로 접속했는지에 따라 링크를 생성할 수 있나요? 그렇다면 “주요” 도메인 이름(예: 이메일 내 링크에 사용되는 도메인)은 어떻게 정해지나요? 등등.