Wanna try it out? Current master is hosted for testing on https://ipam.erictapen.name/ip4/
.
curl https://ipam.erictapen.name/ip4 \
-H 'Accept: application/json' \ # This line can be omitted with curl, but in general ffp-ipam cares about the Accept header and serves HTML if wanted!
-H 'x-api-key: ThisIsNotSecretYet'
curl https://ipam.erictapen.name/ip4/register \
-H 'x-api-key: ThisIsNotSecretYet' \
-H 'Content-Type: application/json' \
--data '{ "ip4": "192.168.0.1/32", "contact": "mail@freifunk-potsdam.de", "location": "Behind the corner", "node_name": "mynodename" }'
As this uses Rocket, you need a nightly version of rustc
for building. Rustup is a way to get it.
Also you need pkgconfig
and openssl
to be installed. If you are using Nix, nix-shell
should be enough to get them through shell.nix
.
$ cargo build --release
ffp-ipam \
--listen 127.0.0.1 \
--port 8000 \
--token "ThisIsNotSecretYet" \
--ip4-range "192.168.0.0/24" \
--ip4-range "10.0.0.0/16" \
/path/to/state/dir