Skip to content
Freifunk Potsdam IP-Address Management
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
nix
src
web
.gitignore
Cargo.lock
Cargo.nix
Cargo.toml
README.md
release.nix
shell.nix

README.md

IPv4 Address Management für Freifunk Potsdam

built with nix

CI status

API

Wanna try it out? Current master is hosted for testing on https://ipam.erictapen.name/ip4/.

List registered IPv4 adresses

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'

Register a new address

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" }'

Building the daemon

Dependencies

As this uses Rocket, you need a recent 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.

Building with Cargo

$ cargo build --release

Running the daemon

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" \
  --static-dir ./web/build/ \
  /path/to/state/dir

Building the Web app

See ./web.

You can’t perform that action at this time.