# Homebrew mirror (pkg.shecan.ir)

> Mirror of the Homebrew JSON API (formulae.brew.sh) and of Homebrew bottles (ghcr.io/v2/homebrew) for brew install.

- Upstream: formulae.brew.sh و bottle های Homebrew
- Mirror URL: <https://mirror-brew.pkg.shecan.ir/>
- Clients: brew
- Service status: <https://pkg.shecan.ir/status.json> (key `homebrew`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/homebrew/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/homebrew.json>

## Limitations

- brew update (git) and the Homebrew install script still need GitHub; set HOMEBREW_NO_AUTO_UPDATE=1.
- Formulae without bottles and casks download from their vendors; brew falls back to the original URLs for anything the mirror does not serve.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### brew: persistent (user- or system-wide configuration)

Configuration file (linux, macos): `~/.zprofile` or `~/.bashrc`

```sh
export HOMEBREW_API_DOMAIN=https://mirror-brew.pkg.shecan.ir/api
export HOMEBREW_ARTIFACT_DOMAIN=https://mirror-brew.pkg.shecan.ir
export HOMEBREW_NO_AUTO_UPDATE=1
```

Undo / restore the default (linux, macos)

```sh
unset HOMEBREW_API_DOMAIN HOMEBREW_ARTIFACT_DOMAIN HOMEBREW_NO_AUTO_UPDATE
sed -i.bak -E '/^export (HOMEBREW_API_DOMAIN|HOMEBREW_ARTIFACT_DOMAIN|HOMEBREW_NO_AUTO_UPDATE)=/d' ~/.bashrc ~/.zshrc ~/.profile 2>/dev/null || true
```
