Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add(app): Tor Socks Proxy #5333

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apps/tor-socks-proxy/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Tor Socks Proxy",
"id": "tor-socks-proxy",
"available": true,
"short_desc": "Tor Socks5 proxy server inside a Docker container",
"author": "PeterDaveHello",
"port": 9180,
"categories": ["network"],
"description": "The super easy way to set up a Tor Socks5 proxy server inside a Docker container, without Tor relay/exit node function enabled.",
"tipi_version": 1,
"version": "v1.0.0",
"source": "https://github.com/PeterDaveHello/tor-socks-proxy",
"exposable": true,
"supported_architectures": ["arm64", "amd64"],
"created_at": 1729881000000,
"updated_at": 1729881000000
}
12 changes: 12 additions & 0 deletions apps/tor-socks-proxy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3.9"

services:
tor-socks-proxy:
container_name: tor-socks-proxy
image: peterdavehello/tor-socks-proxy:latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Pin the image to a specific version for security and stability.

Using latest tag can lead to unexpected changes and potential security issues. Consider pinning to a specific version.

-    image: peterdavehello/tor-socks-proxy:latest
+    image: peterdavehello/tor-socks-proxy:0.4.7.13
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
image: peterdavehello/tor-socks-proxy:latest
image: peterdavehello/tor-socks-proxy:0.4.7.13

restart: unless-stopped
ports:
- ${APP_PORT}:9150/tcp
Comment on lines +8 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider restricting port access to specific networks.

The Tor SOCKS proxy port is currently exposed to all interfaces. For better security, consider binding to specific networks or localhost if possible.

     ports:
-      - ${APP_PORT}:9150/tcp
+      - 127.0.0.1:${APP_PORT}:9150/tcp
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ports:
- ${APP_PORT}:9150/tcp
ports:
- 127.0.0.1:${APP_PORT}:9150/tcp

networks:
- tipi_main_network

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix formatting issues.

There are two formatting issues that should be addressed:

  1. Remove trailing spaces
  2. Add a newline at the end of file
     networks:
-      - tipi_main_network
-    
+      - tipi_main_network
+

Committable suggestion was skipped due to low confidence.

🧰 Tools
🪛 yamllint

[error] 12-12: no new line character at the end of file

(new-line-at-end-of-file)


[error] 12-12: trailing spaces

(trailing-spaces)

93 changes: 93 additions & 0 deletions apps/tor-socks-proxy/metadata/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<p align="center">
<img width="300px" src="https://upload.wikimedia.org/wikipedia/commons/8/8f/Tor_project_logo_hq.png">
</p>

# Tor-socks-proxy

![license](https://img.shields.io/badge/license-GPLv3.0-brightgreen.svg?style=flat)
[![Build Status](https://app.travis-ci.com/PeterDaveHello/tor-socks-proxy.svg?branch=master)](https://app.travis-ci.com/PeterDaveHello/tor-socks-proxy)
[![Docker Hub pulls](https://img.shields.io/docker/pulls/peterdavehello/tor-socks-proxy.svg)](https://hub.docker.com/r/peterdavehello/tor-socks-proxy/)

[![Docker Hub badge](http://dockeri.co/image/peterdavehello/tor-socks-proxy)](https://hub.docker.com/r/peterdavehello/tor-socks-proxy/)

The super easy way to set up a [Tor](https://www.torproject.org) [SOCKS5](https://en.wikipedia.org/wiki/SOCKS#SOCKS5) [proxy server](https://en.wikipedia.org/wiki/Proxy_server) inside a [Docker](https://en.wikipedia.org/wiki/Docker_(software)) [container](https://en.wikipedia.org/wiki/Container_(virtualization)), without Tor relay/exit node function enabled.

## Docker image Repository

We push the built image to Docker Hub and GitHub Container Registry:

- GitHub Container Registry:
- `ghcr.io/peterdavehello/tor-socks-proxy`
- <https://github.com/PeterDaveHello/tor-socks-proxy/pkgs/container/tor-socks-proxy>
- Docker Hub:
- `peterdavehello/tor-socks-proxy`
- <https://hub.docker.com/r/peterdavehello/tor-socks-proxy/>

Use the prefix `ghcr.io/` if you prefer to use GitHub Container Registry.

## Usage

### First-Time Setup

```sh
docker run -d --restart=always --name tor-socks-proxy -p 127.0.0.1:9150:9150/tcp peterdavehello/tor-socks-proxy:latest
```

- `--restart=always`: This ensures the container automatically restarts whenever the system reboots.
- `-p 127.0.0.1:9150:9150/tcp`: This binds the container to localhost, and you should not change this IP unless you want to expose the proxy to a local network or the Internet.
- You can change the first `9150` to any available port. Please note that ports `9050`/`9150` may be occupied if you are running another Tor client like TorBrowser.

### Start or stop an existing Instance manually

```sh
docker start tor-socks-proxy
```

```sh
docker stop tor-socks-proxy
```

### Checking the Proxy Status and logs

```sh
docker logs tor-socks-proxy
```

### Configuring a Client to Use the Proxy

```sh
curl --socks5-hostname 127.0.0.1:9150 https://ipinfo.tw/ip
```

### Stopping the Proxy

```sh
docker stop tor-socks-proxy
```

## IP Renewal

By default, Tor automatically changes IPs every 10 minutes. You can manually renew the IP by restarting the container:

```sh
docker restart tor-socks-proxy
```

## DNS over Tor

Publish DNS port during setup to query DNS requests over Tor:

```sh
docker run -d --restart=always --name tor-socks-proxy -p 127.0.0.1:9150:9150/tcp -p 127.0.0.1:53:8853/udp peterdavehello/tor-socks-proxy:latest
```
## Sponsor

<a href="https://m.do.co/c/1fdd0a1d695a"><img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px"></a>

This project is now sponsored by DigitalOcean, providing us with a dedicated development and testing environment.

For cloud VPS hosting with $200 in free credit, consider using my DigitalOcean referral link: https://m.do.co/c/1fdd0a1d695a

## Support Tor Project

Support the Tor project by [setting up Tor bridge/exit nodes](https://trac.torproject.org/projects/tor/wiki/TorRelayGuide) and [donating](https://donate.torproject.org/).
Binary file added apps/tor-socks-proxy/metadata/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.