fastd-limiter

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

README

fastd-limiter

We are building a peer limiter for the fastd vpn daemon.

Getting Started

Requirements
Installation
$ go get github.com/freifunk-mwu/fastd-limiter
Configuration

fastd-limiter searches for a config file in /etc/fastd-limiter.yaml. An example can be found in this repository.

There are three mandatory config options: fastd_keys, gateways and metrics_url.

fastd_keys is the path to the directory that holds the fastd public keys.

gateways is a list of all gateways from which fastd-exporter metrics should be retrieved.

metrics_url is the base url for retrieving metrics. It has to include on one placeholder (%s) which is replaced with the values from gateways.

All other options are populated with sane default values. See example config for more information.

Usage

fastd-limiter has four commands: keys, limit, peers and verify. The first three are meant be called periodically. verify is supposed to be called via on verify by fastd.

./fastd-limiter [command]

keys reads all keys found into the Redis database with the configured TTL.

limit reads the prometheus metrics from all configured gateways, calculates the average peer count and stores it in the Redis database.

peers reads the local prometheus metrics and writes the locally connected peers count into the Redis database.

verify takes the public key to verify as first command line argument and checks if it is present in the Redis database and if the connected locally connected peers are below the calculated limit. If one of the two criteria is not met the application exits with a return code of 1.

./fastd-limiter verify [fastd_key]
Help

Check out the help for additional information.

$ ./fastd-limiter --help
Formatting

We are using go's internal formatting for this codebase.

$ go fmt

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL