feat: add bin/ directory with pre-built binaries, update deploy workflow

- Add aasd/bin/ with compiled aasd binary and gotestwaf binary
- Fix .gitignore: remove blanket *.exe/*.bin rules
- Update install.sh to support local bin/ deployment (dev workflow)
- Update README and AGENT.md docs to reference bin/ directory
This commit is contained in:
administrator 2026-04-29 08:15:51 +00:00
parent 71b31b7c28
commit c09d266f02
6 changed files with 39 additions and 22 deletions

4
.gitignore vendored
View file

@ -11,10 +11,6 @@ Thumbs.db
*.swp *.swp
*.swo *.swo
# Binaries
*.exe
*.bin
# Config — never commit real credentials # Config — never commit real credentials
**/config.yaml **/config.yaml

View file

@ -41,7 +41,7 @@ gitex2026/
- **Wordlist**: `/opt/aasd/subdomains.txt` (5000 names from SecLists) - **Wordlist**: `/opt/aasd/subdomains.txt` (5000 names from SecLists)
- **Frontend**: `/opt/aasd/static/` - **Frontend**: `/opt/aasd/static/`
- **Service**: `aasd.service` (systemd, runs as `engineer`, WorkingDir `/opt/aasd`) - **Service**: `aasd.service` (systemd, runs as `engineer`, WorkingDir `/opt/aasd`)
- **Build**: `cd ~/gitex2026/aasd/src && go build -o /opt/aasd/aasd ./cmd/aasd/` - **Build**: `cd ~/gitex2026/aasd/src && go build -o ../bin/aasd ./cmd/aasd/` (outputs to `bin/`)
- **Restart**: `sudo systemctl restart aasd` - **Restart**: `sudo systemctl restart aasd`
## Architecture — Pipeline Flow ## Architecture — Pipeline Flow
@ -111,7 +111,7 @@ executeScanPhase() discoverSubdomains()
```bash ```bash
# Build and deploy # Build and deploy
cd ~/gitex2026/aasd/src && go build -o /opt/aasd/aasd ./cmd/aasd/ cd ~/gitex2026/aasd/src && go build -o ../bin/aasd ./cmd/aasd/ && sudo cp ../bin/aasd /opt/aasd/aasd
sudo systemctl restart aasd sudo systemctl restart aasd
# Check service # Check service

View file

@ -9,11 +9,12 @@ Enter domain → Discover subdomains → Pick target → GoTestWAF scan → AI r
## Quick Start ## Quick Start
```bash ```bash
# Build # Build (from source)
cd ~/gitex2026/aasd/src cd ~/gitex2026/aasd/src
go build -o /opt/aasd/aasd ./cmd/aasd/ go build -o ../bin/aasd ./cmd/aasd/
# Deploy # Quick deploy (pre-built binary in bin/)
sudo cp bin/aasd /opt/aasd/aasd
sudo systemctl restart aasd sudo systemctl restart aasd
# Monitor # Monitor
@ -36,19 +37,28 @@ sudo journalctl -u aasd -f
### Structure ### Structure
``` ```
/opt/aasd/ gitex2026/aasd/
├── aasd # Compiled binary (31M) ├── bin/ # Pre-built binaries
│ ├── aasd # Compiled Go binary (31M)
│ └── gotestwaf # WAF scanner binary (27M)
├── src/ # Go source code
├── docs/ # Documentation
├── install.sh # Production installer (creates /opt/aasd/)
├── sample.config.yaml # Config template (copy to /opt/aasd/config.yaml)
├── sample.env # Environment variable template
├── README.md # This file
└── VERSION
/opt/aasd/ # Deployed runtime (created by install.sh)
├── aasd # Compiled binary (from bin/)
├── config.yaml # Server URL, admin credentials, AI key ├── config.yaml # Server URL, admin credentials, AI key
├── prompt.txt # DeepSeek system prompt ├── prompt.txt # DeepSeek system prompt
├── subdomains.txt # 5000 common subdomain names (SecLists) ├── subdomains.txt # Subdomain wordlist
├── gotestwaf # WAF scanner binary (27M) ├── gotestwaf # WAF scanner binary (from bin/)
├── gotestwaf-config.yaml # HTTP headers for scans ├── gotestwaf-config.yaml # HTTP headers for scans
├── testcases/ # GoTestWAF attack payloads ├── testcases/ # GoTestWAF attack payloads
├── static/ # Frontend files ├── static/ # Frontend files
│ ├── index.html # Landing page ├── templates/ # Admin dashboard template
│ └── simulation.html # Selection + progress page
├── templates/
│ └── admin.html # Consultant dashboard
├── reports/ # Generated scan reports ├── reports/ # Generated scan reports
└── logs/ # Server logs └── logs/ # Server logs
``` ```
@ -148,11 +158,12 @@ src/
# Repository # Repository
cd ~/gitex2026 cd ~/gitex2026
# aasd/src/ — Go source # aasd/src/ — Go source
# aasd/bin/ — Pre-built binaries
# aasd/docs/ — Documentation # aasd/docs/ — Documentation
# Build # Build (outputs to bin/)
cd ~/gitex2026/aasd/src cd ~/gitex2026/aasd/src
go build -o /opt/aasd/aasd ./cmd/aasd/ go build -o ../bin/aasd ./cmd/aasd/
go vet ./... go vet ./...
# Update wordlist (optional, defaults to built-in 40 names) # Update wordlist (optional, defaults to built-in 40 names)

BIN
aasd/bin/aasd Executable file

Binary file not shown.

BIN
aasd/bin/gotestwaf Executable file

Binary file not shown.

View file

@ -93,11 +93,12 @@ else
fi fi
# ────────────────────────────────────────────── # ──────────────────────────────────────────────
# Determine source of dist/ # Determine source of binaries + assets
# ────────────────────────────────────────────── # ──────────────────────────────────────────────
RELEASE_URL="${AASD_RELEASE_URL:-}" RELEASE_URL="${AASD_RELEASE_URL:-}"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
LOCAL_DIST="$SCRIPT_DIR/dist" LOCAL_DIST="$SCRIPT_DIR/dist"
LOCAL_BIN="$SCRIPT_DIR/bin"
if [[ -n "$RELEASE_URL" ]]; then if [[ -n "$RELEASE_URL" ]]; then
# Download from URL # Download from URL
@ -113,13 +114,22 @@ if [[ -n "$RELEASE_URL" ]]; then
rm -rf "$TMP_DIR" rm -rf "$TMP_DIR"
pass "Release downloaded and extracted" pass "Release downloaded and extracted"
elif [[ -d "$LOCAL_DIST" ]]; then elif [[ -d "$LOCAL_DIST" ]]; then
# Copy from local dist/ # Copy from local dist/ (full release bundle)
info "Copying local dist/ to $APP_HOME ..." info "Copying local dist/ to $APP_HOME ..."
mkdir -p "$APP_HOME" mkdir -p "$APP_HOME"
cp -r "$LOCAL_DIST"/* "$APP_HOME/" cp -r "$LOCAL_DIST"/* "$APP_HOME/"
pass "Local dist/ copied" pass "Local dist/ copied"
elif [[ -d "$LOCAL_BIN" ]]; then
# Copy from local bin/ + source directory (dev workflow)
info "Deploying from local bin/ and source files ..."
mkdir -p "$APP_HOME"
cp "$LOCAL_BIN"/aasd "$LOCAL_BIN"/gotestwaf "$APP_HOME/" 2>/dev/null || true
cp "$SCRIPT_DIR/src/gotestwaf-config.yaml" "$APP_HOME/" 2>/dev/null || true
cp -r "$SCRIPT_DIR/src/static" "$SCRIPT_DIR/src/templates" "$APP_HOME/" 2>/dev/null || true
cp -r "$SCRIPT_DIR/src/gotestwaf/testcases" "$APP_HOME/" 2>/dev/null || true
pass "Local binaries and assets deployed"
else else
fail "No release URL set (AASD_RELEASE_URL) and no local dist/ found at $LOCAL_DIST" fail "No release URL set (AASD_RELEASE_URL) and no local dist/ or bin/ found at $SCRIPT_DIR"
fi fi
# ────────────────────────────────────────────── # ──────────────────────────────────────────────