# MongoDB mirror (pkg.shecan.ir)

> Mirror of repo.mongodb.org (apt for Ubuntu/Debian, yum for RHEL-compatible and Amazon Linux: mongodb-org, mongosh, database tools) and the signing keys of pgp.mongodb.com under /static/pgp/. repo.mongodb.org refuses Iranian addresses (403).

- Upstream: repo.mongodb.org, pgp.mongodb.com
- Mirror URL: <https://mirror-mongodb.pkg.shecan.ir/>
- Clients: apt, dnf, yum
- Service status: <https://pkg.shecan.ir/status.json> (key `mongodb`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/mongodb/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/mongodb.json>

## Limitations

- apt and dnf still verify the official MongoDB signature. The guide uses 8.0; for another version replace 8.0 in the repository path (the 8.2 repository is signed with the server-8.0 key).
- MongoDB Enterprise (repo.mongodb.com), Atlas and the Compass/tarball downloads (fastdl.mongodb.org) are not mirrored.

## 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.

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

Run, Ubuntu (linux)

```sh
sudo install -d /etc/apt/keyrings
sudo curl -fsSLo /etc/apt/keyrings/mongodb-server-8.0.asc https://mirror-mongodb.pkg.shecan.ir/static/pgp/server-8.0.asc
. /etc/os-release
echo "deb [signed-by=/etc/apt/keyrings/mongodb-server-8.0.asc] https://mirror-mongodb.pkg.shecan.ir/apt/ubuntu $VERSION_CODENAME/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt update && sudo apt install -y mongodb-org
```

Undo / restore the default, Ubuntu (linux)

```sh
sudo rm -f /etc/apt/sources.list.d/mongodb-org-8.0.list /etc/apt/keyrings/mongodb-server-8.0.asc
sudo apt update
```

Run, Debian (linux)

```sh
sudo install -d /etc/apt/keyrings
sudo curl -fsSLo /etc/apt/keyrings/mongodb-server-8.0.asc https://mirror-mongodb.pkg.shecan.ir/static/pgp/server-8.0.asc
. /etc/os-release
echo "deb [signed-by=/etc/apt/keyrings/mongodb-server-8.0.asc] https://mirror-mongodb.pkg.shecan.ir/apt/debian $VERSION_CODENAME/mongodb-org/8.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt update && sudo apt install -y mongodb-org
```

Undo / restore the default, Debian (linux)

```sh
sudo rm -f /etc/apt/sources.list.d/mongodb-org-8.0.list /etc/apt/keyrings/mongodb-server-8.0.asc
sudo apt update
```

### dnf, yum: persistent (user- or system-wide configuration)

Configuration file (linux): `/etc/yum.repos.d/mongodb-org-8.0.repo`

```ini
[mongodb-org-8.0]
name=MongoDB Repository
baseurl=https://mirror-mongodb.pkg.shecan.ir/yum/redhat/$releasever/mongodb-org/8.0/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://mirror-mongodb.pkg.shecan.ir/static/pgp/server-8.0.asc
```

Undo / restore the default (linux)

```sh
sudo rm -f /etc/yum.repos.d/mongodb-org-8.0.repo
sudo dnf clean all
```

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

Run (linux) (checked by hand)

```sh
sudo dnf install -y mongodb-org
```
