From d05a62bee0095960c033a81f07c47c71785fb400 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 20 Mar 2026 15:01:28 +0000 Subject: [PATCH] fix: .env contains harb-specific defaults that leak into non-harb sessions (#398) Remove per-project settings from .env.example and env.sh defaults: - CODEBERG_REPO no longer defaults to johba/harb - WOODPECKER_REPO_ID no longer defaults to 2 - Remove deprecated HARB_REPO_ROOT alias - .env.example now points to projects/*.toml for per-project config Co-Authored-By: Claude Opus 4.6 (1M context) --- .env.example | 11 +++++------ lib/env.sh | 7 +++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index 6347e96..d770d2b 100644 --- a/.env.example +++ b/.env.example @@ -2,11 +2,10 @@ # Copy to .env and fill in your values. # NEVER commit .env to the repo. -# ── Target project ──────────────────────────────────────────────────────── -CODEBERG_REPO=johba/yourproject # org/repo slug on Codeberg -PROJECT_REPO_ROOT=/home/you/yourproject # local clone of the target repo -PRIMARY_BRANCH=main # main or master -# PROJECT_NAME=yourproject # optional — auto-derived from CODEBERG_REPO +# ── Per-project config ──────────────────────────────────────────────────── +# Project-specific settings (CODEBERG_REPO, PROJECT_REPO_ROOT, PRIMARY_BRANCH, +# WOODPECKER_REPO_ID) now live in projects/*.toml — see projects/harb.toml +# for an example. Do NOT set them here; they leak into every session. # ── Auth tokens ─────────────────────────────────────────────────────────── # Dev-agent token: push branches, create PRs, merge PRs. @@ -22,7 +21,7 @@ REVIEW_BOT_TOKEN= # ── Woodpecker CI ───────────────────────────────────────────────────────── WOODPECKER_TOKEN= WOODPECKER_SERVER=http://localhost:8000 -WOODPECKER_REPO_ID=2 # numeric repo ID in Woodpecker DB +# WOODPECKER_REPO_ID — now per-project, set in projects/*.toml [ci] section # Woodpecker Postgres (for direct DB queries) WOODPECKER_DB_PASSWORD= diff --git a/lib/env.sh b/lib/env.sh index 505d14e..a940da0 100755 --- a/lib/env.sh +++ b/lib/env.sh @@ -31,14 +31,13 @@ fi export CODEBERG_TOKEN # Project config -export CODEBERG_REPO="${CODEBERG_REPO:-johba/harb}" +export CODEBERG_REPO="${CODEBERG_REPO:-}" export CODEBERG_API="${CODEBERG_API:-https://codeberg.org/api/v1/repos/${CODEBERG_REPO}}" export CODEBERG_WEB="https://codeberg.org/${CODEBERG_REPO}" export PROJECT_NAME="${PROJECT_NAME:-${CODEBERG_REPO##*/}}" -export PROJECT_REPO_ROOT="${PROJECT_REPO_ROOT:-${HARB_REPO_ROOT:-/home/${USER}/${PROJECT_NAME}}}" -export HARB_REPO_ROOT="${PROJECT_REPO_ROOT}" # deprecated alias +export PROJECT_REPO_ROOT="${PROJECT_REPO_ROOT:-/home/${USER}/${PROJECT_NAME}}" export PRIMARY_BRANCH="${PRIMARY_BRANCH:-master}" -export WOODPECKER_REPO_ID="${WOODPECKER_REPO_ID:-2}" +export WOODPECKER_REPO_ID="${WOODPECKER_REPO_ID:-}" export WOODPECKER_SERVER="${WOODPECKER_SERVER:-http://localhost:8000}" export CLAUDE_TIMEOUT="${CLAUDE_TIMEOUT:-7200}"