diff --git a/.env.example b/.env.example index ff1ecdc..c87290f 100644 --- a/.env.example +++ b/.env.example @@ -75,3 +75,23 @@ # Directory for delegate-job audit logs (sits beside .mam/jobs/). #default: /.mam/delegate_job_logs # DELEGATE_JOB_LOGS_DIR=/path/to/workspace/.mam/delegate_job_logs + +# ============================================================================== +# deploy / distribution source (for forks/mirrors) +# ============================================================================== +# Note: These variables are read from the execution environment by deployment scripts. +# Since deploy/install.sh runs before .env exists, you must pass them via export +# or prepended variables (e.g. MAM_REPO_URL=... bash deploy/install.sh). +# If you run a private mirror, we strongly recommend configuring all three variables. + +# Distribution repository URL (cloned during recovery steps). +#default: https://git.godopu.com/tmpl/multi-agent-mux.git +# MAM_REPO_URL=https://git.godopu.com/tmpl/multi-agent-mux.git + +# Distribution archive download URL (used for bootstrap extraction). +#default: https://git.godopu.com/tmpl/multi-agent-mux/archive/main.tar.gz +# MAM_ARCHIVE_URL=https://git.godopu.com/tmpl/multi-agent-mux/archive/main.tar.gz + +# Distribution update/installer script URL. +#default: https://git.godopu.com/tmpl/multi-agent-mux/raw/branch/main/deploy/install.sh +# MAM_INSTALLER_URL=https://git.godopu.com/tmpl/multi-agent-mux/raw/branch/main/deploy/install.sh diff --git a/deploy/README.md b/deploy/README.md index 1ac93a2..31d747c 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -26,6 +26,20 @@ Alternatively, if they have cloned the repository, they can execute: bash deploy/install.sh ``` +### 2. Custom Fork / Private Mirror Installations +If you run a private mirror or fork, you can override the source URLs during installation using environment variables: + +```bash +# Installing from a custom mirror (pipe prepends must be applied to the bash command) +curl -fsSL https://my-mirror.example.com/.../install.sh \ + | MAM_REPO_URL=https://my-mirror.example.com/me/multi-agent-mux.git \ + MAM_ARCHIVE_URL=https://my-mirror.example.com/me/multi-agent-mux/archive/main.tar.gz \ + bash + +# Updating an existing workspace against a mirror +MAM_INSTALLER_URL=https://my-mirror.example.com/.../install.sh bash deploy/update.sh +``` + ### 2. Registering as a Workspace Plugin To register these skills globally or for a specific workspace: * **Workspace Level**: Copy the `.agents/` folder into your project root. diff --git a/deploy/install.sh b/deploy/install.sh index c22b170..294f14b 100644 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -54,8 +54,8 @@ echo "✅ PyYAML (system dependency) detected." mkdir -p "$TARGET_DIR" cd "$TARGET_DIR" -REPO_URL="https://git.godopu.com/tmpl/multi-agent-mux.git" -ARCHIVE_URL="https://git.godopu.com/tmpl/multi-agent-mux/archive/main.tar.gz" +REPO_URL="${MAM_REPO_URL:-https://git.godopu.com/tmpl/multi-agent-mux.git}" +ARCHIVE_URL="${MAM_ARCHIVE_URL:-https://git.godopu.com/tmpl/multi-agent-mux/archive/main.tar.gz}" # Helper to verify presence of all core runtime files. # Keying off a set of core files helps detect and recover from partial/interrupted installations. diff --git a/deploy/update.sh b/deploy/update.sh index 199babb..2c3fd02 100644 --- a/deploy/update.sh +++ b/deploy/update.sh @@ -135,7 +135,8 @@ bash remove.sh --force # 4. Fetch and run the latest installer from Gitea echo "📥 Fetching and running the latest installer..." -INSTALLER_URL="https://git.godopu.com/tmpl/multi-agent-mux/raw/branch/main/deploy/install.sh" +# Note: MAM_*_URL environment variables are automatically inherited by the child installer bash process. +INSTALLER_URL="${MAM_INSTALLER_URL:-https://git.godopu.com/tmpl/multi-agent-mux/raw/branch/main/deploy/install.sh}" if command -v curl &>/dev/null; then curl -fsSL "$INSTALLER_URL" | bash -s -- "$TARGET_DIR" elif command -v wget &>/dev/null; then