1

Merge branch 'ewpratten/pkg'

This commit is contained in:
Evan Pratten 2023-07-20 15:51:11 -04:00
commit 0b7e82deec
4 changed files with 27 additions and 12 deletions

3
.gitignore vendored
View File

@ -17,3 +17,6 @@ Cargo.lock
/target
#Cargo.lock
# Built packages
/tars

View File

@ -7,10 +7,22 @@ GIT_HASH ?= $(shell git log --format="%h" -n 1)
# Release binary for x64
target/x86_64-unknown-linux-musl/release/protomask: $(SRC)
cross build --target x86_64-unknown-linux-musl --release
# sudo setcap cap_net_admin=eip $@
# Release binary for aarch64
target/aarch64-unknown-linux-musl/release/protomask: $(SRC)
cross build --target aarch64-unknown-linux-musl --release
# sudo setcap cap_net_admin=eip $@
# All tars
tars: tars/protomask-$(GIT_HASH)-x86_64.tar.gz tars/protomask-$(GIT_HASH)-aarch64.tar.gz
# TAR file for x64
tars/protomask-$(GIT_HASH)-x86_64-linux-musl.tar.gz: target/x86_64-unknown-linux-musl/release/protomask protomask.toml
mkdir -p tars
cp protomask.toml target/x86_64-unknown-linux-musl/release/
tar -czf $@ -C target/x86_64-unknown-linux-musl/release/ protomask protomask.toml
# TAR file for aarch64
tars/protomask-$(GIT_HASH)-aarch64-linux-musl.tar.gz: target/aarch64-unknown-linux-musl/release/protomask protomask.toml
mkdir -p tars
cp protomask.toml target/aarch64-unknown-linux-musl/release/
tar -czf $@ -C target/aarch64-unknown-linux-musl/release/ protomask protomask.toml

View File

@ -24,6 +24,8 @@ Protomask uses a [TOML](https://toml.io) configuration file. Here is a functiona
```toml
# The NAT64 prefix to route to protomask
Nat64Prefix = "64:ff9b::/96"
# Setting this will enable prometheus metrics
Prometheus = "[::]:8080" # Optional, defaults to disabled
[Pool]
# All prefixes in the pool
@ -38,20 +40,18 @@ Static = [{ v4 = "192.0.2.2", v6 = "2001:db8:1::2" }]
Protomask can be installed using various methods:
### Using pre-built binaries
Head over to the [releases](https://github.com/ewpratten/protomask/releases) page and download the latest release for your platform.
This will contain a binary and example config file to get you started.
### Using Cargo
```bash
cargo install protomask
```
### From source
```bash
git clone https://github.com/ewpratten/protomask
cd protomask
cargo install --path .
```
## Usage
```text

View File

@ -1,7 +1,7 @@
# Protomask example configuraiton file
# The NAT64 prefix to route to protomask
Nat64Prefix = "64:ff9b::/96"
# Setting this will enable prometheus metrics
Prometheus = "[::]:8080" # Optional, defaults to disabled
[Pool]
# All prefixes in the pool