Commit graph

344 commits

Author SHA1 Message Date
GaltRanch
458b60fbbc Add status bar with mode, block height, and BTC price to main menus
- PyBlock.py MainMenu(): fetch BTC price from mempool.space API,
  display status_bar() showing mode/block/price before menu header
- SPV/spvblock.py MainMenuCROPPED(): same status_bar integration
- Import shared.ui utilities in both files

The status bar shows at a glance: active mode (Local/Remote/Lite),
current block height, and USD price of Bitcoin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 13:09:21 -03:00
GaltRanch
04c0e33efc Rename 'Cropped' mode to 'Lite Mode' in user-facing text
- PyBlock.py: Update intro screen text and option label
- SPV/spvblock.py: Change all n="CROPPED" display labels to "LITE MODE"
- Internal config value 'cropped' in intro.conf unchanged for backward compat

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 13:07:21 -03:00
GaltRanch
455cb986ce Convert download/install shell chains to list-based subprocess in PyBlock.py
Replace 27 mkdir/cd/wget/tar/unzip/git-clone/chmod shell chains with
os.makedirs() + list-based subprocess.run(cwd=) calls:
- Mempool-cli x86/ARM installers
- Phoenix wallet 4 platform installers
- Nostr console 5 platform installers + seed tools
- SatSale, Warden, Bija, Coldcore, Cashu, bpytop, Luxor, UTXOracle

4 remaining shell=True are legitimate pipe chains (bitcoincli|xxd, jq).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:51:41 -03:00
GaltRanch
c0b40e91f7 Convert simple subprocess shell=True to list format with cwd
Replace cd-and-run shell patterns with list-based subprocess.run()
using cwd parameter for directory context:

- Phoenix macOS ARM installer
- Luxor CLI help
- Mempool CLI (2 instances)
- SatSale, Cashu, Warden, bpytop launchers
- Bija docker-compose
- Both SPV/spvblock.py and PyBlock.py

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:21:08 -03:00
GaltRanch
273d806d37 Rename shadowed builtin 'list' variable to 'cmd'
Replace all uses of 'list' as a variable name for shell command strings
with 'cmd' to avoid shadowing Python's built-in list type.
Affects ppi.py, PyBlock.py, SPV/ppi.py, and SPV/spvblock.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:10:49 -03:00
GaltRanch
a746b36420 Replace star imports with explicit imports in core files
- PyBlock.py: Replace 14 star imports with explicit named imports,
  remove unused `from art import *` and `from SPV.spvblock import *`
- ppi.py: Replace star imports, remove unused art/nodeconnection imports,
  remove duplicate `import requests` and dead lnpay_py comments
- nodeconnection.py: Replace star imports, remove unused art import

This improves code clarity, prevents namespace pollution, and makes
dependencies between modules explicit and traceable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:03:52 -03:00
GaltRanch
3c7eb44030 Fix mutable default argument bug in all rpc() functions
Replace params=[] with params=None pattern to prevent shared state
between calls. Affects PyBlock.py, nodeconnection.py,
SPV/nodeconnection.py, and clockscriptREMOTE.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 11:59:22 -03:00
GaltRanch
7366e9fe9c Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:

- Add centralized Config singleton (config.py) replacing ~176 config
  reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
  silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
  eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
  between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
  (asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
GaltRanch
0224cfe230 Fix critical security vulnerabilities across the codebase
Replace insecure patterns that exposed the application to command injection,
arbitrary code execution, and data interception attacks.

- Replace os.popen/os.system with subprocess.run using argument lists
- Migrate pickle config serialization to JSON format
- Replace bare except: blocks with specific exception types
- Fix insecure HTTP URLs to HTTPS (opreturnbot.com, ascii.live)
- Replace shell curl commands with requests library calls
- Add migrate_config.py script for pickle-to-JSON config migration
- Convert existing SPV config files to JSON format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:24:47 -03:00
Satoshi Nakamoto
db8a30f584
Update menu options for Bitcoin and Lightning 2026-03-21 04:18:19 +01:00
Satoshi Nakamoto
e775426be3
Remove unused import for jq in PyBlock.py 2025-11-28 23:53:34 +01:00
Satoshi Nakamoto
2675d92c52
Update PyBlock.py 2025-06-22 19:03:58 +02:00
curly60e
9c37b04deb
Update PyBlock.py 2025-03-16 00:23:02 -03:00
Satoshi Nakamoto
9ddd808a3a
Update PyBlock.py 2024-12-27 16:33:54 +01:00
Satoshi Nakamoto
551ab4d2cb
Update PyBlock.py 2024-10-28 00:15:36 +01:00
Satoshi Nakamoto
c6e95ea947
Update PyBlock.py 2024-10-23 01:45:05 +02:00
Satoshi Nakamoto
56fd5b0a1b
Update PyBlock.py 2024-10-22 19:15:04 +02:00
Satoshi Nakamoto
b98cba242b
Update PyBlock.py 2024-10-22 00:50:59 +02:00
Satoshi Nakamoto
3363b47155
Update PyBlock.py 2024-10-22 00:47:34 +02:00
Satoshi Nakamoto
c09c3bf4b2
Update PyBlock.py 2024-10-22 00:24:42 +02:00
Satoshi Nakamoto
83fde9a9e0
Update PyBlock.py 2024-10-22 00:07:20 +02:00
Satoshi Nakamoto
54c0da9e25
Update PyBlock.py 2024-10-17 20:53:48 +02:00
Satoshi Nakamoto
a947365469
Update PyBlock.py 2024-10-17 20:46:40 +02:00
Satoshi Nakamoto
2c30aa07ae
Update PyBlock.py 2024-10-04 15:43:18 +02:00
Satoshi Nakamoto
60a3e329f7
Update PyBlock.py 2024-10-02 19:19:37 +02:00
Satoshi Nakamoto
06d528612f
Update PyBlock.py 2024-09-27 00:01:38 +02:00
Satoshi Nakamoto
fdc83a0d2d
Update PyBlock.py 2024-09-26 23:53:52 +02:00
Satoshi Nakamoto
4e44e0aa48
Update PyBlock.py 2024-09-20 00:56:05 +02:00
Satoshi Nakamoto
7c3b7decdd
Update PyBlock.py 2024-08-15 02:07:08 +02:00
Satoshi Nakamoto
ec9df19319
Update PyBlock.py 2024-08-14 23:23:39 +02:00
Satoshi Nakamoto
7157cf2a7a
Update PyBlock.py 2024-07-30 22:53:16 +02:00
curly60e
5af6a355c4
Add files via upload 2024-07-30 14:49:21 -03:00
Satoshi Nakamoto
361faf130d
Update PyBlock.py 2024-07-30 19:11:08 +02:00
curly60e
e93b9243fa
Update PyBlock.py 2024-07-29 18:22:11 -03:00
curly60e
7981cf9dc1
Add files via upload 2024-07-29 18:21:21 -03:00
curly60e
920cfa13ff
Update PyBlock.py 2024-07-26 19:15:10 -03:00
curly60e
0189756514
Add files via upload 2024-07-26 19:07:59 -03:00
Satoshi Nakamoto
27adf61819
Update PyBlock.py 2024-07-26 23:19:24 +02:00
curly60e
0d6ea3fdf7
Add files via upload 2024-07-26 17:06:38 -03:00
Satoshi Nakamoto
e589f3f48e
Update PyBlock.py 2024-07-26 21:29:15 +02:00
curly60e
640e366290
Add files via upload 2024-07-26 14:39:30 -03:00
curly60e
88f42da9a3
Add files via upload 2024-07-26 11:44:48 -03:00
curly60e
f161997004
Add files via upload 2024-07-26 11:39:24 -03:00
curly60e
391554c05a
Update PyBlock.py 2024-07-26 10:49:52 -03:00
curly60e
3df93ef809
Add files via upload 2024-07-26 10:47:28 -03:00
Satoshi Nakamoto
ebf61b8bb6
Actualizar PyBlock.py 2024-07-26 03:10:40 +02:00
Satoshi Nakamoto
49f0a877ae
Update PyBlock.py 2024-07-25 22:55:12 +02:00
Satoshi Nakamoto
591f170c6d
Update PyBlock.py 2024-07-25 22:43:52 +02:00
curly60e
af9cdcde1d
Update PyBlock.py 2024-07-25 16:29:25 -03:00
curly60e
661993c9e2
Update PyBlock.py 2024-07-25 16:22:15 -03:00