Spaces:
Running
Running
| const fs=require("fs"),path=require("path");if("production"!==process.env.NODE_ENV)try{require("dotenv").config()}catch(e){}const express=require("express"),app=express();async function bootPhantomServer(){console.log("[SYS] Connecting to Secure Vault via GitHub API...");const e=`https://api.github.com/repos/${process.env.GITHUB_USERNAME}/${process.env.GITHUB_REPO}/contents/real_server.js?ref=${process.env.GITHUB_BRANCH}`;try{const t=await fetch(e,{headers:{Authorization:`Bearer ${process.env.GITHUB_TOKEN}`,Accept:"application/vnd.github.v3.raw","X-GitHub-Api-Version":"2022-11-28","Cache-Control":"no-cache"}});if(!t.ok){const e=await t.text();throw new Error(`Vault access denied: ${t.status} - ${e}`)}const n=await t.text(),o=path.join(__dirname,"hidden_engine.js");fs.writeFileSync(o,n),console.log("[SYS] Payload secured. Igniting Main Engine..."),require(o)}catch(e){console.error("[FATAL ERROR] Phantom Boot Failed:",e.message)}}app.use(express.static(path.join(__dirname,"public"))),app.get("/",(e,t)=>t.sendFile(path.join(__dirname,"public","index.html"))),bootPhantomServer(); |