This commit is contained in:
Generic Committer
2021-05-07 14:34:19 +00:00
committed by Generic Commit Task
parent 21257441d0
commit eb60e4b5e9
21 changed files with 130 additions and 170 deletions
+4 -4
View File
@@ -28,9 +28,9 @@ jobs:
- name: Build
run: |
make dist-key
GOOS=linux make build-gortr
GOOS=darwin make build-gortr
GOOS=windows EXTENSION=.exe make build-gortr
GOOS=linux make build-stayrtr
GOOS=darwin make build-stayrtr
GOOS=windows EXTENSION=.exe make build-stayrtr
GOOS=linux make build-rtrdump
GOOS=darwin make build-rtrdump
GOOS=windows EXTENSION=.exe make build-rtrdump
@@ -45,7 +45,7 @@ jobs:
sudo gem install fpm
- name: Package
run: make package-deb-gortr package-rpm-gortr
run: make package-deb-stayrtr package-rpm-stayrtr
- name: Upload Artifact
uses: actions/upload-artifact@v2
+4 -4
View File
@@ -24,9 +24,9 @@ jobs:
- name: Build
run: |
make dist-key
GOOS=linux make build-gortr
GOOS=darwin make build-gortr
GOOS=windows EXTENSION=.exe make build-gortr
GOOS=linux make build-stayrtr
GOOS=darwin make build-stayrtr
GOOS=windows EXTENSION=.exe make build-stayrtr
GOOS=linux make build-rtrdump
GOOS=darwin make build-rtrdump
GOOS=windows EXTENSION=.exe make build-rtrdump
@@ -41,7 +41,7 @@ jobs:
sudo gem install fpm
- name: Package
run: make package-deb-gortr package-rpm-gortr
run: make package-deb-stayrtr package-rpm-stayrtr
- name: Create Release
id: create_release
+1 -1
View File
@@ -1,4 +1,4 @@
ARG src_uri=github.com/cloudflare/gortr/cmd/rtrdump
ARG src_uri=github.com/bgp/stayrtr/cmd/rtrdump
FROM golang:alpine as builder
ARG src_uri
+1 -1
View File
@@ -1,4 +1,4 @@
ARG src_uri=github.com/cloudflare/gortr/cmd/rtrmon
ARG src_uri=github.com/bgp/stayrtr/cmd/rtrmon
FROM golang:alpine as builder
ARG src_uri
+4 -4
View File
@@ -1,4 +1,4 @@
ARG src_dir="/gortr"
ARG src_dir="/stayrtr"
FROM golang:alpine as builder
ARG src_dir
@@ -10,7 +10,7 @@ RUN apk --update --no-cache add git && \
WORKDIR ${src_dir}
COPY . .
RUN go build -ldflags "${LDFLAGS}" cmd/gortr/gortr.go
RUN go build -ldflags "${LDFLAGS}" cmd/stayrtr/stayrtr.go
FROM alpine:latest as keygen
@@ -24,6 +24,6 @@ RUN apk --update --no-cache add ca-certificates && \
adduser -S -D -H -h / rtr
USER rtr
COPY --from=builder ${src_dir}/gortr ${src_dir}/cmd/gortr/cf.pub /
COPY --from=builder ${src_dir}/stayrtr ${src_dir}/cmd/stayrtr/cf.pub /
COPY --from=keygen /private.pem /private.pem
ENTRYPOINT ["./gortr"]
ENTRYPOINT ["./stayrtr"]
@@ -1,4 +1,4 @@
ARG src_uri=github.com/cloudflare/gortr/cmd/gortr
ARG src_uri=github.com/bgp/stayrtr/cmd/stayrtr
FROM golang:alpine as builder
ARG src_uri
@@ -18,7 +18,7 @@ RUN apk --update --no-cache add ca-certificates && \
adduser -S -D -H -h / rtr
USER rtr
COPY --from=builder /go/bin/gortr /
COPY cmd/gortr/cf.pub /
COPY --from=builder /go/bin/stayrtr /
COPY cmd/stayrtr/cf.pub /
COPY --from=keygen /private.pem /private.pem
ENTRYPOINT ["./gortr"]
ENTRYPOINT ["./stayrtr"]
+36 -36
View File
@@ -4,32 +4,32 @@ GOOS ?= linux
ARCH ?= $(shell uname -m)
BUILDINFOSDET ?=
DOCKER_REPO := cloudflare/
GORTR_NAME := gortr
GORTR_VERSION := $(shell git describe --tags $(git rev-list --tags --max-count=1))
VERSION_PKG := $(shell echo $(GORTR_VERSION) | sed 's/^v//g')
DOCKER_REPO := bgp/
STAYRTR_NAME := stayrtr
STAYRTR_VERSION := $(shell git describe --tags $(git rev-list --tags --max-count=1))
VERSION_PKG := $(shell echo $(STAYRTR_VERSION) | sed 's/^v//g')
ARCH := x86_64
LICENSE := BSD-3
URL := https://github.com/cloudflare/gortr
DESCRIPTION := GoRTR: a RPKI-to-Router server
URL := https://github.com/bgp/stayrtr
DESCRIPTION := StayRTR: a RPKI-to-Router server
BUILDINFOS := ($(shell date +%FT%T%z)$(BUILDINFOSDET))
LDFLAGS := '-X main.version=$(GORTR_VERSION) -X main.buildinfos=$(BUILDINFOS)'
LDFLAGS := '-X main.version=$(STAYRTR_VERSION) -X main.buildinfos=$(BUILDINFOS)'
RTRDUMP_NAME := rtrdump
RTRMON_NAME := rtrmon
OUTPUT_GORTR := $(DIST_DIR)gortr-$(GORTR_VERSION)-$(GOOS)-$(ARCH)$(EXTENSION)
OUTPUT_RTRDUMP := $(DIST_DIR)rtrdump-$(GORTR_VERSION)-$(GOOS)-$(ARCH)$(EXTENSION)
OUTPUT_RTRMON := $(DIST_DIR)rtrmon-$(GORTR_VERSION)-$(GOOS)-$(ARCH)$(EXTENSION)
OUTPUT_STAYRTR := $(DIST_DIR)stayrtr-$(STAYRTR_VERSION)-$(GOOS)-$(ARCH)$(EXTENSION)
OUTPUT_RTRDUMP := $(DIST_DIR)rtrdump-$(STAYRTR_VERSION)-$(GOOS)-$(ARCH)$(EXTENSION)
OUTPUT_RTRMON := $(DIST_DIR)rtrmon-$(STAYRTR_VERSION)-$(GOOS)-$(ARCH)$(EXTENSION)
.PHONY: vet
vet:
go vet cmd/gortr/gortr.go
go vet cmd/stayrtr/stayrtr.go
.PHONY: test
test:
go test -v github.com/cloudflare/gortr/lib
go test -v github.com/cloudflare/gortr/prefixfile
go test -v github.com/bgp/stayrtr/lib
go test -v github.com/bgp/stayrtr/prefixfile
.PHONY: prepare
prepare:
@@ -41,11 +41,11 @@ clean:
.PHONY: dist-key
dist-key: prepare
cp cmd/gortr/cf.pub $(DIST_DIR)
cp cmd/stayrtr/cf.pub $(DIST_DIR)
.PHONY: build-gortr
build-gortr: prepare
go build -ldflags $(LDFLAGS) -o $(OUTPUT_GORTR) cmd/gortr/gortr.go
.PHONY: build-stayrtr
build-stayrtr: prepare
go build -ldflags $(LDFLAGS) -o $(OUTPUT_STAYRTR) cmd/stayrtr/stayrtr.go
.PHONY: build-rtrdump
build-rtrdump:
@@ -55,44 +55,44 @@ build-rtrdump:
build-rtrmon:
go build -ldflags $(LDFLAGS) -o $(OUTPUT_RTRMON) cmd/rtrmon/rtrmon.go
.PHONY: docker-gortr
docker-gortr:
docker build -t $(DOCKER_REPO)$(GORTR_NAME):$(GORTR_VERSION) --build-arg LDFLAGS=$(LDFLAGS) -f Dockerfile.gortr .
.PHONY: docker-stayrtr
docker-stayrtr:
docker build -t $(DOCKER_REPO)$(STAYRTR_NAME):$(STAYRTR_VERSION) --build-arg LDFLAGS=$(LDFLAGS) -f Dockerfile.stayrtr .
.PHONY: docker-rtrdump
docker-rtrdump:
docker build -t $(DOCKER_REPO)$(RTRDUMP_NAME):$(GORTR_VERSION) --build-arg LDFLAGS=$(LDFLAGS) -f Dockerfile.rtrdump .
docker build -t $(DOCKER_REPO)$(RTRDUMP_NAME):$(STAYRTR_VERSION) --build-arg LDFLAGS=$(LDFLAGS) -f Dockerfile.rtrdump .
.PHONY: docker-rtrmon
docker-rtrmon:
docker build -t $(DOCKER_REPO)$(RTRMON_NAME):$(GORTR_VERSION) --build-arg LDFLAGS=$(LDFLAGS) -f Dockerfile.rtrmon .
docker build -t $(DOCKER_REPO)$(RTRMON_NAME):$(STAYRTR_VERSION) --build-arg LDFLAGS=$(LDFLAGS) -f Dockerfile.rtrmon .
.PHONY: package-deb-gortr
package-deb-gortr: prepare
fpm -s dir -t deb -n $(GORTR_NAME) -v $(VERSION_PKG) \
.PHONY: package-deb-stayrtr
package-deb-stayrtr: prepare
fpm -s dir -t deb -n $(STAYRTR_NAME) -v $(VERSION_PKG) \
--description "$(DESCRIPTION)" \
--url "$(URL)" \
--architecture $(ARCH) \
--license "$(LICENSE)" \
--package $(DIST_DIR) \
$(OUTPUT_GORTR)=/usr/bin/gortr \
package/gortr.service=/lib/systemd/system/gortr.service \
package/gortr.env=/etc/default/gortr \
cmd/gortr/cf.pub=/usr/share/gortr/cf.pub \
$(OUTPUT_STAYRTR)=/usr/bin/stayrtr \
package/stayrtr.service=/lib/systemd/system/stayrtr.service \
package/stayrtr.env=/etc/default/stayrtr \
cmd/stayrtr/cf.pub=/usr/share/stayrtr/cf.pub \
$(OUTPUT_RTRDUMP)=/usr/bin/rtrdump \
$(OUTPUT_RTRMON)=/usr/bin/rtrmon
.PHONY: package-rpm-gortr
package-rpm-gortr: prepare
fpm -s dir -t rpm -n $(GORTR_NAME) -v $(VERSION_PKG) \
.PHONY: package-rpm-stayrtr
package-rpm-stayrtr: prepare
fpm -s dir -t rpm -n $(STAYRTR_NAME) -v $(VERSION_PKG) \
--description "$(DESCRIPTION)" \
--url "$(URL)" \
--architecture $(ARCH) \
--license "$(LICENSE) "\
--package $(DIST_DIR) \
$(OUTPUT_GORTR)=/usr/bin/gortr \
package/gortr.service=/lib/systemd/system/gortr.service \
package/gortr.env=/etc/default/gortr \
cmd/gortr/cf.pub=/usr/share/gortr/cf.pub \
$(OUTPUT_STAYRTR)=/usr/bin/stayrtr \
package/stayrtr.service=/lib/systemd/system/stayrtr.service \
package/stayrtr.env=/etc/default/stayrtr \
cmd/stayrtr/cf.pub=/usr/share/stayrtr/cf.pub \
$(OUTPUT_RTRDUMP)=/usr/bin/rtrdump \
$(OUTPUT_RTRMON)=/usr/bin/rtrmon
+39 -79
View File
@@ -1,14 +1,13 @@
# GoRTR
# StayRTR
[![Build Status](https://github.com/cloudflare/gortr/workflows/Go/badge.svg)](https://github.com/cloudflare/gortr/actions?query=workflow%3AGo)
[![GoDoc](https://godoc.org/github.com/cloudflare/gortr?status.svg)](https://pkg.go.dev/github.com/cloudflare/gortr)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/cloudflare/gortr)
GoRTR is an open-source implementation of RPKI to Router protocol (RFC 6810) using the [the Go Programming Language](http://golang.org/).
StayRTR is an open-source implementation of RPKI to Router protocol (RFC 6810) based on StayRTR using the [the Go Programming Language](http://golang.org/).
This project is not affiliated with Cloudflare and any references to Cloudflare are simply a function of forking. We do love the Cloudyflares though!
* `/lib` contains a library to create your own server and client.
* `/prefixfile` contains the structure of a JSON export file and signing capabilities.
* `/cmd/gortr/gortr.go` is a simple implementation that fetches a list and offers it to a router.
* `/cmd/stayrtr/stayrtr.go` is a simple implementation that fetches a list and offers it to a router.
* `/cmd/rtrdump/rtrdump.go` allows copying the PDUs sent by a RTR server as a JSON file.
* `/cmd/rtrmon/rtrmon.go` compare and monitor two RTR servers (using RTR and/or JSON), outputs diff and Prometheus metrics.
@@ -18,50 +17,11 @@ _This software comes with no warranty._
## In the field
<img align="left" src="docs/images/cloudflare.png" alt="Cloudflare" width="200px">
_Cloudflare operates 200+ GoRTR globally. They provide redundancy in at the PoP level.
This provides increased reliability by computing a unique prefix list and providing
a secure distribution of the file over its CDN before being sent to the routers._
_GoRTR also powers the public RTR server available on rtr.rpki.cloudflare.com on port 8282 and 8283 for SSH (rpki/rpki)_
<br>
<img align="left" src="docs/images/telia.png" alt="Telia" width="200px">
_Telia has deployed RPKI and uses GoRTR connected with OctoRPKI and rpki-client to distribute the ROAs to its routers.
Instances of the RTR servers handle around 250 sessions each._
<br>
<img align="left" src="docs/images/ntt.png" alt="NTT" width="150px">
_NTT has deployed OpenBSD's rpki-client together with GoRTR to facilitate rejecting RPKI Invalid BGP route announcements
towards it's Global IP Network (AS 2914). More information is available [here](https://www.us.ntt.net/support/policy/rr.cfm#RPKI)._
<br>
<img align="left" src="docs/images/gtt.png" alt="GTT" width="100px">
_GTT deployed GoRTR along with OctoRPKI. The setup currently provides 400+ RTR sessions to their routers for filtering
RPKI invalids._
<br>
<img align="left" src="docs/images/cogent.png" alt="Cogent" width="150px">
_Cogent deployed GoRTR and OctoRPKI at the end of May 2020. 8 validators feed approximately 2500 routers._
<br>
Router vendors also used this software to develop their implementations.
_Do you use this tool at scale? Let us know!_
People probably use this!
## Features of the server
* Refreshes a JSON list of prefixes (from either Cloudflare or a RIPE Validator)
* Refreshes a JSON list of prefixes
* Prometheus metrics
* Lightweight
* TLS
@@ -89,42 +49,42 @@ You need a working [Go environment](https://golang.org/doc/install) (1.10 or new
This project also uses [Go Modules](https://github.com/golang/go/wiki/Modules).
```bash
$ git clone git@github.com:cloudflare/gortr.git && cd gortr
$ go build cmd/gortr/gortr.go
$ git clone git@github.com:bgp/stayrtr.git && cd stayrtr
$ go build cmd/stayrtr/stayrtr.go
```
## With Docker
If you do not want to use Docker, please go to the next section.
If you have **Docker**, you can start GoRTR with `docker run -ti -p 8082:8082 cloudflare/gortr`.
If you have **Docker**, you can start StayRTR with `docker run -ti -p 8082:8082 bgp/stayrtr` someday when it has been built.
The containers contain Cloudflare's public signing key and an testing ECDSA private
key for the SSH server.
It will automatically download Cloudflare's prefix list and use the public key
It will automatically download Cloudflare's (thanks Cloudflare!) prefix list and use the public key
to validate it.
You can now use any CLI attributes as long as they are after the image name:
```bash
$ docker run -ti -p 8083:8083 cloudflare/gortr -bind :8083
$ docker run -ti -p 8083:8083 bgp/stayrtr -bind :8083
```
If you want to build your own image of GoRTR:
If you want to build your own image of StayRTR:
```bash
$ docker build -t mygortr -f Dockerfile.gortr.prod .
$ docker run -ti mygortr -h
$ docker build -t mystayrtr -f Dockerfile.stayrtr.prod .
$ docker run -ti mystayrtr -h
```
It will download the code from GitHub and compile it with Go and also generate an ECDSA key for SSH.
Please note: if you plan to use SSH with Cloudflare's default container (`cloudflare/gortr`),
Please note: if you plan to use SSH with the default container (`bgp/stayrtr`),
replace the key `private.pem` since it is a testing key that has been published.
An example is given below:
```bash
$ docker run -ti -v $PWD/mynewkey.pem:/private.pem cloudflare/gortr -ssh.bind :8083
$ docker run -ti -v $PWD/mynewkey.pem:/private.pem bgp/stayrtr -ssh.bind :8083
```
## Install it
@@ -134,7 +94,7 @@ There are a few solutions to install it.
Go can directly fetch it from the source
```bash
$ go get github.com/cloudflare/gortr/cmd/gortr
$ go get github.com/bgp/stayrtr/cmd/stayrtr
```
Copy `cf.pub` to your local directory if you want to use Cloudflare's signed JSON file.
@@ -142,22 +102,22 @@ Copy `cf.pub` to your local directory if you want to use Cloudflare's signed JSO
You can use the Makefile (by default it will be compiled for Linux, add `GOOS=darwin` for Mac)
```bash
$ make dist-key build-gortr
$ make dist-key build-stayrtr
```
The compiled file will be in `/dist`.
Or you can use a package (or binary) file from the [Releases page](https://github.com/cloudflare/gortr/releases):
Or you can use a package (or binary) file from the [Releases page](https://github.com/bgp/stayrtr/releases):
```bash
$ sudo dpkg -i gortr[...].deb
$ sudo systemctl start gortr
$ sudo dpkg -i stayrtr[...].deb
$ sudo systemctl start stayrtr
```
If you want to sign your list of prefixes, generate an ECDSA key.
Then generate the public key to be used in GoRTR.
Then generate the public key to be used in StayRTR.
You will have to setup your validator to use this key or have another
tool to sign the JSON file before passing it to GoRTR.
tool to sign the JSON file before passing it to StayRTR.
```bash
$ openssl ecparam -genkey -name prime256v1 -noout -outform pem > private.pem
@@ -169,7 +129,7 @@ $ openssl ec -in private.pem -pubout -outform pem > public.pem
Once you have a binary:
```bash
$ ./gortr -tls.bind 127.0.0.1:8282
$ ./stayrtr -tls.bind 127.0.0.1:8282
```
Make sure cf.pub is in the current directory. Or pass `-verify.key=path/to/cf.pub`
@@ -189,7 +149,7 @@ You can find both files in the `dist/` directory.
This was tested with a basic Squid proxy. The `User-Agent` header is passed
in the CONNECT.
You have to export the following two variables in order for GoRTR to use the proxy.
You have to export the following two variables in order for StayRTR to use the proxy.
```
export HTTP_PROXY=schema://host:port
@@ -198,7 +158,7 @@ export HTTPS_PROXY=schema://host:port
### With SSL
You can run GoRTR and listen for TLS connections only (just pass `-bind ""`).
You can run StayRTR and listen for TLS connections only (just pass `-bind ""`).
First, you will have to create a SSL certificate.
@@ -210,12 +170,12 @@ $ openssl req -new -x509 -key private.pem -out server.pem
Then, you have to run
```bash
$ ./gortr -ssh.bind :8282 -tls.key private.pem -tls.cert server.pem
$ ./stayrtr -ssh.bind :8282 -tls.key private.pem -tls.cert server.pem
```
### With SSH
You can run GoRTR and listen for SSH connections only (just pass `-bind ""`).
You can run StayRTR and listen for SSH connections only (just pass `-bind ""`).
You will have to create an ECDSA key. You can use the following command:
@@ -226,7 +186,7 @@ $ openssl ecparam -genkey -name prime256v1 -noout -outform pem > private.pem
Then you can start:
```bash
$ ./gortr -ssh.bind :8282 -ssh.key private.pem -bind ""
$ ./stayrtr -ssh.bind :8282 -ssh.key private.pem -bind ""
```
By default, there is no authentication.
@@ -236,18 +196,18 @@ You can use password and key authentication:
For example, to configure user **rpki** and password **rpki**:
```bash
$ ./gortr -ssh.bind :8282 -ssh.key private.pem -ssh.method.password=true -ssh.auth.user rpki -ssh.auth.password rpki -bind ""
$ ./stayrtr -ssh.bind :8282 -ssh.key private.pem -ssh.method.password=true -ssh.auth.user rpki -ssh.auth.password rpki -bind ""
```
And to configure a bypass for every SSH key:
```bash
$ ./gortr -ssh.bind :8282 -ssh.key private.pem -ssh.method.key=true -ssh.auth.key.bypass=true -bind ""
$ ./stayrtr -ssh.bind :8282 -ssh.key private.pem -ssh.method.key=true -ssh.auth.key.bypass=true -bind ""
```
## Configure filters and overrides (SLURM)
GoRTR supports SLURM configuration files ([RFC8416](https://tools.ietf.org/html/rfc8416)).
StayRTR supports SLURM configuration files ([RFC8416](https://tools.ietf.org/html/rfc8416)).
Create a json file (`slurm.json`):
@@ -285,7 +245,7 @@ Create a json file (`slurm.json`):
}
```
When starting GoRTR, add the `-slurm ./slurm.json` argument.
When starting StayRTR, add the `-slurm ./slurm.json` argument.
The log should display something similar to the following:
@@ -297,9 +257,9 @@ INFO[0002] New update (112215 uniques, 112215 total prefixes).
For instance, if the original JSON fetched contains the ROA: `10.0.0.0/24-24 AS65001`,
it will be removed.
The JSON exported by GoRTR will contain the overrides and the file can be signed again.
Others GoRTR can be configured to fetch the ROAs from the filtering GoRTR:
the operator manages one SLURM file on a leader GoRTR.
The JSON exported by StayRTR will contain the overrides and the file can be signed again.
Others StayRTR can be configured to fetch the ROAs from the filtering StayRTR:
the operator manages one SLURM file on a leader StayRTR.
## Debug the content
@@ -348,9 +308,9 @@ You can define a serial to start with the following way:
* the flag `-useserial` must be set to 1 or 2
When flag is set to 1, every change of file will increment the serial regardless of the current `serial` field.
Make sure the refresh rate of GoRTR is more frequent than the refresh rate of the JSON.
Make sure the refresh rate of StayRTR is more frequent than the refresh rate of the JSON.
When flag is set to 2, GoRTR will set the value of the serial in the JSON. If an ID is missed or not updated,
When flag is set to 2, StayRTR will set the value of the serial in the JSON. If an ID is missed or not updated,
it will cause discrepancies on the client.
## Configurations
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"errors"
"flag"
"fmt"
rtr "github.com/cloudflare/gortr/lib"
"github.com/cloudflare/gortr/prefixfile"
rtr "github.com/bgp/stayrtr/lib"
"github.com/bgp/stayrtr/prefixfile"
log "github.com/sirupsen/logrus"
"golang.org/x/crypto/ssh"
"io"
+4 -4
View File
@@ -7,9 +7,9 @@ import (
"errors"
"flag"
"fmt"
rtr "github.com/cloudflare/gortr/lib"
"github.com/cloudflare/gortr/prefixfile"
"github.com/cloudflare/gortr/utils"
rtr "github.com/bgp/stayrtr/lib"
"github.com/bgp/stayrtr/prefixfile"
"github.com/bgp/stayrtr/utils"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/sirupsen/logrus"
@@ -43,7 +43,7 @@ var (
MetricsPath = flag.String("metrics", "/metrics", "Metrics path")
OutFile = flag.String("file", "diff.json", "Diff file (or URL path without /)")
UserAgent = flag.String("useragent", fmt.Sprintf("Cloudflare-%v (+https://github.com/cloudflare/gortr)", AppVersion), "User-Agent header")
UserAgent = flag.String("useragent", fmt.Sprintf("StayRTR-%v (+https://github.com/bgp/stayrtr)", AppVersion), "User-Agent header")
PrimaryHost = flag.String("primary.host", "tcp://rtr.rpki.cloudflare.com:8282", "primary server")
PrimaryValidateCert = flag.Bool("primary.tls.validate", true, "Validate TLS")
@@ -12,9 +12,9 @@ import (
"errors"
"flag"
"fmt"
rtr "github.com/cloudflare/gortr/lib"
"github.com/cloudflare/gortr/prefixfile"
"github.com/cloudflare/gortr/utils"
rtr "github.com/bgp/stayrtr/lib"
"github.com/bgp/stayrtr/prefixfile"
"github.com/bgp/stayrtr/utils"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/sirupsen/logrus"
@@ -31,8 +31,8 @@ import (
)
const (
ENV_SSH_PASSWORD = "GORTR_SSH_PASSWORD"
ENV_SSH_KEY = "GORTR_SSH_AUTHORIZEDKEYS"
ENV_SSH_PASSWORD = "STAYRTR_SSH_PASSWORD"
ENV_SSH_KEY = "STAYRTR_SSH_AUTHORIZEDKEYS"
METHOD_NONE = iota
METHOD_PASSWORD
@@ -46,7 +46,7 @@ const (
var (
version = ""
buildinfos = ""
AppVersion = "GoRTR " + version + " " + buildinfos
AppVersion = "StayRTR " + version + " " + buildinfos
MetricsAddr = flag.String("metrics.addr", ":8080", "Metrics address")
MetricsPath = flag.String("metrics.path", "/metrics", "Metrics path")
@@ -85,7 +85,7 @@ var (
UseSerial = flag.String("useserial", "disable", "Use serial contained in file (disable, startup, full)")
Etag = flag.Bool("etag", true, "Enable Etag header")
UserAgent = flag.String("useragent", fmt.Sprintf("Cloudflare-%v (+https://github.com/cloudflare/gortr)", AppVersion), "User-Agent header")
UserAgent = flag.String("useragent", fmt.Sprintf("StayRTR-%v (+https://github.com/bgp/stayrtr)", AppVersion), "User-Agent header")
Mime = flag.String("mime", "application/json", "Accept setting format (some servers may prefer text/json)")
RefreshInterval = flag.Int("refresh", 600, "Refresh interval in seconds")
MaxConn = flag.Int("maxconn", 0, "Max simultaneous connections (0 to disable limit)")
@@ -661,7 +661,7 @@ func main() {
if *Bind != "" {
go func() {
sessid, _ := server.GetSessionId(nil)
log.Infof("GoRTR Server started (sessionID:%d, refresh:%d, retry:%d, expire:%d)", sessid, sc.RefreshInterval, sc.RetryInterval, sc.ExpireInterval)
log.Infof("StayRTR Server started (sessionID:%d, refresh:%d, retry:%d, expire:%d)", sessid, sc.RefreshInterval, sc.RetryInterval, sc.ExpireInterval)
err := server.Start(*Bind)
if err != nil {
log.Fatal(err)
+6 -6
View File
@@ -1,8 +1,8 @@
version: '3'
services:
gortr:
stayrtr:
build:
dockerfile: Dockerfile.gortr
dockerfile: Dockerfile.stayrtr
context: .
command:
- -cache
@@ -12,16 +12,16 @@ services:
- -verify=false
- -checktime=false
volumes:
- ./cmd/gortr/test.rpki.json:/rpki.json
- ./cmd/gortr/test.slurm.json:/slurm.json
- ./cmd/stayrtr/test.rpki.json:/rpki.json
- ./cmd/stayrtr/test.slurm.json:/slurm.json
rtrdump:
build:
dockerfile: Dockerfile.rtrdump
context: .
command:
- -connect
- gortr:8282
- stayrtr:8282
- -file
- ""
depends_on:
- gortr
- stayrtr
+3 -3
View File
@@ -4,8 +4,8 @@ services:
build: package
entrypoint: make
command:
- build-gortr
- package-deb-gortr
- package-rpm-gortr
- build-stayrtr
- package-deb-stayrtr
- package-rpm-stayrtr
volumes:
- ./:/work/
+1 -1
View File
@@ -1,4 +1,4 @@
module github.com/cloudflare/gortr
module github.com/bgp/stayrtr
go 1.12
-1
View File
@@ -1 +0,0 @@
GORTR_ARGS=
-12
View File
@@ -1,12 +0,0 @@
[Unit]
Description=GoRTR
After=network.target
[Service]
Type=simple
EnvironmentFile=/etc/default/gortr
WorkingDirectory=/usr/share/gortr
ExecStart=/usr/bin/gortr $GORTR_ARGS
[Install]
WantedBy=multi-user.target
+1
View File
@@ -0,0 +1 @@
STAYRTR_ARGS=
+12
View File
@@ -0,0 +1,12 @@
[Unit]
Description=StayRTR
After=network.target
[Service]
Type=simple
EnvironmentFile=/etc/default/stayrtr
WorkingDirectory=/usr/share/stayrtr
ExecStart=/usr/bin/stayrtr $STAYRTR_ARGS
[Install]
WantedBy=multi-user.target