Fix dashboard pruned/full label: accept MONERO_PRUNE=1 (#32)#174
Merged
Conversation
The dashboard parsed MONERO_PRUNE with `== "true"`, but pithead renders config.json's monero.prune as 1/0 (the form monerod's CLI wants), so a correctly pruned local node always displayed "Full" — purely a display bug (the node prunes either way), but misleading. The parser now accepts 1/true/yes/on (and falsy 0/false/no/off/empty), with unit tests covering both. Surfaced on a live pruned deployment whose badge read "XMR Full" despite prune-blockchain=1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The dashboard's Monero Pruned/Full badge always showed Full on a local node, even when the node was correctly pruned.
config.pyparsed the env var as:…but pithead renders
config.json'smonero.pruneinto.envasMONERO_PRUNE=1(the numeric form monerod's CLI requires)."1" == "true"isFalse, so a correctly pruned node read as Full.This is purely a display bug — the node prunes either way — but it's misleading (it confused a real deployment whose header read "XMR Full" despite
prune-blockchain=1).Fix
Accept the numeric/boolean truthy forms
1/true/yes/on(and the falsy0/false/no/off/empty).Tests
test_monero_prune_accepts_truthy_forms/test_monero_prune_accepts_falsy_formsintests/config/test_config.py, covering case + whitespace variants.config.py100%).Scope
Standalone, general fix — independent of #114. It belongs in
mainso a clean deploy labels pruned nodes correctly.Fixes #32.
🤖 Generated with Claude Code