Skip to content

Modular refactor v1.1 (lib/ + per-tool modules, CI, docs)#1

Merged
WhiteMuush merged 10 commits into
mainfrom
refactor/modular-v1.1
May 26, 2026
Merged

Modular refactor v1.1 (lib/ + per-tool modules, CI, docs)#1
WhiteMuush merged 10 commits into
mainfrom
refactor/modular-v1.1

Conversation

@WhiteMuush

Copy link
Copy Markdown
Owner

Summary

This PR restructures the project from a single 1022-line feedyourspider.sh into a thin orchestrator over a lib/ 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.sh shrinks to ~80 lines: sources lib/, dispatches menu choices to <tool>_run functions.
    • 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 single ensure_command / install_package pair that collapses ~400 lines of duplicated command -v / apt-get / dnf / brew boilerplate 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

    • Fragile IFS=$'\n' read -r -d '' -a pattern replaced with mapfile -t (UI) and read -ra (custom-args parsing).
    • tput color setup now guarded by [[ -t 1 ]] so colors do not leak into pipes / CI logs.
    • Menu spacing inconsistency ([0]Exit vs [1] Nmap) fixed.
    • Stale/misleading comment about a "duplicate menu index" removed.
    • Duplicated header block (between the title screen and the menu) consolidated into one helper.
  • Open-source machinery

    • GPL-3.0 LICENSE, .gitignore, .editorconfig.
    • GitHub Actions CI: shellcheck (warning severity), bash -n syntax check on every *.sh, and a smoke test that sources the whole lib/ chain and asserts every expected function is defined.
    • Issue templates (bug report, tool request) in YAML form, blank issues disabled, PR template with a contribution checklist.
    • 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) and docs/ADDING_A_TOOL.md (4-step recipe to add a new module).
    • README refreshed with badges, Project Layout, and contribution links.

Compatibility

  • No CLI flags removed or renamed.
  • Output directory layout ($HOME/feedyourspider_<tool>/) preserved, with a new optional FEEDYOURSPIDER_OUTPUT_ROOT env var to redirect everything under a single sandbox dir.
  • All code, comments, prompts, and docs are in English.

Test plan

  • bash -n passes on every *.sh (also covered by the new CI job).
  • Smoke test: source lib/core.sh, lib/installer.sh, lib/ui.sh, every lib/modules/*.sh, and verify the 27 expected functions are defined.
  • Run ./feedyourspider.sh on a Linux box and exercise at least one menu entry per category (scan / capture / fingerprint).
  • CI green on this PR before merge.

@WhiteMuush
WhiteMuush merged commit 61ae266 into main May 26, 2026
3 checks passed
@WhiteMuush
WhiteMuush deleted the refactor/modular-v1.1 branch May 26, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant