1# myaur
2
3A simple, self-hosted AUR (Arch User Repository) mirror written in Go. Provides both RPC API endpoints and git protocol access to AUR packages.
4
5myaur takes advantage of the [official AUR mirror](https://github.com/archlinux/aur.git) on GitHub. You may use any mirror that you wish, however, note that it must have the same format as the official repo, in that each individual package should be a branch within the repo.
6
7## Installation
8
9### Using Docker Compose
10
11The easiest way to start the mirror is to use `docker compose up -d`. This will start both the myaur service and set up a Caddy reverse proxy.
12
13```bash
14docker compose up -d
15```
16
17If you wish to use your own domain, modify the `Caddyfile` and change `:443` to your domain.
18
19### Building from Source
20
21Requirements:
22- Go 1.25.3 or later
23- Git
24
25```bash
26go build -o myaur ./cmd/myaur
27```
28
29## Usage
30
31### Populate Database
32
33If you wish to clone the mirror repo and populate the database, you can do so without actually serving the mirror API.
34
35```bash
36./myaur populate \
37 --database-path ./myaur.db \
38 --repo-path ./aur-mirror \
39 --concurrency 10
40```
41
42Options:
43- `--database-path`: Path to SQLite database file (default: `./myaur.db`)
44- `--repo-path`: Path to clone/update AUR git mirror (default: `./aur-mirror`)
45- `--remote-repo-url`: Remote AUR repository URL (default: `https://github.com/archlinux/aur.git`)
46- `--concurrency`: Number of worker threads for parsing (default: `10`)
47- `--debug`: Enable debug logging
48
49### Serve
50
51To serve the API:
52
53```bash
54./myaur serve \
55 --listen-addr :8080 \
56 --database-path ./myaur.db \
57 --repo-path ./aur-mirror \
58 --concurrency 10
59```
60
61Options:
62- `--listen-addr`: HTTP server listen address (default: `:8080`)
63- `--database-path`: Path to SQLite database file (default: `./myaur.db`)
64- `--repo-path`: Path to AUR git mirror (default: `./aur-mirror`)
65- `--remote-repo-url`: Remote AUR repository URL (default: `https://github.com/archlinux/aur.git`)
66- `--concurrency`: Number of worker threads for parsing (default: `10`)
67- `--auto-update`: Whether or not to automtically fetch updates from the remote repo (default: `true`)
68- `--update-interval`: Time between automatic fetches (default: `1h`)
69- `--debug`: Enable debug logging