From: Alberto Leiva Popper Date: Mon, 25 Mar 2019 21:08:12 +0000 (-0600) Subject: Add instructions to run X-Git-Tag: v0.0.2~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56e305ac509085c8e85e2309947b1a893e6d80c7;p=thirdparty%2FFORT-validator.git Add instructions to run --- diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index 8d7616ba..25384c2e 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -4,10 +4,17 @@ {{ page.title }} + + + +
+WARNING Warning: This documentation is still under construction. A good chunk of it will already be obsolete by the time FORT v1.0.0 is released. +
+ {{ content }} diff --git a/docs/css/screen.css b/docs/css/screen.css index 431d3725..5cca8753 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -1,3 +1,13 @@ +blockquote { + padding: 1em; + border-radius: 3px; + border: 1px solid #ddd; + color: #404040; + background-color: #f0f6ff; + margin-left: 3em; + margin-right: 3em; +} + code { background-color: #f8f8f8; } diff --git a/docs/doc/index.md b/docs/doc/index.md index 0be75e19..b445e8b6 100644 --- a/docs/doc/index.md +++ b/docs/doc/index.md @@ -1,10 +1,12 @@ --- +title: Documentation Index --- -# Documentation Index +# {{ page.title }} 1. [Introduction to RPKI](intro-rpki.html) 2. [Introduction to Fort](intro-fort.html) 3. [Compilation and Installation](installation.html) -4. [Validator usage](validator.html) -5. [RTR Server usage](rtr-server.html) +4. [Running the package](run.html) +5. [Validator usage](validator.html) +6. [RTR Server usage](rtr-server.html) diff --git a/docs/doc/installation.md b/docs/doc/installation.md index 0524135c..75092cc6 100644 --- a/docs/doc/installation.md +++ b/docs/doc/installation.md @@ -1,7 +1,8 @@ --- +title: Compilation and Installation --- -# Compilation and Installation +# {{ page.title }} ## Index diff --git a/docs/doc/intro-fort.md b/docs/doc/intro-fort.md index bbc4e1c1..5cf92873 100644 --- a/docs/doc/intro-fort.md +++ b/docs/doc/intro-fort.md @@ -1,7 +1,8 @@ --- +title: Introduction to FORT --- -# Introduction to FORT +# {{ page.title }} ## Design diff --git a/docs/doc/rtr-server.md b/docs/doc/rtr-server.md index 39960599..607c7cbd 100644 --- a/docs/doc/rtr-server.md +++ b/docs/doc/rtr-server.md @@ -1,5 +1,6 @@ --- +title: RTR Server arguments --- -# +# {{ page.title }} diff --git a/docs/doc/run.md b/docs/doc/run.md new file mode 100644 index 00000000..d5e22934 --- /dev/null +++ b/docs/doc/run.md @@ -0,0 +1,102 @@ +--- +title: Running the package +--- + +# {{ page.title }} + +> Note: The separation between Validator and RTR server is a temporal arrangement for the Beta version. +> +> For the sake of performance and ease of use, the two binaries will be merged by the time version 1.0.0 is released. These instructions will become obsolete then. + +Create file `~/fort/update-rpki.sh`, and drop the following content into it: + +{% highlight bash %} +#!/bin/bash + +# TODO I'm assuming the file names will not contain whitespace for now. + +# First argument: Directory containing all the TALs +TAL_DIRECTORY=$1 +# Second argument: File we share with the RTR server +# (The script will also temporarily manage a file called +# "$OUTPUT_FILE.tmp") +OUTPUT_FILE=$2 +# Third argument: Working directory. +# We'll store the repository and temporal files here. +WORKING_DIR=$3 + +# Directory where we'll store temporal ROA files, used to assemble +# $OUTPUT_FILE.tmp. +TMP_ROA_DIR=$WORKING_DIR/roa +# The local repository cache +CACHE_DIR=$WORKING_DIR/repository + + +mkdir -p $TMP_ROA_DIR +mkdir -p $CACHE_DIR + +echo "Updating and validating the repository..." +# TODO we'd probably gain a lot of performance by running these in +# parallel +for TAL_FILE in $TAL_DIRECTORY/*; do + echo " Handling TAL $TAL_FILE..." + /usr/local/bin/rpki_validator \ + --tal $TAL_FILE \ + --local-repository $CACHE_DIR \ + --roa-output-file $TMP_ROA_DIR/$(basename $TAL_FILE .tal).roa.tmp \ + > /dev/null +done + +echo "Joining all the generated ROA files..." + +# Make sure it exists. Otherwise the mv explodes +touch $OUTPUT_FILE.tmp +# Make sure $TMP_ROA_DIR/*.tmp expands, even if there are no files. +shopt -s nullglob + +for TMP_ROA_FILE in $TMP_ROA_DIR/*.tmp; do + echo " Joining file $TMP_ROA_FILE..." + cat $TMP_ROA_FILE >> $OUTPUT_FILE.tmp + rm $TMP_ROA_FILE +done + +echo "Replacing old ROA file with new one..." +# (Needs to be done last for the sake of atomicity.) +mv $OUTPUT_FILE.tmp $OUTPUT_FILE + +echo "Done." +{% endhighlight %} + +Grant it executable permissions: + +{% highlight bash %} +$ chmod +x ~/fort/update-rpki.sh +{% endhighlight %} + +Place your `.tal` files in `~/fort/tal`: + +{% highlight bash %} +$ mv ~/fort/tal +{% endhighlight %} + +Then create a cron job (`crontab -e`), running the script above every hour: + + 0 * * * * ~/fort/update-rpki.sh ~/fort/tal /tmp/fort/roas.csv /tmp/fort + +Now the RTR Server can serve the ROAs: + +{% highlight bash %} +$ cat rtr-config.json +{ + "listen": { + "address": "::1", + "port": "8323", + "queue": 10 + }, + "vrps": { + "location": "/tmp/fort/roas.csv", + "checkInterval": 60 + } +} +$ rtr_server -f rtr-config.json +{% endhighlight %} diff --git a/docs/doc/validator.md b/docs/doc/validator.md index b4901638..8e7a125d 100644 --- a/docs/doc/validator.md +++ b/docs/doc/validator.md @@ -1,8 +1,9 @@ --- +title: Validator Usage command: rpki_validator --- -# Validator Usage +# {{ page.title }} ## Index diff --git a/docs/img/warn.svg b/docs/img/warn.svg new file mode 100644 index 00000000..2ef3cba6 --- /dev/null +++ b/docs/img/warn.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/docs/index.md b/docs/index.md index 7ed79c77..35ac7974 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,8 @@ --- +title: Home --- -# Home +# {{ page.title }} ## Introduction