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 +```