From 4a39f8ad688498da43446cd4c3a42d0ae85166f0 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:09:16 +0500 Subject: [PATCH 01/13] Change ComssDNS --- https-dns-proxy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/https-dns-proxy b/https-dns-proxy index 23f80a7..93e4e7c 100644 --- a/https-dns-proxy +++ b/https-dns-proxy @@ -27,8 +27,8 @@ config https-dns-proxy option listen_port '5055' config https-dns-proxy - option resolver_url 'https://dns.comss.one/dns-query' - option bootstrap_dns '83.220.169.155, 212.109.195.93' + option resolver_url 'https://router.comss.one/dns-query' + option bootstrap_dns '195.133.25.16, 212.109.195.93' option listen_addr '127.0.0.1' option listen_port '5056' From 003026b0137181fe70524f1296af3b43229004b1 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:17:59 +0500 Subject: [PATCH 02/13] Fix ComssDNS --- https-dns-proxy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/https-dns-proxy b/https-dns-proxy index 93e4e7c..f546eaa 100644 --- a/https-dns-proxy +++ b/https-dns-proxy @@ -28,7 +28,7 @@ config https-dns-proxy config https-dns-proxy option resolver_url 'https://router.comss.one/dns-query' - option bootstrap_dns '195.133.25.16, 212.109.195.93' + option bootstrap_dns '195.133.25.16,212.109.195.93' option listen_addr '127.0.0.1' option listen_port '5056' From 64720b811a8baa7e906df54fd74aac23511262c5 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:36:57 +0500 Subject: [PATCH 03/13] Add block QUIC and add new AI domain --- configure_zaprets.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/configure_zaprets.sh b/configure_zaprets.sh index 570706c..772bbd3 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -59,6 +59,8 @@ uci add_list dhcp.cfg01411c.server='/*.clashroyale.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.brawlstars.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.clash.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.clashofclans.com/127.0.0.1#5056' +uci add_list dhcp.cfg01411c.server='/*.x.ai/127.0.0.1#5056' +uci add_list dhcp.cfg01411c.server='/*.grok.com /127.0.0.1#5056' uci add dhcp domain # =cfg13f37d uci set dhcp.@domain[-1].name='chatgpt.com' uci set dhcp.@domain[-1].ip='94.131.119.85' @@ -67,6 +69,24 @@ uci set dhcp.@domain[-1].name='openai.com' uci set dhcp.@domain[-1].ip='94.131.119.85' uci commit dhcp +echo "Add block QUIC..." + +uci add firewall rule # =cfg2492bd +uci set firewall.@rule[-1].name='Block_UDP_80' +uci add_list firewall.@rule[-1].proto='udp' +uci set firewall.@rule[-1].src='lan' +uci set firewall.@rule[-1].dest='wan' +uci set firewall.@rule[-1].dest_port='80' +uci set firewall.@rule[-1].target='REJECT' +uci add firewall rule # =cfg2592bd +uci set firewall.@rule[-1].name='Block_UDP_443' +uci add_list firewall.@rule[-1].proto='udp' +uci set firewall.@rule[-1].src='lan' +uci set firewall.@rule[-1].dest='wan' +uci set firewall.@rule[-1].dest_port='443' +uci set firewall.@rule[-1].target='REJECT' +uci commit firewall + echo "Crod task add restart service yotubeUnblock..." cronTask="0 4 * * * service youtubeUnblock restart" From 6fde98ea2682ec3d8d1255f1446d8cc95ed7bed8 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:53:08 +0500 Subject: [PATCH 04/13] Fix forward domain Grok --- configure_zaprets.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure_zaprets.sh b/configure_zaprets.sh index 772bbd3..cdb01bc 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -60,7 +60,7 @@ uci add_list dhcp.cfg01411c.server='/*.brawlstars.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.clash.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.clashofclans.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.x.ai/127.0.0.1#5056' -uci add_list dhcp.cfg01411c.server='/*.grok.com /127.0.0.1#5056' +uci add_list dhcp.cfg01411c.server='/*.grok.com/127.0.0.1#5056' uci add dhcp domain # =cfg13f37d uci set dhcp.@domain[-1].name='chatgpt.com' uci set dhcp.@domain[-1].ip='94.131.119.85' From 4de28f6b47d5995e8a377a3faec91cdd781f7ba6 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 11:41:07 +0500 Subject: [PATCH 05/13] Fix restart script --- configure_zaprets.sh | 71 ++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/configure_zaprets.sh b/configure_zaprets.sh index cdb01bc..8afce9f 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -13,18 +13,16 @@ opkg update opkg upgrade youtubeUnblock opkg upgrade luci-app-youtubeUnblock -echo "Backup files..." - if [ ! -d "$DIR_BACKUP" ] then + echo "Backup files..." mkdir $DIR_BACKUP + for file in $config_files + do + cp -f "$DIR/$file" "$DIR_BACKUP/$file" + done fi -for file in $config_files -do - cp -f "$DIR/$file" "$DIR_BACKUP/$file" -done - echo "Replace configs..." for file in $config_files @@ -61,31 +59,46 @@ uci add_list dhcp.cfg01411c.server='/*.clash.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.clashofclans.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.x.ai/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.grok.com/127.0.0.1#5056' -uci add dhcp domain # =cfg13f37d -uci set dhcp.@domain[-1].name='chatgpt.com' -uci set dhcp.@domain[-1].ip='94.131.119.85' -uci add dhcp domain # =cfg14f37d -uci set dhcp.@domain[-1].name='openai.com' -uci set dhcp.@domain[-1].ip='94.131.119.85' uci commit dhcp -echo "Add block QUIC..." +nameRule="option name 'chatgpt.com'" +str=$(grep -i "$nameRule" /etc/config/dhcp) +if [ -z "$str" ] +then + echo "Add unblock ChatGPT..." -uci add firewall rule # =cfg2492bd -uci set firewall.@rule[-1].name='Block_UDP_80' -uci add_list firewall.@rule[-1].proto='udp' -uci set firewall.@rule[-1].src='lan' -uci set firewall.@rule[-1].dest='wan' -uci set firewall.@rule[-1].dest_port='80' -uci set firewall.@rule[-1].target='REJECT' -uci add firewall rule # =cfg2592bd -uci set firewall.@rule[-1].name='Block_UDP_443' -uci add_list firewall.@rule[-1].proto='udp' -uci set firewall.@rule[-1].src='lan' -uci set firewall.@rule[-1].dest='wan' -uci set firewall.@rule[-1].dest_port='443' -uci set firewall.@rule[-1].target='REJECT' -uci commit firewall + uci add dhcp domain # =cfg13f37d + uci set dhcp.@domain[-1].name='chatgpt.com' + uci set dhcp.@domain[-1].ip='94.131.119.85' + uci add dhcp domain # =cfg14f37d + uci set dhcp.@domain[-1].name='openai.com' + uci set dhcp.@domain[-1].ip='94.131.119.85' + uci commit dhcp +fi + +nameRule="option name 'Block_UDP_443'" +str=$(grep -i "$nameRule" /etc/config/firewall) +if [ -z "$str" ] +then + echo "Add block QUIC..." + + uci add firewall rule # =cfg2492bd + uci set firewall.@rule[-1].name='Block_UDP_80' + uci add_list firewall.@rule[-1].proto='udp' + uci set firewall.@rule[-1].src='lan' + uci set firewall.@rule[-1].dest='wan' + uci set firewall.@rule[-1].dest_port='80' + uci set firewall.@rule[-1].target='REJECT' + uci add firewall rule # =cfg2592bd + uci set firewall.@rule[-1].name='Block_UDP_443' + uci add_list firewall.@rule[-1].proto='udp' + uci set firewall.@rule[-1].src='lan' + uci set firewall.@rule[-1].dest='wan' + uci set firewall.@rule[-1].dest_port='443' + uci set firewall.@rule[-1].target='REJECT' + uci commit firewall + service firewall restart +fi echo "Crod task add restart service yotubeUnblock..." From 1eea4ffb8f6b70326349a298772f5628c04941f8 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 16:38:45 +0500 Subject: [PATCH 06/13] Add voice domain ChatGPT --- configure_zaprets.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure_zaprets.sh b/configure_zaprets.sh index 8afce9f..d95fbc4 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -73,6 +73,12 @@ then uci add dhcp domain # =cfg14f37d uci set dhcp.@domain[-1].name='openai.com' uci set dhcp.@domain[-1].ip='94.131.119.85' + uci add dhcp domain # =cfg15f37d + uci set dhcp.@domain[-1].name='webrtc.chatgpt.com' + uci set dhcp.@domain[-1].ip='94.131.119.85' + uci add dhcp domain # =cfg16f37d + uci set dhcp.@domain[-1].name='ios.chat.openai.com' + uci set dhcp.@domain[-1].ip='94.131.119.85' uci commit dhcp fi From 662c205d2dcf22257ebc3f832e20f3d78471d31e Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 16:39:54 +0500 Subject: [PATCH 07/13] Add search domain ChatGPT --- configure_zaprets.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure_zaprets.sh b/configure_zaprets.sh index d95fbc4..98e7861 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -79,6 +79,9 @@ then uci add dhcp domain # =cfg16f37d uci set dhcp.@domain[-1].name='ios.chat.openai.com' uci set dhcp.@domain[-1].ip='94.131.119.85' + uci add dhcp domain # =cfg17f37d + uci set dhcp.@domain[-1].name='searchgpt.com' + uci set dhcp.@domain[-1].ip='94.131.119.85' uci commit dhcp fi From 4826315f096d218e818e30e89f64c56806f861bb Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 17:12:14 +0500 Subject: [PATCH 08/13] Refactoring the system for adding permanent domains --- configure_zaprets.sh | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/configure_zaprets.sh b/configure_zaprets.sh index 98e7861..82c10f9 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -7,6 +7,20 @@ config_files="dhcp youtubeUnblock https-dns-proxy" +checkAndAddDomainPermanentName() +{ + nameRule="option name '$1'" + str=$(grep -i "$nameRule" /etc/config/dhcp) + if [ -z "$str" ] + then + + uci add dhcp domain + uci set dhcp.@domain[-1].name="$1" + uci set dhcp.@domain[-1].ip="$2" + uci commit dhcp + fi +} + echo "Upgrade packages..." opkg update @@ -61,29 +75,13 @@ uci add_list dhcp.cfg01411c.server='/*.x.ai/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.grok.com/127.0.0.1#5056' uci commit dhcp -nameRule="option name 'chatgpt.com'" -str=$(grep -i "$nameRule" /etc/config/dhcp) -if [ -z "$str" ] -then - echo "Add unblock ChatGPT..." +echo "Add unblock ChatGPT..." - uci add dhcp domain # =cfg13f37d - uci set dhcp.@domain[-1].name='chatgpt.com' - uci set dhcp.@domain[-1].ip='94.131.119.85' - uci add dhcp domain # =cfg14f37d - uci set dhcp.@domain[-1].name='openai.com' - uci set dhcp.@domain[-1].ip='94.131.119.85' - uci add dhcp domain # =cfg15f37d - uci set dhcp.@domain[-1].name='webrtc.chatgpt.com' - uci set dhcp.@domain[-1].ip='94.131.119.85' - uci add dhcp domain # =cfg16f37d - uci set dhcp.@domain[-1].name='ios.chat.openai.com' - uci set dhcp.@domain[-1].ip='94.131.119.85' - uci add dhcp domain # =cfg17f37d - uci set dhcp.@domain[-1].name='searchgpt.com' - uci set dhcp.@domain[-1].ip='94.131.119.85' - uci commit dhcp -fi +checkAndAddDomainPermanentName "chatgpt.com" "94.131.119.85" +checkAndAddDomainPermanentName "openai.com" "94.131.119.85" +checkAndAddDomainPermanentName "webrtc.chatgpt.com" "94.131.119.85" +checkAndAddDomainPermanentName "ios.chat.openai.com" "94.131.119.85" +checkAndAddDomainPermanentName "searchgpt.com" "94.131.119.85" nameRule="option name 'Block_UDP_443'" str=$(grep -i "$nameRule" /etc/config/firewall) From 5ea9486c687b22f47010f68cce67adcd0e615a30 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 20:57:14 +0500 Subject: [PATCH 09/13] Add cron task auto run configure_zaprets --- configure_zaprets.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/configure_zaprets.sh b/configure_zaprets.sh index 82c10f9..3d17a41 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -107,12 +107,11 @@ then service firewall restart fi -echo "Crod task add restart service yotubeUnblock..." - -cronTask="0 4 * * * service youtubeUnblock restart" -str=$(grep -i "0 4 \* \* \* service youtubeUnblock restart" /etc/crontabs/root) +cronTask="0 4 * * * wget -O - https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main/configure_zaprets.sh | sh" +str=$(grep -i "0 4 \* \* \* wget -O - https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main/configure_zaprets.sh | sh" /etc/crontabs/root) if [ -z "$str" ] then + echo "Add cron task auto run configure_zapret..." echo "$cronTask" >> /etc/crontabs/root fi From 1aa929cbf148830f8d865f9c85d1a54d3496d5a2 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 22:09:02 +0500 Subject: [PATCH 10/13] Delete cron task auto run script --- off_configure_zaprets.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/off_configure_zaprets.sh b/off_configure_zaprets.sh index 8825da5..66e7295 100644 --- a/off_configure_zaprets.sh +++ b/off_configure_zaprets.sh @@ -1,5 +1,6 @@ #!/bin/sh +URL_REPO="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs" DIR="/etc/config" DIR_BACKUP="/root/backup" config_files="dhcp @@ -20,4 +21,10 @@ service https-dns-proxy restart service dnsmasq restart service odhcpd restart +echo "Remove cron task auto run script configure zaprets.." + +grep -v "0 4 \* \* \* wget -O - $URL_REPO/refs/heads/main/configure_zaprets.sh | sh" /etc/crontabs/root > /etc/crontabs/temp +cp -f "/etc/crontabs/temp" "/etc/crontabs/root" +rm -f "/etc/crontabs/temp" + echo "Off configure complete..." From 03228656011337268ddc62ef6bd9aae9b973da6c Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 22:11:45 +0500 Subject: [PATCH 11/13] Add variable URL_REPO --- configure_zaprets.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure_zaprets.sh b/configure_zaprets.sh index 3d17a41..b700046 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -1,6 +1,7 @@ #!/bin/sh -URL="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main" +URL_REPO="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs" +URL="$URL_REPO/refs/heads/main" DIR="/etc/config" DIR_BACKUP="/root/backup" config_files="dhcp @@ -107,8 +108,8 @@ then service firewall restart fi -cronTask="0 4 * * * wget -O - https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main/configure_zaprets.sh | sh" -str=$(grep -i "0 4 \* \* \* wget -O - https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main/configure_zaprets.sh | sh" /etc/crontabs/root) +cronTask="0 4 * * * wget -O - $URL_REPO/refs/heads/main/configure_zaprets.sh | sh" +str=$(grep -i "0 4 \* \* \* wget -O - $URL_REPO/refs/heads/main/configure_zaprets.sh | sh" /etc/crontabs/root) if [ -z "$str" ] then echo "Add cron task auto run configure_zapret..." From 415b9f121f1c3bcda6b5e7f414c158f588d25ce5 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 23:15:26 +0500 Subject: [PATCH 12/13] Delete variable URL_REPO --- configure_zaprets.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/configure_zaprets.sh b/configure_zaprets.sh index b700046..58d9d9e 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -1,7 +1,6 @@ #!/bin/sh -URL_REPO="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs" -URL="$URL_REPO/refs/heads/main" +URL="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main" DIR="/etc/config" DIR_BACKUP="/root/backup" config_files="dhcp @@ -108,8 +107,8 @@ then service firewall restart fi -cronTask="0 4 * * * wget -O - $URL_REPO/refs/heads/main/configure_zaprets.sh | sh" -str=$(grep -i "0 4 \* \* \* wget -O - $URL_REPO/refs/heads/main/configure_zaprets.sh | sh" /etc/crontabs/root) +cronTask="0 4 * * * wget -O - $URL/configure_zaprets.sh | sh" +str=$(grep -i "0 4 \* \* \* wget -O - $URL/configure_zaprets.sh | sh" /etc/crontabs/root) if [ -z "$str" ] then echo "Add cron task auto run configure_zapret..." From 66f2fa6fa19397aba836b6d07d82299406e67cea Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Fri, 21 Feb 2025 23:26:06 +0500 Subject: [PATCH 13/13] Delete folder backup --- off_configure_zaprets.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/off_configure_zaprets.sh b/off_configure_zaprets.sh index 66e7295..a4f5953 100644 --- a/off_configure_zaprets.sh +++ b/off_configure_zaprets.sh @@ -1,6 +1,6 @@ #!/bin/sh -URL_REPO="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs" +URL="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main" DIR="/etc/config" DIR_BACKUP="/root/backup" config_files="dhcp @@ -14,6 +14,8 @@ do cp -f "$DIR_BACKUP/$file" "$DIR/$file" done +rm -rf "$DIR_BACKUP" + echo "Restart service..." service youtubeUnblock restart @@ -23,7 +25,7 @@ service odhcpd restart echo "Remove cron task auto run script configure zaprets.." -grep -v "0 4 \* \* \* wget -O - $URL_REPO/refs/heads/main/configure_zaprets.sh | sh" /etc/crontabs/root > /etc/crontabs/temp +grep -v "0 4 \* \* \* wget -O - $URL/configure_zaprets.sh | sh" /etc/crontabs/root > /etc/crontabs/temp cp -f "/etc/crontabs/temp" "/etc/crontabs/root" rm -f "/etc/crontabs/temp"