Repository navigation
Conversation
The TUI form pre-filled examples/sample_wordlist.txt and rejected an empty field, so a binary run outside a checkout failed on ctrl+r with "cannot read wordlist: open examples/sample_wordlist.txt", and the bundled top-5000 list the command line falls back to was unreachable from the TUI. The Wordlist field is now optional: validate no longer rejects an empty value, and loadWordlist reads the bundled list through the same Preparer/EachLine path prepareWordlist uses for a missing -w. beginScan adds the CLI's notice, so the scan view names the list that ran. The field loses its repo-relative default and its required marker, with a placeholder that says what empty means. Tests: TestEmptyWordlistUsesBundledList starts a scan from an empty field and checks the loaded entries and the notice (it fails before the fix with the issue's "Wordlist path is required"); TestNewFormModelDefaults and TestFormViewRows pin the empty default. go test ./... passes, gofmt clean. Refs TMHSDigital#288
bfs2021
force-pushed
the
fix/tui-wordlist-default
branch
from
November 15, 2026 01:36
efc5920 to
73aeca2
Compare
Contributor
Author
This branch has not been deployed
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
Fixes #288. The TUI form pre-fills
examples/sample_wordlist.txtand rejects an empty Wordlist field, but that path only exists inside a checkout:subenum -tuifromgo install, a release archive or the Docker image fails on the first ctrl+r withcannot read wordlist: open examples/sample_wordlist.txt. The command line has no such requirement — a missing-wscans with the bundled top-5000 list — so the TUI could not reach the default list the CLI uses.Root cause
formFields[fieldWordlist]carrieddef: "examples/sample_wordlist.txt"andvalidatereturned "Wordlist path is required" for an empty value, whileloadWordlistCmdonly ever calledwordlist.LoadWordlist(path, domain), which opens a file. Nothing in the TUI could produce the bundled list, so an installed binary had no way to scan without a wordlist file of its own.Fix
validatekeeps the stdin rejection (-would read the stdin Bubble Tea owns) and drops the empty rejection.loadWordlist(new, inmodel.go) reads the file named on the form, or, when the field is empty, walksdata.Subdomains5kthroughwordlist.NewPreparer/EachLine— the same pathprepareWordlistuses for a missing-w, so normalization, dedupe and the per-domain length clamp match the CLI.beginScanadds the CLI's notice (using the bundled top-5000 list), so the scan view says which list ran.empty = bundled top-5000 list. README's TUI section and the CHANGELOG say the wordlist is optional.Testing
TestEmptyWordlistUsesBundledListstarts a scan from an empty Wordlist field in simulation mode and asserts the loaded entries come from the bundled list and the scan view names it. Before the fix it fails with the issue's own symptom:form error: Wordlist path is required.TestNewFormModelDefaultsandTestFormViewRowspin the empty default and the new row/placeholder.go test ./...— all packages pass (root 10.9s, internal/tui, internal/scan, pkg/subenum included).gofmt -l internal/tui— clean.golangci-lint run— could not run locally: this machine's golangci-lint was built against an older Go (export-data version 5 vs 2), so it refuses to typecheckgo1.27packages. Lint is left to CI.