Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fosskers/faur
A simpler alternative to the AUR RPC.
https://github.com/fosskers/faur
archlinux aura clojure
Last synced: 4 months ago
JSON representation
A simpler alternative to the AUR RPC.
- Host: GitHub
- URL: https://github.com/fosskers/faur
- Owner: fosskers
- License: gpl-3.0
- Created: 2024-08-01T22:49:43.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-08-14T04:00:26.000Z (6 months ago)
- Last Synced: 2024-09-29T17:21:57.620Z (4 months ago)
- Topics: archlinux, aura, clojure
- Language: Clojure
- Homepage: https://stats.uptimerobot.com/xacx44XVJx
- Size: 8.2 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# faur
A `faur` instance is a mirror of all package data on the AUR. `faur` is...
- **Simple**
- There is only a single endpoint (i.e. no difference between `info` and `search`).
- JSON format is identical to the AUR RPC (but failure is always an empty list).
- **Fast**
- All data is held in memory with custom indices for near-instant lookups.
- No rate limits.
- **Featureful**
- Searching by "provides".
- Searching by multiple terms at once (has "AND" semantics).
- **Small**
- ~300 lines of Clojure.
- No external database or other infrastructure required.For instance, visit:
-
-### API
There is only a single endpoint: `packages`.
| Endpoint | Function | Big-O Efficiency |
|-----------------------------------|----------------------------------------------------------------------------------|------------------|
| `packages?names=` | Look up `m`-many packages by name | `O(mlogn)` |
| `packages?names=&by=prov` | Find packages that satisfy `TOKEN` | `O(logn)` |
| `packages?names=&by=desc` | Find packages that contain all `TOKENS` in their names / descriptions / keywords | `O(mlogn)` |Where multiple `TOKENS` are accepted, these are separated by commas, as in:
```
packages?names=spotify,teams,zoom
```**Caveat:** `by=desc` is term-based, not regex based. This is for performance
reasons. So, `packages?names=aura&by=desc` will match on `aura-bin` but not on
`auralcap`.### Running a `faur` Instance
Running a personal `faur` instance is simple. First, you'll need package data.
From the top-level of the project repo:```sh
wget https://aur.archlinux.org/packages-meta-ext-v1.json.gz
gzip -d packages-meta-ext-v1.json.gz
```Then simply:
```sh
clojure -M -m faur
```This will run a local `faur` server on http://0.0.0.0:8080 . To run in TLS mode,
pass `--key` and `--cert` as well and HTTPS requests will be accepted on port
443. For example, here is how the official faur instance itself is invoked:``` sh
clojure -M -m faur --key /etc/letsencrypt/live/faur.fosskers.ca/privkey.pem --cert /etc/letsencrypt/live/faur.fosskers.ca/fullchain.pem
```### Live Remote REPL
For live debugging, an [nREPL][0] server is embedded and ran on
`localhost:7888`. If running `faur` on a remote server, you can access this
nREPL remotely by first doing an SSH port-forward on your local machine:``` sh
ssh -NL 7888:localhost:7888 root@ -v
```and then performing a `cider-connect-clj` (or similar), selecting
`localhost:7888` as the target. Once connected, you're free to inspect the
various Atoms or redefine functions.[0]: https://nrepl.org/nrepl/index.html