From 8362bf6410e26173cda64747552e679032e85de9 Mon Sep 17 00:00:00 2001 From: mcfly722 <7221798@gmail.com> Date: Sun, 15 Sep 2024 00:27:27 +0300 Subject: [PATCH] bash scripts formed --- cloak-wg-helper/config.js | 116 ++++++++++++++++++------------------- cloak-wg-helper/index.html | Bin 20536 -> 21362 bytes 2 files changed, 55 insertions(+), 61 deletions(-) diff --git a/cloak-wg-helper/config.js b/cloak-wg-helper/config.js index a4ec23b..c0ee6af 100644 --- a/cloak-wg-helper/config.js +++ b/cloak-wg-helper/config.js @@ -113,18 +113,15 @@ function regenerateCloak(){ function update(){ let client = ` -

1. Local Gateway

- -

1.1 Install Cloak Client binary

-
curl -L https://github.com/cbeuw/Cloak/releases/download/v2.7.0/ck-client-:clientOS-:clientArch-v2.7.0 > ck-client
+
# ------------------ 1.1 Install Cloak Client binary ---------------------
+curl -L https://github.com/cbeuw/Cloak/releases/download/v2.7.0/ck-client-:clientOS-:clientArch-v2.7.0 > ck-client
 chmod +x ck-client
-  
 sudo mv ck-client /usr/bin/ck-client
-sudo mkdir -p /etc/config/cloak
- -

1.2 Create Cloak client config

-
sudo mkdir -p /etc/cloak
- 
+sudo mkdir -p /etc/config/cloak
+
+
+# ------------------ 1.2 Create Cloak client config ----------------------
+sudo mkdir -p /etc/cloak
 sudo tee /etc/cloak/cloak-client.json << EOF
 {
     "Transport": "direct",
@@ -138,10 +135,11 @@ sudo tee /etc/cloak/cloak-client.json << EOF
     "BrowserSig": "chrome",
     "StreamTimeout": 300
 }
-EOF
- -

1.3 Register Cloak Client as service

-
sudo tee /lib/systemd/system/cloak-client.service << EOF
+EOF
+
+
+# --------------- 1.3 Register Cloak Client as service -------------------
+sudo tee /lib/systemd/system/cloak-client.service << EOF
 [Unit]
 Description=Cloak Client Service
 After=network-online.target
@@ -157,28 +155,27 @@ User=root
 [Install]
 WantedBy=multi-user.target
 EOF
-
- -

1.4 Start Cloak Client service

-
sudo systemctl daemon-reload
+
+
+# ------------------ 1.4 Start Cloak Client service ----------------------
+sudo systemctl daemon-reload
 sudo systemctl enable cloak-client.service
 sudo systemctl restart cloak-client.service
 sudo systemctl status cloak-client.service
-
- -

1.5 Install Wireguard Client

-
sudo apt install -y wireguard openresolv iptables
+ + +# ------------------ 1.5 Install Wireguard Client ------------------------ +sudo apt install -y wireguard openresolv iptables -

1.6 Create Wireguard Client config

-
sudo tee /etc/wireguard/client-wg0.conf << EOF
+
+# --------------- 1.6 Create Wireguard Client config ---------------------
+sudo tee /etc/wireguard/client-wg0.conf << EOF
 [Interface]
 PrivateKey = :wireguardClientPrivate
 Address = 10.1.1.2/32
 MTU = :wireguardMTU
-  
 PostUp = iptables -t nat -A POSTROUTING -o wg0 -j MASQUERADE
 PostUp = ip route add :cloakServer/32 via :cloakGateway
-  
 PostDown = iptables -t nat -D POSTROUTING -o wg0 -j MASQUERADE
 PostDown = ip route del :cloakServer/32 via :cloakGateway
   
@@ -187,31 +184,31 @@ PublicKey = :wireguardServerPublic
 Endpoint = :cloakClient:1984
 AllowedIPs = 0.0.0.0/0
 EOF
-
- -

1.7 Start Wireguard Client service

-
sudo systemctl enable wg-quick@wg0.service
+
+
+# --------------- 1.7 Start Wireguard Client service ---------------------
+sudo systemctl enable wg-quick@wg0.service
 sudo systemctl restart wg-quick@wg0.service
-sudo systemctl status wg-quick@wg0.service
+sudo systemctl status wg-quick@wg0.service + -

1.8 Enable IPv4 Gateway Forwarding

-
echo "net.ipv4.ip_forward=1"          | sudo tee -a /etc/sysctl.conf
+# --------------- 1.8 Enable IPv4 Gateway Forwarding ---------------------
+echo "net.ipv4.ip_forward=1"          | sudo tee -a /etc/sysctl.conf
 echo "net.ipv4.conf.all.forwarding=1" | sudo tee -a /etc/sysctl.conf
 sudo sysctl -p
` let server = ` -

2. Outgoing VM

- -

2.1 Install Cloak Server binary

-
wget https://github.com/cbeuw/Cloak/releases/download/v2.7.0/ck-server-:serverOS-:serverArch-v2.7.0 -O ck-server
-  
+

+# ----------------- 2.1 Install Cloak Server binary ----------------------
+wget https://github.com/cbeuw/Cloak/releases/download/v2.7.0/ck-server-:serverOS-:serverArch-v2.7.0 -O ck-server
 chmod +x ck-server
-sudo mv ck-server /usr/bin/ck-server
- -

2.2 Create Cloak Server config

-
sudo mkdir -p /etc/cloak
+sudo mv ck-server /usr/bin/ck-server
+
+
+# ----------------- 2.2 Create Cloak Server config -----------------------
+sudo mkdir -p /etc/cloak
 sudo tee /etc/cloak/cloak-server.json << EOF
 {
     "ProxyBook": {
@@ -230,11 +227,9 @@ sudo tee /etc/cloak/cloak-server.json << EOF
     "PrivateKey": ":cloakServerPrivate"
 }
 EOF    
-
- -

2.3 Register Cloak Server service

-
sudo tee /etc/systemd/system/cloak-server.service << EOF
+# ---------------- 2.3 Register Cloak Server service ---------------------
+sudo tee /etc/systemd/system/cloak-server.service << EOF
 [Unit]
 Description=cloak-server
 After=network.target
@@ -248,27 +243,26 @@ Restart=always
 [Install]
 WantedBy=multi-user.target
 EOF
-
-

2.4 Start Cloak Server service

-
sudo systemctl daemon-reload
+# ----------------- 2.4 Start Cloak Server service -----------------------
+sudo systemctl daemon-reload
 sudo systemctl enable cloak-server.service
 sudo systemctl restart cloak-server.service
-sudo systemctl status cloak-server.service
+sudo systemctl status cloak-server.service -

2.5 Allow incomming HTTPS connections on Cloak Server service

-
sudo ufw allow 443
+# ---- 2.5 Allow incomming HTTPS connections on Cloak Server service ----- +sudo ufw allow 443 -

2.6 Install Wireguard Server service

-
sudo apt install -y wireguard openresolv iptables
+# --------------- 2.6 Install Wireguard Server service ------------------- +sudo apt install -y wireguard openresolv iptables -

2.7 Create Wireguard Server config

-
export default_interface=$(ip route | awk '/default/ {print $5; exit}')
-  
+# ---------------- 2.7 Create Wireguard Server config --------------------
+export default_interface=$(ip route | awk '/default/ {print $5; exit}')
+
 sudo tee /etc/wireguard/wg0.conf << EOF
 [Interface]
 PrivateKey = :wireguardServerPrivate
@@ -287,10 +281,10 @@ PostDown = iptables -t nat -D POSTROUTING -o $default_interface -j MASQUERADE
 PublicKey = :wireguardClientPublic
 AllowedIPs = 10.1.1.2/32
 EOF
-
- -

2.7 Start Wireguard Server service

-
sudo systemctl enable wg-quick@wg0.service
+
+
+# ---------------- 2.7 Start Wireguard Server service --------------------
+sudo systemctl enable wg-quick@wg0.service
 sudo systemctl restart wg-quick@wg0.service
 sudo systemctl status wg-quick@wg0.service
 sudo wg
diff --git a/cloak-wg-helper/index.html b/cloak-wg-helper/index.html index ac2202bf011153ce55da5655e7213e61536174ee..b8e26ad05a71e77342cc80fae2ede00a344e62e5 100644 GIT binary patch delta 222 zcmdn7fbr8Z#tm_d%-ReJll|pHC)Y6Un!L-qY%&M)B2fi~WQKf(9EM_s0)|9}JO*0^ zB?hC(g^JFT{k&Dw4H@(p6c~JfDw2V+IY72MkS<|JWhe*Il?*lv`V1KiMw6MOfP-gq77LRKesdL#fadx$lmbmk2b!G;v^O1Sb{K;%iiw-^G+2~5lYllA18q^5 XT<9&$T?}+d5l}|~L&@gp-V0d(w$wCa delta 112 zcmeygjB&>T#tm_d?BxuZ3?&R1lj9jLPF}#QB3;0c$WR2txeTd5@l+tYn8AiYpCN<6 zXfm&b^yGp7iOF3436qyGEt)(>d&}ex!Yq^hxHvXnVP#U;JV%>NdGZ=RDeh#3e1<%R OG@#k(n=kq;WB~wuwIWRb