You've already forked bird-lg-go
mirror of
https://github.com/xddxdd/bird-lg-go
synced 2025-11-08 19:03:11 +01:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01438edaef | ||
|
|
90f36610dc | ||
|
|
6174208d07 | ||
|
|
76174cdc08 | ||
|
|
088bb6fe5a | ||
|
|
3951eed011 | ||
|
|
91c0a8962b | ||
|
|
5f7850a903 | ||
|
|
6a78cf2e80 | ||
|
|
5b5a44bcb6 | ||
|
|
ac31862237 | ||
|
|
86129190ab | ||
|
|
ff55064a20 | ||
|
|
dbb02c04ed | ||
|
|
c2b7de2e17 | ||
|
|
c1b578e8db | ||
|
|
7b0e5689d4 | ||
|
|
3c46bda49d | ||
|
|
32e00d2ce3 | ||
|
|
a19750cdef | ||
|
|
7f1cdaa4ee | ||
|
|
2d2193041e | ||
|
|
aad8ee98d7 | ||
|
|
00b5c12787 | ||
|
|
55a1eb54fd | ||
|
|
0594edc69d | ||
|
|
38bf6aba09 | ||
|
|
d261c22235 | ||
|
|
19aa8c77c5 | ||
|
|
fe07ebb5a5 | ||
|
|
66547ebfa9 | ||
|
|
d253e4311b | ||
|
|
026498ba2f |
16
.github/workflows/auto-merge.yml
vendored
Normal file
16
.github/workflows/auto-merge.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: auto-merge
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-merge:
|
||||||
|
name: Dependabot Auto Merge
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ahmadnassri/action-dependabot-auto-merge@v2
|
||||||
|
with:
|
||||||
|
target: minor
|
||||||
|
github-token: ${{ secrets.AUTOMERGE_TOKEN }}
|
||||||
21
.github/workflows/develop.yaml
vendored
21
.github/workflows/develop.yaml
vendored
@@ -47,7 +47,7 @@ jobs:
|
|||||||
- name: Test whois binary in frontend image
|
- name: Test whois binary in frontend image
|
||||||
run: |
|
run: |
|
||||||
docker build -t local/frontend frontend/
|
docker build -t local/frontend frontend/
|
||||||
docker run --rm --net host --entrypoint whois local/frontend github.com || exit 1
|
docker run --rm --net host --entrypoint whois local/frontend -I github.com || exit 1
|
||||||
docker run --rm --net host --entrypoint whois local/frontend -h whois.ripe.net github.com || exit 1
|
docker run --rm --net host --entrypoint whois local/frontend -h whois.ripe.net github.com || exit 1
|
||||||
docker run --rm --net host --entrypoint whois local/frontend -h whois.ripe.net:43 github.com || exit 1
|
docker run --rm --net host --entrypoint whois local/frontend -h whois.ripe.net:43 github.com || exit 1
|
||||||
|
|
||||||
@@ -57,6 +57,12 @@ jobs:
|
|||||||
docker run --rm --net host --entrypoint traceroute local/proxy 127.0.0.1 || exit 1
|
docker run --rm --net host --entrypoint traceroute local/proxy 127.0.0.1 || exit 1
|
||||||
docker run --rm --net host --entrypoint traceroute local/proxy ::1 || exit 1
|
docker run --rm --net host --entrypoint traceroute local/proxy ::1 || exit 1
|
||||||
|
|
||||||
|
- name: Test mtr binary in proxy image
|
||||||
|
run: |
|
||||||
|
docker build -t local/proxy:mtr -f proxy/Dockerfile.mtr proxy/
|
||||||
|
docker run --rm --net host --entrypoint mtr local/proxy:mtr -w -c1 -Z1 -G1 -b 127.0.0.1 || exit 1
|
||||||
|
docker run --rm --net host --entrypoint mtr local/proxy:mtr -w -c1 -Z1 -G1 -b ::1 || exit 1
|
||||||
|
|
||||||
docker-develop:
|
docker-develop:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
@@ -106,3 +112,16 @@ jobs:
|
|||||||
xddxdd/bird-lgproxy-go:develop-${{ github.sha }}
|
xddxdd/bird-lgproxy-go:develop-${{ github.sha }}
|
||||||
ghcr.io/xddxdd/bird-lg-go:proxy-develop
|
ghcr.io/xddxdd/bird-lg-go:proxy-develop
|
||||||
ghcr.io/xddxdd/bird-lg-go:proxy-develop-${{ github.sha }}
|
ghcr.io/xddxdd/bird-lg-go:proxy-develop-${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Build proxy docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: '{{defaultContext}}:proxy'
|
||||||
|
file: 'Dockerfile.mtr'
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
xddxdd/bird-lgproxy-go:develop-mtr
|
||||||
|
xddxdd/bird-lgproxy-go:develop-${{ github.sha }}-mtr
|
||||||
|
ghcr.io/xddxdd/bird-lg-go:proxy-develop-mtr
|
||||||
|
ghcr.io/xddxdd/bird-lg-go:proxy-develop-${{ github.sha }}-mtr
|
||||||
|
|||||||
13
.github/workflows/release.yaml
vendored
13
.github/workflows/release.yaml
vendored
@@ -85,3 +85,16 @@ jobs:
|
|||||||
xddxdd/bird-lgproxy-go:${{ github.event.release.tag_name }}
|
xddxdd/bird-lgproxy-go:${{ github.event.release.tag_name }}
|
||||||
ghcr.io/xddxdd/bird-lg-go:proxy
|
ghcr.io/xddxdd/bird-lg-go:proxy
|
||||||
ghcr.io/xddxdd/bird-lg-go:proxy-${{ github.event.release.tag_name }}
|
ghcr.io/xddxdd/bird-lg-go:proxy-${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
|
- name: Build proxy docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: '{{defaultContext}}:proxy'
|
||||||
|
file: 'Dockerfile.mtr'
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
xddxdd/bird-lgproxy-go:latest-mtr
|
||||||
|
xddxdd/bird-lgproxy-go:${{ github.event.release.tag_name }}-mtr
|
||||||
|
ghcr.io/xddxdd/bird-lg-go:proxy-mtr
|
||||||
|
ghcr.io/xddxdd/bird-lg-go:proxy-${{ github.event.release.tag_name }}-mtr
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -20,7 +20,3 @@ proxy/proxy
|
|||||||
|
|
||||||
# don't include generated bindata file
|
# don't include generated bindata file
|
||||||
frontend/bindata.go
|
frontend/bindata.go
|
||||||
|
|
||||||
# don't include generated Dockerfiles
|
|
||||||
frontend/Dockerfile.*
|
|
||||||
proxy/Dockerfile.*
|
|
||||||
@@ -167,6 +167,7 @@ Example: the following docker-compose.yml entry does the same as above, but by s
|
|||||||
services:
|
services:
|
||||||
bird-lgproxy:
|
bird-lgproxy:
|
||||||
# Use xddxdd/bird-lgproxy-go:develop for the latest build from master branch
|
# Use xddxdd/bird-lgproxy-go:develop for the latest build from master branch
|
||||||
|
# Use xddxdd/bird-lgproxy-go:latest-mtr to use MTR instead of Traceroute
|
||||||
image: xddxdd/bird-lgproxy-go:latest
|
image: xddxdd/bird-lgproxy-go:latest
|
||||||
container_name: bird-lgproxy
|
container_name: bird-lgproxy
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
@@ -8,6 +8,19 @@
|
|||||||
<meta name="renderer" content="webkit">
|
<meta name="renderer" content="webkit">
|
||||||
<title>{{ html .Title }}</title>
|
<title>{{ html .Title }}</title>
|
||||||
<link rel="stylesheet" href="/static/jsdelivr/npm/bootstrap@4.5.1/dist/css/bootstrap.min.css" integrity="sha256-VoFZSlmyTXsegReQCNmbXrS4hBBUl/cexZvPmPWoJsY=" crossorigin="anonymous">
|
<link rel="stylesheet" href="/static/jsdelivr/npm/bootstrap@4.5.1/dist/css/bootstrap.min.css" integrity="sha256-VoFZSlmyTXsegReQCNmbXrS4hBBUl/cexZvPmPWoJsY=" crossorigin="anonymous">
|
||||||
|
<style>
|
||||||
|
.navbar-nav {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.navbar form {
|
||||||
|
min-width: 400px;
|
||||||
|
}
|
||||||
|
.nav-link {
|
||||||
|
padding: 0.2rem 0.5rem !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -4,30 +4,30 @@ go 1.17
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||||
github.com/gorilla/handlers v1.5.1
|
github.com/gorilla/handlers v1.5.2
|
||||||
github.com/jarcoal/httpmock v1.3.1
|
github.com/jarcoal/httpmock v1.3.1
|
||||||
github.com/magiconair/properties v1.8.7
|
github.com/magiconair/properties v1.8.7
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/spf13/viper v1.17.0
|
github.com/spf13/viper v1.18.2
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/felixge/httpsnoop v1.0.3 // indirect
|
github.com/felixge/httpsnoop v1.0.3 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||||
github.com/sagikazarmark/locafero v0.3.0 // indirect
|
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
||||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||||
github.com/spf13/afero v1.10.0 // indirect
|
github.com/spf13/afero v1.11.0 // indirect
|
||||||
github.com/spf13/cast v1.5.1 // indirect
|
github.com/spf13/cast v1.6.0 // indirect
|
||||||
github.com/subosito/gotenv v1.6.0 // indirect
|
github.com/subosito/gotenv v1.6.0 // indirect
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.uber.org/atomic v1.9.0 // indirect
|
||||||
go.uber.org/multierr v1.9.0 // indirect
|
go.uber.org/multierr v1.9.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
||||||
golang.org/x/sys v0.12.0 // indirect
|
golang.org/x/sys v0.15.0 // indirect
|
||||||
golang.org/x/text v0.13.0 // indirect
|
golang.org/x/text v0.14.0 // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
503
frontend/go.sum
503
frontend/go.sum
File diff suppressed because it is too large
Load Diff
@@ -2,11 +2,14 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/jarcoal/httpmock"
|
||||||
)
|
)
|
||||||
|
|
||||||
type channelData struct {
|
type channelData struct {
|
||||||
@@ -14,6 +17,29 @@ type channelData struct {
|
|||||||
data string
|
data string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func createConnectionTimeoutRoundTripper(timeout int) http.RoundTripper {
|
||||||
|
context := net.Dialer{
|
||||||
|
Timeout: time.Duration(timeout) * time.Second,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prefer httpmock's transport if activated, so unit tests can work
|
||||||
|
if http.DefaultTransport == httpmock.DefaultTransport {
|
||||||
|
return httpmock.DefaultTransport
|
||||||
|
}
|
||||||
|
|
||||||
|
return &http.Transport{
|
||||||
|
DialContext: context.DialContext,
|
||||||
|
|
||||||
|
// Default options from transport.go
|
||||||
|
Proxy: http.ProxyFromEnvironment,
|
||||||
|
ForceAttemptHTTP2: true,
|
||||||
|
MaxIdleConns: 100,
|
||||||
|
IdleConnTimeout: 90 * time.Second,
|
||||||
|
TLSHandshakeTimeout: 10 * time.Second,
|
||||||
|
ExpectContinueTimeout: 1 * time.Second,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Send commands to lgproxy instances in parallel, and retrieve their responses
|
// Send commands to lgproxy instances in parallel, and retrieve their responses
|
||||||
func batchRequest(servers []string, endpoint string, command string) []string {
|
func batchRequest(servers []string, endpoint string, command string) []string {
|
||||||
// Channel and array for storing responses
|
// Channel and array for storing responses
|
||||||
@@ -47,7 +73,10 @@ func batchRequest(servers []string, endpoint string, command string) []string {
|
|||||||
}
|
}
|
||||||
url := "http://" + hostname + ":" + strconv.Itoa(setting.proxyPort) + "/" + url.PathEscape(endpoint) + "?q=" + url.QueryEscape(command)
|
url := "http://" + hostname + ":" + strconv.Itoa(setting.proxyPort) + "/" + url.PathEscape(endpoint) + "?q=" + url.QueryEscape(command)
|
||||||
go func(url string, i int) {
|
go func(url string, i int) {
|
||||||
client := http.Client{Timeout: time.Duration(setting.timeOut) * time.Second}
|
client := http.Client{
|
||||||
|
Transport: createConnectionTimeoutRoundTripper(setting.connectionTimeOut),
|
||||||
|
Timeout: time.Duration(setting.timeOut) * time.Second,
|
||||||
|
}
|
||||||
response, err := client.Get(url)
|
response, err := client.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ch <- channelData{i, "request failed: " + err.Error() + "\n"}
|
ch <- channelData{i, "request failed: " + err.Error() + "\n"}
|
||||||
|
|||||||
@@ -7,24 +7,25 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type settingType struct {
|
type settingType struct {
|
||||||
servers []string
|
servers []string
|
||||||
serversDisplay []string
|
serversDisplay []string
|
||||||
domain string
|
domain string
|
||||||
proxyPort int
|
proxyPort int
|
||||||
whoisServer string
|
whoisServer string
|
||||||
listen string
|
listen string
|
||||||
dnsInterface string
|
dnsInterface string
|
||||||
netSpecificMode string
|
netSpecificMode string
|
||||||
titleBrand string
|
titleBrand string
|
||||||
navBarBrand string
|
navBarBrand string
|
||||||
navBarBrandURL string
|
navBarBrandURL string
|
||||||
navBarAllServer string
|
navBarAllServer string
|
||||||
navBarAllURL string
|
navBarAllURL string
|
||||||
bgpmapInfo string
|
bgpmapInfo string
|
||||||
telegramBotName string
|
telegramBotName string
|
||||||
protocolFilter []string
|
protocolFilter []string
|
||||||
nameFilter string
|
nameFilter string
|
||||||
timeOut int
|
timeOut int
|
||||||
|
connectionTimeOut int
|
||||||
}
|
}
|
||||||
|
|
||||||
var setting settingType
|
var setting settingType
|
||||||
|
|||||||
@@ -193,6 +193,11 @@ func summaryParse(data string, serverName string) (TemplateSummary, error) {
|
|||||||
row.Info = strings.TrimSpace(lineSplitted[10])
|
row.Info = strings.TrimSpace(lineSplitted[10])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Dynamic BGP session, show without any color
|
||||||
|
if strings.Contains(row.Info, "Passive") {
|
||||||
|
row.MappedState = summaryStateMap["passive"]
|
||||||
|
}
|
||||||
|
|
||||||
// add to the result
|
// add to the result
|
||||||
args.Rows = append(args.Rows, row)
|
args.Rows = append(args.Rows, row)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,23 +9,24 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type viperSettingType struct {
|
type viperSettingType struct {
|
||||||
Servers string `mapstructure:"servers"`
|
Servers string `mapstructure:"servers"`
|
||||||
Domain string `mapstructure:"domain"`
|
Domain string `mapstructure:"domain"`
|
||||||
ProxyPort int `mapstructure:"proxy_port"`
|
ProxyPort int `mapstructure:"proxy_port"`
|
||||||
WhoisServer string `mapstructure:"whois"`
|
WhoisServer string `mapstructure:"whois"`
|
||||||
Listen string `mapstructure:"listen"`
|
Listen string `mapstructure:"listen"`
|
||||||
DNSInterface string `mapstructure:"dns_interface"`
|
DNSInterface string `mapstructure:"dns_interface"`
|
||||||
NetSpecificMode string `mapstructure:"net_specific_mode"`
|
NetSpecificMode string `mapstructure:"net_specific_mode"`
|
||||||
TitleBrand string `mapstructure:"title_brand"`
|
TitleBrand string `mapstructure:"title_brand"`
|
||||||
NavBarBrand string `mapstructure:"navbar_brand"`
|
NavBarBrand string `mapstructure:"navbar_brand"`
|
||||||
NavBarBrandURL string `mapstructure:"navbar_brand_url"`
|
NavBarBrandURL string `mapstructure:"navbar_brand_url"`
|
||||||
NavBarAllServer string `mapstructure:"navbar_all_servers"`
|
NavBarAllServer string `mapstructure:"navbar_all_servers"`
|
||||||
NavBarAllURL string `mapstructure:"navbar_all_url"`
|
NavBarAllURL string `mapstructure:"navbar_all_url"`
|
||||||
BgpmapInfo string `mapstructure:"bgpmap_info"`
|
BgpmapInfo string `mapstructure:"bgpmap_info"`
|
||||||
TelegramBotName string `mapstructure:"telegram_bot_name"`
|
TelegramBotName string `mapstructure:"telegram_bot_name"`
|
||||||
ProtocolFilter string `mapstructure:"protocol_filter"`
|
ProtocolFilter string `mapstructure:"protocol_filter"`
|
||||||
NameFilter string `mapstructure:"name_filter"`
|
NameFilter string `mapstructure:"name_filter"`
|
||||||
TimeOut int `mapstructure:"timeout"`
|
TimeOut int `mapstructure:"timeout"`
|
||||||
|
ConnectionTimeOut int `mapstructure:"connection_timeout"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse settings with viper, and convert to legacy setting format
|
// Parse settings with viper, and convert to legacy setting format
|
||||||
@@ -87,9 +88,12 @@ func parseSettings() {
|
|||||||
pflag.String("name-filter", "", "protocol name regex to hide in summary tables (RE2 syntax); defaults to none if not set")
|
pflag.String("name-filter", "", "protocol name regex to hide in summary tables (RE2 syntax); defaults to none if not set")
|
||||||
viper.BindPFlag("name_filter", pflag.Lookup("name-filter"))
|
viper.BindPFlag("name_filter", pflag.Lookup("name-filter"))
|
||||||
|
|
||||||
pflag.Int("time-out", 120, "time before request timed out, in seconds; defaults to 120 if not set")
|
pflag.Int("time-out", 120, "time before backend HTTP request times out, in seconds; defaults to 120 if not set")
|
||||||
viper.BindPFlag("timeout", pflag.Lookup("time-out"))
|
viper.BindPFlag("timeout", pflag.Lookup("time-out"))
|
||||||
|
|
||||||
|
pflag.Int("connection-time-out", 5, "time before backend TCP connection times out, in seconds; defaults to 5 if not set")
|
||||||
|
viper.BindPFlag("connection_timeout", pflag.Lookup("connection-time-out"))
|
||||||
|
|
||||||
pflag.Parse()
|
pflag.Parse()
|
||||||
|
|
||||||
if err := viper.ReadInConfig(); err != nil {
|
if err := viper.ReadInConfig(); err != nil {
|
||||||
@@ -139,6 +143,7 @@ func parseSettings() {
|
|||||||
|
|
||||||
setting.nameFilter = viperSettings.NameFilter
|
setting.nameFilter = viperSettings.NameFilter
|
||||||
setting.timeOut = viperSettings.TimeOut
|
setting.timeOut = viperSettings.TimeOut
|
||||||
|
setting.connectionTimeOut = viperSettings.ConnectionTimeOut
|
||||||
|
|
||||||
fmt.Printf("%#v\n", setting)
|
fmt.Printf("%#v\n", setting)
|
||||||
}
|
}
|
||||||
|
|||||||
31
proxy/Dockerfile.mtr
Normal file
31
proxy/Dockerfile.mtr
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
FROM golang AS step_0
|
||||||
|
|
||||||
|
ENV CGO_ENABLED=0 GO111MODULE=on
|
||||||
|
WORKDIR /root
|
||||||
|
COPY . .
|
||||||
|
RUN go build -ldflags "-w -s" -o /proxy
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
FROM alpine:edge AS step_1
|
||||||
|
|
||||||
|
WORKDIR /root
|
||||||
|
RUN apk add --no-cache build-base linux-headers
|
||||||
|
|
||||||
|
RUN wget https://www.bitwizard.nl/mtr/files/mtr-0.94.tar.gz \
|
||||||
|
-O mtr-0.94.tar.gz
|
||||||
|
RUN tar xvf mtr-0.94.tar.gz \
|
||||||
|
&& cd mtr-0.94 \
|
||||||
|
&& ./configure --without-gtk --without-ncurses --without-jansson --without-ipinfo --disable-bash-completion \
|
||||||
|
&& make -j4 LDFLAGS="-static" \
|
||||||
|
&& strip /root/mtr-0.94/mtr \
|
||||||
|
&& strip /root/mtr-0.94/mtr-packet
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
FROM scratch AS step_2
|
||||||
|
ENV PATH=/
|
||||||
|
COPY --from=step_0 /proxy /
|
||||||
|
COPY --from=step_1 /root/mtr-0.94/mtr /
|
||||||
|
COPY --from=step_1 /root/mtr-0.94/mtr-packet /
|
||||||
|
ENTRYPOINT ["/proxy"]
|
||||||
16
proxy/go.mod
16
proxy/go.mod
@@ -4,29 +4,29 @@ go 1.17
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||||
github.com/gorilla/handlers v1.5.1
|
github.com/gorilla/handlers v1.5.2
|
||||||
github.com/magiconair/properties v1.8.7
|
github.com/magiconair/properties v1.8.7
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/spf13/viper v1.17.0
|
github.com/spf13/viper v1.18.2
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/felixge/httpsnoop v1.0.3 // indirect
|
github.com/felixge/httpsnoop v1.0.3 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||||
github.com/sagikazarmark/locafero v0.3.0 // indirect
|
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
||||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||||
github.com/spf13/afero v1.10.0 // indirect
|
github.com/spf13/afero v1.11.0 // indirect
|
||||||
github.com/spf13/cast v1.5.1 // indirect
|
github.com/spf13/cast v1.6.0 // indirect
|
||||||
github.com/subosito/gotenv v1.6.0 // indirect
|
github.com/subosito/gotenv v1.6.0 // indirect
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.uber.org/atomic v1.9.0 // indirect
|
||||||
go.uber.org/multierr v1.9.0 // indirect
|
go.uber.org/multierr v1.9.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
||||||
golang.org/x/sys v0.12.0 // indirect
|
golang.org/x/sys v0.15.0 // indirect
|
||||||
golang.org/x/text v0.13.0 // indirect
|
golang.org/x/text v0.14.0 // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
503
proxy/go.sum
503
proxy/go.sum
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user