Skip to content

Commit 2885de4

Browse files
committed
Move docs into wiki/ with GitHub Action sync
- Rename docs/ to wiki/ — source of truth for wiki content - Add wiki/Home.md as the wiki landing page with navigation - Add .github/workflows/sync-wiki.yml to auto-publish wiki/ to the GitHub wiki on push to master - Update README.md links to wiki/ directory The wiki at github.com/firehol/iprange/wiki is now a mirror of the wiki/ directory in this repo. Edit wiki/ in the repo, and the GitHub Action syncs it to the wiki on merge to master.
1 parent 1d8b502 commit 2885de4

9 files changed

Lines changed: 114 additions & 8 deletions

File tree

.github/workflows/sync-wiki.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Sync wiki
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'wiki/**'
8+
9+
jobs:
10+
sync:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v4
17+
18+
- name: Checkout wiki
19+
uses: actions/checkout@v4
20+
with:
21+
repository: ${{ github.repository }}.wiki
22+
path: wiki-repo
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Sync wiki files
26+
run: |
27+
cp wiki/*.md wiki-repo/
28+
cd wiki-repo
29+
git config user.name "github-actions[bot]"
30+
git config user.email "github-actions[bot]@users.noreply.github.com"
31+
git add -A
32+
if git diff --cached --quiet; then
33+
echo "No wiki changes to sync"
34+
else
35+
git commit -m "Sync wiki from repo"
36+
git push
37+
fi

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ To skip the man page: `./configure --disable-man`
366366
| Directory | Contents |
367367
|-----------|----------|
368368
| `src/` | C sources and headers |
369-
| `docs/` | Detailed documentation |
369+
| `wiki/` | Documentation (synced to GitHub wiki) |
370370
| `packaging/` | Spec template, ebuild, release tooling |
371371
| `tests.d/` | CLI regression tests |
372372
| `tests.build.d/` | Build and layout regressions |
@@ -376,14 +376,14 @@ To skip the man page: `./configure --disable-man`
376376

377377
## Documentation
378378

379-
Detailed guides in the [`docs/`](docs/) directory:
379+
Detailed guides in the [`wiki/`](wiki/) directory (also published to the [GitHub wiki](https://github.com/firehol/iprange/wiki)):
380380

381-
- [Input formats](docs/input-formats.md) — every accepted format, file lists, directories, binary
382-
- [Output formats](docs/output-formats.md) — CIDR, ranges, single IPs, binary, CSV, prefix/suffix
383-
- [Operations](docs/operations.md) — merge, intersect, exclude, diff, reduce, compare, count
384-
- [IPv6 support](docs/ipv6.md) — address family, normalization, cross-family rules
385-
- [DNS resolution](docs/dns-resolution.md) — threading, retry, configuration
386-
- [Optimizing ipsets for iptables](docs/ipset-reduce.md) — prefix reduction with examples
381+
- [Input formats](wiki/input-formats.md) — every accepted format, file lists, directories, binary
382+
- [Output formats](wiki/output-formats.md) — CIDR, ranges, single IPs, binary, CSV, prefix/suffix
383+
- [Operations](wiki/operations.md) — merge, intersect, exclude, diff, reduce, compare, count
384+
- [IPv6 support](wiki/ipv6.md) — address family, normalization, cross-family rules
385+
- [DNS resolution](wiki/dns-resolution.md) — threading, retry, configuration
386+
- [Optimizing ipsets for iptables](wiki/ipset-reduce.md) — prefix reduction with examples
387387

388388
## Getting help
389389

wiki/Home.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# iprange
2+
3+
`iprange` is a fast command-line tool for managing IPv4 and IPv6 address sets. It reads IPs, CIDRs, ranges, and hostnames, normalizes them into optimal non-overlapping sets, and performs set operations: union, intersection, difference, complement, comparison, and prefix reduction.
4+
5+
For 1 million input lines, a merge completes in under a second.
6+
7+
## Documentation
8+
9+
- [Input formats](input-formats.md) — every accepted format, file lists, directories, binary input
10+
- [Output formats](output-formats.md) — CIDR, ranges, single IPs, binary, CSV, prefix/suffix strings
11+
- [Operations](operations.md) — merge, intersect, exclude, diff, reduce, compare, count
12+
- [IPv6 support](ipv6.md) — address family selection, normalization, cross-family rules
13+
- [DNS resolution](dns-resolution.md) — parallel threading, retry, configuration
14+
- [Optimizing ipsets for iptables](ipset-reduce.md) — prefix reduction tutorial with examples
15+
16+
## Quick reference
17+
18+
```
19+
iprange [options] file1 file2 ...
20+
```
21+
22+
### Address family
23+
24+
| Flag | Mode |
25+
|------|------|
26+
| *(default)* | IPv4 |
27+
| `-4` / `--ipv4` | Explicit IPv4 |
28+
| `-6` / `--ipv6` | IPv6 (accepts both IPv6 and IPv4, normalizes IPv4 to `::ffff:x.x.x.x`) |
29+
30+
### Operations
31+
32+
| Option | Operation | Output |
33+
|--------|-----------|--------|
34+
| *(default)* | Union / merge | CIDR |
35+
| `--common` | Intersection | CIDR |
36+
| `--except` | A minus B (positional) | CIDR |
37+
| `--diff` | Symmetric difference (positional) | CIDR |
38+
| `--ipset-reduce N` | Merge + reduce prefixes | CIDR |
39+
| `--compare` | All vs all | CSV |
40+
| `--compare-first` | First vs rest | CSV |
41+
| `--compare-next` | Group vs group (positional) | CSV |
42+
| `--count-unique` / `-C` | Merged counts | CSV |
43+
| `--count-unique-all` | Per-file counts | CSV |
44+
45+
### Output format
46+
47+
| Option | Format |
48+
|--------|--------|
49+
| *(default)* | CIDR (`10.0.0.0/24`) |
50+
| `-j` / `--print-ranges` | Ranges (`10.0.0.0-10.0.0.255`) |
51+
| `-1` / `--print-single-ips` | One IP per line |
52+
| `--print-binary` | Binary (same-architecture cache) |
53+
54+
### Feature detection
55+
56+
```bash
57+
iprange --has-compare # compare modes
58+
iprange --has-reduce # reduce mode
59+
iprange --has-filelist-loading # @filename support
60+
iprange --has-directory-loading # @directory support
61+
iprange --has-ipv6 # IPv6 support
62+
```
63+
64+
Each exits 0 if the feature is present.
65+
66+
## Related projects
67+
68+
- [FireHOL IP Lists](https://iplists.firehol.org) — curated collection of IP blocklists, updated daily using `iprange`
69+
- [FireHOL](https://github.com/firehol/firehol) — Linux firewall tool that uses `iprange` for ipset management
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)