|
| 1 | +# Building |
| 2 | + |
| 3 | +## Building from Source |
| 4 | + |
| 5 | +You can build standalone executables using PyInstaller. This creates a single binary file that includes all dependencies. |
| 6 | + |
| 7 | +Requirements: |
| 8 | + |
| 9 | +- Python 3.9-3.14 |
| 10 | +- PyInstaller 6.20.0+ |
| 11 | +- Dependencies from `requirements.txt` and `requirements/db.txt` |
| 12 | + |
| 13 | +## Quick Build |
| 14 | + |
| 15 | +```sh |
| 16 | +pip install -r requirements.txt -r requirements/db.txt |
| 17 | +pip install pyinstaller==6.20.0 |
| 18 | +pyinstaller pyinstaller/dirsearch.spec |
| 19 | +./dist/dirsearch --version |
| 20 | +``` |
| 21 | + |
| 22 | +## Manual Build on Linux or macOS |
| 23 | + |
| 24 | +```sh |
| 25 | +pyinstaller \ |
| 26 | + --onefile \ |
| 27 | + --name dirsearch \ |
| 28 | + --paths=. \ |
| 29 | + --collect-submodules=lib \ |
| 30 | + --add-data "db:db" \ |
| 31 | + --add-data "config.ini:." \ |
| 32 | + --add-data "lib/report:lib/report" \ |
| 33 | + --hidden-import=requests \ |
| 34 | + --hidden-import=httpx \ |
| 35 | + --hidden-import=urllib3 \ |
| 36 | + --hidden-import=jinja2 \ |
| 37 | + --hidden-import=colorama \ |
| 38 | + --strip \ |
| 39 | + --clean \ |
| 40 | + dirsearch.py |
| 41 | +``` |
| 42 | + |
| 43 | +## Manual Build on Windows |
| 44 | + |
| 45 | +```powershell |
| 46 | +pyinstaller ` |
| 47 | + --onefile ` |
| 48 | + --name dirsearch ` |
| 49 | + --paths=. ` |
| 50 | + --collect-submodules=lib ` |
| 51 | + --add-data "db;db" ` |
| 52 | + --add-data "config.ini;." ` |
| 53 | + --add-data "lib/report;lib/report" ` |
| 54 | + --hidden-import=requests ` |
| 55 | + --hidden-import=httpx ` |
| 56 | + --hidden-import=urllib3 ` |
| 57 | + --hidden-import=jinja2 ` |
| 58 | + --hidden-import=colorama ` |
| 59 | + --clean ` |
| 60 | + dirsearch.py |
| 61 | +``` |
| 62 | + |
| 63 | +Windows uses `;` instead of `:` as the path separator in `--add-data`. |
| 64 | + |
| 65 | +## Build Output |
| 66 | + |
| 67 | +- Linux/macOS: `dist/dirsearch` |
| 68 | +- Windows: `dist/dirsearch.exe` |
| 69 | + |
| 70 | +The binary includes: |
| 71 | + |
| 72 | +- All Python dependencies |
| 73 | +- `db/` directory with wordlists and blacklists |
| 74 | +- `config.ini` default configuration |
| 75 | +- `lib/report/` Jinja2 templates for reports |
| 76 | + |
| 77 | +## GitHub Workflows |
| 78 | + |
| 79 | +dirsearch uses GitHub Actions for continuous integration and automated builds. |
| 80 | + |
| 81 | +| Workflow | Trigger | Description | |
| 82 | +|----------|---------|-------------| |
| 83 | +| Inspection (CI) | Push, PR | Runs tests, linting, and codespell on Python 3.9/3.11/3.14 across Ubuntu and Windows | |
| 84 | +| PyInstaller Linux | Manual, Workflow call | Builds `dirsearch-linux-amd64` binary | |
| 85 | +| PyInstaller Windows | Manual, Workflow call | Builds `dirsearch-windows-x64.exe` binary | |
| 86 | +| PyInstaller macOS Intel | Manual, Workflow call | Builds `dirsearch-macos-intel` binary | |
| 87 | +| PyInstaller macOS Silicon | Manual, Workflow call | Builds `dirsearch-macos-silicon` binary | |
| 88 | +| PyInstaller Draft Release | Manual | Builds all platforms and creates a draft GitHub release | |
| 89 | +| Docker Image | Push, PR | Builds and tests Docker image | |
| 90 | +| CodeQL Analysis | Push, PR, Schedule | Security scanning with GitHub CodeQL | |
| 91 | +| Semgrep Analysis | Push, PR | Static analysis with Semgrep | |
| 92 | + |
| 93 | +## Running Workflows Manually |
| 94 | + |
| 95 | +PyInstaller builds can be triggered manually from the GitHub Actions tab: |
| 96 | + |
| 97 | +1. Go to Actions and select a workflow, such as PyInstaller Linux. |
| 98 | +2. Click Run workflow. |
| 99 | +3. Download artifacts from the completed run. |
| 100 | + |
| 101 | +## Creating a Release |
| 102 | + |
| 103 | +To create a release with all platform binaries: |
| 104 | + |
| 105 | +1. Go to Actions > PyInstaller Draft Release. |
| 106 | +2. Click Run workflow. |
| 107 | +3. Enter the tag, such as `v5.0.0`. |
| 108 | +4. Select the target branch. |
| 109 | +5. Optionally mark it as a prerelease. |
| 110 | +6. Review and publish the draft release. |
| 111 | + |
| 112 | +## Build Matrix |
| 113 | + |
| 114 | +The CI workflow tests on: |
| 115 | + |
| 116 | +- Python versions: 3.9, 3.11, 3.14 |
| 117 | +- Operating systems: Ubuntu latest and Windows latest |
0 commit comments