Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ jobs:
with:
python-version: '3.12'

- uses: snok/install-poetry@v1
- uses: astral-sh/setup-uv@v5

- name: Build
shell: bash
run: |
poetry install --with dev
poetry run pyinstaller strix.spec --noconfirm
uv sync --frozen
uv run pyinstaller strix.spec --noconfirm

VERSION=$(poetry version -s)
VERSION=$(grep '^version' pyproject.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
mkdir -p dist/release

if [[ "${{ runner.os }}" == "Windows" ]]; then
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ repos:
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
args: ['--maxkb=1024']
- id: debug-statements
- id: check-case-conflict
- id: check-docstring-first
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Thank you for your interest in contributing to Strix! This guide will help you g

- Python 3.12+
- Docker (running)
- Poetry (for dependency management)
- [uv](https://docs.astral.sh/uv/) (for dependency management)
- Git

### Local Development
Expand All @@ -24,8 +24,8 @@ Thank you for your interest in contributing to Strix! This guide will help you g
make setup-dev

# or manually:
poetry install --with=dev
poetry run pre-commit install
uv sync
uv run pre-commit install
```

3. **Configure your LLM provider**
Expand All @@ -36,7 +36,7 @@ Thank you for your interest in contributing to Strix! This guide will help you g

4. **Run Strix in development mode**
```bash
poetry run strix --target https://example.com
uv run strix --target https://example.com
```

## 📚 Contributing Skills
Expand Down
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,57 +22,57 @@ help:
@echo " clean - Clean up cache files and artifacts"

install:
poetry install --only=main
uv sync --no-dev

dev-install:
poetry install --with=dev
uv sync

setup-dev: dev-install
poetry run pre-commit install
uv run pre-commit install
@echo "✅ Development environment setup complete!"
@echo "Run 'make check-all' to verify everything works correctly."

format:
@echo "🎨 Formatting code with ruff..."
poetry run ruff format .
uv run ruff format .
@echo "✅ Code formatting complete!"

lint:
@echo "🔍 Linting code with ruff..."
poetry run ruff check . --fix
uv run ruff check . --fix
@echo "📝 Running additional linting with pylint..."
poetry run pylint strix/ --score=no --reports=no
uv run pylint strix/ --score=no --reports=no
@echo "✅ Linting complete!"

type-check:
@echo "🔍 Type checking with mypy..."
poetry run mypy strix/
uv run mypy strix/
@echo "🔍 Type checking with pyright..."
poetry run pyright strix/
uv run pyright strix/
@echo "✅ Type checking complete!"

security:
@echo "🔒 Running security checks with bandit..."
poetry run bandit -r strix/ -c pyproject.toml
uv run bandit -r strix/ -c pyproject.toml
@echo "✅ Security checks complete!"

check-all: format lint type-check security
@echo "✅ All code quality checks passed!"

test:
@echo "🧪 Running tests..."
poetry run pytest -v
uv run pytest -v
@echo "✅ Tests complete!"

test-cov:
@echo "🧪 Running tests with coverage..."
poetry run pytest -v --cov=strix --cov-report=term-missing --cov-report=html
uv run pytest -v --cov=strix --cov-report=term-missing --cov-report=html
@echo "✅ Tests with coverage complete!"
@echo "📊 Coverage report generated in htmlcov/"

pre-commit:
@echo "🔧 Running pre-commit hooks..."
poetry run pre-commit run --all-files
uv run pre-commit run --all-files
@echo "✅ Pre-commit hooks complete!"

clean:
Expand Down
22 changes: 8 additions & 14 deletions containers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ USER root
RUN cp /app/certs/ca.crt /usr/local/share/ca-certificates/ca.crt && \
update-ca-certificates

RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3 - && \
ln -s /opt/poetry/bin/poetry /usr/local/bin/poetry && \
chmod +x /usr/local/bin/poetry && \
python3 -m venv /app/venv && \
chown -R pentester:pentester /app/venv /opt/poetry
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/usr/local/bin sh
Comment thread
shanyu-strix marked this conversation as resolved.

USER pentester
WORKDIR /tmp
Expand Down Expand Up @@ -130,9 +126,8 @@ RUN apt-get autoremove -y && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENV PATH="/home/pentester/go/bin:/home/pentester/.local/bin:/home/pentester/.npm-global/bin:/app/venv/bin:$PATH"
ENV VIRTUAL_ENV="/app/venv"
ENV POETRY_HOME="/opt/poetry"
ENV PATH="/home/pentester/go/bin:/home/pentester/.local/bin:/home/pentester/.npm-global/bin:/app/.venv/bin:$PATH"
ENV VIRTUAL_ENV="/app/.venv"

WORKDIR /app

Expand All @@ -157,17 +152,16 @@ ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

RUN mkdir -p /workspace && chown -R pentester:pentester /workspace /app

COPY pyproject.toml poetry.lock ./
COPY pyproject.toml uv.lock ./
RUN echo "# Sandbox Environment" > README.md && mkdir -p strix && touch strix/__init__.py

USER pentester
RUN poetry install --no-root --without dev --extras sandbox
RUN poetry run playwright install chromium
RUN uv sync --frozen --no-dev --extra sandbox
RUN /app/.venv/bin/python -m playwright install chromium

RUN /app/venv/bin/pip install -r /home/pentester/tools/jwt_tool/requirements.txt && \
RUN uv pip install -r /home/pentester/tools/jwt_tool/requirements.txt && \
ln -s /home/pentester/tools/jwt_tool/jwt_tool.py /home/pentester/.local/bin/jwt_tool

RUN echo "# Sandbox Environment" > README.md

COPY strix/__init__.py strix/
COPY strix/config/ /app/strix/config/
COPY strix/utils/ /app/strix/utils/
Expand Down
3 changes: 1 addition & 2 deletions containers/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,11 @@ echo "Starting tool server..."
cd /app
export PYTHONPATH=/app
export STRIX_SANDBOX_MODE=true
export POETRY_VIRTUALENVS_CREATE=false
export TOOL_SERVER_TIMEOUT="${STRIX_SANDBOX_EXECUTION_TIMEOUT:-120}"
TOOL_SERVER_LOG="/tmp/tool_server.log"

sudo -E -u pentester \
poetry run python -m strix.runtime.tool_server \
/app/.venv/bin/python -m strix.runtime.tool_server \
--token="$TOOL_SERVER_TOKEN" \
--host=0.0.0.0 \
--port="$TOOL_SERVER_PORT" \
Expand Down
8 changes: 4 additions & 4 deletions docs/contributing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: "Contribute to Strix development"

- Python 3.12+
- Docker (running)
- Poetry
- [uv](https://docs.astral.sh/uv/)
- Git

### Local Development
Expand All @@ -26,8 +26,8 @@ description: "Contribute to Strix development"
make setup-dev

# or manually:
poetry install --with=dev
poetry run pre-commit install
uv sync
uv run pre-commit install
```
</Step>
<Step title="Configure LLM">
Expand All @@ -38,7 +38,7 @@ description: "Contribute to Strix development"
</Step>
<Step title="Run Strix">
```bash
poetry run strix --target https://example.com
uv run strix --target https://example.com
```
</Step>
</Steps>
Expand Down
Loading