From 5dc75e981eede4806dc0ba384dbc39e37427e648 Mon Sep 17 00:00:00 2001 From: ruslan Date: Wed, 25 Jun 2025 14:09:57 +0200 Subject: [PATCH] Create tor-website.md --- content/posts/tor-website.md | 63 ++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 content/posts/tor-website.md diff --git a/content/posts/tor-website.md b/content/posts/tor-website.md new file mode 100644 index 0000000..162a41b --- /dev/null +++ b/content/posts/tor-website.md @@ -0,0 +1,63 @@ +--- +title: Поднятие сайта в TOR +description: Caddy +date: 2025-06-25T14:02:00+02:00 +tags: [linux, tor, caddy] +--- +## Генерация vanity адреса + +```bash +docker run -it nwtgck/mkp224o +mkp224o -s +``` + +Формула для вычисления ожидаемого времени генерации: +```python +32^/ = +``` + +## Установка и конфигурация TOR + +Установка TOR: + +```shell +apt -y install tor +``` + +Следующие строки необходимо добавить в `/etc/tor/torrc`: + +```python +HiddenServiceDir /var/lib/tor/website +HiddenServicePort 80 127.0.0.1:80 +``` + +Файлы, сгенерированные `mkp224o`, необходимо добавить в директорию '/var/lib/tor/website': + +```shell +mkdir /var/lib/tor/website +mv .onion/* /var/lib/tor/website +chown -R debian-tor: /var/lib/tor/website +chmod -R 700 /var/lib/tor/website +``` + +## Конфигурация Caddy + +В `Caddyfile` необходимо добавить следующее: + +```python + { + header Onion-Location http://.onion{uri} + respond "cleanet" +} + +http://.onion { + respond "onion" +} +``` + +## Перезапуск сервисов + +```shell +sudo systemctl restart tor +sudo systemctl restart caddy +```