Config: .env = projects root only; derive each project's forge from git

Reduce .env to just REPOS_HOST_PATH (the projects root); runtime bootstrap moves to compose/defaults. Projects are the subdirectories of the single root — removed the project-directories feature (store table, service methods, /api/config/project-dirs, Settings section). Each project's forge is derived from its git remote (matched to a configured forge, else the bare host) and shown as a pill next to its name (State.Forge via scanner ForgeFor + svc.ForgeDisplay). Removed first-run .env seeding; forges + identity are managed in Settings. Added forge.HostOf. AGENT.md updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-22 05:52:03 -04:00
parent e30c3b632a
commit 32ae17cc9f
15 changed files with 175 additions and 434 deletions
+10 -82
View File
@@ -1,87 +1,15 @@
# ---------------------------------------------------------------------------
# GitManager configuration. Copy this file to `.env` and fill in values.
# NEVER commit a real `.env` (it is git-ignored). See AGENT.md §1.5.
# GitManager configuration. Copy this file to `.env`.
# NEVER commit a real `.env` (it is git-ignored).
#
# NOTE: forges (URL + token), project directories, and the git identity now live
# in the config DATABASE (a private SQLite store, AGENT.md §1.3), managed in the
# app's Settings. The GITEA_*, GIT_REPO_ROOTS, and GIT_USER_* values below are
# used ONLY to seed that DB the first time the app starts with an empty store;
# after that, edit them in Settings (changing .env has no effect).
# The ONLY thing configured in .env is the root directory that holds your
# projects. Each project is a subdirectory of that root, and its forge is
# detected from its git remote. Everything else — forge hosts + access tokens
# and the git commit identity — is managed in the app's Settings (/settings) and
# stored in a private database (AGENT.md §1.5). Runtime bootstrap (listen address,
# TLS, DB path, the container projects root) is set by docker-compose.
# ---------------------------------------------------------------------------
# Config store location (SQLite). docker-compose points this at a PRIVATE named
# volume that is not bind-mounted or exposed, so credentials in it are only
# reachable inside the container (AGENT.md §1.3).
GITMANAGER_DB=/data/gitmanager.db
# Address the HTTP server binds to. Localhost-only by default: there is NO
# authentication (AGENT.md §0). Only bind to a non-local interface deliberately.
LISTEN_ADDR=127.0.0.1:8080
# HTTPS (optional, but REQUIRED for the MCP connector — Claude Desktop only
# accepts https:// URLs). When HTTPS_ADDR and both cert/key are set, an HTTPS
# listener starts alongside HTTP. docker-compose sets these to the mounted certs.
# Generate a locally-trusted cert on the HOST with mkcert (installs a local CA
# your OS — and Claude Desktop — will trust), from the project root:
# winget install FiloSottile.mkcert
# mkcert -install # trust step (adds the local CA)
# mkdir certs
# mkcert -cert-file certs/localhost.pem -key-file certs/localhost-key.pem localhost 127.0.0.1 ::1
# Then connect Claude Desktop to https://localhost:8443/mcp
HTTPS_ADDR=
TLS_CERT_FILE=
TLS_KEY_FILE=
# SEED ONLY (first run) → project directories in the config DB. Comma-separated
# *container* paths (the host roots are mounted here; see docker-compose.yml).
# After first run, manage these in Settings. Example: /repos,/work/other
GIT_REPO_ROOTS=/repos
# DOCKER ONLY: the HOST folder that holds your repositories. docker-compose
# mounts it to /repos inside the container (which GIT_REPO_ROOTS points at).
# Ignored when running the binary directly. Example: C:/Users/you/Projects
# Host folder that holds your projects. docker-compose mounts it to /repos inside
# the container (scanned as PROJECTS_ROOT). Example: C:/Users/you/Projects
REPOS_HOST_PATH=./repos
# Path to the git binary. "git" resolves it from PATH (git is installed in the
# container image).
GIT_BIN=git
# --- Repo scanner (read-only; AGENT.md §5) ---------------------------------
# How often the background scanner refreshes repo state.
SCAN_INTERVAL=30s
# Max directory depth to descend under each root when discovering repos.
SCAN_MAX_DEPTH=4
# Directory names to skip during discovery, comma-separated.
SCAN_IGNORE=node_modules,vendor,.cache
# Allow the scanner to run `git fetch` (network) to keep ahead/behind counts
# current. OFF by default — no unsolicited network. (AGENT.md §5)
SCAN_FETCH_ENABLED=false
# --- Logging (AGENT.md §7) --------------------------------------------------
# "dev" uses a readable console handler; anything else uses structured JSON.
APP_ENV=dev
# SEED ONLY (first run) → git identity in the config DB. Without an identity,
# commits inside the container fail with "empty ident". After first run, set it
# in Settings.
GIT_USER_NAME=
GIT_USER_EMAIL=
# The app configures git to authenticate to each configured forge over HTTPS
# (an http.extraheader per host), so push/fetch/pull work from the container
# without a separate SSH key or credential helper.
# Optional: also append structured logs to this file. Leave empty to disable.
LOG_FILE=
# --- Forge integration — SEED ONLY (first run) → forges in the config DB ----
# Multiple forges are now supported and managed in Settings; this pair only
# seeds the FIRST one on an empty DB. Set BOTH to enable PRs + "Merge & clean up"
# for repos whose remote host matches this URL. Token scope: repo read + PR write
# + branch delete. Writes are confirmed per AGENT.md §1.4.
GITEA_URL=
GITEA_TOKEN=