├── Bgp4.sh
├── README.md
├── direct.sh
└── src
├── Thumbs.db
├── logo.jpg
└── t.png
/Bgp4.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Coler Code
4 | Purple='\033[0;35m'
5 | Cyan='\033[0;36m'
6 | cyan='\033[0;36m'
7 | CYAN='\033[0;36m'
8 | YELLOW='\033[0;33m'
9 | White='\033[0;96m'
10 | RED='\033[0;31m'
11 | BLUE='\033[0;34m'
12 | MAGENTA='\033[0;35m'
13 | NC='\033[0m' # No Color
14 |
15 | # Detect the Linux distribution
16 | detect_distribution() {
17 | if [ -f /etc/os-release ]; then
18 | source /etc/os-release
19 | case "${ID}" in
20 | ubuntu | debian)
21 | p_m="apt-get"
22 | ;;
23 | centos)
24 | p_m="yum"
25 | ;;
26 | fedora)
27 | p_m="dnf"
28 | ;;
29 | *)
30 | echo -e "${red}Unsupported distribution!${rest}"
31 | exit 1
32 | ;;
33 | esac
34 | else
35 | echo -e "${red}Unsupported distribution!${rest}"
36 | exit 1
37 | fi
38 | }
39 |
40 | # Install Dependencies
41 | check_dependencies() {
42 | detect_distribution
43 |
44 | local dependencies
45 | dependencies=("wget" "curl" "unzip" "socat" "jq")
46 |
47 | for dep in "${dependencies[@]}"; do
48 | if ! command -v "${dep}" &>/dev/null; then
49 | echo -e "${YELLOW} ${dep} ${yellow}is not installed. Installing...${rest}"
50 | sudo "${p_m}" install "${dep}" -y
51 | fi
52 | done
53 | }
54 |
55 | # Check and nstall waterwall
56 | install_waterwall() {
57 | LATEST_RELEASE=$(curl --silent "https://api.github.com/repos/radkesvat/WaterWall/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
58 | INSTALL_DIR="/root/Waterwall"
59 | FILE_NAME="Waterwall"
60 |
61 | if [ ! -f "$INSTALL_DIR/$FILE_NAME" ]; then
62 | check_dependencies
63 | echo ""
64 | echo -e "${YELLOW}============================${rest}"
65 | echo -e "${YELLOW}Installing Waterwall...${rest}"
66 |
67 | if [ -z "$LATEST_RELEASE" ]; then
68 | echo -e "${red}Failed to get the latest release version.${rest}"
69 | return 1
70 | LATEST_RELEASE
71 | fi
72 |
73 | echo -e "${YELLOW}Latest version: ${yellow}${LATEST_RELEASE}${rest}"
74 |
75 | # Determine the download URL based on the architecture
76 | ARCH=$(uname -m)
77 | if [ "$ARCH" == "x86_64" ]; then
78 | DOWNLOAD_URL="https://github.com/radkesvat/WaterWall/releases/download/${LATEST_RELEASE}/Waterwall-linux-64.zip"
79 | elif [ "$ARCH" == "aarch64" ]; then
80 | DOWNLOAD_URL="https://github.com/radkesvat/WaterWall/releases/download/${LATEST_RELEASE}/Waterwall-linux-arm64.zip"
81 | else
82 | echo -e "${red}Unsupported architecture: $ARCH${rest}"
83 | return 1
84 | fi
85 |
86 | # Create the installation directory if it doesn't exist
87 | mkdir -p "$INSTALL_DIR"
88 |
89 | # Download the ZIP file directly into INSTALL_DIR
90 | ZIP_FILE="$INSTALL_DIR/Waterwall.zip"
91 | curl -L -o "$ZIP_FILE" "$DOWNLOAD_URL"
92 | if [ $? -ne 0 ]; then
93 | echo -e "${red}Download failed.${rest}"
94 | return 1
95 | fi
96 |
97 | # Unzip the downloaded file directly into INSTALL_DIR
98 | unzip "$ZIP_FILE" -d "$INSTALL_DIR" >/dev/null 2>&1
99 | if [ $? -ne 0 ]; then
100 | echo -e "${red}Unzip failed.${rest}"
101 | rm -f "$ZIP_FILE"
102 | return 1
103 | fi
104 |
105 | rm -f "$ZIP_FILE"
106 |
107 | # Set executable permission for Waterwall binary
108 | sudo chmod +x "$INSTALL_DIR/$FILE_NAME"
109 | if [ $? -ne 0 ]; then
110 | echo -e "${red}Failed to set executable permission for Waterwall.${rest}"
111 | return 1
112 | fi
113 |
114 | echo -e "${green}Waterwall installed successfully in $INSTALL_DIR.${rest}"
115 | echo -e "${YELLOW}============================${rest}"
116 | return 0
117 | fi
118 | }
119 |
120 |
121 | #===================================
122 |
123 |
124 | # Core.json
125 | create_core_json() {
126 | if [ ! -d /root/Waterwall ]; then
127 | mkdir -p /root/Waterwall
128 | fi
129 |
130 | if [ ! -f ~/Waterwall/core.json ]; then
131 | echo -e "${YELLOW}Creating core.json...${rest}"
132 | echo ""
133 | cat <~/Waterwall/core.json
134 | {
135 | "log": {
136 | "path": "log/",
137 | "core": {
138 | "loglevel": "DEBUG",
139 | "file": "core.log",
140 | "console": true
141 | },
142 | "network": {
143 | "loglevel": "DEBUG",
144 | "file": "network.log",
145 | "console": true
146 | },
147 | "dns": {
148 | "loglevel": "SILENT",
149 | "file": "dns.log",
150 | "console": false
151 | }
152 | },
153 | "dns": {},
154 | "misc": {
155 | "workers": 0,
156 | "ram-profile": "server",
157 | "libs-path": "libs/"
158 | },
159 | "configs": [
160 | "config.json"
161 | ]
162 | }
163 | EOF
164 | fi
165 | }
166 |
167 | #2
168 | # Bgp4 Tunnel
169 | bgp4() {
170 | create_bgp4_iran() {
171 | echo -e "${YELLOW}============================${rest}"
172 | echo -en "${green}Enter the local port: ${rest}"
173 | read -r local_port
174 | echo -en "${green}Enter the remote address: ${rest}"
175 | read -r remote_address
176 | echo -en "${green}Enter the remote (${yellow}Connection${green}) port [${yellow}Default: 2249${green}]: ${rest}"
177 | read -r remote_port
178 | remote_port=${remote_port:-2249}
179 |
180 | install_waterwall
181 |
182 | json=$(
183 | cat </root/Waterwall/config.json
217 | }
218 |
219 | create_bgp4_kharej() {
220 | echo -e "${YELLOW}============================${rest}"
221 | echo -en "${green}Enter the local (${yellow}Connection${green}) port [${yellow}Default: 2249${green}]: ${rest}"
222 | read -r local_port
223 | local_port=${local_port:-2249}
224 | echo -en "${green}Enter the remote (${yellow}Server Config ${green}) port: ${rest}"
225 | read -r remote_port
226 |
227 | install_waterwall
228 |
229 | json=$(
230 | cat </root/Waterwall/config.json
264 | }
265 |
266 | create_bgp4_multiport_iran() {
267 | echo -e "${YELLOW}============================${rest}"
268 | echo -en "${YELLOW}Enter the starting local port [${yellow}greater than 23${green}]: ${rest}"
269 | read -r start_port
270 | echo -en "${YELLOW}Enter the ending local port [${yellow}less than 65535${green}]: ${rest}"
271 | read -r end_port
272 | echo -en "${YELLOW}Enter the remote address: ${rest}"
273 | read -r remote_address
274 | echo -en "${YELLOW}Enter the remote (${yellow}Connection${green}) port [${yellow}Default: 2249${green}]: ${rest}"
275 | read -r remote_port
276 | remote_port=${remote_port:-2249}
277 |
278 | install_waterwall
279 |
280 | json=$(
281 | cat <port"
300 | },
301 | "next": "bgp_client"
302 | },
303 | {
304 | "name": "bgp_client",
305 | "type": "Bgp4Client",
306 | "settings": {},
307 | "next": "output"
308 | },
309 | {
310 | "name": "output",
311 | "type": "TcpConnector",
312 | "settings": {
313 | "nodelay": true,
314 | "address": "$remote_address",
315 | "port": $remote_port
316 | }
317 | }
318 | ]
319 | }
320 | EOF
321 | )
322 | echo "$json" >/root/Waterwall/config.json
323 | }
324 |
325 | create_bgp4_multiport_kharej() {
326 | echo -e "${YELLOW}============================${rest}"
327 | echo -en "${green}Enter the local (${yellow}Connection${green}) port [${yellow}Default: 2249${green}]: ${rest}"
328 | read -r local_port
329 | local_port=${local_port:-2249}
330 |
331 | install_waterwall
332 |
333 | json=$(
334 | cat <port"
359 | },
360 | "next": "output"
361 |
362 | },
363 | {
364 | "name": "output",
365 | "type": "TcpConnector",
366 | "settings": {
367 | "nodelay": true,
368 | "address": "127.0.0.1",
369 | "port": "dest_context->port"
370 | }
371 | }
372 | ]
373 | }
374 | EOF
375 | )
376 | echo "$json" >/root/Waterwall/config.json
377 | }
378 | echo -e "1. ${YELLOW} bgp4 Multiport Iran${rest}"
379 | echo -e "2. ${White} bgp4 Multiport kharej${rest}"
380 | echo -e "0. ${YELLOW} Back to Main Menu${rest}"
381 | echo -en "${Purple} Enter your choice: ${rest}"
382 | read -r choice
383 |
384 | case $choice in
385 | 1)
386 | create_bgp4_multiport_iran
387 | waterwall_service
388 | ;;
389 | 2)
390 | create_bgp4_multiport_kharej
391 | waterwall_service
392 | ;;
393 | 0)
394 | main
395 | ;;
396 | *)
397 | echo -e "${red}Invalid choice!${rest}"
398 | ;;
399 | esac
400 | }
401 |
402 | # Uninstall Waterwall
403 | uninstall_waterwall() {
404 | if [ -f ~/Waterwall/config.json ] || [ -f /etc/systemd/system/Waterwall.service ]; then
405 | echo -e "${YELLOW}==============================================${rest}"
406 | echo -en "${green}Press Enter to continue, or Ctrl+C to cancel.${rest}"
407 | read -r
408 | if [ -d ~/Waterwall/cert ] || [ -f ~/.acme/acme.sh ]; then
409 | echo -e "${YELLOW}============================${rest}"
410 | echo -en "${green}Do you want to delete the Domain Certificates? (yes/no): ${rest}"
411 | read -r delete_cert
412 |
413 | if [[ "$delete_cert" == "yes" ]]; then
414 | echo -e "${YELLOW}============================${rest}"
415 | echo -en "${green}Enter Your domain: ${rest}"
416 | read -r domain
417 |
418 | rm -rf ~/.acme.sh/"${domain}"_ecc
419 | rm -rf ~/Waterwall/cert
420 | echo -e "${green}Certificate for ${domain} has been deleted.${rest}"
421 | fi
422 | fi
423 |
424 | rm -rf ~/Waterwall/{core.json,config.json,Waterwall,log/}
425 | systemctl stop Waterwall.service >/dev/null 2>&1
426 | systemctl disable Waterwall.service >/dev/null 2>&1
427 | rm -rf /etc/systemd/system/Waterwall.service >/dev/null 2>&1
428 | echo -e "${YELLOW}============================${rest}"
429 | echo -e "${green}Waterwall has been uninstalled successfully.${rest}"
430 | echo -e "${YELLOW}============================${rest}"
431 | else
432 | echo -e "${YELLOW}============================${rest}"
433 | echo -e "${red}Waterwall is not installed.${rest}"
434 | echo -e "${YELLOW}============================${rest}"
435 | fi
436 | }
437 |
438 | # Create Service
439 | waterwall_service() {
440 | create_core_json
441 | # Create a new service
442 | cat </etc/systemd/system/Waterwall.service
443 | [Unit]
444 | Description=Waterwall Tunnel Service
445 | After=network.target
446 |
447 | [Service]
448 | Type=simple
449 | User=root
450 | WorkingDirectory=/root/Waterwall
451 | ExecStart=/root/Waterwall/Waterwall
452 | Restart=always
453 |
454 | [Install]
455 | WantedBy=multi-user.target
456 | EOL
457 |
458 | # Reload systemctl daemon and start the service
459 | sudo systemctl daemon-reload
460 | sudo systemctl restart Waterwall.service >/dev/null 2>&1
461 | check_waterwall_status
462 | }
463 | #===================================
464 |
465 | # Trojan Service
466 | trojan_service() {
467 | create_trojan_core_json
468 | # Create Trojan service
469 | cat </etc/systemd/system/trojan.service
470 | [Unit]
471 | Description=Waterwall Trojan Service
472 | After=network.target
473 |
474 | [Service]
475 | Type=simple
476 | User=root
477 | WorkingDirectory=/root/Waterwall/trojan
478 | ExecStart=/root/Waterwall/Waterwall
479 | Restart=always
480 |
481 | [Install]
482 | WantedBy=multi-user.target
483 | EOL
484 |
485 | # Reload systemctl daemon and start the service
486 | sudo systemctl daemon-reload
487 | sudo systemctl restart trojan.service >/dev/null 2>&1
488 | }
489 |
490 | # Check Install service
491 | check_install_service() {
492 | if [ -f /etc/systemd/system/Waterwall.service ]; then
493 | echo -e "${YELLOW}===================================${rest}"
494 | echo -e "${red}Please uninstall the existing Waterwall service before continuing.${rest}"
495 | echo -e "${YELLOW}===================================${rest}"
496 | exit 1
497 | fi
498 | }
499 |
500 |
501 |
502 | # Check Waterwall status
503 | check_waterwall_status() {
504 | sleep 1
505 | # Check the status of the tunnel service
506 | if sudo systemctl is-active --quiet Waterwall.service; then
507 | echo -e "${YELLOW}Waterwall Installed successfully${rest}"
508 | echo -e "${YELLOW}============================================${rest}"
509 | else
510 | echo -e "${yellow}Waterwall is not installed${rest}"
511 | echo -e "${YELLOW}==============================================${rest}"
512 | fi
513 | }
514 |
515 | # Main Menu
516 |
517 | main() {
518 | clear
519 |
520 | echo "
521 | ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄
522 | ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░▌ ▐░▌
523 | ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌░▌ ▐░▌
524 | ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌
525 | ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▐░▌
526 | ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌
527 | ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀ ▐░▌ ▐░▌ ▐░▌
528 | ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌
529 | ▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▐░▌
530 | ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░░▌
531 | ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀ ▀▀ "
532 |
533 | echo ""
534 | check_tunnel_status
535 | echo ""
536 | echo ""
537 |
538 | echo -e "${YELLOW}1. Bgp4 Tunnel${rest}"
539 | echo -e "${YELLOW}2. Uninstall Waterwall${rest}"
540 | echo -e "${White}0. Exit${rest}"
541 | echo -en "${Purple}Enter your choice: ${rest}"
542 | read -r choice
543 |
544 | case $choice in
545 | 1)
546 | check_install_service
547 | bgp4
548 | ;;
549 | 2)
550 | uninstall_waterwall
551 | ;;
552 | 0)
553 | echo -e "${YELLOW}Exit..${rest}"
554 | exit
555 | ;;
556 | *)
557 | echo -e "${Purple}Invalid choice!${rest}"
558 | ;;
559 | esac
560 | }
561 | main
562 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
WaterWall Tunnel
8 | تانل واتر وال
9 |
10 |
11 | ## پیش نیاز
12 |
13 | اوبنتو 20 و بالاتر
14 |
15 | ------------------------
16 |
17 |
18 |
ویدیوهای آموزشی
19 | ------------------------------------
20 |
21 | - **ویدیوی آموزشی توسط 69**
22 |
27 |
28 |
29 |
30 | ---------------------------------
31 | ## نصب
32 |
33 | - اسکریپت روی هر دو سرور اجرا شود (خارج و ایران )
34 |
35 |
36 |
37 | ### mux (http2 , mux , grpc)
38 |
39 |
40 | ```
41 | bash <(curl https://raw.githubusercontent.com/ahmteam/waterwall/main/mux.sh)
42 |
43 |
44 | ```
45 | ------------------------------------
46 |
47 |
48 |
ویدیوهای آموزشی
49 | ------------------------------------
50 |
51 | - **ویدیوی آموزشی توسط 69**
52 |
57 |
58 |
59 |
60 | ### Bgp4 (multiport)
61 |
62 | ```
63 | bash <(curl https://raw.githubusercontent.com/69learn/waterwall/main/Bgp4.sh)
64 |
65 | ```
66 |
67 |
68 | ### direct reaality(multiport)
69 |
70 | ```
71 | bash <(curl https://raw.githubusercontent.com/69learn/waterwall/main/direct.sh)
72 |
73 | ```
74 | ---
75 |
76 | [لینک اصلی پروژه](https://github.com/radkesvat/WaterWall)
77 | ---
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | # تلگرام
92 |
93 | [@sixtininelearn](https://t.me/sixtininelearn)
94 |
95 | [@sixti9learn](https://t.me/sixti9learn)
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/direct.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | Purple='\033[0;35m'
5 | YELLOW='\033[0;33m'
6 | White='\033[0;96m'
7 | RED='\033[0;31m'
8 | BLUE='\033[0;34m'
9 | MAGENTA='\033[0;35m'
10 | NC='\033[0m' # No Color
11 |
12 | clear
13 | echo "
14 | ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄
15 | ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░▌ ▐░▌
16 | ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌░▌ ▐░▌
17 | ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌
18 | ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▐░▌
19 | ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌
20 | ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀ ▐░▌ ▐░▌ ▐░▌
21 | ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌
22 | ▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▐░▌
23 | ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░░▌
24 | ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀ ▀▀ "
25 |
26 | # Determine the architecture and set the ASSET_NAME accordingly
27 | ARCH=$(uname -m)
28 | if [ "$ARCH" == "aarch64" ]; then
29 | ASSET_NAME="Waterwall-linux-arm64.zip"
30 | elif [ "$ARCH" == "x86_64" ]; then
31 | ASSET_NAME="Waterwall-linux-64.zip"
32 | else
33 | echo "Unsupported architecture: $ARCH"
34 | exit 1
35 | fi
36 |
37 | # Function to download and unzip the release
38 | download_and_unzip() {
39 | local url="$1"
40 | local dest="$2"
41 |
42 | echo "Downloading $dest from $url..."
43 | wget -q -O "$dest" "$url"
44 | if [ $? -ne 0 ]; then
45 | echo "Error: Unable to download file."
46 | return 1
47 | fi
48 |
49 | echo "Unzipping $dest..."
50 | unzip -o "$dest"
51 | if [ $? -ne 0 ]; then
52 | echo "Error: Unable to unzip file."
53 | return 1
54 | fi
55 |
56 | sleep 0.5
57 | chmod +x Waterwall
58 | rm "$dest"
59 |
60 | echo "Download and unzip completed successfully."
61 | }
62 |
63 | # Function to get download URL for the latest release
64 | get_latest_release_url() {
65 | local api_url="https://api.github.com/repos/radkesvat/WaterWall/releases/latest"
66 |
67 | echo "Fetching latest release data..." >&2
68 | local response=$(curl -s "$api_url")
69 | if [ $? -ne 0 ]; then
70 | echo "Error: Unable to fetch release data." >&2
71 | return 1
72 | fi
73 |
74 | local asset_url=$(echo "$response" | jq -r ".assets[] | select(.name == \"$ASSET_NAME\") | .browser_download_url")
75 | if [ -z "$asset_url" ]; then
76 | echo "Error: Asset not found." >&2
77 | return 1
78 | fi
79 |
80 | echo "$asset_url"
81 | }
82 |
83 | # Function to get download URL for a specific release version
84 | get_specific_release_url() {
85 | local version=$1
86 | local api_url="https://api.github.com/repos/radkesvat/WaterWall/releases/tags/$version"
87 |
88 | echo "Fetching release data for version $version..." >&2
89 | response=$(curl -s $api_url)
90 | if [ $? -ne 0 ]; then
91 | echo "Error: Unable to fetch release data for version $version." >&2
92 | exit 1
93 | fi
94 |
95 | local asset_url=$(echo $response | jq -r ".assets[] | select(.name == \"$ASSET_NAME\") | .browser_download_url")
96 | if [ -z "$asset_url" ]; then
97 | echo "Error: Asset not found for version $version." >&2
98 | exit 1
99 | fi
100 |
101 | echo $asset_url
102 | }
103 |
104 | setup_waterwall_service() {
105 | cat > /etc/systemd/system/waterwall.service << EOF
106 | [Unit]
107 | Description=Waterwall Service
108 | After=network.target
109 |
110 | [Service]
111 | ExecStart=/root/RRT/Waterwall
112 | WorkingDirectory=/root/RRT
113 | Restart=always
114 | RestartSec=5
115 | User=root
116 | StandardOutput=null
117 | StandardError=null
118 |
119 | [Install]
120 | WantedBy=multi-user.target
121 | EOF
122 | systemctl daemon-reload
123 | systemctl enable waterwall
124 | systemctl start waterwall
125 | }
126 |
127 | while true; do
128 | echo -e "${Purple}Select an option:${NC}"
129 | echo -e "${White}1. IRAN ${NC}"
130 | echo -e "${YELLOW}2. KHAREJ ${NC}"
131 | echo -e "${White}3. Uninstall${NC}"
132 | echo -e "${YELLOW}0. Exit ${NC}"
133 |
134 | read -p "Enter your choice: " choice
135 | if [[ "$choice" -eq 1 || "$choice" -eq 2 ]]; then
136 | SSHD_CONFIG_FILE="/etc/ssh/sshd_config"
137 | CURRENT_PORT=$(grep -E '^(#Port |Port )' "$SSHD_CONFIG_FILE")
138 |
139 | if [[ "$CURRENT_PORT" != "Port 22" && "$CURRENT_PORT" != "#Port 22" ]]; then
140 | sudo sed -i -E 's/^(#Port |Port )[0-9]+/Port 22/' "$SSHD_CONFIG_FILE"
141 | echo "SSH Port has been updated to Port 22."
142 | sudo systemctl restart sshd
143 | sudo service ssh restart
144 | fi
145 | sleep 0.5
146 | mkdir /root/RRT
147 | cd /root/RRT
148 | apt install unzip -y
149 | apt install jq -y
150 |
151 | read -p "Do you want to install the latest version? (y/n): " answer
152 | if [[ "$answer" == [Yy]* ]]; then
153 | # Get the latest release URL
154 | url=$(get_latest_release_url)
155 |
156 | if [ $? -ne 0 ] || [ -z "$url" ]; then
157 | echo "Failed to retrieve the latest release URL."
158 | exit 1
159 | fi
160 | echo "Latest Release URL: $url"
161 | download_and_unzip "$url" "$ASSET_NAME"
162 | if [ $? -ne 0 ]; then
163 | echo "Failed to download or unzip the file."
164 | exit 1
165 | fi
166 | elif [[ "$answer" == [Nn]* ]]; then
167 | read -p "Enter the version you want to install (e.g., v1.18): " version
168 | # Get the specific release URL
169 | url=$(get_specific_release_url "$version")
170 |
171 | if [ $? -ne 0 ] || [ -z "$url" ]; then
172 | echo "Failed to retrieve the latest release URL."
173 | exit 1
174 | fi
175 | echo "Specific Version URL: $url"
176 | download_and_unzip "$url" "$ASSET_NAME"
177 | else
178 | echo "Please answer yes (y) or no (n)."
179 | break
180 | fi
181 |
182 | cat > core.json << EOF
183 | {
184 | "log": {
185 | "path": "log/",
186 | "core": {
187 | "loglevel": "DEBUG",
188 | "file": "core.log",
189 | "console": true
190 | },
191 | "network": {
192 | "loglevel": "DEBUG",
193 | "file": "network.log",
194 | "console": true
195 | },
196 | "dns": {
197 | "loglevel": "SILENT",
198 | "file": "dns.log",
199 | "console": false
200 | }
201 | },
202 | "dns": {},
203 | "misc": {
204 | "workers": 0,
205 | "ram-profile": "server",
206 | "libs-path": "libs/"
207 | },
208 | "configs": [
209 | "config.json"
210 | ]
211 | }
212 | EOF
213 | fi
214 |
215 | if [ "$choice" -eq 1 ]; then
216 | public_ip=$(wget -qO- https://api.ipify.org)
217 | echo -e "${YELLOW}You chose Iran.${NC}"
218 | read -p "enter Kharej Ipv4: " ip_remote
219 | read -p "Enter the SNI (default: discord.com): " input_sni
220 | HOSTNAME=${input_sni:-discord.com}
221 | cat > config.json << EOF
222 | {
223 | "name": "reality_client_multiport",
224 | "nodes": [
225 | {
226 | "name": "users_inbound",
227 | "type": "TcpListener",
228 | "settings": {
229 | "address": "0.0.0.0",
230 | "port": [443,65535],
231 | "nodelay": true
232 | },
233 | "next": "header"
234 | },
235 | {
236 | "name": "header",
237 | "type": "HeaderClient",
238 | "settings": {
239 | "data": "src_context->port"
240 | },
241 | "next": "my_reality_client"
242 | },
243 | {
244 | "name": "my_reality_client",
245 | "type": "RealityClient",
246 | "settings": {
247 | "sni":"$HOSTNAME",
248 | "password":"2200AHS490"
249 | },
250 | "next": "outbound_to_kharej"
251 | },
252 | {
253 | "name": "outbound_to_kharej",
254 | "type": "TcpConnector",
255 | "settings": {
256 | "nodelay": true,
257 | "address":"$ip_remote",
258 | "port":443
259 | }
260 | }
261 | ]
262 | }
263 | EOF
264 | sleep 0.5
265 | setup_waterwall_service
266 | sleep 0.5
267 | echo -e "${YELLOW}Iran IPv4 is: $public_ip${NC}"
268 | echo -e "${Purple}Kharej IPv4 is: $ip_remote${NC}"
269 | echo -e "${YELLOW}SNI $HOSTNAME${NC}"
270 | echo -e "${Purple}Iran Setup Successfully Created ${NC}"
271 | read -p "Press Enter to continue"
272 | elif [ "$choice" -eq 2 ]; then
273 | public_ip=$(wget -qO- https://api.ipify.org)
274 | echo -e "${Purple}You chose Kharej.${NC}"
275 | read -p "enter Iran Ip: " ip_remote
276 | read -p "Enter the SNI (default: discord.com): " input_sni
277 | HOSTNAME=${input_sni:-discord.com}
278 | cat > config.json << EOF
279 | {
280 | "name": "reality_server_multiport",
281 | "nodes": [
282 | {
283 | "name": "main_inbound",
284 | "type": "TcpListener",
285 | "settings": {
286 | "address": "0.0.0.0",
287 | "port": 443,
288 | "nodelay": true
289 | },
290 | "next": "my_reality_server"
291 | },
292 | {
293 | "name": "my_reality_server",
294 | "type": "RealityServer",
295 | "settings": {
296 | "destination":"reality_dest_node",
297 | "password":"2200AHS490"
298 | },
299 | "next": "header_server"
300 | },
301 | {
302 | "name": "header_server",
303 | "type": "HeaderServer",
304 | "settings": {
305 | "override": "dest_context->port"
306 | },
307 | "next": "final_outbound"
308 | },
309 | {
310 | "name": "final_outbound",
311 | "type": "TcpConnector",
312 | "settings": {
313 | "nodelay": true,
314 | "address":"127.0.0.1",
315 | "port":"dest_context->port"
316 | }
317 | },
318 | {
319 | "name": "reality_dest_node",
320 | "type": "TcpConnector",
321 | "settings": {
322 | "nodelay": true,
323 | "address":"$HOSTNAME",
324 | "port":443
325 | }
326 | }
327 | ]
328 | }
329 | EOF
330 | sleep 0.5
331 | setup_waterwall_service
332 | sleep 0.5
333 | echo -e "${Purple}Kharej IPv4 is: $public_ip${NC}"
334 | echo -e "${YELLOW}Iran IPv4 is: $ip_remote${NC}"
335 | echo -e "${Purple}SNI $HOSTNAME${NC}"
336 | echo -e "${YELLOW}Kharej Setup Successfully Created ${NC}"
337 | read -p "Press Enter to continue"
338 | elif [ "$choice" -eq 3 ]; then
339 | sudo systemctl stop waterwall
340 | sudo systemctl disable waterwall
341 | rm -rf /etc/systemd/system/waterwall.service
342 | pkill -f Waterwall
343 | rm -rf /root/RRT
344 | echo "Removed"
345 | read -p "Press Enter to continue"
346 | elif [ "$choice" -eq 0 ]; then
347 | echo "Exit.."
348 | break
349 | else
350 | echo "Invalid choice. Please try again."
351 | fi
352 | done
353 |
--------------------------------------------------------------------------------
/src/Thumbs.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/69learn/waterwall/43fccbbf16931b426e7f25494e8269cada76b4a0/src/Thumbs.db
--------------------------------------------------------------------------------
/src/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/69learn/waterwall/43fccbbf16931b426e7f25494e8269cada76b4a0/src/logo.jpg
--------------------------------------------------------------------------------
/src/t.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/69learn/waterwall/43fccbbf16931b426e7f25494e8269cada76b4a0/src/t.png
--------------------------------------------------------------------------------