Add files via upload

This commit is contained in:
xVRVx
2026-03-17 20:22:14 +03:00
committed by GitHub
parent 737332d136
commit f05e5d266b
2 changed files with 105 additions and 5 deletions

View File

@@ -98,7 +98,7 @@ done
SERVER_PORT=443
echo -e "${YEL}Обновление и установка необходимых пакетов...${NC}"
apt-get update && apt-get install curl jq dnsutils openssl nginx certbot -y
apt-get update && apt-get install curl jq dnsutils openssl nginx certbot wget tar -y
systemctl enable --now nginx
LOCAL_IP=$(hostname -I | awk '{print $1}')
@@ -350,8 +350,8 @@ cat << EOF > "$SCRIPT_DIR/config.json"
"inbounds":[
{
"tag": "RUbrEUraw",
"port": $SERVER_PORT,
"listen": "0.0.0.0",
"port": 500,
"listen": "127.0.0.1",
"protocol": "vless",
"settings": {
"clients":[
@@ -728,7 +728,10 @@ echo -e "Перезапуск XRAY"
subPageLink="https://$DOMAIN/$path_subpage.json"
configListLink="https://$DOMAIN/$path_subpage.html"
# --- ЗАПИСЬ HEAD HTML ---
echo -e "\n\n${GRN}Устанавливаем MTProto FakeTLS ${NC}"
source <(curl -sL https://github.com/xVRVx/autoXRAY/raw/refs/heads/main/test/telemt-test.sh)
echo -e "\n\n${GRN}Создаем страницу подписки ${NC}"
cat > "$WEB_PATH/$path_subpage.html" <<'EOF'
<!DOCTYPE html><html lang="ru"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="robots" content="noindex,nofollow">
@@ -783,7 +786,7 @@ EOF
((idx++))
done
# Дописываем Socks5, All links и подвал
# Дописываем Socks5, MTProto, All links и подвал
cat >> "$WEB_PATH/$path_subpage.html" <<EOF
<div class="config-row">
<div class="config-label">Мост Socks5 (TG)</div>
@@ -792,6 +795,13 @@ cat >> "$WEB_PATH/$path_subpage.html" <<EOF
<a href="https://t.me/socks?server=$DOMAIN&port=10443&user=${socksUser}&pass=${socksPasw}" target="_blank" class="btn-action qr-btn" title="автодобавление моста в тг" style="text-decoration:none">✈️ Add to TG</a>
</div>
<div class="config-row">
<div class="config-label">Мост MTProtoFakeTLS (TG)</div>
<div class="config-code" id="mtproto">{$MTProto}</div>
<button class="btn-action copy-btn" onclick="copyText('mtproto', this)">Copy</button>
<a href="{$MTProto}" target="_blank" class="btn-action qr-btn" title="автодобавление моста в тг" style="text-decoration:none">✈️ Add to TG</a>
</div>
<h2>💠 Все конфиги вместе</h2>
<div class="config-row">
<div class="config-code" id="cAll" style="max-height:60px;white-space:pre-wrap;word-break:break-all">$ALL_LINKS_TEXT</div>

90
test/telemt-test.sh Normal file
View File

@@ -0,0 +1,90 @@
wget -qO- "https://github.com/telemt/telemt/releases/latest/download/telemt-$(uname -m)-linux-$(ldd --version 2>&1 | grep -iq musl && echo musl || echo gnu).tar.gz" | tar -xz
mv telemt /bin
chmod +x /bin/telemt
telemtHEX16=$(openssl rand -hex 16)
mkdir -p /etc/telemt
cat <<EOF > "/etc/telemt/telemt.toml"
[general]
prefer_ipv6 = false
fast_mode = true
use_middle_proxy = false
[general.modes]
classic = false
secure = false
tls = true
[server]
port = 443
listen_addr_ipv4 = "0.0.0.0"
# === Timeouts (in seconds) ===
[timeouts]
client_handshake = 15
tg_connect = 10
client_keepalive = 60
client_ack = 300
[server.api]
enabled = true
listen = "127.0.0.1:9091"
# whitelist = ["127.0.0.1/32"]
# read_only = true
# === Anti-Censorship & Masking ===
[censorship]
tls_domain = "$DOMAIN"
mask = true
mask_port = 500
mask_host = "127.0.0.1"
fake_cert_len = 2048
[access.users]
hello = "$telemtHEX16"
[[upstreams]]
type = "socks5"
address = "127.0.0.1:10443"
username = "$socksUser"
password = "$socksPasw"
weight = 10
enabled = true
EOF
useradd -d /opt/telemt -m -r -U telemt
chown -R telemt:telemt /etc/telemt
cat <<EOF > "/etc/systemd/system/telemt.service"
[Unit]
Description=Telemt
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=telemt
Group=telemt
WorkingDirectory=/opt/telemt
ExecStart=/bin/telemt /etc/telemt/telemt.toml
Restart=on-failure
LimitNOFILE=65536
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
sleep 1
systemctl start telemt
systemctl enable telemt
sleep 3
telemtSecret=$(curl -s http://127.0.0.1:9091/v1/users | jq -r '.data[0].links.tls[0] | split("secret=")[1]')
MTProto="https://t.me/proxy?server=$DOMAIN&port=443&secret=$telemtSecret"