pyblock/pybitblock/clone.py
GaltRanch 893aabc85d Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
  (nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00

31 lines
977 B
Python

#Developer: Curly60e
#PyBLOCK its a clock of the Bitcoin blockchain.
import logging
import os
import os.path
import subprocess
import time as t
def gitclone():
url = "https://github.com/curly60e/satellite"
subprocess.run(["git", "clone", url])
subprocess.run(["mkdir", "satellite/api/examples/.gnupg"])
subprocess.run(["gpg", "--full-generate-key", "--homedir", "satellite/api/examples/.gnupg"])
def satnode():
try:
subprocess.run(["python3", "satellite/api/examples/demo-rx.py"])
t.sleep(5)
subprocess.run(["python3", "satellite/api/examples/api_data_reader.py", "--demo", "--plaintext"])
except (OSError, subprocess.SubprocessError) as e:
logging.getLogger(__name__).debug("satnode error: %s", e)
def matrixsc():
if os.path.isdir('$HOME/pyblock/terminal_matrix'):
print("OK Pass")
else:
url = "https://github.com/curly60e/terminal_matrix.git"
subprocess.run(["git", "clone", url])