Skip to content

Commit 6d25f54

Browse files
committed
Initial release v1.0.0
One-click Tor Bridge/Relay node setup and management tool with live TUI dashboard, Snowflake proxy support, and Telegram notifications.
0 parents  commit 6d25f54

File tree

6 files changed

+7092
-0
lines changed

6 files changed

+7092
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Saman - SamNet
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.

README.md

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
# Torware
2+
3+
One-click Tor Bridge/Relay node setup and management tool with live TUI dashboard, Snowflake proxy support, and Telegram notifications.
4+
5+
![License](https://img.shields.io/badge/license-MIT-blue.svg)
6+
![Platform](https://img.shields.io/badge/platform-Linux-green.svg)
7+
![Tor](https://img.shields.io/badge/Tor-supported-purple.svg)
8+
9+
## Screenshots
10+
11+
| Main Menu | Live Dashboard | Settings |
12+
|:---------:|:--------------:|:--------:|
13+
| ![Main Menu](torware-mainmenu.png) | ![Live Stats](torware-livestats.png) | ![Settings](torware-settings.png) |
14+
15+
## Quick Install
16+
17+
```bash
18+
curl -sL https://raw.githubusercontent.com/SamNet-dev/torware/main/torware.sh | sudo bash
19+
```
20+
21+
That's it. The installer will:
22+
- Detect your OS (Ubuntu, Debian, Fedora, CentOS, Arch, Alpine, etc.)
23+
- Install Docker if not already present
24+
- Walk you through an interactive setup wizard
25+
- Start your Tor relay in Docker with auto-restart on boot
26+
27+
## Features
28+
29+
### Relay Types
30+
- **Bridge (obfs4)** — Hidden entry point for censored users. IP not publicly listed. Safest option. *(Default)*
31+
- **Middle Relay** — Routes encrypted traffic within the Tor network. IP is publicly listed but no exit traffic.
32+
- **Exit Relay** — Final hop to the internet. Requires understanding of legal implications. Full warning and confirmation during setup.
33+
34+
### Live TUI Dashboard
35+
Real-time terminal dashboard with 5-second refresh:
36+
- Active circuits and connections
37+
- Bandwidth (download/upload) with totals
38+
- CPU and RAM usage per container and system-wide
39+
- Client countries (24-hour unique clients for bridges)
40+
- Data cap usage (if configured)
41+
- Snowflake proxy stats
42+
43+
### Snowflake WebRTC Proxy
44+
Run a Snowflake proxy alongside your relay to help censored users connect via WebRTC:
45+
- No port forwarding needed (WebRTC handles NAT traversal)
46+
- Configurable CPU and memory limits
47+
- Live connection and traffic stats on the dashboard
48+
- Independent start/stop from the main relay
49+
50+
### Multi-Container Support
51+
Run up to 5 Tor containers simultaneously:
52+
- Each container gets unique ORPort and ControlPort
53+
- Per-container bandwidth, relay type, and resource limits
54+
- Mixed relay types (e.g., container 1 = bridge, container 2 = middle)
55+
- Add/remove containers from the management menu
56+
57+
### Telegram Notifications
58+
- Setup wizard with guided BotFather integration
59+
- Periodic status reports (configurable interval + start hour)
60+
- Bot commands: `/tor_status`, `/tor_peers`, `/tor_uptime`, `/tor_containers`, `/tor_snowflake`, `/tor_start_N`, `/tor_stop_N`, `/tor_restart_N`, `/tor_help`
61+
- Alerts for high CPU, high RAM, all containers down, or zero connections
62+
- Daily and weekly summary reports
63+
- Uses `/tor_` prefix so the bot can be shared with other services
64+
65+
### Background Traffic Tracker
66+
- ControlPort event subscription for real-time bandwidth and circuit data
67+
- Country-level traffic aggregation via GeoIP
68+
- Cumulative statistics persisted to disk
69+
- Runs as a systemd service (or OpenRC/SysVinit)
70+
71+
### Health Check
72+
15-point diagnostic covering:
73+
- Docker daemon status
74+
- Container state and restart count
75+
- ControlPort connectivity and cookie authentication
76+
- Data volume integrity
77+
- Network mode verification
78+
- Relay fingerprint validation
79+
- Snowflake proxy and metrics endpoint
80+
- GeoIP and system tool availability
81+
82+
### About & Learn
83+
Built-in educational section covering:
84+
- What is Tor and how it works
85+
- Bridge, Middle, and Exit relay explanations
86+
- Snowflake proxy details
87+
- How Tor circuits work (with ASCII diagram)
88+
- Dashboard metrics explained
89+
- Legal and safety considerations
90+
- Port forwarding guide for home users
91+
92+
## CLI Commands
93+
94+
```
95+
torware start Start all relay containers
96+
torware stop Stop all relay containers
97+
torware restart Restart all relay containers
98+
torware status Show relay status summary
99+
torware dashboard Open live TUI dashboard
100+
torware stats Open advanced statistics
101+
torware peers Show live peers by country
102+
torware logs View container logs
103+
torware health Run health check
104+
torware fingerprint Show relay fingerprint(s)
105+
torware bridge-line Show bridge line(s) for sharing
106+
torware snowflake Snowflake proxy management
107+
torware backup Backup Tor identity keys
108+
torware restore Restore from backup
109+
torware uninstall Remove Torware and containers
110+
torware menu Open interactive menu
111+
torware help Show help
112+
torware version Show version
113+
```
114+
115+
Or just run `torware` with no arguments to open the interactive menu.
116+
117+
## Requirements
118+
119+
- **OS**: Linux (Ubuntu, Debian, Fedora, CentOS, RHEL, Arch, Alpine, openSUSE, Raspbian)
120+
- **RAM**: 512 MB minimum (1 GB+ recommended for multiple containers)
121+
- **Docker**: Installed automatically if not present
122+
- **Ports**: 9001 TCP (ORPort), 9002 TCP (obfs4) — must be forwarded if behind NAT
123+
- **Root**: Required for Docker and system service management
124+
125+
## Port Forwarding (Home Users)
126+
127+
If running from home behind a router, you must forward these ports:
128+
129+
| Port | Protocol | Purpose |
130+
|------|----------|---------|
131+
| 9001 | TCP | Tor ORPort |
132+
| 9002 | TCP | obfs4 pluggable transport |
133+
134+
Log into your router (usually `192.168.1.1` or `10.0.0.1`), find **Port Forwarding**, and add both TCP forwards to your server's local IP.
135+
136+
Snowflake does **not** need port forwarding — WebRTC handles NAT traversal automatically.
137+
138+
## Docker Images
139+
140+
| Relay Type | Image |
141+
|------------|-------|
142+
| Bridge (obfs4) | `thetorproject/obfs4-bridge:latest` |
143+
| Middle/Exit Relay | `osminogin/tor-simple:latest` |
144+
| Snowflake Proxy | `thetorproject/snowflake-proxy:latest` |
145+
146+
## File Structure
147+
148+
```
149+
/opt/torware/
150+
├── settings.conf # Configuration
151+
├── torware # Management script (symlinked to /usr/local/bin/torware)
152+
├── torware-tracker.sh # Background ControlPort monitor
153+
├── backups/ # Tor identity key backups
154+
├── relay_stats/ # Tracker data
155+
│ ├── cumulative_data # Country|InBytes|OutBytes
156+
│ ├── cumulative_ips # Country|IP
157+
│ ├── tracker_snapshot # Real-time 15s window
158+
│ └── geoip_cache # IP to Country cache
159+
└── containers/ # Per-container torrc files
160+
├── relay-1/torrc
161+
├── relay-2/torrc
162+
└── ...
163+
```
164+
165+
## Configuration
166+
167+
All settings are stored in `/opt/torware/settings.conf` and can be changed via the Settings menu or by editing the file directly.
168+
169+
Key settings:
170+
- `RELAY_TYPE` — bridge, middle, or exit
171+
- `NICKNAME` — your relay's nickname on the Tor network
172+
- `CONTACT_EMAIL` — contact for directory authorities
173+
- `BANDWIDTH` — bandwidth rate limit (Mbit/s)
174+
- `CONTAINER_COUNT` — number of Tor containers (1-5)
175+
- `DATA_CAP` — monthly data cap (GB), 0 for unlimited
176+
- `SNOWFLAKE_ENABLED` — true/false
177+
- `SNOWFLAKE_CPUS` / `SNOWFLAKE_MEMORY` — Snowflake resource limits
178+
179+
Per-container overrides: `RELAY_TYPE_N`, `BANDWIDTH_N`, `ORPORT_N` (where N is the container index).
180+
181+
## Uninstall
182+
183+
```bash
184+
sudo torware uninstall
185+
```
186+
187+
This will stop and remove containers, remove systemd services, and optionally delete configuration and backups.
188+
189+
## Contributing
190+
191+
Contributions are welcome. Please open an issue or pull request on GitHub.
192+
193+
## License
194+
195+
This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
196+
197+
## Acknowledgments
198+
199+
- [The Tor Project](https://www.torproject.org/) for building and maintaining the Tor network
200+
- [Snowflake](https://snowflake.torproject.org/) for the WebRTC pluggable transport
201+
- All Tor relay operators who keep the network running
202+
203+
---
204+
205+
<div dir="rtl">
206+
207+
## فارسی
208+
209+
### تورویر (Torware) چیست؟
210+
211+
تورویر یک ابزار خط فرمان برای راه‌اندازی و مدیریت نودهای شبکه تور (Tor) است. با یک دستور ساده، می‌توانید یک بریج (Bridge)، رله میانی (Middle Relay) یا رله خروجی (Exit Relay) تور را روی سرور خود راه‌اندازی کنید.
212+
213+
### نصب سریع
214+
215+
<div dir="ltr">
216+
217+
```bash
218+
curl -sL https://raw.githubusercontent.com/SamNet-dev/torware/main/torware.sh | sudo bash
219+
```
220+
221+
</div>
222+
223+
### انواع رله
224+
225+
- **بریج (Bridge)** — نقطه ورود مخفی برای کاربرانی که در کشورهای سانسورشده هستند. آدرس IP شما عمومی نمی‌شود. **امن‌ترین گزینه.** (پیش‌فرض)
226+
- **رله میانی (Middle Relay)** — ترافیک رمزنگاری‌شده را در شبکه تور مسیریابی می‌کند. آدرس IP شما عمومی است اما ترافیک خروجی ندارید.
227+
- **رله خروجی (Exit Relay)** — آخرین گام به اینترنت. نیاز به درک مسائل حقوقی دارد.
228+
229+
### ویژگی‌ها
230+
231+
- **داشبورد زنده** — نمایش لحظه‌ای مدارها، پهنای باند، مصرف CPU/RAM و کشور کاربران
232+
- **پروکسی اسنوفلیک (Snowflake)** — کمک به کاربران سانسورشده از طریق WebRTC بدون نیاز به Port Forwarding
233+
- **چند کانتینر** — تا ۵ کانتینر تور همزمان با انواع مختلف رله
234+
- **اعلان‌های تلگرام** — گزارش وضعیت خودکار و دستورات ربات
235+
- **بررسی سلامت** — ۱۵ نقطه تشخیصی برای اطمینان از عملکرد صحیح
236+
- **آموزش داخلی** — توضیح کامل شبکه تور، انواع رله‌ها و مسائل حقوقی
237+
238+
### پیش‌نیازها
239+
240+
- **سیستم‌عامل**: لینوکس (اوبونتو، دبیان، فدورا، سنت‌اواس، آرچ، آلپاین و...)
241+
- **رم**: حداقل ۵۱۲ مگابایت (۱ گیگابایت یا بیشتر توصیه می‌شود)
242+
- **داکر**: در صورت نبودن، به صورت خودکار نصب می‌شود
243+
- **پورت‌ها**: 9001 TCP و 9002 TCP — اگر پشت NAT هستید باید Port Forward کنید
244+
245+
### Port Forwarding (کاربران خانگی)
246+
247+
اگر از خانه و پشت روتر اجرا می‌کنید، باید این پورت‌ها را Forward کنید:
248+
249+
| پورت | پروتکل | کاربرد |
250+
|------|---------|--------|
251+
| 9001 | TCP | پورت اصلی تور (ORPort) |
252+
| 9002 | TCP | انتقال obfs4 |
253+
254+
وارد تنظیمات روتر شوید (معمولا `192.168.1.1` یا `10.0.0.1`)، بخش **Port Forwarding** را پیدا کنید و هر دو پورت TCP را به IP محلی سرور خود Forward کنید.
255+
256+
اسنوفلیک نیازی به Port Forwarding **ندارد** — WebRTC به صورت خودکار از NAT عبور می‌کند.
257+
258+
### خط بریج (Bridge Line)
259+
260+
بعد از راه‌اندازی، خط بریج شما ممکن است چند ساعت تا ۱-۲ روز طول بکشد تا در دسترس قرار بگیرد. تور باید مراحل زیر را طی کند:
261+
1. بوت‌استرپ کامل و تست دسترسی ORPort
262+
2. انتشار توصیفگر به مرجع بریج
263+
3. اضافه شدن به BridgeDB برای توزیع
264+
265+
می‌توانید پیشرفت را با گزینه **Health Check** (شماره ۸ در منو) بررسی کنید.
266+
267+
### چرا بریج اجرا کنیم؟
268+
269+
میلیون‌ها نفر در کشورهایی مانند ایران، چین، روسیه و بسیاری دیگر از کشورها، به دلیل سانسور اینترنت قادر به دسترسی آزاد به اطلاعات نیستند. با اجرای یک بریج تور، شما به این افراد کمک می‌کنید تا:
270+
271+
- به اینترنت آزاد دسترسی پیدا کنند
272+
- اخبار واقعی را بخوانند
273+
- با خانواده و دوستان خود در خارج از کشور ارتباط برقرار کنند
274+
- از حریم خصوصی خود محافظت کنند
275+
276+
**هر بریج مهم است.** حتی یک بریج کوچک با پهنای باند محدود می‌تواند به ده‌ها نفر کمک کند.
277+
278+
### مجوز
279+
280+
این پروژه تحت مجوز MIT منتشر شده است. فایل [LICENSE](LICENSE) را ببینید.
281+
282+
</div>

torware-livestats.png

77.1 KB
Loading

torware-mainmenu.png

74.3 KB
Loading

torware-settings.png

26.4 KB
Loading

0 commit comments

Comments
 (0)