Skip to content

4ndr0666/ars0n-framework-v2-pi

 
 

Repository files navigation

Build Status Raspberry Pi License

Ars0n Framework — Raspberry Pi Edition 🛠️

ARM64-optimized fork with a hardened, reproducible setup. Fixes the classic “Failed to fetch” by steering the frontend to the Pi’s API IP.

Ars0n Pi Edition Hero


Table of Contents


🚀 Quick Start (5 steps)

  1. Install prerequisites
    Docker + Docker Compose. Ensure your user is in the docker group.

  2. Configure frontend environment
    Detect your Pi’s LAN IP and inject into the client build:

    PI_IP=$(hostname -I | awk '{print $1}')
    echo "REACT_APP_SERVER_IP=${PI_IP}" > client/.env
  3. Build & run the stack

    docker compose down
    docker compose build --no-cache
    docker compose up -d
  4. Open the app
    UI → http://${PI_IP}:3000
    API → https://${PI_IP}:8443

  5. (Optional) Enable autostart
    See Autostart on Boot.


🧭 Architecture

High-level Architecture

Flow summary

  • Client (React) reads REACT_APP_SERVER_IP at build time → calls API at https://${IP}:8443.
  • API serves requests, talks to PostgreSQL, orchestrates modules (assetfinder, gospider, nuclei, etc.).
  • All services live on Docker network ars0n-network.

Ports

  • Client → 3000/tcp (host → container)
  • API → 8443/tcp (host → container)
  • DB → 5432/tcp (internal only unless exposed)

📋 Detailed Setup

Prereqs & Permissions

  • Raspberry Pi 4 (8 GB recommended), ARM64 Linux

  • Docker daemon running

  • Add your user to Docker:

    sudo usermod -aG docker ${USER}
    newgrp docker

Configure Frontend → API

Create the .env before building:

PI_IP=$(hostname -I | awk '{print $1}')
echo "REACT_APP_SERVER_IP=${PI_IP}" > client/.env

This writes:

REACT_APP_SERVER_IP=192.168.1.92

Build & Run

docker compose down
docker compose build --no-cache
docker compose up -d

🔥 Ignition Script

Automates IP detection, environment generation, and deployment.
Save as ignition.sh in repo root, make it executable (chmod +x ignition.sh), then run:

#!/usr/bin/env bash
set -e

echo "[+] Detecting Pi IP address..."
PI_IP=$(hostname -I | awk '{print $1}')
if [ -z "$PI_IP" ]; then
  echo "Error: Could not detect local IP address. Exiting."
  exit 1
fi
echo "Detected IP: $PI_IP"

echo "[+] Writing frontend env configuration (client/.env)..."
mkdir -p client
cat > client/.env <<EOF
REACT_APP_SERVER_IP=${PI_IP}
EOF

echo "[+] Shutting down any existing containers..."
docker compose down || true

echo "[+] Building containers (no cache)..."
docker compose build --no-cache

echo "[+] Starting containers..."
docker compose up -d

echo "[+] Setup complete."
echo "UI  : http://${PI_IP}:3000"
echo "API : https://${PI_IP}:8443"

Ignition Flow


🧷 Autostart on Boot

Create /etc/systemd/system/ars0n.service:

[Unit]
Description=Ars0n Framework Service
Requires=docker.service
After=network-online.target docker.service

[Service]
Type=oneshot
RemainAfterExit=yes
User=${USER}
Group=${USER}
WorkingDirectory=/path/to/your/repo
ExecStart=/usr/bin/docker compose up -d --build
ExecStop=/usr/bin/docker compose down
Restart=on-failure
RestartSec=10s

[Install]
WantedBy=multi-user.target

Enable it:

sudo systemctl daemon-reload
sudo systemctl enable --now ars0n.service

✅ Verification Checklist

  • client/.env exists and contains REACT_APP_SERVER_IP=<Pi IP>
  • docker compose up -d completes without errors
  • docker compose ps shows client, api, db as Up
  • UI reachable at http://${PI_IP}:3000
  • API reachable at https://${PI_IP}:8443
  • Browser network calls target the Pi IP (not 127.0.0.1)

🛠️ Troubleshooting

Symptom Root Cause Fix
“Failed to fetch” / import fails Frontend still points to 127.0.0.1 Recreate .env, rebuild, confirm requests hit https://${IP}:8443.
CORS error in browser API not allowing frontend origin Allow CORS for http://${PI_IP}:3000.
UI loads but actions fail API unreachable / wrong protocol curl -k https://${PI_IP}:8443/ to verify API; adjust protocol or cert.
Nothing on :3000 Client binds only to localhost Ensure it listens on 0.0.0.0 in config.
DB errors Database not ready / bad credentials Check docker compose logs db and API’s DATABASE_URL.

Logs:

docker compose logs client
docker compose logs api
docker compose logs db

Network & ports:

docker compose ps
ss -tulpen | grep -E '(:3000|:8443)'

❓ FAQ

Q: Do I need to edit the compose file for my IP?
A: No. Run ./ignition.sh or manually create .env before building.

Q: Can I change the UI port?
A: Yes. Edit the client service ports mapping in docker-compose.yml.

Q: Will this work on non-Pi hosts?
A: Yes, provided the environment variable points to the correct host IP.


📦 Client Snippet (Reference)

client:
  container_name: ars0n-framework-v2-client-1
  build:
    context: ./client
    args:
      REACT_APP_SERVER_IP: 192.168.1.92
  ports:
    - "3000:3000"
  depends_on:
    - api
  restart: unless-stopped
  networks:
    - ars0n-network

Ensure your full compose file matches this pattern.


Footer

About

Ars0n Framework (Raspberry Pi Flavor)

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 62.1%
  • Go 36.4%
  • Python 0.9%
  • Dockerfile 0.3%
  • CSS 0.2%
  • HTML 0.1%