You've already forked bird-lg-go
mirror of
https://github.com/xddxdd/bird-lg-go
synced 2025-11-02 13:02:29 +01:00
Compare commits
21 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 |
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>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ require (
|
|||||||
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.18.0
|
github.com/spf13/viper v1.18.2
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|||||||
@@ -1576,8 +1576,8 @@ github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
|
|||||||
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/spf13/viper v1.18.0 h1:pN6W1ub/G4OfnM+NR9p7xP9R6TltLUzp5JG9yZD3Qg0=
|
github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ=
|
||||||
github.com/spf13/viper v1.18.0/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk=
|
github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
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"]
|
||||||
@@ -7,7 +7,7 @@ require (
|
|||||||
github.com/gorilla/handlers v1.5.2
|
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.18.0
|
github.com/spf13/viper v1.18.2
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|||||||
@@ -1572,8 +1572,8 @@ github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
|
|||||||
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/spf13/viper v1.18.0 h1:pN6W1ub/G4OfnM+NR9p7xP9R6TltLUzp5JG9yZD3Qg0=
|
github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ=
|
||||||
github.com/spf13/viper v1.18.0/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk=
|
github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
|
|||||||
Reference in New Issue
Block a user