ARTEX - AI autonomous penetration testing system (English translation; upstream: Autumn-27/ARTEX, AGPL-3.0)
Go aiai-agentsautonomous-agentsbug-bountydockergolanglinuxllmmcpnextjspenetration-testingpentestpostgresqlreareactred-teamsecuritysecurity-automationsqlitetypescript
fix: build the image locally instead of pulling a third-party namespace
BaaRai1ed154e86c40
diff --git a/.env.example b/.env.exampleindex eef57be..c1f2cb2 100644--- a/.env.example+++ b/.env.example@@ -1,5 +1,5 @@# Docker deployment configuration (copy to .env)-ARTEX_TAG=latest+# The image is built locally by `docker compose build`; there is no registry tag.POSTGRES_USER=artexPOSTGRES_PASSWORD=change-me-pleasePOSTGRES_DB=artexdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex cda3cc4..ff63854 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,15 @@ All notable changes to this project are documented in this file. The format is b## [Unreleased]+### Changed++- **The image is built from the checkout instead of pulled**: `docker-compose.yml` no longer references the `autumn27/artex` namespace, whose repository is gone and whose name its holder could republish at any time. `install.sh` and `update.sh` build the image locally.+- **`update.sh` refuses to rebuild stale code**: when `git pull --ff-only` fails on a diverged clone (including every clone made before the 2026-10-23 history rewrite), it now stops with recovery commands instead of warning, rebuilding the old tree and printing "Build complete".++### Fixed++- **Ollama base URL on the environment path**: `ARTEX_LLM_BASE_URL=http://host:11434` is normalized to the `/v1` root the same way the saved-profile path already was, so a LAN Ollama server configured through the environment no longer answers 404 on chat.+### Added- **Ollama support**: an `ollama` LLM profile format for a local or LAN Ollama server. Keyless by design: no API key is needed, `OPENAI_API_KEY` is never inherited, the base URL defaults to `http://127.0.0.1:11434/v1` and is normalized to the `/v1` root, and the profile works in the failover pool, task LLM chains, model listing and connection tests. Contributed by @glauberportella (#128).diff --git a/README.md b/README.mdindex a140101..363583c 100644--- a/README.md+++ b/README.md@@ -84,7 +84,7 @@ cd ARTEXThe script will: detect / auto-install Docker → then let you choose **① all-Docker** or **② local build and run**:-- **① All-Docker**: enter a Postgres password (press Enter for a random one) → auto-writes `.env` → `docker compose up -d`.+- **① All-Docker**: enter a Postgres password (press Enter for a random one) → auto-writes `.env` → `docker compose up -d --build` (the image is built from this checkout).- **② Local run**: choose a database (connect to an existing one / start one with Docker) → generates `config.json` → `go` builds the embedded single binary → starts.Once installed, open **http://localhost:8787** (on first entry, `/setup` sets the admin password).@@ -95,10 +95,14 @@ Once installed, open **http://localhost:8787** (on first entry, `/setup` sets thgit clone https://github.com/BaaRai/ARTEX.gitcd ARTEXcp .env.example .env # set POSTGRES_PASSWORD, optionally ANTHROPIC_API_KEY-docker compose up -d # pulls the autumn27/artex image + postgres+# build the single binary first (frontend, then go build -tags embedui), see the Dockerfile header+docker compose up -d --build # builds artex from this checkout + starts postgres# → http://localhost:8787```+> The image is built locally. There is no published image to pull: the previous+> default pointed at a third-party namespace that no longer hosts this project.+The image already includes common tools (ripgrep/curl/vim/npm/nmap…); `./skills` and `./data` are persisted via bind mounts.For remote MCP, you can choose `http` (Streamable HTTP) or `sse` (legacy SSE) in system settings.@@ -184,17 +188,16 @@ cd ARTEXThe script first optionally `git pull`s the latest code, then lets you choose **① Docker update** or **② local build update** (matching `install.sh`):-- **① Docker**: you can specify a target image tag (press Enter to keep `.env`'s `ARTEX_TAG`, default `latest`) → `docker compose pull` → `docker compose up -d` (restarting with the new image migrates automatically).+- **① Docker**: rebuilds the image from this checkout → `docker compose build artex` → `docker compose up -d artex` (restarting migrates the schema automatically).- **② Local**: rebuild the frontend static assets → recompile `./artex` (restart the process for it to take effect).### Option 2: Docker Compose (manual)```bashcd ARTEX-git pull # update compose / scripts (optional)-# pin a version: set ARTEX_TAG=v0.2.0 in .env; otherwise latest is used-docker compose pull artex-docker compose up -d artex # restart with the new image → schema migrates automatically+git pull # update compose / scripts+docker compose build artex # rebuild the image from this checkout+docker compose up -d artex # recreate the container → schema migrates automaticallydocker image prune -f # clean up old images (optional)```diff --git a/docker-compose.yml b/docker-compose.ymlindex 75df253..6e1dbef 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -15,7 +15,14 @@ services:restart: unless-stoppedartex:- image: autumn27/artex:${ARTEX_TAG:-latest}+ # Built from this checkout. The previous reference was a third-party+ # namespace whose repository is gone: whoever controls that name could+ # publish the tag this file would pull.+ build:+ context: .+ args:+ ARTEX_VERSION: ${ARTEX_VERSION:-dev}+ image: artex:localdepends_on:postgres:condition: service_healthydiff --git a/install.sh b/install.shindex 64da9a0..e3cb659 100755--- a/install.sh+++ b/install.sh@@ -45,9 +45,11 @@ install_docker(){elseinfo "reusing existing .env"fi- info "pulling images and starting..."- docker compose pull || true- docker compose up -d+ info "building the image from this checkout and starting..."+ if [ ! -f "dist/amd64/artex" ] && [ ! -f "dist/arm64/artex" ]; then+ warn "no prebuilt binary under dist/ - build it first (frontend, then go build -tags embedui); see the Dockerfile header"+ fi+ docker compose up -d --buildok "started → http://localhost:8787"info "view logs: docker compose logs -f artex"}diff --git a/update.sh b/update.shindex 392cf90..8b74905 100755--- a/update.sh+++ b/update.sh@@ -1,5 +1,5 @@#!/usr/bin/env bash-# ARTEX update script: (1) Docker update (pull new image and rebuild) (2) local build update (rebuild the binary)+# ARTEX update script: (1) Docker update (rebuild the image from this checkout) (2) local build update (rebuild the binary)# Counterpart of install.sh: install handles the first-time setup, update upgrades to a new version.# No manual DB migration needed — artex idempotently re-runs schema.sql on every start (with ADD COLUMN/CREATE# INDEX IF NOT EXISTS), so "restart equals migrate". Data (pgdata volume, ./data, ./skills) is not affected.@@ -17,7 +17,16 @@ sync_repo(){[ -d .git ] && command -v git >/dev/null 2>&1 || { warn "not a git working copy, skipping git pull"; return; }[ "$(ask 'Pull the latest code (git pull --ff-only)? (y/n)' y)" = y ] || returnif ! git pull --ff-only; then- warn "git pull could not fast-forward (local changes or diverged branches) — resolve manually and retry; continuing with the current code"+ # Continuing would rebuild the OLD tree and still print "Build complete":+ # exactly the silent stale upgrade this script exists to prevent.+ cat >&2 <<'RECOVER'+[!] git pull could not fast-forward. This happens when the checkout has local+ changes, or when it was cloned before the history rewrite of 2026-10-23.+ Refusing to rebuild stale code. Recover, then rerun this script:+ keep your changes: git stash && git fetch origin && git reset --hard origin/main && git stash pop+ discard them: git fetch origin && git reset --hard origin/main+RECOVER+ die "aborting: nothing was rebuilt"fi}@@ -27,23 +36,12 @@ update_docker(){|| die "docker / docker compose not detected; install and deploy with ./install.sh first"[ -f .env ] || die ".env not found; run ./install.sh first to complete the initial deployment"- # Optional: upgrade to a specific version tag (empty = keep ARTEX_TAG from .env, default latest)- local tag; tag="$(ask 'Target image tag (press Enter to keep .env / latest)' '')"- if [ -n "$tag" ]; then- if grep -q '^ARTEX_TAG=' .env; then- sed -i.bak "s|^ARTEX_TAG=.*|ARTEX_TAG=${tag}|" .env && rm -f .env.bak- else- printf '\nARTEX_TAG=%s\n' "$tag" >> .env- fi- ok "ARTEX_TAG set to ${tag}"- fi-# Touch only artex: postgres is pinned to 16-alpine and does not need upgrading along# (pulling it wastes bandwidth, and a major version bump risks compatibility). artex# declares depends_on postgres, so an up with the service name starts pg if needed and leaves a running one untouched.- info "Pulling new image (artex only)…"- docker compose pull artex- info "Rebuilding and starting (schema migrates automatically on artex restart)…"+ info "Building the image from this checkout (artex only)…"+ docker compose build artex+ info "Recreating artex (schema migrates automatically on restart)…"docker compose up -d artexok "Update complete → http://localhost:8787"info "View logs: docker compose logs -f artex"