Modular refactor v1.1 (lib/ + per-tool modules, CI, docs)#1
Merged
Conversation
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.
Summary
This PR restructures the project from a single 1022-line
feedyourspider.shinto a thin orchestrator over alib/of helpers and per-tool modules, and adds the supporting open-source machinery (CI, contribution docs, issue/PR templates).Functionality is preserved end-to-end: same 10 tools, same menu numbering, same prompts, same output paths under
$HOME/feedyourspider_<tool>/.What changes
Code structure
feedyourspider.shshrinks to ~80 lines: sourceslib/, dispatches menu choices to<tool>_runfunctions.lib/core.sh— TTY-aware color setup (no more polluted pipes), constants, output-dir helpers.lib/installer.sh— logging (log_step/log_info/log_warn/log_error/log_success), prompts (prompt_value/prompt_choice/prompt_yesno), and a singleensure_command/install_packagepair that collapses ~400 lines of duplicatedcommand -v / apt-get / dnf / brewboilerplate into one dispatcher.lib/ui.sh— ASCII banner, centered title screen, side-by-side renderer.lib/modules/<tool>.sh— one ~30-line file per tool (nmap, netcat, tcpdump, tshark, hping3, arpscan, masscan, nikto, dnsenum, whatweb).Bug fixes during the split
IFS=$'\n' read -r -d '' -apattern replaced withmapfile -t(UI) andread -ra(custom-args parsing).tputcolor setup now guarded by[[ -t 1 ]]so colors do not leak into pipes / CI logs.[0]Exitvs[1] Nmap) fixed.Open-source machinery
LICENSE,.gitignore,.editorconfig.bash -nsyntax check on every*.sh, and a smoke test that sources the wholelib/chain and asserts every expected function is defined.CONTRIBUTING.md,CODE_OF_CONDUCT.md(Contributor Covenant v2.1 by reference),SECURITY.md(wrapper-scope disclosure policy).docs/ARCHITECTURE.md(boot sequence, cross-cutting helpers) anddocs/ADDING_A_TOOL.md(4-step recipe to add a new module).Compatibility
$HOME/feedyourspider_<tool>/) preserved, with a new optionalFEEDYOURSPIDER_OUTPUT_ROOTenv var to redirect everything under a single sandbox dir.Test plan
bash -npasses on every*.sh(also covered by the new CI job).lib/core.sh,lib/installer.sh,lib/ui.sh, everylib/modules/*.sh, and verify the 27 expected functions are defined../feedyourspider.shon a Linux box and exercise at least one menu entry per category (scan / capture / fingerprint).