# LuaRocks mirror (pkg.shecan.ir)

> Mirror of the LuaRocks rocks server (luarocks.org): the manifests, rockspecs and rock files (.src.rock, binary rocks) at the root, under /dev/ and under /manifests/<user>/, for luarocks install, luarocks search and luarocks make.

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

## Limitations

- Rockspecs whose source is a git repository (most of them point at GitHub) are built from that repository, which the mirror does not serve; LuaRocks prefers the .src.rock when the rock has one, and most rocks do.
- Read-only: luarocks upload, the luarocks.org API and the website are not served.

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

### luarocks: temporary (one command or the current shell; nothing saved)

Run

```sh
luarocks install --only-server=https://mirror-luarocks.pkg.shecan.ir argparse
```

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

Run

```sh
mkdir -p ~/.luarocks && luarocks config rocks_servers[1] https://mirror-luarocks.pkg.shecan.ir --scope=user
```

Undo / restore the default

```sh
luarocks config rocks_servers --unset --scope=user
```
